From 2a6bd3bd5c6f8bf0147ae65433d15ba91eeb4bad Mon Sep 17 00:00:00 2001 From: Albert Magyar Date: Mon, 11 May 2020 23:02:37 -0700 Subject: [PATCH] Bump verilator to v4.034 (#547) * Bump verilator to v4.034 * Add new flags to verilator makefile * Conditionally set timescale flag based on Verilator version --- .circleci/defaults.sh | 2 +- .circleci/images/Dockerfile | 2 +- scripts/centos-req.sh | 2 +- scripts/ubuntu-req.sh | 2 +- sims/verilator/Makefile | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/defaults.sh b/.circleci/defaults.sh index 38da902b..3420a1a2 100755 --- a/.circleci/defaults.sh +++ b/.circleci/defaults.sh @@ -21,7 +21,7 @@ clean () { NPROC=8 # verilator version -VERILATOR_VERSION=v4.028 +VERILATOR_VERSION=v4.034 # remote variables REMOTE_WORK_DIR=$CI_DIR/$CIRCLE_PROJECT_REPONAME-$CIRCLE_BRANCH-$CIRCLE_SHA1-$CIRCLE_JOB diff --git a/.circleci/images/Dockerfile b/.circleci/images/Dockerfile index 807c15f0..3efb4cc9 100644 --- a/.circleci/images/Dockerfile +++ b/.circleci/images/Dockerfile @@ -164,7 +164,7 @@ RUN apt-get install -y \ # Install verilator RUN git clone http://git.veripool.org/git/verilator \ && cd verilator \ - && git checkout v4.028 \ + && git checkout v4.034 \ && autoconf && ./configure && make && make install # Update PATH for Java tools diff --git a/scripts/centos-req.sh b/scripts/centos-req.sh index 30b9fe70..89e8644c 100755 --- a/scripts/centos-req.sh +++ b/scripts/centos-req.sh @@ -22,5 +22,5 @@ sudo yum install -y dtc # install verilator git clone http://git.veripool.org/git/verilator cd verilator -git checkout v4.028 +git checkout v4.034 autoconf && ./configure && make -j16 && sudo make install diff --git a/scripts/ubuntu-req.sh b/scripts/ubuntu-req.sh index ee541e81..f72c48f4 100755 --- a/scripts/ubuntu-req.sh +++ b/scripts/ubuntu-req.sh @@ -23,5 +23,5 @@ sudo apt-get install -y device-tree-compiler # install verilator git clone http://git.veripool.org/git/verilator cd verilator -git checkout v4.028 +git checkout v4.034 autoconf && ./configure && make -j16 && sudo make install diff --git a/sims/verilator/Makefile b/sims/verilator/Makefile index 432169d6..fd7f1bd6 100644 --- a/sims/verilator/Makefile +++ b/sims/verilator/Makefile @@ -86,7 +86,10 @@ ARIANE_VERILATOR_FLAGS = \ CHIPYARD_VERILATOR_FLAGS = \ --assert +# Use --timescale to approximate timescale behavior of pre-4.034 +TIMESCALE_OPTS := $(shell verilator --version | perl -lne 'if (/(\d.\d+)/ && $$1 >= 4.034) { print "--timescale 1ns/1ps"; }') VERILATOR_NONCC_OPTS = \ + $(TIMESCALE_OPTS) \ --top-module $(VLOG_MODEL) \ $(shell if ! grep -iq "module.*ariane" $(build_dir)/*.*v; then echo "$(CHIPYARD_VERILATOR_FLAGS)"; else echo "$(ARIANE_VERILATOR_FLAGS)"; fi) \ --output-split 10000 \