diff --git a/verif/sim/Makefile b/verif/sim/Makefile index 9b956fb119..d715a31310 100644 --- a/verif/sim/Makefile +++ b/verif/sim/Makefile @@ -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 ############################################################################### @@ -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 \ @@ -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: @@ -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) @@ -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 \ @@ -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 ###############################################################################