Skip to content

Commit

Permalink
fixed Verilator detection by tests
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinThomazic committed Feb 20, 2024
1 parent a8c15ca commit 7e08c3c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions verif/regress/install-spike.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ ROOT_PROJECT=$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)
# Use the in-tree vendorized Spike if SPIKE_SRC_DIR is not set
# or when a fully local installation was requested.
if [ -z "$SPIKE_SRC_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
SPIKE_SRC_DIR=$ROOT_PROJECT/verif/core-v-verif/vendor/riscv/riscv-isa-sim
export SPIKE_SRC_DIR=$ROOT_PROJECT/verif/core-v-verif/vendor/riscv/riscv-isa-sim
fi

# Expect/perform Spike installation in directory $SPIKE_INSTALL_DIR.
# which defaults to $ROOT_PROJECT/tools/spike.
if [ -z "$SPIKE_INSTALL_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
SPIKE_INSTALL_DIR="$ROOT_PROJECT/tools/spike"
export SPIKE_INSTALL_DIR="$ROOT_PROJECT/tools/spike"
fi

# Do not clean up the destination directory: leave that to the user (real or CI job).
Expand Down
4 changes: 2 additions & 2 deletions verif/regress/install-verilator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ fi
# Define the default src+build location of Verilator.
# No need to force this location in Continuous Integration scripts.
if [ -z "$VERILATOR_BUILD_DIR" ]; then
VERILATOR_BUILD_DIR="$ROOT_PROJECT"/tools/verilator-$VERILATOR_HASH/verilator
export VERILATOR_BUILD_DIR="$ROOT_PROJECT"/tools/verilator-$VERILATOR_HASH/verilator
fi

# Define the default installation location of Verilator: one level up
# from the source tree in the core-v-verif tree.
# Continuous Integration may need to override this particular variable
# to use a preinstalled build of Verilator.
if [ -z "$VERILATOR_INSTALL_DIR" ]; then
VERILATOR_INSTALL_DIR="$(dirname $VERILATOR_BUILD_DIR)"
export VERILATOR_INSTALL_DIR="$(dirname $VERILATOR_BUILD_DIR)"
fi

# Build and install Verilator only if not already installed at the expected
Expand Down
5 changes: 2 additions & 3 deletions verif/regress/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ if ! [ -n "$BBL_ROOT" ]; then
return 1
fi

# install the required tools
source verif/regress/install-cva6.sh
source verif/regress/install-riscv-dv.sh
# setup sim env
source verif/sim/setup-env.sh

if ! [ -n "$DV_SIMULATORS" ]; then
DV_SIMULATORS=veri-testharness
Expand Down
8 changes: 7 additions & 1 deletion verif/regress/smoke-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ if ! [ -n "$RISCV" ]; then
return
fi

source ./verif/sim/setup-env.sh

# install the required tools
source ./verif/regress/install-verilator.sh
source ./verif/regress/install-spike.sh

# install the required test suites
source ./verif/regress/install-riscv-compliance.sh
source ./verif/regress/install-riscv-tests.sh
source ./verif/regress/install-riscv-arch-test.sh

# setup sim env
source ./verif/sim/setup-env.sh

echo "$SPIKE_INSTALL_DIR$"

if ! [ -n "$DV_SIMULATORS" ]; then
DV_SIMULATORS=vcs-testharness,spike
fi
Expand Down
2 changes: 1 addition & 1 deletion verif/sim/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fi

# Set verilator and spike related variables
if [ -z "$VERILATOR_INSTALL_DIR" ]; then
export VERILATOR_INSTALL_DIR="$ROOT_PROJECT"/tools/$(ls $ROOT_PROJECT/tools | grep verilator)
export VERILATOR_INSTALL_DIR="$ROOT_PROJECT"/tools/$(ls $ROOT_PROJECT/tools | grep verilator | head -n 1)
fi

if [ -z "$SPIKE_SRC_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
Expand Down

0 comments on commit 7e08c3c

Please sign in to comment.