mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-19 03:44:46 -04:00
removed the usage of install-cva6.sh and add setup-env.sh (#1741)
This commit is contained in:
parent
72b855672e
commit
706daa0a3b
26 changed files with 175 additions and 218 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
@ -50,7 +50,8 @@ jobs:
|
|||
name: compiled-tools
|
||||
- name: Run Tests
|
||||
run: |
|
||||
set -x
|
||||
tar xf tools.tar
|
||||
tar xf tmp.tar
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/sim/setup-env.sh
|
||||
make run-${{ matrix.testcase}}-verilator target=${{ matrix.target }}
|
||||
|
|
|
@ -216,7 +216,7 @@ asic-synthesis:
|
|||
- echo $PERIOD
|
||||
- echo $TECH_NAME
|
||||
- echo $DV_TARGET
|
||||
- source verif/regress/install-cva6.sh
|
||||
- source ./verif/sim/setup-env.sh
|
||||
- echo $SYN_DCSHELL_BASHRC; source $SYN_DCSHELL_BASHRC
|
||||
- make -C pd/synth cva6_synth TARGET="$DV_TARGET"
|
||||
- mv pd/synth/cva6_${DV_TARGET}_synth_modified.v artifacts/cva6_${DV_TARGET}_synth_modified.v
|
||||
|
@ -233,7 +233,7 @@ fpga-build:
|
|||
TARGET: cv32a60x
|
||||
script:
|
||||
- source $VIVADO_SETUP
|
||||
- source verif/regress/install-cva6.sh
|
||||
- source ./verif/sim/setup-env.sh
|
||||
- make fpga target=$TARGET
|
||||
- mkdir -p artifacts/reports
|
||||
- mv corev_apu/fpga/work-fpga/ariane_xilinx.bit artifacts/ariane_xilinx_$TARGET.bit
|
||||
|
@ -460,8 +460,7 @@ smoke-gate:
|
|||
- echo $FOUNDRY_PATH
|
||||
- echo $PERIOD
|
||||
- echo $TECH_NAME
|
||||
- source verif/regress/install-cva6.sh
|
||||
- source verif/regress/install-riscv-dv.sh
|
||||
- source ./verif/sim/setup-env.sh
|
||||
- source verif/regress/install-riscv-tests.sh
|
||||
- mv artifacts/cva6_${DV_TARGET}_synth_modified.v pd/synth/cva6_${DV_TARGET}_synth_modified.v
|
||||
- cd verif/sim
|
||||
|
@ -481,10 +480,8 @@ fpga-boot:
|
|||
DASHBOARD_JOB_DESCRIPTION: "Test of Linux 32 bits boot on FPGA Genesys2"
|
||||
DASHBOARD_SORT_INDEX: 10
|
||||
DASHBOARD_JOB_CATEGORY: "Synthesis"
|
||||
VERILATOR_INSTALL_DIR: "NO" # Skip install and checks of verilator
|
||||
SPIKE_INSTALL_DIR: "NO" # Skip install and checks of spike
|
||||
script:
|
||||
- source verif/regress/install-cva6.sh
|
||||
- source ./verif/sim/setup-env.sh
|
||||
- source $VIVADO2022_SETUP
|
||||
- mkdir -p corev_apu/fpga/work-fpga
|
||||
- mv artifacts/ariane_xilinx_cv32a60x.bit corev_apu/fpga/work-fpga/ariane_xilinx.bit
|
||||
|
|
15
README.md
15
README.md
|
@ -51,7 +51,13 @@ For Debian-based Linux distributions, run :
|
|||
sudo apt-get install help2man device-tree-compiler
|
||||
```
|
||||
|
||||
5. Run these commands to install a custom Spike and Verilator (i.e. these versions must be used to simulate the CVA6) and [these](#running-regression-tests-simulations) tests suites.
|
||||
5. Install the riscv-dv requirements:
|
||||
|
||||
```sh
|
||||
pip3 install -r verif/sim/dv/requirements.txt
|
||||
```
|
||||
|
||||
6. Run these commands to install a custom Spike and Verilator (i.e. these versions must be used to simulate the CVA6) and [these](#running-regression-tests-simulations) tests suites.
|
||||
```sh
|
||||
# DV_SIMULATORS is detailed in the next section
|
||||
export DV_SIMULATORS=veri-testharness,spike
|
||||
|
@ -81,9 +87,9 @@ If exactly 2 simulators are given, their trace is compared ([see the Regression
|
|||
Here is how you can run the hello world C program with the Verilator model:
|
||||
|
||||
```sh
|
||||
# Make sure to source these 2 scripts to correctly set the environment variables related to the tools
|
||||
source ./verif/regress/install-cva6.sh
|
||||
source ./verif/regress/install-riscv-dv.sh
|
||||
# Make sure to source this script from the root directory
|
||||
# to correctly set the environment variables related to the tools
|
||||
source verif/sim/setup-env.sh
|
||||
|
||||
# Set the NUM_JOBS variable to increase the number of parallel make jobs
|
||||
# export NUM_JOBS=
|
||||
|
@ -387,4 +393,3 @@ If you use CVA6 in your academic work you can cite us:
|
|||
# Acknowledgements
|
||||
|
||||
Check out the [acknowledgements](ACKNOWLEDGEMENTS.md).
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
VERSION="eeacd5507db7a0f50ca8c4f27aff220fcbb60bdf"
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
export ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
export ROOT_PROJECT=$ROOT
|
||||
|
||||
|
@ -25,5 +26,6 @@ tar -x -f $RISCV64_UNKNOWN_ELF_GCC --strip-components=1 -C $RISCV
|
|||
|
||||
sudo apt install libfl-dev help2man
|
||||
|
||||
verif/regress/install-cva6.sh
|
||||
bash verif/regress/install-verilator.sh
|
||||
(source verif/sim/setup-env.sh; bash verif/regress/install-spike.sh)
|
||||
ci/build-riscv-tests.sh
|
||||
|
|
|
@ -14,8 +14,10 @@ if [ -z "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if [ -z "$DV_SIMULATORS" ]; then
|
||||
DV_SIMULATORS=veri-testharness,spike
|
||||
|
|
|
@ -19,11 +19,13 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-compliance.sh
|
||||
source verif/regress/install-riscv-tests.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_SIMULATORS" ]; then
|
||||
DV_SIMULATORS=veri-testharness
|
||||
fi
|
||||
|
|
|
@ -14,11 +14,13 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-compliance.sh
|
||||
source verif/regress/install-riscv-tests.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_SIMULATORS" ]; then
|
||||
DV_SIMULATORS=veri-testharness
|
||||
fi
|
||||
|
|
|
@ -14,8 +14,11 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
|
||||
export cov=1 #enable the Code Coverage
|
||||
|
||||
|
|
|
@ -18,9 +18,10 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source verif/regress/install-spike.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv32a6_embedded
|
||||
|
|
|
@ -18,9 +18,10 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source verif/regress/install-spike.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv32a6_embedded
|
||||
|
|
|
@ -14,10 +14,12 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-arch-test.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv64a6_imafdc_sv39
|
||||
fi
|
||||
|
|
|
@ -14,10 +14,12 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-compliance.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv64a6_imafdc_sv39
|
||||
fi
|
||||
|
|
|
@ -14,10 +14,12 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-arch-test.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv32a60x
|
||||
fi
|
||||
|
|
|
@ -14,10 +14,12 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-arch-test.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv32a60x
|
||||
fi
|
||||
|
|
|
@ -14,10 +14,12 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-tests.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv64a6_imafdc_sv39
|
||||
fi
|
||||
|
|
|
@ -14,10 +14,12 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-tests.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_SIMULATORS" ]; then
|
||||
DV_SIMULATORS=veri-testharness,spike
|
||||
fi
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
# Copyright 2021 Thales DIS design services SAS
|
||||
#
|
||||
# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
|
||||
# You may obtain a copy of the License at https://solderpad.org/licenses/
|
||||
#
|
||||
# Original Author: Jean-Roch COULON - Thales
|
||||
|
||||
# Customise this to a fast local disk
|
||||
export ROOT_PROJECT=$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../../)
|
||||
export TOP="$ROOT_PROJECT/tools"
|
||||
|
||||
# where to install the tools
|
||||
if [ -z "$RISCV" ]; then
|
||||
echo "Error: RISCV variable undefined."
|
||||
return
|
||||
fi
|
||||
|
||||
# Auto-detect RISC-V tool name prefix if not explicitly given.
|
||||
if [ -z "$CV_SW_PREFIX" ]; then
|
||||
export CV_SW_PREFIX="$(ls -1 -r $RISCV/bin/riscv*-gcc | head -n 1| grep gcc | rev | cut -d '/' -f 1 | cut -d '-' -f 2- | rev)-"
|
||||
fi
|
||||
|
||||
# Default to auto-detected GCC name if not explicitly given.
|
||||
if [ -z "$RISCV_GCC" ]; then
|
||||
export RISCV_GCC=$RISCV/bin/${CV_SW_PREFIX}gcc
|
||||
fi
|
||||
|
||||
# Default to auto-detected OBJCOPY name if not explicitly given.
|
||||
if [ -z "$RISCV_OBJCOPY" ]; then
|
||||
export RISCV_OBJCOPY=$RISCV/bin/${CV_SW_PREFIX}objcopy
|
||||
fi
|
||||
|
||||
# Set up tool-related variables.
|
||||
export PATH="$RISCV/bin:$PATH"
|
||||
export LIBRARY_PATH="$RISCV/lib"
|
||||
export LD_LIBRARY_PATH="$RISCV/lib:$LD_LIBRARY_PATH"
|
||||
export C_INCLUDE_PATH="$RISCV/include"
|
||||
export CPLUS_INCLUDE_PATH="$RISCV/include"
|
||||
|
||||
# Install Verilator v5.
|
||||
# Set VERILATOR_INSTALL_DIR to 'NO' to skip installation and checks
|
||||
# of Verilator (useful for CI jobs not depending on Verilator in any way).
|
||||
if [ "$VERILATOR_INSTALL_DIR" != "NO" ]; then
|
||||
source verif/regress/install-verilator.sh
|
||||
|
||||
# Complain if the installation directory of Verilator still is not set
|
||||
# after running the installer.
|
||||
if [ -z "$VERILATOR_INSTALL_DIR" ]; then
|
||||
echo "Error: VERILATOR_INSTALL_DIR variable still undefined after running Verilator installer."
|
||||
return
|
||||
fi
|
||||
|
||||
# Verilator was set up: add Verilator paths to appropriate variables.
|
||||
export PATH="$VERILATOR_INSTALL_DIR/bin:$PATH"
|
||||
export C_INCLUDE_PATH="$VERILATOR_INSTALL_DIR/share/verilator/include:$C_INCLUDE_PATH"
|
||||
export CPLUS_INCLUDE_PATH="$VERILATOR_INSTALL_DIR/share/verilator/include:$CPLUS_INCLUDE_PATH"
|
||||
|
||||
echo "Verilator version:"
|
||||
verilator --version || { echo "Error: Verilator not in \$PATH." ; return ; }
|
||||
else
|
||||
echo "Skipping Verilator setup on user's request (\$VERILATOR_INSTALL_DIR = \"NO\")."
|
||||
fi
|
||||
|
||||
# install the required tools for cva6
|
||||
if [ -z "$CVA6_REPO" ]; then
|
||||
CVA6_REPO="https://github.com/openhwgroup/cva6.git"
|
||||
CVA6_BRANCH="master"
|
||||
CVA6_HASH="853fb4bee5ca6e36e39dc3c272a97f49d95c3c1d"
|
||||
CVA6_PATCH=
|
||||
fi
|
||||
echo $CVA6_REPO
|
||||
echo $CVA6_BRANCH
|
||||
echo $CVA6_HASH
|
||||
echo $CVA6_PATCH
|
||||
|
||||
# install Spike
|
||||
if [ -z "$SPIKE_INSTALL_DIR" ]; then
|
||||
export SPIKE_INSTALL_DIR=$TOP/spike/
|
||||
fi
|
||||
source verif/regress/install-spike.sh
|
|
@ -1,23 +0,0 @@
|
|||
# Copyright 2021 Thales DIS design services SAS
|
||||
#
|
||||
# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
|
||||
# You may obtain a copy of the License at https://solderpad.org/licenses/
|
||||
#
|
||||
# Original Author: Jean-Roch COULON - Thales
|
||||
|
||||
# riscv-dv env variables
|
||||
export RISCV_TOOLCHAIN=$RISCV
|
||||
if [ -z "$RISCV_GCC" ]; then
|
||||
export RISCV_GCC="$RISCV_TOOLCHAIN/bin/riscv-none-elf-gcc"
|
||||
fi
|
||||
if [ -z "$RISCV_OBJCOPY" ]; then
|
||||
export RISCV_OBJCOPY="$RISCV_TOOLCHAIN/bin/riscv-none-elf-objcopy"
|
||||
fi
|
||||
export SPIKE_PATH=$SPIKE_INSTALL_DIR/bin
|
||||
export RTL_PATH=$ROOT_PROJECT/
|
||||
export TB_PATH=$ROOT_PROJECT/verif/tb/core
|
||||
export TESTS_PATH=$ROOT_PROJECT/verif/tests
|
||||
|
||||
(cd verif/sim/dv; pip3 install -r requirements.txt)
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2021-2023 Thales DIS design services SAS
|
||||
#
|
||||
# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
|
||||
|
@ -11,59 +12,42 @@ if [ -z ${NUM_JOBS} ]; then
|
|||
NUM_JOBS=1
|
||||
fi
|
||||
|
||||
# Make sure we know the path to the top of the CVA6 tree.
|
||||
if [ -z "$ROOT_PROJECT" ]; then
|
||||
echo "ERROR: Variable ROOT_PROJECT not set, cannot continue!"
|
||||
return 1
|
||||
ROOT_PROJECT=$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)
|
||||
|
||||
# Set the location of Spike source code.
|
||||
# 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
|
||||
fi
|
||||
|
||||
# Set default installation location of Spike if not specified so far.
|
||||
if [ -z "$SPIKE_INSTALL_DIR" ]; then
|
||||
export SPIKE_INSTALL_DIR=$ROOT_PROJECT/tools/spike
|
||||
# Expect/perform Spike installation in directory $SPIKE_INSTALL_DIR.
|
||||
# which defaults to $ROOT_PROJECT/tools/spike.
|
||||
if [ -n "$SPIKE_INSTALL_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
|
||||
SPIKE_INSTALL_DIR="$ROOT_PROJECT/tools/spike"
|
||||
fi
|
||||
|
||||
# Set SPIKE_INSTALL_DIR to 'NO' to skip the installation/checks of Spike
|
||||
# altogether. This is useful for CI jobs not depending on Spike in any way.
|
||||
if [ "$SPIKE_INSTALL_DIR" = "NO" ]; then
|
||||
echo "NOTE: Skipping Spike setup on user's request (\$SPIKE_INSTALL_DIR = \"NO\")."
|
||||
# Do not clean up the destination directory: leave that to the user (real or CI job).
|
||||
|
||||
# Rebuild Spike or reuse an existing Spike build.
|
||||
if ! [ -f "$SPIKE_INSTALL_DIR/bin/spike" ]; then
|
||||
echo "Building Spike in $SPIKE_SRC_DIR"
|
||||
echo "Installing Spike in $SPIKE_INSTALL_DIR"
|
||||
# Keep track of current working dir.
|
||||
CALLER_DIR="$(pwd)"
|
||||
# Enter the vendorized tree. It already captures the desired Spike config.
|
||||
cd $SPIKE_SRC_DIR
|
||||
echo "Building Spike sources in $SPIKE_SRC_DIR..."
|
||||
# Build and install Spike (including extensions).
|
||||
mkdir -p build
|
||||
cd build
|
||||
if [[ ! -f config.log ]]; then
|
||||
../configure --prefix="$SPIKE_INSTALL_DIR"
|
||||
fi
|
||||
make -j${NUM_JOBS}
|
||||
echo "Installing Spike in '$SPIKE_INSTALL_DIR'..."
|
||||
make install
|
||||
cd $CALLER_DIR
|
||||
else
|
||||
# Expect/perform Spike installation in directory $SPIKE_INSTALL_DIR.
|
||||
# which defaults to $ROOT_PROJECT/tools/spike.
|
||||
|
||||
# Set the location of Spike source code.
|
||||
# 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
|
||||
export SPIKE_SRC_DIR=$ROOT_PROJECT/verif/core-v-verif/vendor/riscv/riscv-isa-sim
|
||||
fi
|
||||
|
||||
# Set the installation location of Spike.
|
||||
# A value equal to '__local__' means $ROOT_PROJECT/tools/spike.
|
||||
if [ -n "$SPIKE_INSTALL_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
|
||||
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).
|
||||
|
||||
# Rebuild Spike or reuse an existing Spike build.
|
||||
if ! [ -f "$SPIKE_INSTALL_DIR/bin/spike" ]; then
|
||||
# Keep track of current working dir.
|
||||
CALLER_DIR="$(pwd)"
|
||||
# Enter the vendorized tree. It already captures the desired Spike config.
|
||||
cd $SPIKE_SRC_DIR
|
||||
echo "Building Spike sources in $SPIKE_SRC_DIR..."
|
||||
# Build and install Spike (including extensions).
|
||||
mkdir -p build
|
||||
cd build
|
||||
if [[ ! -f config.log ]]; then
|
||||
../configure --prefix="$SPIKE_INSTALL_DIR"
|
||||
fi
|
||||
make -j${NUM_JOBS}
|
||||
echo "Installing Spike in '$SPIKE_INSTALL_DIR'..."
|
||||
make install
|
||||
cd $CALLER_DIR
|
||||
else
|
||||
echo "Using pre-installed Spike from '$SPIKE_INSTALL_DIR'."
|
||||
fi
|
||||
echo "Spike already installed in '$SPIKE_INSTALL_DIR'."
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2021 Thales DIS design services SAS
|
||||
#
|
||||
# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
|
||||
|
@ -7,21 +8,18 @@
|
|||
#
|
||||
# Original Author: Jean-Roch COULON - Thales
|
||||
|
||||
# Customise this to a fast local disk
|
||||
ROOT_PROJECT=$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../../)
|
||||
|
||||
if [ -z "$NUM_JOBS" ]; then
|
||||
NUM_JOBS=1
|
||||
fi
|
||||
|
||||
# Ensure the location of tools is known (usually, .../core-v-verif/tools).
|
||||
if [ -z "$TOP" ]; then
|
||||
echo "Error: location of core-v-verif 'tools' tree (\$TOP) is not defined."
|
||||
return
|
||||
fi
|
||||
|
||||
VERILATOR_REPO="https://github.com/verilator/verilator.git"
|
||||
VERILATOR_BRANCH="master"
|
||||
# Use the release tag instead of a full SHA1 hash.
|
||||
VERILATOR_HASH="v5.018"
|
||||
VERILATOR_PATCH="$TOP/../verif/regress/verilator-v5.patch"
|
||||
VERILATOR_PATCH="$ROOT_PROJECT/verif/regress/verilator-v5.patch"
|
||||
|
||||
# Unset historical variable VERILATOR_ROOT as it collides with the build process.
|
||||
if [ -n "$VERILATOR_ROOT" ]; then
|
||||
|
@ -31,7 +29,7 @@ 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
|
||||
export VERILATOR_BUILD_DIR=${TOP}/verilator-$VERILATOR_HASH/verilator
|
||||
VERILATOR_BUILD_DIR="$ROOT_PROJECT"/tools/verilator-$VERILATOR_HASH/verilator
|
||||
fi
|
||||
|
||||
# Define the default installation location of Verilator: one level up
|
||||
|
@ -39,7 +37,7 @@ fi
|
|||
# Continuous Integration may need to override this particular variable
|
||||
# to use a preinstalled build of Verilator.
|
||||
if [ -z "$VERILATOR_INSTALL_DIR" ]; then
|
||||
export VERILATOR_INSTALL_DIR="$(dirname $VERILATOR_BUILD_DIR)"
|
||||
VERILATOR_INSTALL_DIR="$(dirname $VERILATOR_BUILD_DIR)"
|
||||
fi
|
||||
|
||||
# Build and install Verilator only if not already installed at the expected
|
||||
|
@ -71,9 +69,5 @@ if [ ! -f "$VERILATOR_INSTALL_DIR/bin/verilator" ]; then
|
|||
#make test || echo "### 'make test' in $VERILATOR_ROOT: some tests failed."
|
||||
cd -
|
||||
else
|
||||
echo "Using Verilator from cached directory $VERILATOR_INSTALL_DIR."
|
||||
echo "Verilator already installed in $VERILATOR_INSTALL_DIR."
|
||||
fi
|
||||
|
||||
# Update PATH to match the verilator installation.
|
||||
export PATH="$VERILATOR_INSTALL_DIR/bin:$PATH"
|
||||
|
||||
|
|
|
@ -14,10 +14,12 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-compliance.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_SIMULATORS" ]; then
|
||||
echo "Error DV_SIMULATORS variable undefined"
|
||||
fi
|
||||
|
|
|
@ -14,11 +14,13 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source verif/regress/install-riscv-compliance.sh
|
||||
source verif/regress/install-riscv-tests.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_SIMULATORS" ]; then
|
||||
DV_SIMULATORS=veri-testharness,spike
|
||||
fi
|
||||
|
|
|
@ -18,8 +18,10 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source verif/regress/install-cva6.sh
|
||||
source verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
|
||||
source verif/sim/setup-env.sh
|
||||
|
||||
if ! [ -n "$DV_TARGET" ]; then
|
||||
DV_TARGET=cv32a6_embedded
|
||||
|
|
|
@ -14,16 +14,18 @@ if ! [ -n "$RISCV" ]; then
|
|||
fi
|
||||
|
||||
# install the required tools
|
||||
source ./verif/regress/install-cva6.sh
|
||||
source ./verif/regress/install-riscv-dv.sh
|
||||
source ./verif/regress/install-verilator.sh
|
||||
source ./verif/regress/install-spike.sh
|
||||
source ./verif/regress/install-riscv-compliance.sh
|
||||
source ./verif/regress/install-riscv-tests.sh
|
||||
source ./verif/regress/install-riscv-arch-test.sh
|
||||
|
||||
source ./verif/sim/setup-env.sh
|
||||
|
||||
|
||||
if ! [ -n "$DV_SIMULATORS" ]; then
|
||||
DV_SIMULATORS=vcs-testharness,spike
|
||||
fi
|
||||
fi
|
||||
|
||||
cd verif/sim/
|
||||
python3 cva6.py --testlist=../tests/testlist_riscv-tests-cv64a6_imafdc_sv39-v.yaml --test rv64ui-v-add --iss_yaml cva6.yaml --target cv64a6_imafdc_sv39 --iss=$DV_SIMULATORS $DV_OPTS
|
||||
|
|
47
verif/sim/setup-env.sh
Normal file
47
verif/sim/setup-env.sh
Normal file
|
@ -0,0 +1,47 @@
|
|||
# CVA6 project root
|
||||
export ROOT_PROJECT=$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)
|
||||
|
||||
export RTL_PATH=$ROOT_PROJECT/
|
||||
export TB_PATH=$ROOT_PROJECT/verif/tb/core
|
||||
export TESTS_PATH=$ROOT_PROJECT/verif/tests
|
||||
|
||||
if [ -z "$RISCV" ]; then
|
||||
echo "Error: RISCV variable undefined."
|
||||
return
|
||||
fi
|
||||
# Set RISCV toolchain-related variables
|
||||
export LIBRARY_PATH="$RISCV/lib"
|
||||
export LD_LIBRARY_PATH="$RISCV/lib:$LD_LIBRARY_PATH"
|
||||
export C_INCLUDE_PATH="$RISCV/include"
|
||||
export CPLUS_INCLUDE_PATH="$RISCV/include"
|
||||
|
||||
# Auto-detect RISC-V tool name prefix if not explicitly given.
|
||||
if [ -z "$CV_SW_PREFIX" ]; then
|
||||
export CV_SW_PREFIX="$(ls -1 -r $RISCV/bin/riscv*-gcc | head -n 1| grep gcc | rev | cut -d '/' -f 1 | cut -d '-' -f 2- | rev)-"
|
||||
fi
|
||||
# Default to auto-detected GCC name if not explicitly given.
|
||||
if [ -z "$RISCV_GCC" ]; then
|
||||
export RISCV_GCC=$RISCV/bin/${CV_SW_PREFIX}gcc
|
||||
fi
|
||||
# Default to auto-detected OBJCOPY name if not explicitly given.
|
||||
if [ -z "$RISCV_OBJCOPY" ]; then
|
||||
export RISCV_OBJCOPY=$RISCV/bin/${CV_SW_PREFIX}objcopy
|
||||
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)
|
||||
fi
|
||||
|
||||
if [ -z "$SPIKE_SRC_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
|
||||
export SPIKE_SRC_DIR=$ROOT_PROJECT/verif/core-v-verif/vendor/riscv/riscv-isa-sim
|
||||
fi
|
||||
|
||||
if [ -z "$SPIKE_INSTALL_DIR" -o "$SPIKE_INSTALL_DIR" = "__local__" ]; then
|
||||
export SPIKE_INSTALL_DIR="$ROOT_PROJECT"/tools/spike
|
||||
fi
|
||||
|
||||
export SPIKE_PATH=$SPIKE_INSTALL_DIR/bin
|
||||
|
||||
# Update the PATH to add all the tools
|
||||
export PATH="$VERILATOR_INSTALL_DIR/bin:$RISCV/bin:$PATH"
|
Loading…
Add table
Reference in a new issue