blob: c7031efc67ac3282f969fefed770438917b22dea [file] [log] [blame]
lowRISC Contributors802543a2019-08-31 12:12:56 +01001// Copyright lowRISC contributors.
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4//
5// TOP Earlgrey configuration
6{ name: "earlgrey",
7 type: "top",
8
Michael Schaffner7b0807d2020-10-27 19:54:52 -07009 /////////////////////////////////////////////////////////////
10 // Seed for compile-time random constants //
11 // NOTE: REPLACE THIS WITH A NEW VALUE BEFORE THE TAPEOUT //
12 /////////////////////////////////////////////////////////////
13 rnd_cnst_seed: 4881560218908238235
14
15 // 32-bit datawidth
Timothy Chenc6233932020-08-19 15:34:07 -070016 datawidth: "32",
lowRISC Contributors802543a2019-08-31 12:12:56 +010017
Michael Schaffner7b0807d2020-10-27 19:54:52 -070018 // This is the clock data structure of the design.
Timothy Chenf56c1b52020-04-28 17:00:43 -070019 // The hier path refers to the clock reference path (struct / port)
20 // - The top/ext desgination follows the same scheme as inter-module
Timothy Chen0550d692020-04-20 17:19:35 -070021 // The src key indicates the raw clock sources in the design
22 // The groups key indicates the various clock groupings in the design
23 clocks: {
24
Timothy Chenf56c1b52020-04-28 17:00:43 -070025 hier_paths: {
26 top: "clkmgr_clocks.", // top level is a struct
27 ext: "", // ext is a port of the clock name
28 },
29
Timothy Chen33b3b9d2020-05-08 10:14:17 -070030 // Clock Source attributes
31 // name: Name of group.
32 // aon: Whether the clock is free running all the time.
33 // If it is, the clock is not hanlded by clkmgr.
34 // freq: Absolute frequency of clk in Hz
Timothy Chen0550d692020-04-20 17:19:35 -070035 srcs: [
Timothy Chen33b3b9d2020-05-08 10:14:17 -070036 { name: "main", aon: "no", freq: "100000000" }
Timothy Chenced60b22020-08-20 10:35:00 -070037 { name: "io", aon: "no", freq: "96000000" }
Timothy Chen33b3b9d2020-05-08 10:14:17 -070038 { name: "usb", aon: "no", freq: "48000000" }
39 { name: "aon", aon: "yes", freq: "200000" }
Timothy Chen0550d692020-04-20 17:19:35 -070040 ],
41
Timothy Chen79972ad2020-06-30 17:13:49 -070042 // Derived clock source attributes
43 // name: Name of group.
44 // aon: Whether the clock is free running all the time.
45 // If it is, the clock is not hanlded by clkmgr.
46 // freq: Absolute frequency of clk in Hz
47 // src: From which clock source is the clock derived
48 // div: Ratio between derived clock and source clock
49 derived_srcs: [
Timothy Chenced60b22020-08-20 10:35:00 -070050 { name: "io_div2", aon: "no", div: 2, src: "io", freq: "48000000" }
51 { name: "io_div4", aon: "no", div: 4, src: "io", freq: "24000000" }
Timothy Chen79972ad2020-06-30 17:13:49 -070052 ],
53
Timothy Chen0550d692020-04-20 17:19:35 -070054 // Clock Group attributes
55 // name: name of group.
56 //
Timothy Chenf56c1b52020-04-28 17:00:43 -070057 // src: The hierarchical source of the clock
58 // "ext" - clock is supplied from a port of the top module
59 // "top" - clock is supplied from a net inside the top module
60 //
Rupert Swarbrickcba33a22020-07-02 16:46:38 +010061 // sw_cg: whether software is allowed to gate the clock
Timothy Chen0550d692020-04-20 17:19:35 -070062 // "no" - software is not allowed to gate clocks
63 // "yes" - software is allowed to gate clocks
64 // "hint" - software can provide a hint, and hw controls the rest
65 //
66 // unique: whether each module in the group can be separately gated
Rupert Swarbrickcba33a22020-07-02 16:46:38 +010067 // if sw_cg is "no", this field has no meaning
Timothy Chen0550d692020-04-20 17:19:35 -070068 // "yes" - each clock is individually controlled
69 // "no" - the group is controlled as one single unit
70 //
71 // The powerup and proc groups are unique.
Timothy Chen33b3b9d2020-05-08 10:14:17 -070072 // The powerup group of clocks do not feed through the clock
Timothy Chen0550d692020-04-20 17:19:35 -070073 // controller as they manage clock controller behavior
74 // The proc group is not peripheral, and direclty hardwired
75
76 groups: [
Timothy Chen79972ad2020-06-30 17:13:49 -070077 // the powerup group is used exclusively by clk/pwr/rstmgr
78 { name: "powerup", src:"top", sw_cg: "no" }
Timothy Chenf56c1b52020-04-28 17:00:43 -070079 { name: "trans", src:"top", sw_cg: "hint", unique: "yes", }
80 { name: "infra", src:"top", sw_cg: "no", }
81 { name: "secure", src:"top", sw_cg: "no" }
82 { name: "peri", src:"top", sw_cg: "yes", unique: "no" }
83 { name: "timers", src:"top", sw_cg: "no" }
Timothy Chen0550d692020-04-20 17:19:35 -070084 { name: "proc",
Timothy Chenc6233932020-08-19 15:34:07 -070085 src: "no",
86 sw_cg: "no",
87 unique: "no",
Timothy Chen0550d692020-04-20 17:19:35 -070088 clocks: {
89 clk_proc_main: main
90 }
91 }
92 ],
Timothy Chenc6233932020-08-19 15:34:07 -070093 },
lowRISC Contributors802543a2019-08-31 12:12:56 +010094
Timothy Chenc6233932020-08-19 15:34:07 -070095 // This is the reset data strcture of the design.
96 // The hier path refers to the reset reference path (struct / port)
97 // - The top/ext desgination follows the same scheme as inter-module
98 // The node key represents all the known resets in the design
99 resets: {
100
101 hier_paths: {
102 top: "rstmgr_resets.", // top level is a struct
103 ext: "", // ext is a port of the clock name
104 },
105
106 // Reset node attributes
107 // name: name of reset.
108 //
109 // gen: whether the reset is generated
110 // true: it is a generated reset inside rstmgr
111 // false: it is a hardwired design reset inside rstmgr (roots and por)
112 //
113 // type: the reset type [ext, top]
114 // ext: the reset is coming in from the ports, external to earlgrey
115 // int: the reset is only used inside rstmgr
116 // top: the reset is output from rstmgr to top level struct
117 //
118 // parent: The parent reset
119 // If type is "ext", there is no root, since it is external
120 //
121 // domain: The power domain
122 // If no domain, it means there is no choice, just inherits from root.
123 // Otherwise, selects the domain to which it is related
124 // 0 is defaulted for always on.
125 // TBD: This should eventually be changed to a name->index project wide lookup
126 //
127 // clk: related clock domain for synchronous release
128 // If type is "por", there is not related clock, since it is
129 // likely external or generated from a voltage comparator
130 //
131 nodes: [
Timothy Chen6b70fd22020-08-20 14:01:26 -0700132 { name: "rst_ni", gen: false, type: "ext" }
Timothy Chenc6233932020-08-19 15:34:07 -0700133 { name: "por_aon", gen: false, type: "top", parent: "rst_ni", clk: "aon" }
134 { name: "lc_src", gen: false, type: "int", parent: "por", clk: "io_div2" }
135 { name: "sys_src", gen: false, type: "int", parent: "por", clk: "io_div2" }
136 { name: "por", gen: true, type: "top", parent: "por_aon", clk: "main" }
137 { name: "por_io", gen: true, type: "top", parent: "por_aon", clk: "io" }
138 { name: "por_io_div2", gen: true, type: "top", parent: "por_aon", clk: "io_div2" }
Timothy Chenced60b22020-08-20 10:35:00 -0700139 { name: "por_io_div4", gen: true , type: "top", parent: "por_aon", clk: "io_div4" }
Timothy Chenc6233932020-08-19 15:34:07 -0700140 { name: "por_usb", gen: true, type: "top", parent: "por_aon", clk: "usb" }
Timothy Chen6b70fd22020-08-20 14:01:26 -0700141 { name: "lc", gen: true, type: "top", domain: "0", parent: "lc_src", clk: "main" }
142 { name: "lc_io", gen: true, type: "top", domain: "0", parent: "lc_src", clk: "io_div4" }
Timothy Chenc6233932020-08-19 15:34:07 -0700143 { name: "sys", gen: true, type: "top", domain: "0", parent: "sys_src", clk: "main" }
144 { name: "sys_io", gen: true, type: "top", domain: "0", parent: "sys_src", clk: "io_div2" }
Timothy Chen6b70fd22020-08-20 14:01:26 -0700145 { name: "sys_io_div4", gen: true, type: "top", domain: "0", parent: "sys_src", clk: "io_div4" }
Timothy Chenc6233932020-08-19 15:34:07 -0700146 { name: "sys_aon", gen: true, type: "top", domain: "0", parent: "sys_src", clk: "aon" }
Timothy Chen6b70fd22020-08-20 14:01:26 -0700147 { name: "spi_device", gen: true, type: "top", domain: "0", parent: "sys_src", clk: "io_div2", sw: 1 }
148 { name: "usb", gen: true, type: "top", domain: "0", parent: "sys_src", clk: "usb", sw: 1 }
Timothy Chenc6233932020-08-19 15:34:07 -0700149 ]
150 }
Timothy Chen3193b002019-10-04 16:56:05 -0700151
lowRISC Contributors802543a2019-08-31 12:12:56 +0100152 // Number of cores: used in rv_plic and timer
153 num_cores: "1",
154
155 // `module` defines the peripherals.
156 // Details are coming from each modules' config file `ip.hjson`
157 // TODO: Define parameter here
Timothy Chendde68052020-08-05 16:29:35 -0700158 // generated: A module is templated and generated as part of topgen
159 // top_only: A module is not templated but is specific to 'top_*' instead of 'ip'
lowRISC Contributors802543a2019-08-31 12:12:56 +0100160 module: [
161 { name: "uart", // instance name
162 type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted)
163 // and `hw/ip/{type}`
Timothy Chen3193b002019-10-04 16:56:05 -0700164
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700165 // clock connections defines the port to top level clock connection
166 // the ip.hjson will declare the clock port names
167 // If none are defined at ip.hjson, clk_i is used by default
Timothy Chen6b70fd22020-08-20 14:01:26 -0700168 clock_srcs: {clk_i: "io_div4"},
Timothy Chen3193b002019-10-04 16:56:05 -0700169
170 // reset connections defines the port to top level reset connection
171 // the ip.hjson will declare the reset port names
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700172 // If none are defined at ip.hjson, rst_ni is used by default
Timothy Chen6b70fd22020-08-20 14:01:26 -0700173 reset_connections: {rst_ni: "sys_io_div4"},
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700174
lowRISC Contributors802543a2019-08-31 12:12:56 +0100175 base_addr: "0x40000000",
176 },
177 { name: "gpio",
178 type: "gpio",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700179 clock_srcs: {clk_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700180 clock_group: "peri",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700181 reset_connections: {rst_ni: "sys_io_div4"},
lowRISC Contributors802543a2019-08-31 12:12:56 +0100182 base_addr: "0x40010000",
183 }
184
185 { name: "spi_device",
186 type: "spi_device",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700187 clock_srcs: {clk_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700188 clock_group: "peri",
Timothy Chen3193b002019-10-04 16:56:05 -0700189 reset_connections: {rst_ni: "spi_device"},
lowRISC Contributors802543a2019-08-31 12:12:56 +0100190 base_addr: "0x40020000",
191 },
192 { name: "flash_ctrl",
193 type: "flash_ctrl",
Timothy Chen0550d692020-04-20 17:19:35 -0700194 clock_srcs: {clk_i: "main"},
195 clock_group: "infra",
Timothy Chen3193b002019-10-04 16:56:05 -0700196 reset_connections: {rst_ni: "lc"},
lowRISC Contributors802543a2019-08-31 12:12:56 +0100197 base_addr: "0x40030000",
Timothy Chen1daf5822020-10-26 17:28:15 -0700198 generated: "true" // Indicate this module is generated in the topgen
lowRISC Contributors802543a2019-08-31 12:12:56 +0100199 },
200 { name: "rv_timer",
201 type: "rv_timer",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700202 clock_srcs: {clk_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700203 clock_group: "timers",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700204 reset_connections: {rst_ni: "sys_io_div4"},
lowRISC Contributors802543a2019-08-31 12:12:56 +0100205 base_addr: "0x40080000",
206 },
Pirmin Vogeld4534382019-10-17 13:18:31 +0100207 { name: "aes",
208 type: "aes",
Timothy Chen0550d692020-04-20 17:19:35 -0700209 clock_srcs: {clk_i: "main"},
210 clock_group: "trans",
Pirmin Vogeld4534382019-10-17 13:18:31 +0100211 reset_connections: {rst_ni: "sys"},
212 base_addr: "0x40110000",
213 },
lowRISC Contributors802543a2019-08-31 12:12:56 +0100214 { name: "hmac",
215 type: "hmac",
Timothy Chen0550d692020-04-20 17:19:35 -0700216 clock_srcs: {clk_i: "main"},
217 clock_group: "trans",
Timothy Chen3193b002019-10-04 16:56:05 -0700218 reset_connections: {rst_ni: "sys"},
lowRISC Contributors802543a2019-08-31 12:12:56 +0100219 base_addr: "0x40120000",
220 },
221 { name: "rv_plic",
222 type: "rv_plic",
Timothy Chen0550d692020-04-20 17:19:35 -0700223 clock_srcs: {clk_i: "main"},
224 clock_group: "secure",
Timothy Chen3193b002019-10-04 16:56:05 -0700225 reset_connections: {rst_ni: "sys"},
lowRISC Contributors802543a2019-08-31 12:12:56 +0100226 base_addr: "0x40090000",
227 generated: "true" // Indicate this module is generated in the topgen
lowRISC Contributors802543a2019-08-31 12:12:56 +0100228 }
Timothy Chen6b70fd22020-08-20 14:01:26 -0700229 // pinmux is currently allocated to main fabric,
230 // however this should probably be moved to peri fabric
Eunchan Kim436d2242019-10-29 17:25:51 -0700231 { name: "pinmux",
232 type: "pinmux",
233 clock: "main",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700234 clock_srcs: {clk_i: "main", clk_aon_i: "aon"},
Timothy Chen0550d692020-04-20 17:19:35 -0700235 clock_group: "secure",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700236 reset_connections: {rst_ni: "sys", rst_aon_ni: "sys_aon"},
Eunchan Kim436d2242019-10-29 17:25:51 -0700237 base_addr: "0x40070000",
238 generated: "true"
Michael Schaffner666dde12019-10-25 11:57:54 -0700239 },
Timothy Chen6b70fd22020-08-20 14:01:26 -0700240 // see comment regarding pinmux above
Michael Schaffner60157962020-05-01 19:11:28 -0700241 { name: "padctrl",
242 type: "padctrl",
243 clock: "main",
244 clock_srcs: {clk_i: "main"},
245 clock_group: "secure",
246 reset_connections: {rst_ni: "sys"},
247 base_addr: "0x40160000",
248 generated: "true"
249 },
Michael Schaffner666dde12019-10-25 11:57:54 -0700250 { name: "alert_handler",
251 type: "alert_handler",
Timothy Chen0550d692020-04-20 17:19:35 -0700252 clock_srcs: {clk_i: "main"},
253 clock_group: "secure",
Michael Schaffner666dde12019-10-25 11:57:54 -0700254 reset_connections: {rst_ni: "sys"},
255 base_addr: "0x40130000",
256 generated: "true" // Indicate this module is generated in the topgen
257 localparam: {
258 EscCntDw: 32,
259 AccuCntDw: 16,
260 LfsrSeed: "0x7FFFFFFF"
261 }
262 }
Timothy Chen163050b2020-04-13 23:29:29 -0700263 { name: "pwrmgr",
264 type: "pwrmgr",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700265 clock_srcs: {clk_i: "io_div4", clk_slow_i: "aon"},
Timothy Chen0550d692020-04-20 17:19:35 -0700266 clock_group: "powerup",
Timothy Chena4cc10d2020-05-08 16:06:20 -0700267 reset_connections: {rst_ni: "por", rst_slow_ni: "por_aon"},
Timothy Chen163050b2020-04-13 23:29:29 -0700268 base_addr: "0x400A0000",
Timothy Chen4ba25312020-06-17 13:08:57 -0700269 generated: "true" // Indicate this module is generated in the topgen
Timothy Chenf56c1b52020-04-28 17:00:43 -0700270
Timothy Chen163050b2020-04-13 23:29:29 -0700271 },
Timothy Chenc59f7012020-04-16 19:11:42 -0700272 { name: "rstmgr",
273 type: "rstmgr",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700274 clock_srcs: {clk_i: "io_div4", clk_aon_i: "aon", clk_main_i: "main", clk_io_i: "io", clk_usb_i: "usb",
Timothy Chen0f3c1752020-08-26 12:47:17 -0700275 clk_io_div2_i: "io_div2", clk_io_div4_i: "io_div4"},
Timothy Chenc59f7012020-04-16 19:11:42 -0700276 clock_group: "powerup",
277 reset_connections: {rst_ni: "rst_ni"},
278 base_addr: "0x400B0000",
Timothy Chen0f3c1752020-08-26 12:47:17 -0700279 generated: "true" // Indicate this module is generated in the topgen
Timothy Chenf56c1b52020-04-28 17:00:43 -0700280 },
281 { name: "clkmgr",
282 type: "clkmgr",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700283 clock_srcs: {clk_i: "io_div4"},
Timothy Chenf56c1b52020-04-28 17:00:43 -0700284 clock_group: "powerup",
Timothy Chen79972ad2020-06-30 17:13:49 -0700285 reset_connections: {rst_ni: "por_io", rst_main_ni: "por", rst_io_ni: "por_io", rst_usb_ni: "por_usb"
Timothy Chenced60b22020-08-20 10:35:00 -0700286 rst_io_div2_ni: "por_io_div2", rst_io_div4_ni: "por_io_div4"},
Timothy Chenf56c1b52020-04-28 17:00:43 -0700287 base_addr: "0x400C0000",
Timothy Chenc59f7012020-04-16 19:11:42 -0700288 generated: "true"
289 },
Michael Schaffner666dde12019-10-25 11:57:54 -0700290 // dummy module to capture the alert handler escalation signals
291 // and test them by converting them into IRQs
292 { name: "nmi_gen",
293 type: "nmi_gen",
Timothy Chen0550d692020-04-20 17:19:35 -0700294 clock_srcs: {clk_i: "main"},
295 clock_group: "secure",
Michael Schaffner666dde12019-10-25 11:57:54 -0700296 reset_connections: {rst_ni: "sys"},
297 base_addr: "0x40140000",
Eunchan Kim436d2242019-10-29 17:25:51 -0700298 }
Pirmin Vogelea91b302020-01-14 18:53:01 +0000299 { name: "usbdev",
300 type: "usbdev",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700301 clock_srcs: {clk_i: "io_div4", clk_usb_48mhz_i: "usb"},
Timothy Chen0550d692020-04-20 17:19:35 -0700302 clock_group: "peri",
Timothy Chen4c8905e2020-08-26 10:34:33 -0700303 clock_reset_export: ["ast"],
Timothy Chen6b70fd22020-08-20 14:01:26 -0700304 reset_connections: {rst_ni: "sys_io_div4", rst_usb_48mhz_ni: "usb"},
Pirmin Vogelea91b302020-01-14 18:53:01 +0000305 base_addr: "0x40150000",
306 },
Timothy Chendde68052020-08-05 16:29:35 -0700307 { name: "sensor_ctrl",
308 type: "sensor_ctrl",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700309 clock_srcs: {clk_i: "io_div4"},
Timothy Chendde68052020-08-05 16:29:35 -0700310 clock_group: "secure",
Timothy Chen4c8905e2020-08-26 10:34:33 -0700311 clock_reset_export: ["ast"],
Timothy Chen6b70fd22020-08-20 14:01:26 -0700312 reset_connections: {rst_ni: "sys_io_div4"},
Timothy Chendde68052020-08-05 16:29:35 -0700313 base_addr: "0x40170000",
314 top_only: "true"
315 },
Timothy Chen3c3f3482020-09-09 18:45:41 -0700316 { name: "keymgr",
317 type: "keymgr",
318 clock_srcs: {clk_i: "main"},
319 clock_group: "secure",
320 reset_connections: {rst_ni: "sys"},
321 base_addr: "0x401a0000",
322 },
Michael Schaffner5ae4a232020-10-06 19:03:43 -0700323 { name: "otp_ctrl",
324 type: "otp_ctrl",
325 clock_srcs: {clk_i: "io_div4"},
326 clock_group: "timers",
Michael Schaffnerb2a66dd2020-10-26 10:33:12 -0700327 reset_connections: {rst_ni: "lc_io"},
Michael Schaffner5ae4a232020-10-06 19:03:43 -0700328 base_addr: "0x401b0000",
329 },
Philipp Wagnera4a9e402020-06-22 12:06:56 +0100330 { name: "otbn",
331 type: "otbn",
332 clock_srcs: {clk_i: "main"},
333 clock_group: "trans",
334 reset_connections: {rst_ni: "sys"},
335 base_addr: "0x50000000",
336 },
lowRISC Contributors802543a2019-08-31 12:12:56 +0100337 ]
338
339 // Memories (ROM, RAM, eFlash) are defined at the top.
340 // It utilizes the primitive cells but configurable
341 memory: [
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700342 { name: "rom",
Timothy Chen0550d692020-04-20 17:19:35 -0700343 clock_srcs: {clk_i: "main"},
344 clock_group: "infra",
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700345 reset_connections: {rst_ni: "sys"},
346 type: "rom",
347 base_addr: "0x00008000",
Weicai Yang55b2cdf2020-04-10 15:40:30 -0700348 swaccess: "ro",
Timothy Chenda2e3442020-02-24 21:37:47 -0800349 size: "0x4000"
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700350 inter_signal_list: [
351 { struct: "tl"
352 package: "tlul_pkg"
353 type: "req_rsp"
354 act: "rsp"
355 name: "tl"
356 }
357 ]
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700358 },
359 { name: "ram_main",
Timothy Chen0550d692020-04-20 17:19:35 -0700360 clock_srcs: {clk_i: "main"},
361 clock_group: "infra",
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700362 reset_connections: {rst_ni: "sys"},
363 type: "ram_1p",
364 base_addr: "0x10000000",
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700365 size: "0x10000"
366 inter_signal_list: [
367 { struct: "tl"
368 package: "tlul_pkg"
369 type: "req_rsp"
370 act: "rsp"
371 name: "tl"
372 }
373 ]
374 },
Timothy Chen2c9e1a92020-06-29 15:03:25 -0700375 { name: "ram_ret",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700376 clock_srcs: {clk_i: "io_div4"},
Timothy Chen2c9e1a92020-06-29 15:03:25 -0700377 clock_group: "infra",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700378 reset_connections: {rst_ni: "sys_io_div4"},
Timothy Chen2c9e1a92020-06-29 15:03:25 -0700379 type: "ram_1p",
380 base_addr: "0x18000000",
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700381 size: "0x1000"
382 inter_signal_list: [
383 { struct: "tl"
384 package: "tlul_pkg"
385 type: "req_rsp"
386 act: "rsp"
387 name: "tl"
388 }
389 ]
390 },
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700391 { name: "eflash",
Timothy Chen0550d692020-04-20 17:19:35 -0700392 clock_srcs: {clk_i: "main"},
393 clock_group: "infra",
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700394 reset_connections: {rst_ni: "lc"},
395 type: "eflash",
396 base_addr: "0x20000000",
Timothy Chen1daf5822020-10-26 17:28:15 -0700397 banks: 2,
398 pages_per_bank: 256,
Weicai Yang55b2cdf2020-04-10 15:40:30 -0700399 swaccess: "ro",
Eunchan Kime4a85072020-02-05 16:00:00 -0800400 inter_signal_list: [
401 { struct: "flash", // flash_req_t, flash_rsp_t
402 type: "req_rsp",
403 name: "flash_ctrl", // flash_ctrl_i (req), flash_ctrl_o (rsp)
Eunchan Kim40098a92020-04-17 12:22:36 -0700404 act: "rsp",
Timothy Chenac620652020-06-25 13:48:50 -0700405 },
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700406 { struct: "tl"
407 package: "tlul_pkg"
408 type: "req_rsp"
409 act: "rsp"
410 name: "tl"
411 }
Eunchan Kime4a85072020-02-05 16:00:00 -0800412 ],
413 },
lowRISC Contributors802543a2019-08-31 12:12:56 +0100414 ],
415
Eunchan Kime4a85072020-02-05 16:00:00 -0800416 // Inter-module Connection.
417 // format:
418 // requester: [ resp1, resp2, ... ],
419 //
Eunchan Kim40098a92020-04-17 12:22:36 -0700420 // the field and value should be module_inst.port_name
Eunchan Kime4a85072020-02-05 16:00:00 -0800421 // e.g flash_ctrl0.flash: [flash_phy0.flash_ctrl]
422 inter_module: {
Eunchan Kim40098a92020-04-17 12:22:36 -0700423 'connect': {
Timothy Chen9b6f2422020-09-18 16:09:07 -0700424 'flash_ctrl.flash' : ['eflash.flash_ctrl'],
425 'pwrmgr.pwr_flash' : ['flash_ctrl.pwrmgr'],
426 'pwrmgr.pwr_rst' : ['rstmgr.pwr'],
427 'pwrmgr.pwr_clk' : ['clkmgr.pwr'],
Michael Schaffnerb2a66dd2020-10-26 10:33:12 -0700428 'pwrmgr.pwr_otp' : ['otp_ctrl.pwr_otp'],
Timothy Chen75350ca2020-09-22 20:55:55 -0700429 'flash_ctrl.keymgr': ['keymgr.flash'],
Timothy Chenc8f30042020-09-25 16:59:47 -0700430 'alert_handler.crashdump': ['rstmgr.alert_dump'],
Timothy Chen455afcb2020-10-01 11:46:35 -0700431 // The idle connection is automatically connected through topgen.
432 // The user does not need to explicitly declare anything other than
433 // an empty list.
Timothy Chenc8f30042020-09-25 16:59:47 -0700434 'clkmgr.idle' : [],
Eunchan Kim40098a92020-04-17 12:22:36 -0700435 }
436
437 // top is to connect to top net/struct.
438 // It defines the signal in the top and connect from the module,
439 // use of the signal is up to top template
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700440 'top': [
441 'rstmgr.resets', 'rstmgr.cpu', 'pwrmgr.pwr_cpu', 'clkmgr.clocks',
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700442
443 // Xbars
444 'main.tl_corei', 'main.tl_cored', 'main.tl_dm_sba', 'main.tl_debug_mem'
Timothy Cheneba7f492020-08-26 17:12:08 -0700445
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700446 ],
Eunchan Kim40098a92020-04-17 12:22:36 -0700447
448 // ext is to create port in the top.
Eunchan Kim57071c02020-08-07 13:59:05 -0700449 'external': {
Timothy Chen0f3c1752020-08-26 12:47:17 -0700450 'clkmgr.clk_main': 'clk_main', // clock inputs
451 'clkmgr.clk_io': 'clk_io', // clock inputs
452 'clkmgr.clk_usb': 'clk_usb', // clock inputs
453 'clkmgr.clk_aon': 'clk_aon', // clock inputs
454 'rstmgr.ast': '', // ast reset input
Timothy Chendde68052020-08-05 16:29:35 -0700455 'pwrmgr.pwr_ast': '',
456 'sensor_ctrl.ast_alert': '',
457 'sensor_ctrl.ast_status': '',
458 'usbdev.usb_ref_val': '',
459 'usbdev.usb_ref_pulse': '',
Michael Schaffner5ae4a232020-10-06 19:03:43 -0700460 'peri.tl_ast_wrapper': 'ast_tl',
461 'otp_ctrl.otp_ast_pwr_seq': '',
462 'otp_ctrl.otp_ast_pwr_seq_h': '',
Eunchan Kim57071c02020-08-07 13:59:05 -0700463 },
Eunchan Kime4a85072020-02-05 16:00:00 -0800464 },
465
lowRISC Contributors802543a2019-08-31 12:12:56 +0100466 debug_mem_base_addr: "0x1A110000",
467
468 // Crossbars: having a top level crossbar
469 // This version assumes all crossbars are instantiated at the top.
470 // Assume xbar.hjson is located in the same directory of top.hjson
471 xbar: [
472 { name: "main",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700473 clock_srcs: {clk_main_i: "main", clk_fixed_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700474 clock_group: "infra",
Timothy Chen3193b002019-10-04 16:56:05 -0700475 reset: "sys",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700476 reset_connections: {rst_main_ni: "sys", rst_fixed_ni: "sys_io_div4"}
lowRISC Contributors802543a2019-08-31 12:12:56 +0100477 },
Eunchan Kim0523f6b2019-12-17 13:53:11 -0800478 { name: "peri",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700479 clock_srcs: {clk_peri_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700480 clock_group: "infra",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700481 reset: "sys_io_div4",
482 reset_connections: {rst_peri_ni: "sys_io_div4"},
Eunchan Kim0523f6b2019-12-17 13:53:11 -0800483 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100484 ],
485
486 // ===== INTERRUPT CTRL =====================================================
487 // `rv_plic` will be instantiate (need to be defined in `module` field
488 // If interrupt is not defined, it uses the order from the module list
489 // and include every modules.
490 // first item goes to LSB of the interrupt source
Michael Schaffner666dde12019-10-25 11:57:54 -0700491 interrupt_module: ["gpio", "uart", "spi_device", "flash_ctrl",
Philipp Wagnera4a9e402020-06-22 12:06:56 +0100492 "hmac", "alert_handler", "nmi_gen", "usbdev", "pwrmgr",
Timothy Chen3c3f3482020-09-09 18:45:41 -0700493 "otbn", "keymgr" ]
lowRISC Contributors802543a2019-08-31 12:12:56 +0100494
495 // RV_PLIC has two searching algorithm internally to pick the most highest priority interrupt
496 // source. "sequential" is smaller but slower, "matrix" is larger but faster.
497 // Choose depends on the criteria. Currently it is set to "matrix" to meet FPGA timing @ 50MHz
498
499 // generated:
500 interrupt: [
501 ]
502
Michael Schaffner666dde12019-10-25 11:57:54 -0700503 // ===== ALERT HANDLER ======================================================
504 // list all modules that expose alerts
Philipp Wagnera4a9e402020-06-22 12:06:56 +0100505 // first item goes to LSB of the alert source
Cindy Chendae0c652020-10-09 10:00:51 -0700506 alert_module: [ "aes", "otbn", "sensor_ctrl", "keymgr", "otp_ctrl" ]
Michael Schaffner666dde12019-10-25 11:57:54 -0700507
508 // generated list of alerts:
509 alert: [
510 ]
lowRISC Contributors802543a2019-08-31 12:12:56 +0100511
512 // TODO: PINMUX
Eunchan Kim632c6f72019-09-30 11:11:51 -0700513 pinmux: {
514
Eunchan Kim436d2242019-10-29 17:25:51 -0700515 // Total number of Multiplexed I/O
516 // All the input/outputs from IPs are muxed in pinmux, and it has # of I/O
517 // talks to the outside of top_earlgrey.
518 // This field will be replaced to the length of PAD if padctrl is defined
519 num_mio: 32
520
Eunchan Kim632c6f72019-09-30 11:11:51 -0700521 // Dedicated IO modules. The in/out ports of the modules below are connected
522 // to TOP IO port through PADS directly. It bypasses PINMUX multiplexers
523 dio_modules: [
524 { name: "spi_device", pad: ["ChB[0..3]"] },
Eunchan Kim436d2242019-10-29 17:25:51 -0700525 //{ name: "uart.tx", pad: ["ChA[0]"]},
526 { name: "uart", pad: ["ChA[0..1]"]},
Eunchan Kim632c6f72019-09-30 11:11:51 -0700527 // { name: "dio_module.signal_input", pad: ["ChA[31]"] }
Pirmin Vogelfe6863b2020-05-11 17:30:54 +0200528 { name: "usbdev", pad: ["ChC[0..8]"]},
Eunchan Kim632c6f72019-09-30 11:11:51 -0700529 ],
530
531 // Multiplexing IO modules. The in/out ports of the modules below are
532 // connected through PINMUX, which gives controllability of the connection
533 // between the modules and the IO PADS.
534 // If `mio_modules` aren't defined, it uses all remaining modules from
535 // module list except defined in `dio_modules`.
536 mio_modules: ["uart", "gpio"]
537
538 // If any module isn't defined in above two lists, its inputs will be tied
539 // to 0, and the output/OE signals will be floating (or connected to
540 // unused signal). `rv_plic` is special module, shouldn't be defined here.
541 nc_modules: ["rv_timer", "hmac"]
542
Michael Schaffner57c490d2020-04-29 15:08:55 -0700543 // Number of wakeup detectors to instantiate, and bitwidth for the wakeup
544 // counters. Note that all MIO pad inputs are connected to the wakeup detectors,
545 // and there is no way to disable this. DIO inputs on the other hand are by
546 // default not connected.
547 // TODO: need to add mechanism to mark them as wakeup pins.
548 num_wkup_detect: 8
549 wkup_cnt_width: 8
550
Eunchan Kim632c6f72019-09-30 11:11:51 -0700551 // Below fields are generated.
552 // inputs: [
553 // { name: "xxx", width: xx },
554 // ]
555 // outputs: [
556 // { name: "xxx", width: xx },
557 // ]
558 // inouts: [
559 // { name: "xxx", width: xx },
560 // ]
561 }
562
563 // PADS instantiation
564 // Number of in/outs and the numer of PAD instances doesn't have to be
565 // same. The number given below excludes clock/reset and other necessary
566 // PADS but only defines GPIO pads.
567 padctrl: {
568 attr_default: ["STRONG"],
569 pads: [
570 { name: "ChA" type: "IO_33V", count: 32 }, // Accessing as ChA[0] .. ChA[31]
571 { name: "ChB" type: "IO_33V", count: 4, attr: ["KEEP", "WEAK"]},
Pirmin Vogelea91b302020-01-14 18:53:01 +0000572 { name: "ChC" type: "IO_33V", count: 4, attr: ["KEEP", "STRONG"]},
Eunchan Kim632c6f72019-09-30 11:11:51 -0700573 ]
574 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100575
576}