blob: 6a2bcbe7d1327aacde1e7e8d1656d469ccbd1ca2 [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
Timothy Chen7f8cc8e2020-11-11 13:15:57 -080018 // Power information for the design
19 power: {
20 // Power domains supported by the design
21 // Aon represents domain aon
22 // 0 represents domain 0
23 domains: ["Aon", "0"],
24
25 // Default power domain used for the design
26 default: "0"
27 },
28
Michael Schaffner7b0807d2020-10-27 19:54:52 -070029 // This is the clock data structure of the design.
Timothy Chenf56c1b52020-04-28 17:00:43 -070030 // The hier path refers to the clock reference path (struct / port)
31 // - The top/ext desgination follows the same scheme as inter-module
Timothy Chen0550d692020-04-20 17:19:35 -070032 // The src key indicates the raw clock sources in the design
33 // The groups key indicates the various clock groupings in the design
34 clocks: {
35
Timothy Chenf56c1b52020-04-28 17:00:43 -070036 hier_paths: {
37 top: "clkmgr_clocks.", // top level is a struct
38 ext: "", // ext is a port of the clock name
39 },
40
Timothy Chen33b3b9d2020-05-08 10:14:17 -070041 // Clock Source attributes
42 // name: Name of group.
43 // aon: Whether the clock is free running all the time.
44 // If it is, the clock is not hanlded by clkmgr.
45 // freq: Absolute frequency of clk in Hz
Timothy Chen0550d692020-04-20 17:19:35 -070046 srcs: [
Timothy Chen33b3b9d2020-05-08 10:14:17 -070047 { name: "main", aon: "no", freq: "100000000" }
Timothy Chenced60b22020-08-20 10:35:00 -070048 { name: "io", aon: "no", freq: "96000000" }
Timothy Chen33b3b9d2020-05-08 10:14:17 -070049 { name: "usb", aon: "no", freq: "48000000" }
50 { name: "aon", aon: "yes", freq: "200000" }
Timothy Chen0550d692020-04-20 17:19:35 -070051 ],
52
Timothy Chen79972ad2020-06-30 17:13:49 -070053 // Derived clock source attributes
54 // name: Name of group.
55 // aon: Whether the clock is free running all the time.
56 // If it is, the clock is not hanlded by clkmgr.
57 // freq: Absolute frequency of clk in Hz
58 // src: From which clock source is the clock derived
59 // div: Ratio between derived clock and source clock
60 derived_srcs: [
Timothy Chenced60b22020-08-20 10:35:00 -070061 { name: "io_div2", aon: "no", div: 2, src: "io", freq: "48000000" }
62 { name: "io_div4", aon: "no", div: 4, src: "io", freq: "24000000" }
Timothy Chen79972ad2020-06-30 17:13:49 -070063 ],
64
Timothy Chen0550d692020-04-20 17:19:35 -070065 // Clock Group attributes
66 // name: name of group.
67 //
Timothy Chenf56c1b52020-04-28 17:00:43 -070068 // src: The hierarchical source of the clock
69 // "ext" - clock is supplied from a port of the top module
70 // "top" - clock is supplied from a net inside the top module
71 //
Rupert Swarbrickcba33a22020-07-02 16:46:38 +010072 // sw_cg: whether software is allowed to gate the clock
Timothy Chen0550d692020-04-20 17:19:35 -070073 // "no" - software is not allowed to gate clocks
74 // "yes" - software is allowed to gate clocks
75 // "hint" - software can provide a hint, and hw controls the rest
76 //
77 // unique: whether each module in the group can be separately gated
Rupert Swarbrickcba33a22020-07-02 16:46:38 +010078 // if sw_cg is "no", this field has no meaning
Timothy Chen0550d692020-04-20 17:19:35 -070079 // "yes" - each clock is individually controlled
80 // "no" - the group is controlled as one single unit
81 //
82 // The powerup and proc groups are unique.
Timothy Chen33b3b9d2020-05-08 10:14:17 -070083 // The powerup group of clocks do not feed through the clock
Timothy Chen0550d692020-04-20 17:19:35 -070084 // controller as they manage clock controller behavior
85 // The proc group is not peripheral, and direclty hardwired
86
87 groups: [
Timothy Chen79972ad2020-06-30 17:13:49 -070088 // the powerup group is used exclusively by clk/pwr/rstmgr
89 { name: "powerup", src:"top", sw_cg: "no" }
Timothy Chenf56c1b52020-04-28 17:00:43 -070090 { name: "trans", src:"top", sw_cg: "hint", unique: "yes", }
91 { name: "infra", src:"top", sw_cg: "no", }
92 { name: "secure", src:"top", sw_cg: "no" }
93 { name: "peri", src:"top", sw_cg: "yes", unique: "no" }
94 { name: "timers", src:"top", sw_cg: "no" }
Timothy Chen0550d692020-04-20 17:19:35 -070095 { name: "proc",
Timothy Chenc6233932020-08-19 15:34:07 -070096 src: "no",
97 sw_cg: "no",
98 unique: "no",
Timothy Chen0550d692020-04-20 17:19:35 -070099 clocks: {
100 clk_proc_main: main
101 }
102 }
103 ],
Timothy Chenc6233932020-08-19 15:34:07 -0700104 },
lowRISC Contributors802543a2019-08-31 12:12:56 +0100105
Timothy Chenc6233932020-08-19 15:34:07 -0700106 // This is the reset data strcture of the design.
107 // The hier path refers to the reset reference path (struct / port)
108 // - The top/ext desgination follows the same scheme as inter-module
109 // The node key represents all the known resets in the design
110 resets: {
111
112 hier_paths: {
113 top: "rstmgr_resets.", // top level is a struct
114 ext: "", // ext is a port of the clock name
115 },
116
117 // Reset node attributes
118 // name: name of reset.
119 //
120 // gen: whether the reset is generated
121 // true: it is a generated reset inside rstmgr
122 // false: it is a hardwired design reset inside rstmgr (roots and por)
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800123 // For non-generated resets, the parent / domain definitions have no meaning.
Timothy Chenc6233932020-08-19 15:34:07 -0700124 //
125 // type: the reset type [ext, top]
126 // ext: the reset is coming in from the ports, external to earlgrey
127 // int: the reset is only used inside rstmgr
128 // top: the reset is output from rstmgr to top level struct
129 //
130 // parent: The parent reset
131 // If type is "ext", there is no root, since it is external
132 //
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800133 // domains: The power domains of a particular reset
134 // This is a list of of the supported power domains.
135 // Valid values are Aon and (power domain)0 ~ (power domain)1.
136 // If no value is supplied, the default is only the Aon version.
Timothy Chenc6233932020-08-19 15:34:07 -0700137 //
138 // clk: related clock domain for synchronous release
139 // If type is "por", there is not related clock, since it is
140 // likely external or generated from a voltage comparator
141 //
142 nodes: [
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800143 { name: "rst_ni", gen: false, type: "ext", }
144 { name: "por_aon", gen: false, type: "top", domains: ["Aon" ], clk: "aon" }
145 { name: "lc_src", gen: false, type: "int", domains: ["Aon", "0"], clk: "io_div4" }
146 { name: "sys_src", gen: false, type: "int", domains: ["Aon", "0"], clk: "io_div4" }
147 { name: "por", gen: true, type: "top", domains: ["Aon" ], parent: "por_aon", clk: "main" }
148 { name: "por_io", gen: true, type: "top", domains: ["Aon", ], parent: "por_aon", clk: "io" }
149 { name: "por_io_div2", gen: true, type: "top", domains: ["Aon", ], parent: "por_aon", clk: "io_div2" }
150 { name: "por_io_div4", gen: true , type: "top", domains: ["Aon", ], parent: "por_aon", clk: "io_div4" }
151 { name: "por_usb", gen: true, type: "top", domains: ["Aon", ], parent: "por_aon", clk: "usb" }
152 { name: "lc", gen: true, type: "top", domains: [ "0"], parent: "lc_src", clk: "main" }
153 { name: "lc_io_div4", gen: true, type: "top", domains: [ "0"], parent: "lc_src", clk: "io_div4" }
154 { name: "sys", gen: true, type: "top", domains: ["Aon", "0"], parent: "sys_src", clk: "main" }
155 { name: "sys_io_div4", gen: true, type: "top", domains: ["Aon", "0"], parent: "sys_src", clk: "io_div4" }
156 { name: "sys_aon", gen: true, type: "top", domains: ["Aon", ], parent: "sys_src", clk: "aon" }
157 { name: "spi_device", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "io_div2", sw: 1 }
158 { name: "usb", gen: true, type: "top", domains: ["Aon", ], parent: "sys_src", clk: "usb", sw: 1 }
Timothy Chenc6233932020-08-19 15:34:07 -0700159 ]
160 }
Timothy Chen3193b002019-10-04 16:56:05 -0700161
lowRISC Contributors802543a2019-08-31 12:12:56 +0100162 // Number of cores: used in rv_plic and timer
163 num_cores: "1",
164
165 // `module` defines the peripherals.
166 // Details are coming from each modules' config file `ip.hjson`
167 // TODO: Define parameter here
Timothy Chendde68052020-08-05 16:29:35 -0700168 // generated: A module is templated and generated as part of topgen
169 // top_only: A module is not templated but is specific to 'top_*' instead of 'ip'
lowRISC Contributors802543a2019-08-31 12:12:56 +0100170 module: [
171 { name: "uart", // instance name
172 type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted)
173 // and `hw/ip/{type}`
Timothy Chen3193b002019-10-04 16:56:05 -0700174
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700175 // clock connections defines the port to top level clock connection
176 // the ip.hjson will declare the clock port names
177 // If none are defined at ip.hjson, clk_i is used by default
Timothy Chen6b70fd22020-08-20 14:01:26 -0700178 clock_srcs: {clk_i: "io_div4"},
Timothy Chen3193b002019-10-04 16:56:05 -0700179
180 // reset connections defines the port to top level reset connection
181 // the ip.hjson will declare the reset port names
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700182 // If none are defined at ip.hjson, rst_ni is used by default
Timothy Chen6b70fd22020-08-20 14:01:26 -0700183 reset_connections: {rst_ni: "sys_io_div4"},
lowRISC Contributors802543a2019-08-31 12:12:56 +0100184 base_addr: "0x40000000",
185 },
186 { name: "gpio",
187 type: "gpio",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700188 clock_srcs: {clk_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700189 clock_group: "peri",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700190 reset_connections: {rst_ni: "sys_io_div4"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800191 base_addr: "0x40040000",
lowRISC Contributors802543a2019-08-31 12:12:56 +0100192 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100193 { name: "spi_device",
194 type: "spi_device",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700195 clock_srcs: {clk_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700196 clock_group: "peri",
Timothy Chen3193b002019-10-04 16:56:05 -0700197 reset_connections: {rst_ni: "spi_device"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800198 base_addr: "0x40050000",
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"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800205 base_addr: "0x40100000",
lowRISC Contributors802543a2019-08-31 12:12:56 +0100206 },
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800207 { name: "sensor_ctrl",
208 type: "sensor_ctrl",
209 clock_srcs: {clk_i: "io_div4"},
210 clock_group: "secure",
211 clock_reset_export: ["ast"],
212 reset_connections: {rst_ni: "sys_io_div4"},
213 domain: "Aon",
Pirmin Vogeld4534382019-10-17 13:18:31 +0100214 base_addr: "0x40110000",
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800215 top_only: "true"
Pirmin Vogeld4534382019-10-17 13:18:31 +0100216 },
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800217 { name: "otp_ctrl",
218 type: "otp_ctrl",
219 clock_srcs: {clk_i: "io_div4"},
220 clock_group: "timers",
221 reset_connections: {rst_ni: "lc_io_div4"},
222 base_addr: "0x40130000",
Timothy Chen65e16672020-12-05 09:17:14 -0800223 },
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800224 { name: "lc_ctrl",
225 type: "lc_ctrl",
226 clock_srcs: {clk_i: "io_div4"},
227 clock_group: "timers",
228 reset_connections: {rst_ni: "lc_io_div4"},
229 base_addr: "0x40140000",
230 },
Timothy Chen163050b2020-04-13 23:29:29 -0700231 { name: "pwrmgr",
232 type: "pwrmgr",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700233 clock_srcs: {clk_i: "io_div4", clk_slow_i: "aon"},
Timothy Chen0550d692020-04-20 17:19:35 -0700234 clock_group: "powerup",
Timothy Chena4cc10d2020-05-08 16:06:20 -0700235 reset_connections: {rst_ni: "por", rst_slow_ni: "por_aon"},
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800236 domain: "Aon",
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800237 base_addr: "0x40400000",
Timothy Chen4ba25312020-06-17 13:08:57 -0700238 generated: "true" // Indicate this module is generated in the topgen
Timothy Chenf56c1b52020-04-28 17:00:43 -0700239
Timothy Chen163050b2020-04-13 23:29:29 -0700240 },
Timothy Chenc59f7012020-04-16 19:11:42 -0700241 { name: "rstmgr",
242 type: "rstmgr",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700243 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 -0700244 clk_io_div2_i: "io_div2", clk_io_div4_i: "io_div4"},
Timothy Chenc59f7012020-04-16 19:11:42 -0700245 clock_group: "powerup",
246 reset_connections: {rst_ni: "rst_ni"},
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800247 domain: "Aon",
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800248 base_addr: "0x40410000",
Timothy Chen0f3c1752020-08-26 12:47:17 -0700249 generated: "true" // Indicate this module is generated in the topgen
Timothy Chenf56c1b52020-04-28 17:00:43 -0700250 },
251 { name: "clkmgr",
252 type: "clkmgr",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700253 clock_srcs: {clk_i: "io_div4"},
Timothy Chenf56c1b52020-04-28 17:00:43 -0700254 clock_group: "powerup",
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800255 reset_connections: {rst_ni: "por_io_div4", rst_main_ni: "por", rst_io_ni: "por_io", rst_usb_ni: "por_usb"
Timothy Chenced60b22020-08-20 10:35:00 -0700256 rst_io_div2_ni: "por_io_div2", rst_io_div4_ni: "por_io_div4"},
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800257 domain: "Aon",
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800258 base_addr: "0x40420000",
Timothy Chenc59f7012020-04-16 19:11:42 -0700259 generated: "true"
260 },
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800261 // pinmux is currently allocated to main fabric,
262 // however this should probably be moved to peri fabric
263 { name: "pinmux",
264 type: "pinmux",
265 clock: "main",
266 clock_srcs: {clk_i: "main", clk_aon_i: "aon"},
267 clock_group: "secure",
268 reset_connections: {rst_ni: "sys", rst_aon_ni: "sys_aon"},
269 domain: "Aon",
270 base_addr: "0x40460000",
271 generated: "true"
272 },
273 // see comment regarding pinmux above
274 { name: "padctrl",
275 type: "padctrl",
276 clock: "main",
Timothy Chen0550d692020-04-20 17:19:35 -0700277 clock_srcs: {clk_i: "main"},
278 clock_group: "secure",
Michael Schaffner666dde12019-10-25 11:57:54 -0700279 reset_connections: {rst_ni: "sys"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800280 domain: "Aon",
281 base_addr: "0x40470000",
282 generated: "true"
283 },
Pirmin Vogelea91b302020-01-14 18:53:01 +0000284 { name: "usbdev",
285 type: "usbdev",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700286 clock_srcs: {clk_i: "io_div4", clk_usb_48mhz_i: "usb"},
Timothy Chen0550d692020-04-20 17:19:35 -0700287 clock_group: "peri",
Timothy Chen4c8905e2020-08-26 10:34:33 -0700288 clock_reset_export: ["ast"],
Timothy Chen6b70fd22020-08-20 14:01:26 -0700289 reset_connections: {rst_ni: "sys_io_div4", rst_usb_48mhz_ni: "usb"},
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800290 domain: "Aon",
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800291 base_addr: "0x40500000",
Pirmin Vogelea91b302020-01-14 18:53:01 +0000292 },
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800293 { name: "flash_ctrl",
294 type: "flash_ctrl",
Timothy Chenf52a4612020-12-04 20:37:49 -0800295 clock_srcs: {clk_i: "main", clk_otp_i: "io_div4"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800296 clock_group: "infra",
Timothy Chenf52a4612020-12-04 20:37:49 -0800297 reset_connections: {rst_ni: "lc", rst_otp_ni: "lc_io_div4"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800298 base_addr: "0x41000000",
299 generated: "true" // Indicate this module is generated in the topgen
300 },
301 { name: "rv_plic",
302 type: "rv_plic",
303 clock_srcs: {clk_i: "main"},
Timothy Chendde68052020-08-05 16:29:35 -0700304 clock_group: "secure",
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800305 reset_connections: {rst_ni: "sys"},
306 base_addr: "0x41010000",
307 generated: "true" // Indicate this module is generated in the topgen
308 },
309 { name: "aes",
310 type: "aes",
311 clock_srcs: {clk_i: "main"},
312 clock_group: "trans",
313 reset_connections: {rst_ni: "sys"},
314 base_addr: "0x41100000",
315 },
316 { name: "hmac",
317 type: "hmac",
318 clock_srcs: {clk_i: "main"},
319 clock_group: "trans",
320 reset_connections: {rst_ni: "sys"},
321 base_addr: "0x41110000",
322 },
323 { name: "kmac"
324 type: "kmac"
325 clock_srcs: {clk_i: "main"}
326 clock_group: "trans"
327 reset_connections: {rst_ni: "sys"}
328 base_addr: "0x41120000"
Timothy Chendde68052020-08-05 16:29:35 -0700329 },
Timothy Chen3c3f3482020-09-09 18:45:41 -0700330 { name: "keymgr",
331 type: "keymgr",
Timothy Chend5820b02020-12-05 17:19:06 -0800332 clock_srcs: {clk_i: "main", clk_edn_i: "main"},
Timothy Chen3c3f3482020-09-09 18:45:41 -0700333 clock_group: "secure",
Timothy Chend5820b02020-12-05 17:19:06 -0800334 reset_connections: {rst_ni: "sys", rst_edn_ni: "sys"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800335 base_addr: "0x41130000",
Michael Schaffner5ae4a232020-10-06 19:03:43 -0700336 },
Mark Branstadff807362020-11-16 07:56:15 -0800337 { name: "csrng",
338 type: "csrng",
339 clock_srcs: {clk_i: "main"},
340 clock_group: "secure",
341 reset_connections: {rst_ni: "sys"},
342 base_addr: "0x41150000",
343 },
344 { name: "entropy_src",
345 type: "entropy_src",
346 clock_srcs: {clk_i: "main"},
347 clock_group: "secure",
348 reset_connections: {rst_ni: "sys"},
349 base_addr: "0x41160000",
350 },
351 { name: "edn0",
352 type: "edn",
353 clock_srcs: {clk_i: "main"},
354 clock_group: "secure",
355 reset_connections: {rst_ni: "sys"},
356 base_addr: "0x41170000",
357 },
358 { name: "edn1",
359 type: "edn",
360 clock_srcs: {clk_i: "main"},
361 clock_group: "secure",
362 reset_connections: {rst_ni: "sys"},
363 base_addr: "0x41180000",
364 },
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800365 { name: "alert_handler",
366 type: "alert_handler",
367 clock_srcs: {clk_i: "main"},
368 clock_group: "secure",
369 reset_connections: {rst_ni: "sys"},
370 base_addr: "0x411b0000",
371 generated: "true" // Indicate this module is generated in the topgen
372 localparam: {
373 EscCntDw: 32,
374 AccuCntDw: 16,
375 LfsrSeed: "0x7FFFFFFF"
376 }
377 },
378 // dummy module to capture the alert handler escalation signals
379 // and test them by converting them into IRQs
380 { name: "nmi_gen",
381 type: "nmi_gen",
382 clock_srcs: {clk_i: "main"},
383 clock_group: "secure",
384 reset_connections: {rst_ni: "sys"},
385 base_addr: "0x411c0000",
386 },
Philipp Wagnera4a9e402020-06-22 12:06:56 +0100387 { name: "otbn",
388 type: "otbn",
389 clock_srcs: {clk_i: "main"},
390 clock_group: "trans",
391 reset_connections: {rst_ni: "sys"},
Martin Lueker-Bodend5a1e4b2020-11-11 19:46:33 -0800392 base_addr: "0x411d0000",
Philipp Wagnera4a9e402020-06-22 12:06:56 +0100393 },
lowRISC Contributors802543a2019-08-31 12:12:56 +0100394 ]
395
396 // Memories (ROM, RAM, eFlash) are defined at the top.
397 // It utilizes the primitive cells but configurable
398 memory: [
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700399 { name: "rom",
Timothy Chen0550d692020-04-20 17:19:35 -0700400 clock_srcs: {clk_i: "main"},
401 clock_group: "infra",
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700402 reset_connections: {rst_ni: "sys"},
403 type: "rom",
404 base_addr: "0x00008000",
Weicai Yang55b2cdf2020-04-10 15:40:30 -0700405 swaccess: "ro",
Timothy Chenda2e3442020-02-24 21:37:47 -0800406 size: "0x4000"
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700407 inter_signal_list: [
408 { struct: "tl"
409 package: "tlul_pkg"
410 type: "req_rsp"
411 act: "rsp"
412 name: "tl"
413 }
414 ]
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700415 },
416 { name: "ram_main",
Timothy Chen0550d692020-04-20 17:19:35 -0700417 clock_srcs: {clk_i: "main"},
418 clock_group: "infra",
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700419 reset_connections: {rst_ni: "sys"},
420 type: "ram_1p",
421 base_addr: "0x10000000",
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700422 size: "0x10000"
Weicai Yang2ac0dee2020-12-08 12:19:18 -0800423 byte_write: "true",
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700424 inter_signal_list: [
425 { struct: "tl"
426 package: "tlul_pkg"
427 type: "req_rsp"
428 act: "rsp"
429 name: "tl"
430 }
431 ]
432 },
Timothy Chen2c9e1a92020-06-29 15:03:25 -0700433 { name: "ram_ret",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700434 clock_srcs: {clk_i: "io_div4"},
Timothy Chen2c9e1a92020-06-29 15:03:25 -0700435 clock_group: "infra",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700436 reset_connections: {rst_ni: "sys_io_div4"},
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800437 domain: "Aon",
Timothy Chen2c9e1a92020-06-29 15:03:25 -0700438 type: "ram_1p",
439 base_addr: "0x18000000",
Timothy Chen7f8cc8e2020-11-11 13:15:57 -0800440 size: "0x1000",
Weicai Yang2ac0dee2020-12-08 12:19:18 -0800441 byte_write: "true",
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700442 inter_signal_list: [
443 { struct: "tl"
444 package: "tlul_pkg"
445 type: "req_rsp"
446 act: "rsp"
447 name: "tl"
448 }
449 ]
450 },
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700451 { name: "eflash",
Timothy Chen0550d692020-04-20 17:19:35 -0700452 clock_srcs: {clk_i: "main"},
453 clock_group: "infra",
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700454 reset_connections: {rst_ni: "lc"},
455 type: "eflash",
456 base_addr: "0x20000000",
Timothy Chen1daf5822020-10-26 17:28:15 -0700457 banks: 2,
Timothy Chene97e0b82020-12-11 17:18:43 -0800458 pages_per_bank: 128,
459 program_resolution: 8, // maximum number of flash words allowed to program at one time
Weicai Yang55b2cdf2020-04-10 15:40:30 -0700460 swaccess: "ro",
Eunchan Kime4a85072020-02-05 16:00:00 -0800461 inter_signal_list: [
462 { struct: "flash", // flash_req_t, flash_rsp_t
463 type: "req_rsp",
464 name: "flash_ctrl", // flash_ctrl_i (req), flash_ctrl_o (rsp)
Eunchan Kim40098a92020-04-17 12:22:36 -0700465 act: "rsp",
Timothy Chenac620652020-06-25 13:48:50 -0700466 },
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700467 { struct: "tl"
468 package: "tlul_pkg"
469 type: "req_rsp"
470 act: "rsp"
471 name: "tl"
Timothy Chend2c9ff42020-11-19 16:03:54 -0800472 },
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800473 { struct: "lc_tx",
474 package: "lc_ctrl_pkg",
475 type: "uni"
476 act: "rcv"
477 name: "lc_dft_en"
478 },
Timothy Chend2c9ff42020-11-19 16:03:54 -0800479 { struct: "logic"
480 package: ""
481 type: "uni"
482 act: "rcv"
483 name: "flash_power_down_h"
484 },
485 { struct: "logic"
486 package: ""
487 type: "uni"
488 act: "rcv"
489 name: "flash_power_ready_h"
490 },
491 { struct: "logic",
492 package: "",
493 width: "2",
494 type: "uni"
495 act: "rcv"
496 name: "flash_test_mode_a"
497 },
498 { struct: "logic",
499 package: "",
500 type: "uni"
501 act: "rcv"
502 name: "flash_test_voltage_h"
503 },
Eunchan Kime4a85072020-02-05 16:00:00 -0800504 ],
505 },
lowRISC Contributors802543a2019-08-31 12:12:56 +0100506 ],
507
Eunchan Kime4a85072020-02-05 16:00:00 -0800508 // Inter-module Connection.
509 // format:
510 // requester: [ resp1, resp2, ... ],
511 //
Eunchan Kim40098a92020-04-17 12:22:36 -0700512 // the field and value should be module_inst.port_name
Eunchan Kime4a85072020-02-05 16:00:00 -0800513 // e.g flash_ctrl0.flash: [flash_phy0.flash_ctrl]
514 inter_module: {
Eunchan Kim40098a92020-04-17 12:22:36 -0700515 'connect': {
Timothy Chenf52a4612020-12-04 20:37:49 -0800516 'alert_handler.crashdump': ['rstmgr.alert_dump'],
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800517 // TODO: uncomment once NMI gen is removed,
518 // the processor core wrapper supports intermodule signals
519 // and the reset manager has an escalation input.
520 //'alert_handler.esc_rx': ['lc_ctrl.esc_wipe_secrets_rx',
521 // 'lc_ctrl.esc_scrap_state_rx'],
522 //'alert_handler.esc_tx': ['lc_ctrl.esc_wipe_secrets_tx',
523 // 'lc_ctrl.esc_scrap_state_tx'],
Mark Branstadff807362020-11-16 07:56:15 -0800524 'csrng.csrng_cmd' : ['edn0.csrng_cmd', 'edn1.csrng_cmd'],
Timothy Chenf52a4612020-12-04 20:37:49 -0800525 'csrng.entropy_src_hw_if' : ['entropy_src.entropy_src_hw_if'],
Timothy Chen9b6f2422020-09-18 16:09:07 -0700526 'flash_ctrl.flash' : ['eflash.flash_ctrl'],
Timothy Chenf52a4612020-12-04 20:37:49 -0800527 'flash_ctrl.keymgr': ['keymgr.flash'],
528 'flash_ctrl.otp' : ['otp_ctrl.flash_otp_key'],
Timothy Chen9b6f2422020-09-18 16:09:07 -0700529 'pwrmgr.pwr_flash' : ['flash_ctrl.pwrmgr'],
530 'pwrmgr.pwr_rst' : ['rstmgr.pwr'],
531 'pwrmgr.pwr_clk' : ['clkmgr.pwr'],
Michael Schaffnerb2a66dd2020-10-26 10:33:12 -0700532 'pwrmgr.pwr_otp' : ['otp_ctrl.pwr_otp'],
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800533 'pwrmgr.pwr_lc' : ['lc_ctrl.pwr_lc'],
Timothy Chen75350ca2020-09-22 20:55:55 -0700534 'flash_ctrl.keymgr': ['keymgr.flash'],
Timothy Chenc8f30042020-09-25 16:59:47 -0700535 'alert_handler.crashdump': ['rstmgr.alert_dump'],
Mark Branstadff807362020-11-16 07:56:15 -0800536 'csrng.entropy_src_hw_if' : ['entropy_src.entropy_src_hw_if'],
Timothy Chend5820b02020-12-05 17:19:06 -0800537 // TODO see #4447
Timothy Chenaeffadc2020-12-11 15:03:07 -0800538 //'edn0.edn' : ['keymgr.edn', 'flash_ctrl.edn'],
Timothy Chend5820b02020-12-05 17:19:06 -0800539
Eunchan Kim97be1d02020-11-03 14:33:52 -0800540 // KeyMgr Sideload & KDF function
Timothy Chen65e16672020-12-05 09:17:14 -0800541 'otp_ctrl.otp_keymgr_key': ['keymgr.otp_key'],
Eunchan Kim97be1d02020-11-03 14:33:52 -0800542 'keymgr.kmac_key' : ['kmac.keymgr_key']
543 'keymgr.kmac_data': ['kmac.keymgr_kdf']
Timothy Chen455afcb2020-10-01 11:46:35 -0700544 // The idle connection is automatically connected through topgen.
545 // The user does not need to explicitly declare anything other than
546 // an empty list.
Timothy Chenc8f30042020-09-25 16:59:47 -0700547 'clkmgr.idle' : [],
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800548
549 // OTP LC interface
550 'otp_ctrl.otp_lc_data' : ['lc_ctrl.otp_lc_data'],
551 'lc_ctrl.lc_otp_program' : ['otp_ctrl.lc_otp_program'],
552 'lc_ctrl.lc_otp_token' : ['otp_ctrl.lc_otp_token'],
553
554 // HW_CFG broadcast
Timothy Chen0a120942020-12-14 17:20:51 -0800555 'otp_ctrl.otp_hw_cfg' : ['lc_ctrl.otp_hw_cfg', 'keymgr.otp_hw_cfg'],
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800556
557 // Diversification constant coming from life cycle
Timothy Chen0a120942020-12-14 17:20:51 -0800558 'lc_ctrl.lc_keymgr_div' : ['keymgr.lc_keymgr_div'],
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800559
560 // LC function control signal broadcast
561 // TODO(#3920): connect all these signals once top-level sim and FPGA can backload LC state
562 'lc_ctrl.lc_dft_en' : ['otp_ctrl.lc_dft_en', 'eflash.lc_dft_en'],
563 'lc_ctrl.lc_nvm_debug_en' : [],
564 'lc_ctrl.lc_hw_debug_en' : [],
565 'lc_ctrl.lc_cpu_en' : [],
Timothy Chen0a120942020-12-14 17:20:51 -0800566 //'lc_ctrl.lc_keymgr_en' : ['keymgr.lc_keymgr_en'],
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800567 'lc_ctrl.lc_escalate_en' : ['otp_ctrl.lc_escalate_en'],
568
569 // TODO: OTP Clock bypass signal going from LC to AST/clkmgr
570 'lc_ctrl.lc_clk_byp_req' : [],
571 //'lc_ctrl.lc_clk_byp_ack' : [],
572
573 // TODO: Flash RMA
574 'lc_ctrl.lc_flash_rma_req' : [],
575 'lc_ctrl.lc_flash_rma_seed' : [],
576 //'lc_ctrl.lc_flash_rma_ack' : [],
577
578 // LC access control signal broadcast
579 'lc_ctrl.lc_creator_seed_sw_rw_en' : ['otp_ctrl.lc_creator_seed_sw_rw_en',
Timothy Chen0a120942020-12-14 17:20:51 -0800580 'flash_ctrl.lc_creator_seed_sw_rw_en'],
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800581 'lc_ctrl.lc_owner_seed_sw_rw_en' : ['flash_ctrl.lc_owner_seed_sw_rw_en'],
582 'lc_ctrl.lc_iso_part_sw_rd_en' : ['flash_ctrl.lc_iso_part_sw_rd_en'],
583 'lc_ctrl.lc_iso_part_sw_wr_en' : ['flash_ctrl.lc_iso_part_sw_wr_en'],
584 'lc_ctrl.lc_seed_hw_rd_en' : ['otp_ctrl.lc_seed_hw_rd_en',
585 'flash_ctrl.lc_seed_hw_rd_en'],
Eunchan Kim40098a92020-04-17 12:22:36 -0700586 }
587
588 // top is to connect to top net/struct.
589 // It defines the signal in the top and connect from the module,
590 // use of the signal is up to top template
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700591 'top': [
592 'rstmgr.resets', 'rstmgr.cpu', 'pwrmgr.pwr_cpu', 'clkmgr.clocks',
Eunchan Kime0d37fe2020-08-03 12:05:21 -0700593
594 // Xbars
595 'main.tl_corei', 'main.tl_cored', 'main.tl_dm_sba', 'main.tl_debug_mem'
596 ],
Eunchan Kim40098a92020-04-17 12:22:36 -0700597
598 // ext is to create port in the top.
Eunchan Kim57071c02020-08-07 13:59:05 -0700599 'external': {
Timothy Chen0f3c1752020-08-26 12:47:17 -0700600 'clkmgr.clk_main': 'clk_main', // clock inputs
601 'clkmgr.clk_io': 'clk_io', // clock inputs
602 'clkmgr.clk_usb': 'clk_usb', // clock inputs
603 'clkmgr.clk_aon': 'clk_aon', // clock inputs
604 'rstmgr.ast': '', // ast reset input
Timothy Chendde68052020-08-05 16:29:35 -0700605 'pwrmgr.pwr_ast': '',
606 'sensor_ctrl.ast_alert': '',
607 'sensor_ctrl.ast_status': '',
608 'usbdev.usb_ref_val': '',
609 'usbdev.usb_ref_pulse': '',
Michael Schaffner5ae4a232020-10-06 19:03:43 -0700610 'peri.tl_ast_wrapper': 'ast_tl',
611 'otp_ctrl.otp_ast_pwr_seq': '',
612 'otp_ctrl.otp_ast_pwr_seq_h': '',
Timothy Chend2c9ff42020-11-19 16:03:54 -0800613 'eflash.flash_power_down_h': 'flash_power_down_h',
614 'eflash.flash_power_ready_h': 'flash_power_ready_h',
615 'eflash.flash_test_mode_a': 'flash_test_mode_a',
616 'eflash.flash_test_voltage_h': 'flash_test_voltage_h',
Eunchan Kim57071c02020-08-07 13:59:05 -0700617 },
Eunchan Kime4a85072020-02-05 16:00:00 -0800618 },
619
lowRISC Contributors802543a2019-08-31 12:12:56 +0100620 debug_mem_base_addr: "0x1A110000",
621
622 // Crossbars: having a top level crossbar
623 // This version assumes all crossbars are instantiated at the top.
624 // Assume xbar.hjson is located in the same directory of top.hjson
625 xbar: [
626 { name: "main",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700627 clock_srcs: {clk_main_i: "main", clk_fixed_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700628 clock_group: "infra",
Timothy Chen3193b002019-10-04 16:56:05 -0700629 reset: "sys",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700630 reset_connections: {rst_main_ni: "sys", rst_fixed_ni: "sys_io_div4"}
lowRISC Contributors802543a2019-08-31 12:12:56 +0100631 },
Eunchan Kim0523f6b2019-12-17 13:53:11 -0800632 { name: "peri",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700633 clock_srcs: {clk_peri_i: "io_div4"},
Timothy Chen0550d692020-04-20 17:19:35 -0700634 clock_group: "infra",
Timothy Chen6b70fd22020-08-20 14:01:26 -0700635 reset: "sys_io_div4",
636 reset_connections: {rst_peri_ni: "sys_io_div4"},
Eunchan Kim0523f6b2019-12-17 13:53:11 -0800637 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100638 ],
639
640 // ===== INTERRUPT CTRL =====================================================
641 // `rv_plic` will be instantiate (need to be defined in `module` field
642 // If interrupt is not defined, it uses the order from the module list
643 // and include every modules.
644 // first item goes to LSB of the interrupt source
Michael Schaffner666dde12019-10-25 11:57:54 -0700645 interrupt_module: ["gpio", "uart", "spi_device", "flash_ctrl",
Philipp Wagnera4a9e402020-06-22 12:06:56 +0100646 "hmac", "alert_handler", "nmi_gen", "usbdev", "pwrmgr",
Philipp Wagner9ac69c62020-12-14 19:22:38 +0000647 "otbn", "keymgr", "kmac" ]
lowRISC Contributors802543a2019-08-31 12:12:56 +0100648
649 // RV_PLIC has two searching algorithm internally to pick the most highest priority interrupt
650 // source. "sequential" is smaller but slower, "matrix" is larger but faster.
651 // Choose depends on the criteria. Currently it is set to "matrix" to meet FPGA timing @ 50MHz
652
653 // generated:
654 interrupt: [
655 ]
656
Michael Schaffner666dde12019-10-25 11:57:54 -0700657 // ===== ALERT HANDLER ======================================================
658 // list all modules that expose alerts
Philipp Wagnera4a9e402020-06-22 12:06:56 +0100659 // first item goes to LSB of the alert source
Michael Schaffner60aa10e2020-12-07 19:39:08 -0800660 alert_module: [ "aes", "otbn", "sensor_ctrl", "keymgr", "otp_ctrl", "lc_ctrl", "entropy_src"]
Michael Schaffner666dde12019-10-25 11:57:54 -0700661
662 // generated list of alerts:
663 alert: [
664 ]
lowRISC Contributors802543a2019-08-31 12:12:56 +0100665
666 // TODO: PINMUX
Eunchan Kim632c6f72019-09-30 11:11:51 -0700667 pinmux: {
668
Eunchan Kim436d2242019-10-29 17:25:51 -0700669 // Total number of Multiplexed I/O
670 // All the input/outputs from IPs are muxed in pinmux, and it has # of I/O
671 // talks to the outside of top_earlgrey.
672 // This field will be replaced to the length of PAD if padctrl is defined
673 num_mio: 32
674
Eunchan Kim632c6f72019-09-30 11:11:51 -0700675 // Dedicated IO modules. The in/out ports of the modules below are connected
676 // to TOP IO port through PADS directly. It bypasses PINMUX multiplexers
677 dio_modules: [
678 { name: "spi_device", pad: ["ChB[0..3]"] },
Eunchan Kim436d2242019-10-29 17:25:51 -0700679 //{ name: "uart.tx", pad: ["ChA[0]"]},
680 { name: "uart", pad: ["ChA[0..1]"]},
Eunchan Kim632c6f72019-09-30 11:11:51 -0700681 // { name: "dio_module.signal_input", pad: ["ChA[31]"] }
Pirmin Vogelfe6863b2020-05-11 17:30:54 +0200682 { name: "usbdev", pad: ["ChC[0..8]"]},
Eunchan Kim632c6f72019-09-30 11:11:51 -0700683 ],
684
685 // Multiplexing IO modules. The in/out ports of the modules below are
686 // connected through PINMUX, which gives controllability of the connection
687 // between the modules and the IO PADS.
688 // If `mio_modules` aren't defined, it uses all remaining modules from
689 // module list except defined in `dio_modules`.
Philipp Wagner9ac69c62020-12-14 19:22:38 +0000690 mio_modules: ["uart", "gpio"]
Eunchan Kim632c6f72019-09-30 11:11:51 -0700691
692 // If any module isn't defined in above two lists, its inputs will be tied
693 // to 0, and the output/OE signals will be floating (or connected to
694 // unused signal). `rv_plic` is special module, shouldn't be defined here.
695 nc_modules: ["rv_timer", "hmac"]
696
Michael Schaffner57c490d2020-04-29 15:08:55 -0700697 // Number of wakeup detectors to instantiate, and bitwidth for the wakeup
698 // counters. Note that all MIO pad inputs are connected to the wakeup detectors,
699 // and there is no way to disable this. DIO inputs on the other hand are by
700 // default not connected.
701 // TODO: need to add mechanism to mark them as wakeup pins.
702 num_wkup_detect: 8
703 wkup_cnt_width: 8
704
Eunchan Kim632c6f72019-09-30 11:11:51 -0700705 // Below fields are generated.
706 // inputs: [
707 // { name: "xxx", width: xx },
708 // ]
709 // outputs: [
710 // { name: "xxx", width: xx },
711 // ]
712 // inouts: [
713 // { name: "xxx", width: xx },
714 // ]
715 }
716
717 // PADS instantiation
718 // Number of in/outs and the numer of PAD instances doesn't have to be
719 // same. The number given below excludes clock/reset and other necessary
720 // PADS but only defines GPIO pads.
721 padctrl: {
722 attr_default: ["STRONG"],
723 pads: [
724 { name: "ChA" type: "IO_33V", count: 32 }, // Accessing as ChA[0] .. ChA[31]
725 { name: "ChB" type: "IO_33V", count: 4, attr: ["KEEP", "WEAK"]},
Pirmin Vogelea91b302020-01-14 18:53:01 +0000726 { name: "ChC" type: "IO_33V", count: 4, attr: ["KEEP", "STRONG"]},
Eunchan Kim632c6f72019-09-30 11:11:51 -0700727 ]
728 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100729
730}