diff --git a/.github/workflows/build-verilator.yml b/.github/workflows/build-verilator.yml index bd2b960f8cb..d920c2115f5 100644 --- a/.github/workflows/build-verilator.yml +++ b/.github/workflows/build-verilator.yml @@ -15,7 +15,7 @@ jobs: commit: v5.010 - version: uvm repo: antmicro/verilator-1 - commit: df36e9ca2597aebe4b92c72461d945745b36c3e0 + commit: vif-trigger env: TOOL_NAME: verilator TOOL_VERSION: ${{ matrix.version }} diff --git a/README.md b/README.md index bd0ea0d8d09..557e7eaba5c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Files under the [tools](tools/) directory may be available under a different lic ## Dependencies -- Verilator **(4.102 or later)** must be installed on the system if running with Verilator +- Verilator **(4.106 or later)** must be installed on the system if running with Verilator - If adding/removing instructions, `espresso` must be installed (used by `tools/coredecode`) - RISCV tool chain (based on gcc version 8.3 or higher) must be installed so that it can be used to prepare RISCV binaries to run. @@ -210,4 +210,4 @@ dhry - Run dhrystone. (Scale by 1757 to get DMIPS/MHZ) The `$RV_ROOT/testbench/hex` directory contains precompiled hex files of the tests, ready for simulation in case RISC-V SW tools are not installed. -**Note**: The testbench has a simple synthesizable bridge that allows you to load the ICCM via load/store instructions. This is only supported for AXI4 builds. \ No newline at end of file +**Note**: The testbench has a simple synthesizable bridge that allows you to load the ICCM via load/store instructions. This is only supported for AXI4 builds. diff --git a/tools/Makefile b/tools/Makefile index 55726813a45..371653c527a 100755 --- a/tools/Makefile +++ b/tools/Makefile @@ -40,6 +40,18 @@ BUILD_DIR = snapshots/${snapshot} TBDIR = ${RV_ROOT}/testbench PICOLIBC_DIR = ${RV_ROOT}/third_party/picolibc/install +# Determine verilator version if possible. Set the flag accordingly. Since +# version v5.006 -Wno-IMPLICIT was renamed to -Wno-IMPLICITSTATIC +VERILATOR_NOIMPLICIT := -Wno-IMPLICITSTATIC +VERILATOR_VERSION := $(subst .,,$(word 2,$(shell $(VERILATOR) --version))) + +ifeq ("$(.SHELLSTATUS)", "0") + $(shell test $(VERILATOR_VERSION) -lt 5006) + ifeq ("$(.SHELLSTATUS)", "0") + VERILATOR_NOIMPLICIT := -Wno-IMPLICIT + endif +endif + # Define test name TEST = hello_world TEST_DIR = ${TBDIR}/asm @@ -123,7 +135,8 @@ verilator-build: ${TBFILES} ${BUILD_DIR}/defines.h test_tb_top.cpp echo '`undef RV_ASSERT_ON' >> ${BUILD_DIR}/common_defines.vh $(VERILATOR) --cc -CFLAGS ${CFLAGS} $(defines) \ $(includes) -I${RV_ROOT}/testbench -f ${RV_ROOT}/testbench/flist \ - -Wno-WIDTH -Wno-UNOPTFLAT -Wno-IMPLICITSTATIC ${TBFILES} --top-module tb_top \ + -Wno-WIDTH -Wno-UNOPTFLAT $(VERILATOR_NOIMPLICIT) \ + ${TBFILES} --top-module tb_top \ -exe test_tb_top.cpp --autoflush $(VERILATOR_DEBUG) $(VERILATOR_COVERAGE) cp ${RV_ROOT}/testbench/test_tb_top.cpp obj_dir/ $(MAKE) -e -C obj_dir/ -f Vtb_top.mk $(VERILATOR_MAKE_FLAGS)