mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-23 04:54:29 +00:00
Cleanup verilator paths
This commit is contained in:
parent
bdc20243a6
commit
59bedb78c5
@ -17,12 +17,10 @@ EXPANDED_PARAM_ARGS:=$(patsubst %,-G%,$(PARAM_ARGS))
|
||||
|
||||
WALLYCONF?=rv64gc
|
||||
TEST?=arch64i
|
||||
TESTBENCH?=testbench
|
||||
TESTBENCH?=testbench
|
||||
|
||||
# constants
|
||||
# assume WALLY variable is correctly configured in the shell environment
|
||||
WORKING_DIR=${WALLY}/sim/verilator
|
||||
TARGET=$(WORKING_DIR)/target
|
||||
# INCLUDE_PATH are pathes that Verilator should search for files it needs
|
||||
INCLUDE_PATH="-I${WALLY}/config/shared" "-I${WALLY}/config/$(WALLYCONF)" "-I${WALLY}/config/deriv/$(WALLYCONF)"
|
||||
# SOURCES are source files
|
||||
@ -30,6 +28,8 @@ SOURCES=${WALLY}/src/cvw.sv ${WALLY}/testbench/${TESTBENCH}.sv ${WALLY}/testbenc
|
||||
# DEPENDENCIES are configuration files and source files, which leads to recompilation of executables
|
||||
DEPENDENCIES=${WALLY}/config/shared/*.vh $(SOURCES)
|
||||
|
||||
WORKDIR = $(VERILATOR_DIR)/wkdir/$(WALLYCONF)_$(TEST)
|
||||
|
||||
# regular testbench requires a wrapper defining getenvval
|
||||
ifeq ($(TESTBENCH), testbench)
|
||||
WRAPPER=${WALLY}/sim/verilator/wrapper.c
|
||||
@ -41,9 +41,9 @@ endif
|
||||
|
||||
default: run
|
||||
|
||||
run: wkdir/$(WALLYCONF)_$(TEST)/V${TESTBENCH}
|
||||
run: $(WORKDIR)/V${TESTBENCH}
|
||||
mkdir -p $(VERILATOR_DIR)/logs
|
||||
wkdir/$(WALLYCONF)_$(TEST)/V${TESTBENCH} ${ARGTEST} $(PLUS_ARGS)
|
||||
$(WORKDIR)/V${TESTBENCH} ${ARGTEST} $(PLUS_ARGS)
|
||||
|
||||
profile: obj_dir_profiling/V${TESTBENCH}_$(WALLYCONF)
|
||||
$(VERILATOR_DIR)/obj_dir_profiling/V${TESTBENCH}_$(WALLYCONF) ${ARGTEST}
|
||||
@ -54,10 +54,10 @@ profile: obj_dir_profiling/V${TESTBENCH}_$(WALLYCONF)
|
||||
mv gmon_$(WALLYCONF)* $(VERILATOR_DIR)/logs_profiling
|
||||
echo "Please check $(VERILATOR_DIR)/logs_profiling/gmon_$(WALLYCONF)* for logs and output files."
|
||||
|
||||
wkdir/$(WALLYCONF)_$(TEST)/V${TESTBENCH}: $(DEPENDENCIES)
|
||||
mkdir -p wkdir/$(WALLYCONF)_$(TEST)
|
||||
$(WORKDIR)/V${TESTBENCH}: $(DEPENDENCIES)
|
||||
mkdir -p $(WORKDIR)
|
||||
verilator \
|
||||
--Mdir wkdir/$(WALLYCONF)_$(TEST) -o V${TESTBENCH} \
|
||||
--Mdir $(WORKDIR) -o V${TESTBENCH} \
|
||||
--binary --trace \
|
||||
$(OPT) $(PARAMS) $(NONPROF) \
|
||||
--top-module ${TESTBENCH} --relative-includes \
|
||||
|
Loading…
Reference in New Issue
Block a user