Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Update Verilator version to v5.008 #1566

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ VCOM ?= vcom$(questa_version)
VLIB ?= vlib$(questa_version)
VMAP ?= vmap$(questa_version)
# verilator version
verilator ?= verilator
verilator ?= $(PWD)/tmp/verilator-v5.008/verilator/bin/verilator
# traget option
target-options ?=
# additional definess
Expand Down Expand Up @@ -536,7 +536,7 @@ xrun-check-benchmarks:
xrun-ci: xrun-asm-tests xrun-amo-tests xrun-mul-tests xrun-fp-tests xrun-benchmarks

# verilator-specific
verilate_command := $(verilator) verilator_config.vlt \
verilate_command := $(verilator) --no-timing 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)))) \
Expand Down
50 changes: 35 additions & 15 deletions ci/install-verilator.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,44 @@
#!/bin/bash
set -e

ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
cd $ROOT/tmp

if [ -z ${NUM_JOBS} ]; then
NUM_JOBS=1
NUM_JOBS=4
fi

if [ ! -e "$VERILATOR_ROOT/bin/verilator" ]; then
echo "Installing Verilator"
rm -f verilator*.tgz
wget https://www.veripool.org/ftp/verilator-4.014.tgz
tar xzf verilator*.tgz
rm -f verilator*.tgz
cd verilator-4.014
mkdir -p $VERILATOR_ROOT
# copy scripts
autoconf && ./configure --prefix="$VERILATOR_ROOT" && make -j${NUM_JOBS}
cp -r * $VERILATOR_ROOT/
make test
VERILATOR_REPO="https://github.com/verilator/verilator.git"
VERILATOR_BRANCH="master"
# Use the release tag instead of a full SHA1 hash.
VERILATOR_HASH="v5.008"
VERILATOR_PATCH="$ROOT/verif/regress/verilator-v5.patch"

VERILATOR_BUILD_DIR=$PWD/verilator-$VERILATOR_HASH/verilator
VERILATOR_INSTALL_DIR="$(dirname $VERILATOR_BUILD_DIR)"

if [ ! -e "$VERILATOR_INSTALL_DIR/bin/verilator" ]; then
echo "Building Verilator in $VERILATOR_BUILD_DIR..."
echo "Verilator will be installed in $VERILATOR_INSTALL_DIR"
echo "VERILATOR_REPO=$VERILATOR_REPO"
echo "VERILATOR_BRANCH=$VERILATOR_BRANCH"
echo "VERILATOR_HASH=$VERILATOR_HASH"
echo "VERILATOR_PATCH=$VERILATOR_PATCH"
mkdir -p $VERILATOR_BUILD_DIR
cd $VERILATOR_BUILD_DIR
sudo apt install libfl-dev help2man
[ -d .git ] || git clone $VERILATOR_REPO -b $VERILATOR_BRANCH .
git checkout $VERILATOR_HASH
if [[ -n "$VERILATOR_PATCH" && -f "$VERILATOR_PATCH" ]] ; then
git apply $VERILATOR_PATCH || true
fi
# Generate the config script and configure Verilator.
autoconf && ./configure --prefix="$VERILATOR_INSTALL_DIR" && make -j${NUM_JOBS}
# FORNOW: Accept failure in 'make test' (segfault issue on Debian10)
make test || true
echo "Installing Verilator in $VERILATOR_INSTALL_DIR..."
make install
else
echo "Using Verilator from cached directory."
echo "Using Verilator from cached directory $VERILATOR_INSTALL_DIR."
fi

cd $ROOT
5 changes: 4 additions & 1 deletion ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ export CPLUS_INCLUDE_PATH=$RISCV/include
echo 'deb http://download.opensuse.org/repositories/home:/phiwag:/edatools/xUbuntu_20.04/ /' | sudo tee /etc/apt/sources.list.d/home:phiwag:edatools.list
curl -fsSL https://download.opensuse.org/repositories/home:phiwag:edatools/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_phiwag_edatools.gpg > /dev/null
sudo apt update
sudo apt install verilator-4.110 device-tree-compiler
sudo apt install device-tree-compiler

ci/make-tmp.sh

ci/install-verilator.sh

sudo mkdir -p $RISCV && sudo chmod 777 $RISCV
RISCV64_UNKNOWN_ELF_GCC=riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-linux-ubuntu14.tar.gz
if [ ! -f "$RISCV64_UNKNOWN_ELF_GCC" ]; then
Expand Down
2 changes: 1 addition & 1 deletion verif/regress/install-riscv-arch-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi
if ! [ -n "$ARCH_TEST_REPO" ]; then
ARCH_TEST_REPO=https://github.com/riscv-non-isa/riscv-arch-test
ARCH_TEST_BRANCH=main
ARCH_TEST_HASH="46cf99d0e020887e398508fc776928a1adad7c23"
ARCH_TEST_HASH="a5a49fc9f244192649e57fe61b4513d9bc39b1e3"
fi
echo "Repo: " $ARCH_TEST_REPO
echo "Branch:" $ARCH_TEST_BRANCH
Expand Down
18 changes: 9 additions & 9 deletions verif/sim/cva6.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def run_c(c_test, iss_yaml, isa, target, mabi, gcc_opts, iss_opts, output_dir,
-nostartfiles %s \
-I%s/dv/user_extension \
-T%s %s -o %s " % \
(get_env_var("RISCV_GCC", debug_cmd = debug_cmd), c_test, cwd,
(get_env_var("RISCV_GCC", debug_cmd = debug_cmd), c_test, cwd,
linker, gcc_opts, elf))
cmd += (" -march=%s" % isa)
cmd += (" -mabi=%s" % mabi)
Expand Down Expand Up @@ -849,9 +849,9 @@ def load_config(args, cwd):
Returns:
Loaded configuration dictionary.
"""

global isa_extension_list
isa_extension_list = args.isa_extension.split(",")
isa_extension_list = args.isa_extension.split(",")
isa_extension_list.append("zicsr")
isa_extension_list.append("zifencei")

Expand Down Expand Up @@ -882,13 +882,13 @@ def load_config(args, cwd):
args.testlist = cwd + "/target/"+ args.target +"/testlist.yaml"
if args.target == "cv64a6_imafdc_sv39":
args.mabi = "lp64d"
args.isa = "rv64gc"
args.isa = "rv64gc_zba_zbb_zbs_zbc"
elif args.target == "cv32a60x": # step1 configuration
args.mabi = "ilp32"
args.isa = "rv32imac"
args.isa = "rv32imac_zba_zbb_zbs_zbc"
elif args.target == "cv32a6_embedded":
args.mabi = "ilp32"
args.isa = "rv32imc"
args.isa = "rv32imc_zba_zbb_zbs_zbc"
elif args.target == "cv32a6_imac_sv0":
args.mabi = "ilp32"
args.isa = "rv32imac"
Expand Down Expand Up @@ -1017,13 +1017,13 @@ def main():
cfg = load_config(args, cwd)
# Create output directory
output_dir = create_output(args.o, args.noclean, cwd+"/out_")

#add z,s,x extensions to the isa if there are some
if isa_extension_list !=['']:
if isa_extension_list !=['']:
for i in isa_extension_list:
if i!= "":
args.isa += (f"_{i}")

if args.verilog_style_check:
logging.debug("Run style check")
style_err = run_cmd("verilog_style/run.sh")
Expand Down
Loading
Loading