From 51f99fffe9888a6bf555b710900ce3f68cb16ac9 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 20 Nov 2023 11:13:54 +0100 Subject: [PATCH 1/3] Add detecting Verilator version and supplying proper flags. Internal-Tag: [#51521] Signed-off-by: Maciej Kurc --- tools/Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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) From 22e589982ace7ed9de6aa2bfbb16ee5d8cc507a9 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 20 Nov 2023 11:16:33 +0100 Subject: [PATCH 2/3] Update min. Verilator version in README.md Internal-Tag: [#51521] Signed-off-by: Maciej Kurc --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. From 4cbb278188b557a179d614fe0989ac6912f8c846 Mon Sep 17 00:00:00 2001 From: Maciej Kurc Date: Mon, 20 Nov 2023 11:46:25 +0100 Subject: [PATCH 3/3] Bump Verilator version Internal-Tag: [#51521] Signed-off-by: Maciej Kurc --- .github/workflows/build-verilator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }}