From 1c149395f0b5ecf14d6a6c4b754784cdc73317a7 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Oct 2023 22:05:17 +0000 Subject: [PATCH] Change CI to build cvv spike --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++----- Makefile | 3 ++- ci/setup.sh | 10 +++++--- verif/regress/install-verilator.sh | 3 ++- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d77b56932f..a1f70fac177 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,28 @@ name: ci on: [push, pull_request] jobs: - riscv-tests: - name: riscv-tests + build-riscv-tests: + name: build-riscv-tests + runs-on: ubuntu-latest + env: + RISCV: /riscv + NUM_JOBS: 4 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Prepare + run: | + ci/setup.sh + tar -cf tools.tar tools + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: compiled-tools + path: | + tools.tar + execute-riscv-tests: + name: execute-riscv-tests runs-on: ubuntu-latest strategy: matrix: @@ -16,11 +36,18 @@ jobs: target: [cv64a6_imafdc_sv39, cv64a6_imafdc_sv39_wb] env: RISCV: /riscv + needs: + build-riscv-tests steps: - uses: actions/checkout@v2 with: submodules: recursive - - name: Prepare - run: ci/setup.sh - - name: run tests - run: make run-${{ matrix.testcase}}-verilator target=${{ matrix.target }} + - name: Download a single artifact + uses: actions/download-artifact@v3 + with: + name: compiled-tools + - name: Run Tests + run: | + ls -la tools.tar + tar xf tools.tar + make run-${{ matrix.testcase}}-verilator target=${{ matrix.target }} diff --git a/Makefile b/Makefile index f464d0b54df..d78552a4f24 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,8 @@ VCOM ?= vcom$(questa_version) VLIB ?= vlib$(questa_version) VMAP ?= vmap$(questa_version) # verilator version -verilator ?= $(PWD)/tmp/verilator-v5.008/verilator/bin/verilator +VERILATOR_INSTALL_DIR ?= $(PWD)/tmp/verilator-v5.008/verilator/ +verilator ?= verilator # traget option target-options ?= # additional defines diff --git a/ci/setup.sh b/ci/setup.sh index 47b1a528740..318c8db5b5b 100755 --- a/ci/setup.sh +++ b/ci/setup.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e -ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) +export ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) +export ROOT_PROJECT=$ROOT export PATH=$RISCV/bin:/bin:$PATH export LIBRARY_PATH=$RISCV/lib @@ -15,13 +16,14 @@ 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 wget https://static.dev.sifive.com/dev-tools/$RISCV64_UNKNOWN_ELF_GCC fi tar -x -f $RISCV64_UNKNOWN_ELF_GCC --strip-components=1 -C $RISCV -ci/install-fesvr.sh + +sudo apt install libfl-dev help2man + +source verif/regress/install-cva6.sh ci/build-riscv-tests.sh diff --git a/verif/regress/install-verilator.sh b/verif/regress/install-verilator.sh index 26ed703e4d3..82e89634430 100755 --- a/verif/regress/install-verilator.sh +++ b/verif/regress/install-verilator.sh @@ -8,7 +8,7 @@ # Original Author: Jean-Roch COULON - Thales if [ -z "$NUM_JOBS" ]; then - NUM_JOBS=1 + NUM_JOBS=4 fi # Ensure the location of tools is known (usually, .../core-v-verif/tools). @@ -51,6 +51,7 @@ if [ ! -f "$VERILATOR_INSTALL_DIR/bin/verilator" ]; then echo "VERILATOR_BRANCH=$VERILATOR_BRANCH" echo "VERILATOR_HASH=$VERILATOR_HASH" echo "VERILATOR_PATCH=$VERILATOR_PATCH" + echo "NUM_JOBS=$NUM_JOBS" mkdir -p $VERILATOR_BUILD_DIR cd $VERILATOR_BUILD_DIR # Clone only if the ".git" directory does not exist.