From 09e2368a019fd05fc4e574e6d2d4713705ba28ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Allart?= Date: Tue, 12 Sep 2023 17:40:19 +0200 Subject: [PATCH 1/2] fix verilator wavedump --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e9e3f9f157..60667163f3 100644 --- a/Makefile +++ b/Makefile @@ -547,8 +547,8 @@ verilate_command := $(verilator) verilator_config.vlt $(if ($(PRELOAD)!=""), -DPRELOAD=1,) \ $(if $(PROFILE),--stats --stats-vars --profile-cfuncs,) \ $(if $(DEBUG), --trace-structs,) \ - $(if $(TRACE_COMPACT), --trace-fst $(VERILATOR_ROOT)/include/verilated_fst_c.cpp) \ - $(if $(TRACE_FAST), --trace $(VERILATOR_ROOT)/include/verilated_vcd_c.cpp) \ + $(if $(TRACE_COMPACT), --trace-fst $(VERILATOR_INSTALL_DIR)/share/verilator/include/verilated_fst_c.cpp) \ + $(if $(TRACE_FAST), --trace $(VERILATOR_INSTALL_DIR)/share/verilator/include/verilated_vcd_c.cpp) \ -LDFLAGS "-L$(RISCV)/lib -L$(SPIKE_ROOT)/lib -Wl,-rpath,$(RISCV)/lib -Wl,-rpath,$(SPIKE_ROOT)/lib -lfesvr$(if $(PROFILE), -g -pg,) -lpthread $(if $(TRACE_COMPACT), -lz,)" \ -CFLAGS "$(CFLAGS)$(if $(PROFILE), -g -pg,) -DVL_DEBUG" \ --cc --vpi \ @@ -563,7 +563,7 @@ verilate_command := $(verilator) verilator_config.vlt verilate: @echo "[Verilator] Building Model$(if $(PROFILE), for Profiling,)" $(verilate_command) - cd $(ver-library) && $(MAKE) -f Variane_testharness.mk + cd $(ver-library) && $(MAKE) -j${NUM_JOBS} -f Variane_testharness.mk sim-verilator: verilate $(ver-library)/Variane_testharness $(elf-bin) From 885082bf7394b500e8a758b26303f5d1e00d8165 Mon Sep 17 00:00:00 2001 From: Zbigniew Chamski Date: Wed, 13 Sep 2023 14:34:54 +0200 Subject: [PATCH 2/2] Factor out occurrences of Verilator include path. * Makefile (VL_INC_DIR): New. (verilate_command): Fix whitespace. Use VL_INC_DIR as path of Verilator include / optional files. --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 60667163f3..8864c83cfb 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,8 @@ support_verilator_4 := $(shell ($(verilator) --version | grep '4\.') > /dev/null ifeq ($(support_verilator_4), 0) verilator_threads := 1 endif +# Location of Verilator headers and optional source files +VL_INC_DIR := $(VERILATOR_INSTALL_DIR)/share/verilator/include ifndef RISCV $(error RISCV not set - please point your RISCV variable to your RISCV installation) @@ -527,7 +529,7 @@ xrun-ci: xrun-asm-tests xrun-amo-tests xrun-mul-tests xrun-fp-tests xrun-benchma verilate_command := $(verilator) verilator_config.vlt \ -f core/Flist.cva6 \ $(filter-out %.vhd, $(ariane_pkg)) \ - $(filter-out core/fpu_wrap.sv, $(filter-out %.vhd, $(filter-out %_config_pkg.sv, $(src)))) \ + $(filter-out core/fpu_wrap.sv, $(filter-out %.vhd, $(filter-out %_config_pkg.sv, $(src)))) \ +define+$(defines)$(if $(TRACE_FAST),+VM_TRACE)$(if $(TRACE_COMPACT),+VM_TRACE+VM_TRACE_FST) \ corev_apu/tb/common/mock_uart.sv \ +incdir+corev_apu/axi_node \ @@ -547,8 +549,8 @@ verilate_command := $(verilator) verilator_config.vlt $(if ($(PRELOAD)!=""), -DPRELOAD=1,) \ $(if $(PROFILE),--stats --stats-vars --profile-cfuncs,) \ $(if $(DEBUG), --trace-structs,) \ - $(if $(TRACE_COMPACT), --trace-fst $(VERILATOR_INSTALL_DIR)/share/verilator/include/verilated_fst_c.cpp) \ - $(if $(TRACE_FAST), --trace $(VERILATOR_INSTALL_DIR)/share/verilator/include/verilated_vcd_c.cpp) \ + $(if $(TRACE_COMPACT), --trace-fst $(VL_INC_DIR)/verilated_fst_c.cpp) \ + $(if $(TRACE_FAST), --trace $(VL_INC_DIR)/include/verilated_vcd_c.cpp) \ -LDFLAGS "-L$(RISCV)/lib -L$(SPIKE_ROOT)/lib -Wl,-rpath,$(RISCV)/lib -Wl,-rpath,$(SPIKE_ROOT)/lib -lfesvr$(if $(PROFILE), -g -pg,) -lpthread $(if $(TRACE_COMPACT), -lz,)" \ -CFLAGS "$(CFLAGS)$(if $(PROFILE), -g -pg,) -DVL_DEBUG" \ --cc --vpi \