From 59bedb78c58377df3844d27cdafcf97e65226856 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Sat, 7 Dec 2024 13:24:10 -0800 Subject: [PATCH] Cleanup verilator paths --- sim/verilator/Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sim/verilator/Makefile b/sim/verilator/Makefile index 6a6ad267a..666516c2d 100644 --- a/sim/verilator/Makefile +++ b/sim/verilator/Makefile @@ -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 \