mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-24 14:17:16 -04:00
Cleanup Makefile infrastructure to support VCS
This commit is contained in:
parent
f84a77a1ac
commit
00678f52c7
5 changed files with 31 additions and 17 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -66,3 +66,6 @@ transcript
|
|||
tools/spike
|
||||
tools/verilator*
|
||||
*_results/
|
||||
*.signature_output
|
||||
ucli.key
|
||||
vcs.cmd
|
||||
|
|
|
@ -18,7 +18,7 @@ CV_CORE_BRANCH ?= master
|
|||
CV_CORE_HASH ?= fcd5968
|
||||
CV_CORE_TAG ?= none
|
||||
# The CV_CORE_HASH above points to version of the RTL that is newer, but
|
||||
# ilogically equivalent RTL with respect to v1.0.0 RTL freeze version.
|
||||
# logically equivalent RTL with respect to v1.0.0 RTL freeze version.
|
||||
# There are some implementation and testbench updates in the above hash.
|
||||
# Set CV_CORE_TAG as below to point to the exact cv32e40p repo as that used at RTL freeze
|
||||
#CV_CORE_TAG ?= cv32e40p_v1.0.0
|
||||
|
@ -36,6 +36,13 @@ COMPLIANCE_BRANCH ?= master
|
|||
# 2020-08-19
|
||||
COMPLIANCE_HASH ?= c21a2e86afa3f7d4292a2dd26b759f3f29cde497
|
||||
|
||||
# This Spike repo is only cloned when the DPI disassembler needs to be rebuilt.
|
||||
# Typically users can simply use the checked-in shared library.
|
||||
# Should you need to, the command is "make dpi_dasm".
|
||||
DPI_DASM_SPIKE_REPO ?= https://github.com/riscv/riscv-isa-sim.git
|
||||
DPI_DASM_SPIKE_BRANCH ?= master
|
||||
DPI_DASM_SPIKE_HASH ?= 8faa928819fb551325e76b463fc0c978e22f5be3
|
||||
|
||||
# SVLIB
|
||||
SVLIB_REPO ?= https://bitbucket.org/verilab/svlib/src/master/svlib
|
||||
SVLIB_BRANCH ?= master
|
||||
|
|
Binary file not shown.
|
@ -677,6 +677,7 @@ DPI_DASM_INC = -I$(DPI_DASM_PKG) -I$(DPI_INCLUDE) -I$(DPI_DASM_SPIKE_PKG)/ris
|
|||
DPI_DASM_CXX = g++
|
||||
|
||||
dpi_dasm: $(DPI_DASM_SPIKE_PKG)
|
||||
$(CLONE_DPI_DASM_SPIKE_CMD)
|
||||
$(DPI_DASM_CXX) $(DPI_DASM_CFLAGS) $(DPI_DASM_INC) $(DPI_DASM_SRC) -o $(DPI_DASM_LIB)
|
||||
|
||||
###############################################################################
|
||||
|
|
|
@ -37,6 +37,7 @@ DVE = $(CV_TOOL_PREFIX) dve
|
|||
URG = $(CV_SIM_PREFIX) urg
|
||||
|
||||
# Paths
|
||||
VCS_RESULTS ?= vcs_results
|
||||
VCS_DIR ?= $(SIM_CFG_RESULTS)/vcs.d
|
||||
VCS_ELAB_COV = -cm line+cond+tgl+fsm+branch+assert -cm_dir $(MAKECMDGOALS)/$(MAKECMDGOALS).vdb
|
||||
|
||||
|
@ -47,13 +48,15 @@ VCS_TIMESCALE = $(shell echo "$(TIMESCALE)" | tr ' ' '=') # -timescale=1ns/1p
|
|||
VCS_UVM_VERBOSITY ?= UVM_MEDIUM
|
||||
|
||||
# Flags
|
||||
VCS_VERSION ?= S-2021.09-SP1
|
||||
VCS_UVMHOME_ARG ?= /synopsys/vcs/$(VCS_VERSION)/etc/uvm-1.2
|
||||
VCS_UVM_ARGS ?= +incdir+$(VCS_UVMHOME_ARG)/src $(VCS_UVMHOME_ARG)/src/uvm_pkg.sv +UVM_VERBOSITY=$(VCS_UVM_VERBOSITY) -ntb_opts uvm-1.2
|
||||
#VCS_UVMHOME_ARG ?= /opt/uvm/1800.2-2017-0.9/
|
||||
#VCS_UVMHOME_ARG ?= /opt/synopsys/vcs-mx/O-2018.09-SP1-1/etc/uvm
|
||||
VCS_UVMHOME_ARG ?= /synopsys/vcs/S-2021.09-SP1/etc/uvm
|
||||
VCS_UVM_ARGS ?= +incdir+$(VCS_UVMHOME_ARG)/src $(VCS_UVMHOME_ARG)/src/uvm_pkg.sv +UVM_VERBOSITY=$(VCS_UVM_VERBOSITY) -ntb_opts uvm-1.2
|
||||
|
||||
VCS_COMP_FLAGS ?= -lca -sverilog \
|
||||
$(SV_CMP_FLAGS) $(VCS_UVM_ARGS) $(VCS_TIMESCALE) \
|
||||
-assert svaext -race=all -ignore unique_checks -full64
|
||||
|
||||
VCS_GUI ?=
|
||||
VCS_RUN_COV = -cm line+cond+tgl+fsm+branch+assert -cm_dir $(MAKECMDGOALS).vdb
|
||||
|
||||
|
@ -63,6 +66,13 @@ VCS_PMA_INC += +incdir+$(TBSRC_HOME)/uvmt \
|
|||
+incdir+$(CV_CORE_COREVDV_PKG)/ldgen \
|
||||
+incdir+$(abspath $(MAKE_PATH)/../../../lib/mem_region_gen)
|
||||
|
||||
# Need to re-define the LIB paths for VCS to drop the "*.so" extension.
|
||||
DPI_DASM_LIB = $(DPI_DASM_PKG)/lib/$(DPI_DASM_ARCH)/libdpi_dasm
|
||||
SVLIB_LIB = $(SVLIB_PKG)/../svlib_dpi
|
||||
|
||||
# Required by dpi_dasm target
|
||||
DPI_INCLUDE ?= $(shell dirname $(shell which vcs))/../include
|
||||
|
||||
###############################################################################
|
||||
# Common QUIET flag defaults to -quiet unless VERBOSE is set
|
||||
ifeq ($(call IS_YES,$(VERBOSE)),YES)
|
||||
|
@ -146,9 +156,9 @@ endif
|
|||
|
||||
VCS_RUN_BASE_FLAGS ?= $(VCS_GUI) \
|
||||
$(VCS_PLUSARGS) +ntb_random_seed=$(RNDSEED) \
|
||||
-sv_lib $(VCS_OVP_MODEL_DPI) \
|
||||
-sv_lib $(DPI_DASM_LIB) \
|
||||
-sv_lib $(abspath $(SVLIB_LIB))
|
||||
-sv_lib $(VCS_OVP_MODEL_DPI) \
|
||||
-sv_lib $(DPI_DASM_LIB) \
|
||||
-sv_lib $(abspath $(SVLIB_LIB))
|
||||
|
||||
# Simulate using latest elab
|
||||
VCS_RUN_FLAGS ?=
|
||||
|
@ -157,10 +167,6 @@ VCS_RUN_FLAGS += $(VCS_RUN_WAVES_FLAGS)
|
|||
VCS_RUN_FLAGS += $(VCS_RUN_COV_FLAGS)
|
||||
VCS_RUN_FLAGS += $(USER_RUN_FLAGS)
|
||||
|
||||
# Special var to point to tool and installation dependent path of DPI headers.
|
||||
# Used to recompile dpi_dasm_spike if needed (by default, not needed).
|
||||
DPI_INCLUDE ?= $(shell dirname $(shell which vcs))/../lib
|
||||
|
||||
###############################################################################
|
||||
# Targets
|
||||
|
||||
|
@ -191,7 +197,7 @@ VCS_COMP = $(VCS_COMP_FLAGS) \
|
|||
$(UVM_PLUSARGS)
|
||||
|
||||
comp: mk_vcs_dir $(CV_CORE_PKG) $(SVLIB_PKG) $(OVP_MODEL_DPI)
|
||||
cd $(VCS_DIR) && $(VCS) $(VCS_COMP) -top uvmt_$(CV_CORE_LC)_tb
|
||||
cd $(SIM_CFG_RESULTS) && $(VCS) $(VCS_COMP) -top uvmt_$(CV_CORE_LC)_tb
|
||||
@echo "$(BANNER)"
|
||||
@echo "* $(SIMULATOR) compile complete"
|
||||
@echo "* Log: $(SIM_CFG_RESULTS)/vcs.log"
|
||||
|
@ -222,12 +228,9 @@ export IMPERAS_TOOLS=$(SIM_RUN_RESULTS)/ovpsim.ic
|
|||
# The new general test target
|
||||
|
||||
test: $(VCS_SIM_PREREQ) hex gen_ovpsim_ic
|
||||
@echo "$(BANNER)"
|
||||
@echo "* Running simulation"
|
||||
@echo "$(BANNER)"
|
||||
echo $(IMPERAS_TOOLS)
|
||||
mkdir -p $(SIM_RUN_RESULTS)
|
||||
cd $(SIM_RUN_RESULTS) && \
|
||||
$(VCS_DIR)/$(SIMV) \
|
||||
$(VCS_RESULTS)/$(CFG)/$(SIMV) \
|
||||
-l vcs-$(TEST_NAME).log \
|
||||
-cm_name $(TEST_NAME) $(VCS_RUN_FLAGS) \
|
||||
$(CFG_PLUSARGS) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue