Skip to content

Commit

Permalink
Add report_file to args
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioOpenHWGroup committed Apr 3, 2024
1 parent 3ed72cc commit c021a74
Showing 1 changed file with 40 additions and 42 deletions.
82 changes: 40 additions & 42 deletions verif/sim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,42 +124,6 @@ spike:
$(tool_path)/spike $(spike_stepout) $(spike_extension) --log-commits --isa=$(variant)_zicntr --priv=$(priv) $(spike_params) -l $(elf)
cp $(log).iss $(log)

###############################################################################
# testharness specific commands, variables
###############################################################################
vcs-testharness:
make -C $(path_var) work-dpi/ariane_dpi.so
make -C $(path_var) vcs_build target=$(target) defines=$(subst +define+,,$(isscomp_opts))$(if $(spike-tandem),SPIKE_TANDEM=1)
$(path_var)/work-vcs/simv $(if $(VERDI), -verdi -do $(path_var)/util/init_testharness.do,) +permissive \
+tohost_addr=$(shell $$RISCV/bin/${CV_SW_PREFIX}nm -B $(elf) | grep -w tohost | cut -d' ' -f1) \
+elf_file=$(elf) +permissive-off ++$(elf) $(issrun_opts) \
$(if $(spike-tandem),-sv_lib $(SPIKE_INSTALL_DIR)/lib/libdisasm) \
$(if $(spike-tandem),-sv_lib $(SPIKE_INSTALL_DIR)/lib/libriscv) \
-sv_lib $(SPIKE_INSTALL_DIR)/lib/libfesvr +CORE_NAME=$(target)
# TODO: Add support for waveform collection.
# Generate disassembled log.
$(tool_path)/spike-dasm --isa=$(variant) < ./trace_rvfi_hart_00.dasm > $(log)
grep $(isspostrun_opts) ./trace_rvfi_hart_00.dasm

veri-testharness:
make -C $(path_var) verilate verilator="verilator --no-timing" target=$(target) defines=$(subst +define+,,$(isscomp_opts))
$(path_var)/work-ver/Variane_testharness $(if $(TRACE_COMPACT), -f verilator.fst) $(if $(TRACE_FAST), -v verilator.vcd) $(elf) $(issrun_opts) \
+elf_file=$(elf) +tohost_addr=$(shell $$RISCV/bin/${CV_SW_PREFIX}nm -B $(elf) | grep -w tohost | cut -d' ' -f1) +core_name=$(target) +report=$(log).yaml
# If present, move default waveform files to log directory.
# Keep track of target in waveform file name.
[ ! -f verilator.fst ] || mv verilator.fst `dirname $(log)`/`basename $(log) .log`.fst
[ ! -f verilator.vcd ] || mv verilator.vcd `dirname $(log)`/`basename $(log) .log`.vcd
# Generate disassembled log.
$(tool_path)/spike-dasm --isa=$(variant) < ./trace_rvfi_hart_00.dasm > $(log)
grep $(isspostrun_opts) ./trace_rvfi_hart_00.dasm

questa-testharness:
mkdir -p $(path_var)/tmp
make -C $(path_var) sim target=$(target) defines=$(subst +define+,,$(isscomp_opts)) batch-mode=1 elf_file=$(elf) \
# TODO: Add support for waveform collection.
$(tool_path)/spike-dasm --isa=$(variant) < $(path_var)/trace_rvfi_hart_00.dasm > $(log)
grep $(isspostrun_opts) $(path_var)/trace_rvfi_hart_00.dasm

###############################################################################
# UVM specific commands, variables
###############################################################################
Expand Down Expand Up @@ -206,14 +170,15 @@ COMMON_COMP_UVM_FLAGS = \
+incdir+$(CVA6_REPO_DIR)/verif/env/uvme +incdir+$(CVA6_REPO_DIR)/verif/tb/uvmt \
$(if $(spike-tandem), +define+SPIKE_TANDEM=1)

COMMON_RUN_UVM_FLAGS = \
COMMON_RUN_FLAGS = \
-sv_lib $(SPIKE_INSTALL_DIR)/lib/libriscv \
-sv_lib $(SPIKE_INSTALL_DIR)/lib/libfesvr \
-sv_lib $(SPIKE_INSTALL_DIR)/lib/libdisasm \
++$(elf) \
+elf_file=$(elf) \
+tohost_addr=$(shell $$RISCV/bin/$(CV_SW_PREFIX)nm -B $(elf) | grep -w tohost | cut -d' ' -f1) \
+signature=$(elf).signature_output +UVM_TESTNAME=uvmt_cva6_firmware_test_c +CORE_NAME=$(target)
+signature=$(elf).signature_output +UVM_TESTNAME=uvmt_cva6_firmware_test_c \
+report_file=$(log).yaml +core_name=$(target)

ALL_UVM_FLAGS = -lca -sverilog +incdir+$(VCS_HOME)/etc/uvm/src \
$(VCS_HOME)/etc/uvm/src/uvm_pkg.sv -ntb_opts uvm-1.2 -timescale=1ns/1ps \
Expand Down Expand Up @@ -242,9 +207,9 @@ ifneq ($(DEBUG),) # If RTL DEBUG support requested
endif

ifneq ($(SPIKE_TANDEM),)
COMMON_RUN_UVM_FLAGS += +scoreboard_enabled=1
COMMON_RUN_FLAGS += +scoreboard_enabled=1
else
COMMON_RUN_UVM_FLAGS += +scoreboard_enabled=0
COMMON_RUN_FLAGS += +scoreboard_enabled=0
endif

vcs_uvm_comp:
Expand All @@ -260,7 +225,7 @@ vcs_uvm_run:
$(if $(TRACE_FAST), unset VERDI_HOME ;) \
cd $(VCS_WORK_DIR)/ && \
$(VCS_WORK_DIR)/simv \
$(COMMON_RUN_UVM_FLAGS) \
$(COMMON_RUN_FLAGS) \
$(ALL_SIMV_UVM_FLAGS) \
$(cov-run-opt) $(issrun_opts)

Expand Down Expand Up @@ -301,7 +266,7 @@ questa_uvm_comp:
questa_uvm_run:
@echo "[QUESTA] Running Model"
vsim -64 \
$(COMMON_RUN_UVM_FLAGS) \
$(COMMON_RUN_FLAGS) \
-sv_lib $(QUESTASIM_HOME)/uvm-1.2/linux_x86_64/uvm_dpi \
-c -do "run -all; " \
-work $(VSIM_WORK_DIR) -t 1ns \
Expand Down Expand Up @@ -329,6 +294,39 @@ vcs_clean_all:
@echo "[VCS] Cleanup (entire vcs_work dir)"
rm -rf $(CVA6_REPO_DIR)/verif/sim/vcs_results/ verdiLog/ simv* *.daidir *.vpd *.fsdb *.db csrc ucli.key vc_hdrs.h novas* inter.fsdb uart

###############################################################################
# testharness specific commands, variables
###############################################################################
vcs-testharness:
make -C $(path_var) work-dpi/ariane_dpi.so
make -C $(path_var) vcs_build target=$(target) defines=$(subst +define+,,$(isscomp_opts))$(if $(spike-tandem),SPIKE_TANDEM=1)
$(path_var)/work-vcs/simv $(if $(VERDI), -verdi -do $(path_var)/util/init_testharness.do,) +permissive \
$(COMMON_RUN_FLAGS) \
+elf_file=$(elf) +permissive-off ++$(elf) $(issrun_opts) \
# TODO: Add support for waveform collection.
# Generate disassembled log.
$(tool_path)/spike-dasm --isa=$(variant) < ./trace_rvfi_hart_00.dasm > $(log)
grep $(isspostrun_opts) ./trace_rvfi_hart_00.dasm

veri-testharness:
make -C $(path_var) verilate verilator="verilator --no-timing" target=$(target) defines=$(subst +define+,,$(isscomp_opts))
$(path_var)/work-ver/Variane_testharness $(if $(TRACE_COMPACT), -f verilator.fst) $(if $(TRACE_FAST), -v verilator.vcd) $(elf) $(issrun_opts) \
+elf_file=$(elf) +tohost_addr=$(shell $$RISCV/bin/${CV_SW_PREFIX}nm -B $(elf) | grep -w tohost | cut -d' ' -f1) +core_name=$(target) +report_file=$(log).yaml
# If present, move default waveform files to log directory.
# Keep track of target in waveform file name.
[ ! -f verilator.fst ] || mv verilator.fst `dirname $(log)`/`basename $(log) .log`.fst
[ ! -f verilator.vcd ] || mv verilator.vcd `dirname $(log)`/`basename $(log) .log`.vcd
# Generate disassembled log.
$(tool_path)/spike-dasm --isa=$(variant) < ./trace_rvfi_hart_00.dasm > $(log)
grep $(isspostrun_opts) ./trace_rvfi_hart_00.dasm

questa-testharness:
mkdir -p $(path_var)/tmp
make -C $(path_var) sim target=$(target) defines=$(subst +define+,,$(isscomp_opts)) batch-mode=1 elf_file=$(elf) \
# TODO: Add support for waveform collection.
$(tool_path)/spike-dasm --isa=$(variant) < $(path_var)/trace_rvfi_hart_00.dasm > $(log)
grep $(isspostrun_opts) $(path_var)/trace_rvfi_hart_00.dasm

###############################################################################
# Common targets and rules
###############################################################################
Expand Down

0 comments on commit c021a74

Please sign in to comment.