mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-04-24 22:07:12 -04:00
Merged wsim changes
This commit is contained in:
commit
f9eec8c43f
3 changed files with 13 additions and 3 deletions
5
bin/wsim
5
bin/wsim
|
@ -23,6 +23,7 @@ parser.add_argument("--tb", "-t", help="Testbench", choices=["testbench", "testb
|
||||||
parser.add_argument("--gui", "-g", help="Simulate with GUI", action="store_true")
|
parser.add_argument("--gui", "-g", help="Simulate with GUI", action="store_true")
|
||||||
parser.add_argument("--coverage", "-c", help="Code & Functional Coverage", action="store_true")
|
parser.add_argument("--coverage", "-c", help="Code & Functional Coverage", action="store_true")
|
||||||
parser.add_argument("--args", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="")
|
parser.add_argument("--args", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="")
|
||||||
|
parser.add_argument("--vcd", "-v", help="Generate testbench.vcd", action="store_true")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
print("Config=" + args.config + " tests=" + args.testsuite + " sim=" + args.sim + " gui=" + str(args.gui) + " args='" + args.args + "'")
|
print("Config=" + args.config + " tests=" + args.testsuite + " sim=" + args.sim + " gui=" + str(args.gui) + " args='" + args.args + "'")
|
||||||
|
|
||||||
|
@ -37,6 +38,8 @@ if (args.coverage):
|
||||||
print("Coverage option only available for Questa")
|
print("Coverage option only available for Questa")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if (args.vcd):
|
||||||
|
args.args += " -DMAKEVCD=1"
|
||||||
|
|
||||||
# create the output sub-directories.
|
# create the output sub-directories.
|
||||||
WALLY = os.environ.get('WALLY')
|
WALLY = os.environ.get('WALLY')
|
||||||
|
@ -73,7 +76,7 @@ elif (args.sim == "verilator"):
|
||||||
if (args.gui):
|
if (args.gui):
|
||||||
print("GUI option not available for Verilator")
|
print("GUI option not available for Verilator")
|
||||||
exit(1)
|
exit(1)
|
||||||
os.system(f"/usr/bin/make -C {regressionDir}/verilator WALLYCONF={args.config} TEST={args.testsuite}")
|
os.system(f"/usr/bin/make -C {regressionDir}/verilator WALLYCONF={args.config} TEST={args.testsuite} EXTRA_ARGS='{args.args}'")
|
||||||
elif (args.sim == "vcs"):
|
elif (args.sim == "vcs"):
|
||||||
print(f"Running VCS on " + args.config + " " + args.testsuite)
|
print(f"Running VCS on " + args.config + " " + args.testsuite)
|
||||||
if (args.coverage):
|
if (args.coverage):
|
||||||
|
|
|
@ -10,7 +10,8 @@ OPT=
|
||||||
PARAMS?=-DVERILATOR=1 --no-trace-top
|
PARAMS?=-DVERILATOR=1 --no-trace-top
|
||||||
NONPROF?=--stats
|
NONPROF?=--stats
|
||||||
VERILATOR_DIR=${WALLY}/sim/verilator
|
VERILATOR_DIR=${WALLY}/sim/verilator
|
||||||
SOURCE=${WALLY}/config/shared/*.vh ${WALLY}/config/${WALLYCONF} ${WALLY}/src/cvw.sv ${WALLY}/testbench/testbench.sv ${WALLY}/testbench/common/*.sv ${WALLY}/src/*/*.sv ${WALLY}/src/*/*/*.sv
|
SOURCE=${WALLY}/config/shared/*.vh ${WALLY}/config/${WALLYCONF} ${WALLY}/src/cvw.sv ${WALLY}/testbench/*.sv ${WALLY}/testbench/common/*.sv ${WALLY}/src/*/*.sv ${WALLY}/src/*/*/*.sv
|
||||||
|
EXTRA_ARGS=
|
||||||
|
|
||||||
|
|
||||||
WALLYCONF?=rv64gc
|
WALLYCONF?=rv64gc
|
||||||
|
@ -48,8 +49,9 @@ run: wkdir/$(WALLYCONF)_$(TEST)/Vtestbench
|
||||||
wkdir/$(WALLYCONF)_$(TEST)/Vtestbench: $(SOURCE)
|
wkdir/$(WALLYCONF)_$(TEST)/Vtestbench: $(SOURCE)
|
||||||
verilator \
|
verilator \
|
||||||
--Mdir wkdir/$(WALLYCONF)_$(TEST) -o Vtestbench \
|
--Mdir wkdir/$(WALLYCONF)_$(TEST) -o Vtestbench \
|
||||||
--binary \
|
--binary --trace \
|
||||||
$(OPT) $(PARAMS) $(NONPROF) \
|
$(OPT) $(PARAMS) $(NONPROF) \
|
||||||
|
$(EXTRA_ARGS) \
|
||||||
--timescale "1ns/1ns" --timing --top-module testbench --relative-includes \
|
--timescale "1ns/1ns" --timing --top-module testbench --relative-includes \
|
||||||
"-I${WALLY}/config/shared" "-I${WALLY}/config/$(WALLYCONF)" \
|
"-I${WALLY}/config/shared" "-I${WALLY}/config/$(WALLYCONF)" \
|
||||||
${WALLY}/sim/verilator/wrapper.c \
|
${WALLY}/sim/verilator/wrapper.c \
|
||||||
|
@ -62,6 +64,7 @@ obj_dir_profiling/Vtestbench_$(WALLYCONF): $(DEPENDENCIES)
|
||||||
--Mdir obj_dir_profiling -o Vtestbench_$(WALLYCONF) \
|
--Mdir obj_dir_profiling -o Vtestbench_$(WALLYCONF) \
|
||||||
--binary \
|
--binary \
|
||||||
--prof-cfuncs $(OPT) $(PARAMS) \
|
--prof-cfuncs $(OPT) $(PARAMS) \
|
||||||
|
$(EXTRA_ARGS) \
|
||||||
--timescale "1ns/1ns" --timing --top-module testbench --relative-includes \
|
--timescale "1ns/1ns" --timing --top-module testbench --relative-includes \
|
||||||
$(INCLUDE_PATH) \
|
$(INCLUDE_PATH) \
|
||||||
wrapper.c \
|
wrapper.c \
|
||||||
|
|
|
@ -222,6 +222,10 @@ module testbench;
|
||||||
$display("TEST %s not supported in this configuration", TEST);
|
$display("TEST %s not supported in this configuration", TEST);
|
||||||
$finish;
|
$finish;
|
||||||
end
|
end
|
||||||
|
`ifdef MAKEVCD
|
||||||
|
$dumpfile("testbench.vcd");
|
||||||
|
$dumpvars;
|
||||||
|
`endif
|
||||||
end // initial begin
|
end // initial begin
|
||||||
|
|
||||||
// Model the testbench as an fsm.
|
// Model the testbench as an fsm.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue