Skip to content

Commit

Permalink
Change CI to build cvv spike
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioOpenHWGroup committed Oct 27, 2023
1 parent d240a2f commit 34fc32b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
42 changes: 36 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,50 @@ 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
tar -cf tmp.tar tmp
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: compiled-tools
path: |
tools.tar
tmp.tar
execute-riscv-tests:
name: execute-riscv-tests
runs-on: ubuntu-latest
strategy:
matrix:
testcase: [asm-tests, mul, amo, fp, benchmarks]
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: |
tar xf tools.tar
tar xf tmp.tar
source verif/regress/install-cva6.sh
make run-${{ matrix.testcase}}-verilator target=${{ matrix.target }}
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions ci/setup.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

verif/regress/install-cva6.sh
ci/build-riscv-tests.sh
3 changes: 2 additions & 1 deletion verif/regress/install-verilator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 34fc32b

Please sign in to comment.