blob: 9a56d440c33727953f3edef538d7200bcc93d046 [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" }
13 ]
14
15 // Number of cores: used in rv_plic and timer
16 num_cores: "1",
17
18 // `module` defines the peripherals.
19 // Details are coming from each modules' config file `ip.hjson`
20 // TODO: Define parameter here
21 module: [
22 { name: "uart", // instance name
23 type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted)
24 // and `hw/ip/{type}`
25 clock: "main", // `ip.hjson` clock is internal name, here top determines
26 // actual clock (signal matched at the top)
27 base_addr: "0x40000000",
28 },
29 { name: "gpio",
30 type: "gpio",
31 clock: "main",
32 base_addr: "0x40010000",
33 }
34
35 { name: "spi_device",
36 type: "spi_device",
37 clock: "main",
38 base_addr: "0x40020000",
39 },
40 { name: "flash_ctrl",
41 type: "flash_ctrl",
42 clock: "main",
43 base_addr: "0x40030000",
44 },
45 { name: "rv_timer",
46 type: "rv_timer",
47 clock: "main",
48 base_addr: "0x40080000",
49 },
50 { name: "hmac",
51 type: "hmac",
52 clock: "main",
53 base_addr: "0x40120000",
54 },
55 { name: "rv_plic",
56 type: "rv_plic",
57 clock: "main",
58 base_addr: "0x40090000",
59 generated: "true" // Indicate this module is generated in the topgen
60 parameter: {
61 // FIND_MAX determines the algorithm for searching highest priority interrupt.
62 // Available: { SEQUENTIAL, MATRIX }
63 FIND_MAX: "MATRIX", // Parameter as key
64 }
65 }
66 ]
67
68 // Memories (ROM, RAM, eFlash) are defined at the top.
69 // It utilizes the primitive cells but configurable
70 memory: [
Timothy Chen44461032019-09-20 15:35:20 -070071 { name: "rom", type: "rom", base_addr: "0x00008000", size: "0x2000" },
lowRISC Contributors802543a2019-08-31 12:12:56 +010072 { name: "ram_main", type: "ram_1p", base_addr: "0x10000000", size: "0x10000" },
73 { name: "eflash", type: "eflash", base_addr: "0x20000000", size: "0x80000" },
74 ],
75
76 debug_mem_base_addr: "0x1A110000",
77
78 // Crossbars: having a top level crossbar
79 // This version assumes all crossbars are instantiated at the top.
80 // Assume xbar.hjson is located in the same directory of top.hjson
81 xbar: [
82 { name: "main",
83 clock: "main", // Main clock, used in sockets
84 },
85 ],
86
87 // ===== INTERRUPT CTRL =====================================================
88 // `rv_plic` will be instantiate (need to be defined in `module` field
89 // If interrupt is not defined, it uses the order from the module list
90 // and include every modules.
91 // first item goes to LSB of the interrupt source
92 interrupt_module: ["gpio", "uart", "spi_device", "flash_ctrl", "hmac" ]
93
94 // RV_PLIC has two searching algorithm internally to pick the most highest priority interrupt
95 // source. "sequential" is smaller but slower, "matrix" is larger but faster.
96 // Choose depends on the criteria. Currently it is set to "matrix" to meet FPGA timing @ 50MHz
97
98 // generated:
99 interrupt: [
100 ]
101
102 // TODO: ALERT HANDLER
103
104 // TODO: PINMUX
Eunchan Kim632c6f72019-09-30 11:11:51 -0700105 pinmux: {
106
107 // Dedicated IO modules. The in/out ports of the modules below are connected
108 // to TOP IO port through PADS directly. It bypasses PINMUX multiplexers
109 dio_modules: [
110 { name: "spi_device", pad: ["ChB[0..3]"] },
111 { name: "uart.tx", pad: ["ChA[0]"]},
112 // { name: "dio_module.signal_input", pad: ["ChA[31]"] }
113 ],
114
115 // Multiplexing IO modules. The in/out ports of the modules below are
116 // connected through PINMUX, which gives controllability of the connection
117 // between the modules and the IO PADS.
118 // If `mio_modules` aren't defined, it uses all remaining modules from
119 // module list except defined in `dio_modules`.
120 mio_modules: ["uart", "gpio"]
121
122 // If any module isn't defined in above two lists, its inputs will be tied
123 // to 0, and the output/OE signals will be floating (or connected to
124 // unused signal). `rv_plic` is special module, shouldn't be defined here.
125 nc_modules: ["rv_timer", "hmac"]
126
127 // Below fields are generated.
128 // inputs: [
129 // { name: "xxx", width: xx },
130 // ]
131 // outputs: [
132 // { name: "xxx", width: xx },
133 // ]
134 // inouts: [
135 // { name: "xxx", width: xx },
136 // ]
137 }
138
139 // PADS instantiation
140 // Number of in/outs and the numer of PAD instances doesn't have to be
141 // same. The number given below excludes clock/reset and other necessary
142 // PADS but only defines GPIO pads.
143 padctrl: {
144 attr_default: ["STRONG"],
145 pads: [
146 { name: "ChA" type: "IO_33V", count: 32 }, // Accessing as ChA[0] .. ChA[31]
147 { name: "ChB" type: "IO_33V", count: 4, attr: ["KEEP", "WEAK"]},
148 ]
149 }
lowRISC Contributors802543a2019-08-31 12:12:56 +0100150
151}