Skip to content

Commit f66e251

Browse files
committed
Add VCS openroad flow
1 parent 14f4f02 commit f66e251

3 files changed

Lines changed: 26 additions & 9 deletions

File tree

Bender.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ sources:
3535
# add your design files containing anything but modules (packages) here
3636

3737
# RTL
38-
- target: not(netlist_yosys)
38+
- target: not(any(netlist_yosys, netlist_openroad))
3939
files:
4040
# Level 1
4141
- rtl/core_wrap.sv
@@ -49,16 +49,21 @@ sources:
4949
# Level 3
5050
- rtl/croc_soc.sv
5151

52-
- target: not(fpga)
52+
- target: not(any(fpga, netlist_yosys, netlist_openroad))
5353
files:
5454
# Level 0
5555
- rtl/croc_chip.sv
5656

57-
# netlist for simulation
57+
# yosys netlist for simulation
5858
- target: netlist_yosys
5959
files:
6060
- yosys/out/croc_chip_yosys_debug.v
6161

62+
# openroad netlist for simulation
63+
- target: netlist_openroad
64+
files:
65+
- openroad/out/croc.v
66+
6267
- target: any(simulation, verilator)
6368
files:
6469
- rtl/tb_croc_soc.sv
@@ -187,4 +192,4 @@ vendor_package:
187192
- { from: 'rtl/', to: '', patch_dir: 'rtl/' }
188193
- { from: 'README.md', to: 'README.md', patch_dir: '' }
189194
- { from: 'doc/03_reference/images/blockdiagram.svg', to: 'blockdiagram.svg', patch_dir: '' }
190-
- { from: 'vendor/lowrisc_ip/ip/prim/rtl/', to: 'include/lowrisc_prim/', patch_dir: 'lowrisc_prim/' }
195+
- { from: 'vendor/lowrisc_ip/ip/prim/rtl/', to: 'include/lowrisc_prim/', patch_dir: 'lowrisc_prim/' }

Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,27 +117,39 @@ vcs/compile_rtl.sh: Bender.lock Bender.yml
117117
$(BENDER) script vcs -t rtl -t vcs -t simulation -t verilator -DSYNTHESIS -DSIMULATION --vlog-arg="$(VCS_SCRIPT_ARGS)" --vlogan-bin="$(VLOGAN)" > $@
118118
chmod +x $@
119119

120-
vcs/compile_netlist.sh: Bender.lock Bender.yml
120+
vcs/compile_netlist_yosys.sh: Bender.lock Bender.yml
121121
$(BENDER) script vcs -t ihp13 -t vcs -t simulation -t verilator -t netlist_yosys -DSYNTHESIS -DSIMULATION --vlog-arg="$(VCS_SCRIPT_ARGS)" --vlogan-bin="$(VLOGAN)" > $@
122122
cat vcs/compile_tech.sh >> $@
123123
chmod +x $@
124124

125+
vcs/compile_netlist_openroad.sh: Bender.lock Bender.yml
126+
$(BENDER) script vcs -t ihp13 -t vcs -t simulation -t verilator -t netlist_openroad -DSYNTHESIS -DSIMULATION --vlog-arg="$(VCS_SCRIPT_ARGS)" --vlogan-bin="$(VLOGAN)" > $@
127+
cat vcs/compile_tech.sh >> $@
128+
chmod +x $@
129+
125130
vcs/tb_croc_soc.sim: vcs/compile_rtl.sh
126131
cd vcs; ./compile_rtl.sh
127132
cd vcs; $(VCS) $(VCS_COMPILE_ARGS) -o tb_croc_soc.sim tb_croc_soc
128133

129-
vcs/tb_croc_soc_yosys.sim: vcs/compile_netlist.sh yosys/out/croc_chip_yosys_debug.v
130-
cd vcs; ./compile_netlist.sh
134+
vcs/tb_croc_soc_yosys.sim: vcs/compile_netlist_yosys.sh yosys/out/croc_chip_yosys_debug.v
135+
cd vcs; ./compile_netlist_yosys.sh
131136
cd vcs; $(VCS) $(VCS_COMPILE_ARGS) -o tb_croc_soc_yosys.sim tb_croc_soc
132137

138+
vcs/tb_croc_soc_openroad.sim: vcs/compile_netlist_openroad.sh openroad/out/croc.v
139+
cd vcs; ./compile_netlist_openroad.sh
140+
cd vcs; $(VCS) $(VCS_COMPILE_ARGS) -o tb_croc_soc_openroad.sim tb_croc_soc
141+
133142
## Simulate RTL using VCS
134143
vcs: vcs/tb_croc_soc.sim $(SW_HEX)
135144
cd vcs; ./tb_croc_soc.sim +fsdb+all=on +binary="$(realpath $(SW_HEX))" -l transcript.log
136145

137146
vcs-yosys: vcs/tb_croc_soc_yosys.sim $(SW_HEX)
138147
cd vcs; ./tb_croc_soc_yosys.sim +fsdb+all=on +binary="$(realpath $(SW_HEX))" -l transcript.log
139148

140-
.PHONY: verilator vsim vsim-yosys vcs
149+
vcs-openroad: vcs/tb_croc_soc_openroad.sim $(SW_HEX)
150+
cd vcs; ./tb_croc_soc_openroad.sim +fsdb+all=on +binary="$(realpath $(SW_HEX))" -l transcript.log
151+
152+
.PHONY: verilator vsim vsim-yosys vcs vcs-yosys vcs-openroad
141153

142154

143155
####################

vcs/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ csrc
66
ucli.key
77
croc.fst
88
compile_rtl.sh
9-
compile_netlist.sh
9+
compile_netlist*
1010
compile.log
1111
novas*
1212
transcript.log

0 commit comments

Comments
 (0)