Skip to content

Commit ecfc6d6

Browse files
committed
Add FuseSoC support
This adds support for FuseSoC, currently for the verilator model only. Signed-off-by: Stefan Wallentowitz <stefan.wallentowitz@hm.edu>
1 parent a57a5b1 commit ecfc6d6

6 files changed

Lines changed: 119 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ TAGS
1515
.build-rtl
1616
.lib-rtl
1717
.opt-rtl
18-
/build
18+
build/
1919
/Bender.lock
2020
/Bender.local

cv32e40p.core

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
CAPI=2:
2+
# Copyright OpenHW Group contributors.
3+
# Licensed under the Solderpad Hardware Licence, Version 2.0 , see LICENSE for details.
4+
name: "openhw:cv32e40p:core:0.1"
5+
description: "CV32E40P is an in-order 4-stage RISC-V RV32IMFCXpulp CPU based on RI5CY from PULP-Platform"
6+
7+
filesets:
8+
files_rtl:
9+
depend:
10+
- pulp-platform.org::fpnew
11+
files:
12+
- rtl/include/apu_macros.sv: {is_include_file: true}
13+
- rtl/include/riscv_config.sv: {is_include_file: true}
14+
- rtl/include/apu_core_package.sv
15+
- rtl/include/riscv_defines.sv
16+
- rtl/include/riscv_tracer_defines.sv
17+
- rtl/riscv_if_stage.sv
18+
- rtl/riscv_tracer.sv
19+
- rtl/cv32e40p_sim_clock_gate.sv
20+
- rtl/riscv_cs_registers.sv
21+
- rtl/riscv_register_file.sv
22+
- rtl/riscv_load_store_unit.sv
23+
- rtl/riscv_id_stage.sv
24+
- rtl/riscv_decoder.sv
25+
- rtl/riscv_compressed_decoder.sv
26+
- rtl/riscv_fetch_fifo.sv
27+
- rtl/riscv_prefetch_buffer.sv
28+
- rtl/riscv_prefetch_L0_buffer.sv
29+
- rtl/riscv_L0_buffer.sv
30+
- rtl/riscv_hwloop_regs.sv
31+
- rtl/riscv_hwloop_controller.sv
32+
- rtl/riscv_mult.sv
33+
- rtl/register_file_test_wrap.sv
34+
- rtl/riscv_int_controller.sv
35+
- rtl/riscv_ex_stage.sv
36+
- rtl/riscv_alu_div.sv
37+
- rtl/riscv_alu.sv
38+
- rtl/riscv_ff_one.sv
39+
- rtl/riscv_popcnt.sv
40+
- rtl/riscv_pmp.sv
41+
- rtl/riscv_apu_disp.sv
42+
- rtl/riscv_controller.sv
43+
- rtl/riscv_core.sv
44+
file_type: systemVerilogSource
45+
46+
targets:
47+
default:
48+
filesets:
49+
- files_rtl

tb/core/Makefile.fusesoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
build:
2+
fusesoc --cores-root=../../ run --target=sim --setup --build openhw:cv32e40p:testbench
3+
4+
run:
5+
build/openhw_cv32e40p_testbench_0.1/sim-verilator/Vtb_top_verilator "+firmware=firmware/firmware.hex"
6+
7+
.PHONY: build run

tb/core/testbench.core

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CAPI=2:
2+
# Copyright OpenHW Group contributors.
3+
# Licensed under the Solderpad Hardware Licence, Version 2.0 , see LICENSE for details.
4+
name: "openhw:cv32e40p:testbench:0.1"
5+
description: "Testbench for CV32E40P"
6+
filesets:
7+
files_sim_verilator:
8+
depend:
9+
- openhw:cv32e40p:core
10+
files:
11+
- tb_top_verilator.sv
12+
- riscv_wrapper.sv
13+
- mm_ram.sv
14+
- dp_ram.sv
15+
- amo_shim.sv
16+
- tb_top_verilator.cpp: { file_type: cppSource }
17+
file_type: systemVerilogSource
18+
19+
targets:
20+
sim:
21+
filesets:
22+
- files_sim_verilator
23+
toplevel: tb_top_verilator
24+
default_tool: verilator
25+
tools:
26+
verilator:
27+
mode: cc
28+
verilator_options:
29+
- "-Wno-fatal"
30+
- "--trace"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build:
2+
fusesoc --cores-root=../../ run --target=sim --setup --build openhw:cv32e40p:verilator-model
3+
4+
.PHONY: build

tb/verilator-model/testbench.core

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CAPI=2:
2+
# Copyright OpenHW Group contributors.
3+
# Licensed under the Solderpad Hardware Licence, Version 2.0 , see LICENSE for details.
4+
name: "openhw:cv32e40p:verilator-model:0.1"
5+
description: "Verilator testbench for CV32E40P"
6+
filesets:
7+
files_sim_verilator:
8+
depend:
9+
- openhw:cv32e40p:core
10+
files:
11+
- dp_ram.sv
12+
- ram.sv
13+
- top.sv
14+
- testbench.cpp: { file_type: cppSource }
15+
file_type: systemVerilogSource
16+
17+
targets:
18+
sim:
19+
filesets:
20+
- files_sim_verilator
21+
toplevel: top
22+
default_tool: verilator
23+
tools:
24+
verilator:
25+
mode: cc
26+
verilator_options:
27+
- "-Wno-fatal"
28+
- "--trace"

0 commit comments

Comments
 (0)