-
Notifications
You must be signed in to change notification settings - Fork 0
/
swervolf.core
336 lines (299 loc) · 9.01 KB
/
swervolf.core
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
CAPI=2:
name : ::swervolf:0.7.4
description : Reference SoC for the SweRV family of cores
filesets:
eh1:
files: [rtl/swerv_wrapper.sv : {file_type : systemVerilogSource}]
depend: ["=chipsalliance.org:cores:SweRV_EH1:1.8"]
el2:
files: [rtl/el2_swerv_wrapper.sv : {file_type : systemVerilogSource}]
depend: ["=chipsalliance.org:cores:SweRV_EL2:1.3"]
core:
files:
- rtl/dpram64.v
- rtl/axi2wb.v
- rtl/wb_mem_wrapper.v
- rtl/swervolf_syscon.v
- rtl/swervolf_core.v
file_type : systemVerilogSource
depend :
- fusesoc:utils:generators
- uart16550
- ">=pulp-platform.org::axi:0.23.0-r1"
- simple_spi
- wb_intercon
bfm:
files:
- tb/uart_decoder.v
file_type : verilogSource
tb:
files:
- sw/hello.vh : {file_type : user, copyto : hello.vh}
- rtl/axi_mem_wrapper.v : {file_type : verilogSource}
- tb/swervolf_core_tb.v : {file_type : systemVerilogSource}
verilator_tb:
files: [tb/tb.cpp : {file_type : cppSource}]
depend : [">=::jtag_vpi:0-r5"]
verilator_waiver: {files: [data/verilator_waiver.vlt : {file_type : vlt}]}
spi_tb:
files:
- tb/s25fl128s.v
- tb/swervolf_spi_tb.v
- sw/hello.ubvh : {file_type : user, copyto : hello.ubvh}
file_type : verilogSource
nexys_a7_files:
files :
- data/vivado_waiver.tcl : {file_type : tclSource}
- data/swervolf_nexys.xdc : {file_type : xdc}
- rtl/clk_gen_nexys.v : {file_type : verilogSource}
- rtl/bscan_tap.sv : {file_type : systemVerilogSource}
- rtl/swervolf_nexys.v : {file_type : systemVerilogSource}
depend : [":swervolf:litedram"]
arty_a7_files:
files :
- data/vivado_waiver.tcl : {file_type : tclSource}
- data/swervolf_arty.xdc : {file_type : xdc}
- rtl/clk_gen_arty.v : {file_type : verilogSource}
- rtl/bscan_tap.sv : {file_type : systemVerilogSource}
- rtl/swervolf_arty.v : {file_type : systemVerilogSource}
depend : [":swervolf:litedram"]
basys3_files:
files :
- data/vivado_waiver.tcl : {file_type : tclSource}
- data/swervolf_basys3.xdc : {file_type : xdc}
- rtl/axi2mem.sv : {file_type : systemVerilogSource}
- rtl/axi_mem.v : {file_type : verilogSource}
- rtl/clk_gen_basys3.v : {file_type : verilogSource}
- rtl/bscan_tap.sv : {file_type : systemVerilogSource}
- rtl/swervolf_basys3.v : {file_type : systemVerilogSource}
bootrom:
files :
- sw/bootloader.vh : {file_type : user, copyto : bootloader.vh}
targets:
basys3:
default_tool : vivado
description : FPGA image with SweRV EL2 for the Digilent Basys 3 FPGA board
filesets :
- bootrom
- el2
- core
- basys3_files
generate : [intercon, swerv_el2_nexys_a7_config, version, wb_intercon]
parameters : [bootrom_file]
tools:
vivado: {part : xc7a35tcpg236-1}
toplevel : swervolf_basys3
sim:
default_tool : verilator
description : Default simulation target
filesets :
- "cpu_el2? (el2)"
- "!cpu_el2? (eh1)"
- core
- "!tool_verilator? (bfm)"
- tb
- bootrom
- "tool_verilator? (verilator_tb)"
- "tool_verilator? (verilator_waiver)"
generate : [intercon, "cpu_el2? (el2_default_config)", "!cpu_el2? (swerv_default_config)", version, wb_intercon]
parameters : [SIMPRINT=true, jtag_vpi_enable, ram_init_file=hello.vh, rom_init_file, signature, timeout, vcd]
tools:
rivierapro:
vlog_options :
- config/common_defines.vh
- -timescale 1ns/1ps
compilation_mode : common
modelsim:
vlog_options :
- -mfcu
- -cuautoname=du
- config/common_defines.vh
- -timescale 1ns/1ns
- -svinputport=compat
- -suppress 2583
verilator:
verilator_options : [--trace, -Wno-fatal]
xsim:
compilation_mode : common
#-d XSIM is required to disable formal properties in axi & common_cells
#For interactive wave debug, also add "-debug all" or "-debug typical"
xelab_options : [-d, XSIM]
toplevel : swervolf_core_tb
spi_tb:
default_tool : modelsim
description : Simulation target with real SPI Flash model
filesets :
- bootrom
- core
- bfm
- spi_tb
generate : [intercon, swerv_default_config, wb_intercon]
parameters : [SIMPRINT=true, ram_init_file, rom_init_file, flash_init_file, mem_clear=true, timeout, vcd]
tools:
rivierapro:
vlog_options :
- config/common_defines.vh
- -timescale 1ns/1ps
compilation_mode : common
modelsim:
vlog_options :
- -mfcu
- -cuautoname=du
- config/common_defines.vh
- -timescale 1ns/1ns
toplevel : swervolf_spi_tb
nexys_a7:
default_tool : vivado
description : FPGA image with SweRV EH1 or EL2 for the Digilent Nexys A7 FPGA board
filesets :
- "cpu_el2? (el2)"
- "!cpu_el2? (eh1)"
- bootrom
- core
- nexys_a7_files
generate : [intercon, "!cpu_el2? (swerv_default_config)", "cpu_el2? (swerv_el2_nexys_a7_config)", version, wb_intercon]
parameters : [bootrom_file, "cpu_el2? (cpu_type=EL2)"]
tools:
vivado: {part : xc7a100tcsg324-1}
toplevel : swervolf_nexys_a7
arty_a7:
default_tool : vivado
description : FPGA image with SweRV EL2 for the Digilent Arty A7 FPGA board
filesets :
- bootrom
- el2
- core
- arty_a7_files
generate : [intercon, swerv_el2_arty_a7_config, version, wb_intercon]
parameters : [bootrom_file]
tools:
vivado: {part : xc7a35tcsg324-1}
toplevel : swervolf_arty_a7
generate:
wb_intercon:
generator: wb_intercon_gen
parameters:
masters:
io:
slaves : [rom, sys, spi_flash, uart]
slaves:
rom:
offset : 0x00000000
size : 0x00001000
sys:
offset : 0x00001000
size : 0x00000040
spi_flash:
offset : 0x00001040
size : 0x00000040
uart:
offset : 0x00002000
size : 0x00001000
intercon:
generator: axi_intercon_gen
parameters:
masters:
ifu:
id_width : 3
read_only : true
lsu:
id_width : 4
sb:
id_width : 1
slaves:
io:
offset : 0x80000000
size : 0x00004000
ram:
offset : 0x00000000
size : 0x08000000 #128MiB
swerv_default_config:
generator: swerv_config
position : first
parameters:
args : [-unset=assert_on, -set=reset_vec=0x80000000, -set=fpga_optimize=1]
el2_default_config:
generator: swerv_el2_config
position : first
parameters:
args : [-unset=assert_on, -set=reset_vec=0x80000000, -set=fpga_optimize=1]
swerv_el2_nexys_a7_config:
generator: swerv_el2_config
position : first
parameters:
args :
- -unset=assert_on
- -set=reset_vec=0x80000000
- -set=ret_stack_size=2
- -set=btb_size=32
- -set=bht_size=128
- -set=dccm_size=16
- -set=dccm_num_banks=2
- -set=iccm_enable=0
- -set=icache_enable=0
- -set=dccm_enable=0
swerv_el2_arty_a7_config:
generator: swerv_el2_config
position : first
parameters:
args :
- -unset=assert_on
- -set=reset_vec=0x80000000
- -set=ret_stack_size=2
- -set=btb_enable=0
- -set=btb_size=8
- -set=bht_size=32
- -set=dccm_size=16
- -set=dccm_num_banks=2
- -set=iccm_enable=0
- -set=icache_enable=0
- -set=dccm_enable=0
- -set=dma_buf_depth=2
- -set=div_bit=1
- -set=pic_total_int=2
# - -target=default_ahb
version:
generator: gitversion
parameters:
SIMPRINT:
datatype : bool
description : Enable simulation character output
paramtype : vlogdefine
cpu_type:
datatype : str
description : Controls whether to use SweRV EH1 or SweRV EL2. Implicitly set by the target
paramtype : vlogparam
mem_clear:
datatype : bool
description : Initialize on-chip RAM to zero on simulation start
paramtype : vlogparam
bootrom_file:
datatype: file
description : Verilog hex file to use as boot ROM
paramtype : vlogparam
jtag_vpi_enable:
datatype : bool
description : Enable JTAG simulation server
paramtype : plusarg
ram_init_file:
datatype: file
description : Verilog hex file to use as initial on-chip RAM contents
paramtype : plusarg
rom_init_file:
datatype: file
description : Verilog hex file to use as initial bootrom RAM contents
paramtype : plusarg
flash_init_file:
datatype: file
description : Verilog hex file to use as initial SPI Flash contents
paramtype : vlogparam
signature:
datatype : file
paramtype : plusarg
timeout:
datatype : int
paramtype : plusarg
vcd:
datatype : bool
description : Dump VCD
paramtype : plusarg