blob: aa0c91979d6f714ecc4651faa94319e9a4877573 [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
9 datawidth: "32", # 32-bit datawidth
10
11 clocks: [
12 { name: "main", freq: "100000000" }
Timothy Chen65d74252019-11-08 14:03:35 -080013 { name: "fixed", freq: "100000000" }
lowRISC Contributors802543a2019-08-31 12:12:56 +010014 ]
15
Timothy Chen3193b002019-10-04 16:56:05 -070016 // Reset attributes
17 // name: name of reset. Real name is `name`_rst_n
18 // type: reset type, either root or leaf
19 // root: if reset type not root, the root reset it is related to
20 // clk: related clock domain for synchronous release
21 resets: [
22 { name: "lc", type: "root", clk: "main"}
23 { name: "sys", type: "root", clk: "main"}
Timothy Chen65d74252019-11-08 14:03:35 -080024 { name: "sys_fixed", type: "leaf", root: "sys", clk: "fixed"}
25 { name: "spi_device", type: "leaf", root: "sys", clk: "fixed"}
Timothy Chen3193b002019-10-04 16:56:05 -070026 ]
27
lowRISC Contributors802543a2019-08-31 12:12:56 +010028 // Number of cores: used in rv_plic and timer
29 num_cores: "1",
30
31 // `module` defines the peripherals.
32 // Details are coming from each modules' config file `ip.hjson`
33 // TODO: Define parameter here
34 module: [
35 { name: "uart", // instance name
36 type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted)
37 // and `hw/ip/{type}`
Timothy Chen3193b002019-10-04 16:56:05 -070038
Timothy Chen80bd8aa2019-10-04 15:57:11 -070039 // clock connections defines the port to top level clock connection
40 // the ip.hjson will declare the clock port names
41 // If none are defined at ip.hjson, clk_i is used by default
Timothy Chen65d74252019-11-08 14:03:35 -080042 clock_connections: {clk_i: "fixed"},
Timothy Chen3193b002019-10-04 16:56:05 -070043
44 // reset connections defines the port to top level reset connection
45 // the ip.hjson will declare the reset port names
Timothy Chen80bd8aa2019-10-04 15:57:11 -070046 // If none are defined at ip.hjson, rst_ni is used by default
Timothy Chen65d74252019-11-08 14:03:35 -080047 reset_connections: {rst_ni: "sys_fixed"},
Timothy Chen80bd8aa2019-10-04 15:57:11 -070048
lowRISC Contributors802543a2019-08-31 12:12:56 +010049 base_addr: "0x40000000",
50 },
51 { name: "gpio",
52 type: "gpio",
Timothy Chen65d74252019-11-08 14:03:35 -080053 clock_connections: {clk_i: "fixed"},
54 reset_connections: {rst_ni: "sys_fixed"},
lowRISC Contributors802543a2019-08-31 12:12:56 +010055 base_addr: "0x40010000",
56 }
57
58 { name: "spi_device",
59 type: "spi_device",
Timothy Chen65d74252019-11-08 14:03:35 -080060 clock_connections: {clk_i: "fixed"},
Timothy Chen3193b002019-10-04 16:56:05 -070061 reset_connections: {rst_ni: "spi_device"},
lowRISC Contributors802543a2019-08-31 12:12:56 +010062 base_addr: "0x40020000",
63 },
64 { name: "flash_ctrl",
65 type: "flash_ctrl",
Timothy Chen80bd8aa2019-10-04 15:57:11 -070066 clock_connections: {clk_i: "main"},
Timothy Chen3193b002019-10-04 16:56:05 -070067 reset_connections: {rst_ni: "lc"},
lowRISC Contributors802543a2019-08-31 12:12:56 +010068 base_addr: "0x40030000",
69 },
70 { name: "rv_timer",
71 type: "rv_timer",
Timothy Chen65d74252019-11-08 14:03:35 -080072 clock_connections: {clk_i: "fixed"},
73 reset_connections: {rst_ni: "sys_fixed"},
lowRISC Contributors802543a2019-08-31 12:12:56 +010074 base_addr: "0x40080000",
75 },
Pirmin Vogeld4534382019-10-17 13:18:31 +010076 { name: "aes",
77 type: "aes",
78 clock_connections: {clk_i: "main"},
79 reset_connections: {rst_ni: "sys"},
80 base_addr: "0x40110000",
81 },
lowRISC Contributors802543a2019-08-31 12:12:56 +010082 { name: "hmac",
83 type: "hmac",
Timothy Chen80bd8aa2019-10-04 15:57:11 -070084 clock_connections: {clk_i: "main"},
Timothy Chen3193b002019-10-04 16:56:05 -070085 reset_connections: {rst_ni: "sys"},
lowRISC Contributors802543a2019-08-31 12:12:56 +010086 base_addr: "0x40120000",
87 },
88 { name: "rv_plic",
89 type: "rv_plic",
Timothy Chen80bd8aa2019-10-04 15:57:11 -070090 clock_connections: {clk_i: "main"},
Timothy Chen3193b002019-10-04 16:56:05 -070091 reset_connections: {rst_ni: "sys"},
lowRISC Contributors802543a2019-08-31 12:12:56 +010092 base_addr: "0x40090000",
93 generated: "true" // Indicate this module is generated in the topgen
lowRISC Contributors802543a2019-08-31 12:12:56 +010094 }
Eunchan Kim436d2242019-10-29 17:25:51 -070095 { name: "pinmux",
96 type: "pinmux",
97 clock: "main",
98 clock_connections: {clk_i: "main"},
99 reset_connections: {rst_ni: "sys"},
100 base_addr: "0x40070000",
101 generated: "true"
Michael Schaffner666dde12019-10-25 11:57:54 -0700102 },
103 { name: "alert_handler",
104 type: "alert_handler",
105 clock_connections: {clk_i: "main"},
106 reset_connections: {rst_ni: "sys"},
107 base_addr: "0x40130000",
108 generated: "true" // Indicate this module is generated in the topgen
109 localparam: {
110 EscCntDw: 32,
111 AccuCntDw: 16,
112 LfsrSeed: "0x7FFFFFFF"
113 }
114 }
115 // dummy module to capture the alert handler escalation signals
116 // and test them by converting them into IRQs
117 { name: "nmi_gen",
118 type: "nmi_gen",
119 clock_connections: {clk_i: "main"},
120 reset_connections: {rst_ni: "sys"},
121 base_addr: "0x40140000",
Eunchan Kim436d2242019-10-29 17:25:51 -0700122 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100123 ]
124
125 // Memories (ROM, RAM, eFlash) are defined at the top.
126 // It utilizes the primitive cells but configurable
127 memory: [
Timothy Chen80bd8aa2019-10-04 15:57:11 -0700128 { name: "rom",
129 clock_connections: {clk_i: "main"},
130 reset_connections: {rst_ni: "sys"},
131 type: "rom",
132 base_addr: "0x00008000",
133 size: "0x2000"
134 },
135 { name: "ram_main",
136 clock_connections: {clk_i: "main"},
137 reset_connections: {rst_ni: "sys"},
138 type: "ram_1p",
139 base_addr: "0x10000000",
140 size: "0x10000" },
141 { name: "eflash",
142 clock_connections: {clk_i: "main"},
143 reset_connections: {rst_ni: "lc"},
144 type: "eflash",
145 base_addr: "0x20000000",
146 size: "0x80000" },
lowRISC Contributors802543a2019-08-31 12:12:56 +0100147 ],
148
149 debug_mem_base_addr: "0x1A110000",
150
151 // Crossbars: having a top level crossbar
152 // This version assumes all crossbars are instantiated at the top.
153 // Assume xbar.hjson is located in the same directory of top.hjson
154 xbar: [
155 { name: "main",
Timothy Chen65d74252019-11-08 14:03:35 -0800156 clock_connections: {clk_main_i: "main", clk_fixed_i: "fixed"},
Timothy Chen3193b002019-10-04 16:56:05 -0700157 reset: "sys",
Timothy Chen65d74252019-11-08 14:03:35 -0800158 reset_connections: {rst_main_ni: "sys", rst_fixed_ni: "sys_fixed"}
lowRISC Contributors802543a2019-08-31 12:12:56 +0100159 },
Eunchan Kim0523f6b2019-12-17 13:53:11 -0800160 { name: "peri",
161 clock_connections: {clk_peri_i: "fixed"},
162 reset: "sys_fixed",
163 reset_connections: {rst_peri_ni: "sys_fixed"},
164 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100165 ],
166
167 // ===== INTERRUPT CTRL =====================================================
168 // `rv_plic` will be instantiate (need to be defined in `module` field
169 // If interrupt is not defined, it uses the order from the module list
170 // and include every modules.
171 // first item goes to LSB of the interrupt source
Michael Schaffner666dde12019-10-25 11:57:54 -0700172 interrupt_module: ["gpio", "uart", "spi_device", "flash_ctrl",
173 "hmac", "alert_handler", "nmi_gen" ]
lowRISC Contributors802543a2019-08-31 12:12:56 +0100174
175 // RV_PLIC has two searching algorithm internally to pick the most highest priority interrupt
176 // source. "sequential" is smaller but slower, "matrix" is larger but faster.
177 // Choose depends on the criteria. Currently it is set to "matrix" to meet FPGA timing @ 50MHz
178
179 // generated:
180 interrupt: [
181 ]
182
Michael Schaffner666dde12019-10-25 11:57:54 -0700183 // ===== ALERT HANDLER ======================================================
184 // list all modules that expose alerts
185 // first item goes to LSB of the interrupt source
186 alert_module: [ "hmac" ]
187
188 // generated list of alerts:
189 alert: [
190 ]
lowRISC Contributors802543a2019-08-31 12:12:56 +0100191
192 // TODO: PINMUX
Eunchan Kim632c6f72019-09-30 11:11:51 -0700193 pinmux: {
194
Eunchan Kim436d2242019-10-29 17:25:51 -0700195 // Total number of Multiplexed I/O
196 // All the input/outputs from IPs are muxed in pinmux, and it has # of I/O
197 // talks to the outside of top_earlgrey.
198 // This field will be replaced to the length of PAD if padctrl is defined
199 num_mio: 32
200
Eunchan Kim632c6f72019-09-30 11:11:51 -0700201 // Dedicated IO modules. The in/out ports of the modules below are connected
202 // to TOP IO port through PADS directly. It bypasses PINMUX multiplexers
203 dio_modules: [
204 { name: "spi_device", pad: ["ChB[0..3]"] },
Eunchan Kim436d2242019-10-29 17:25:51 -0700205 //{ name: "uart.tx", pad: ["ChA[0]"]},
206 { name: "uart", pad: ["ChA[0..1]"]},
Eunchan Kim632c6f72019-09-30 11:11:51 -0700207 // { name: "dio_module.signal_input", pad: ["ChA[31]"] }
208 ],
209
210 // Multiplexing IO modules. The in/out ports of the modules below are
211 // connected through PINMUX, which gives controllability of the connection
212 // between the modules and the IO PADS.
213 // If `mio_modules` aren't defined, it uses all remaining modules from
214 // module list except defined in `dio_modules`.
215 mio_modules: ["uart", "gpio"]
216
217 // If any module isn't defined in above two lists, its inputs will be tied
218 // to 0, and the output/OE signals will be floating (or connected to
219 // unused signal). `rv_plic` is special module, shouldn't be defined here.
220 nc_modules: ["rv_timer", "hmac"]
221
222 // Below fields are generated.
223 // inputs: [
224 // { name: "xxx", width: xx },
225 // ]
226 // outputs: [
227 // { name: "xxx", width: xx },
228 // ]
229 // inouts: [
230 // { name: "xxx", width: xx },
231 // ]
232 }
233
234 // PADS instantiation
235 // Number of in/outs and the numer of PAD instances doesn't have to be
236 // same. The number given below excludes clock/reset and other necessary
237 // PADS but only defines GPIO pads.
238 padctrl: {
239 attr_default: ["STRONG"],
240 pads: [
241 { name: "ChA" type: "IO_33V", count: 32 }, // Accessing as ChA[0] .. ChA[31]
242 { name: "ChB" type: "IO_33V", count: 4, attr: ["KEEP", "WEAK"]},
243 ]
244 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100245
246}