mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-04-19 03:44:46 -04:00
Use cva6.py in github ci (#1874)
This commit is contained in:
parent
9fb5db2555
commit
a3dd9a708d
4 changed files with 116 additions and 41 deletions
94
.github/workflows/ci.yml
vendored
94
.github/workflows/ci.yml
vendored
|
@ -11,47 +11,99 @@ jobs:
|
|||
name: build-riscv-tests
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RISCV: /riscv
|
||||
NUM_JOBS: 4
|
||||
NUM_JOBS: 8
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Cache toolchain
|
||||
id: cache-toolchain
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-toolchain
|
||||
with:
|
||||
path: tools/riscv-toolchain/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ci/install-toolchain.sh') }}
|
||||
|
||||
- name: Cache verilator
|
||||
id: cache-verilator
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-verilator
|
||||
with:
|
||||
path: tools/verilator/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-verilator.sh') }}
|
||||
|
||||
- name: Cache Spike
|
||||
id: cache-spike
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-spike
|
||||
with:
|
||||
path: tools/spike/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-spike.sh', 'verif/core-v-verif/vendor/riscv/riscv-isa-sim/') }}
|
||||
|
||||
- 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
|
||||
env:
|
||||
SPIKE_TANDEM: 1
|
||||
strategy:
|
||||
matrix:
|
||||
testcase: [asm-tests, mul, amo, fp, benchmarks]
|
||||
target: [cv64a6_imafdc_sv39, cv64a6_imafdc_sv39_wb, cv64a6_imafdc_sv39_hpdcache]
|
||||
env:
|
||||
RISCV: /riscv
|
||||
testcase: [ dv-riscv-arch-test , smoke-tests ]
|
||||
target: [ veri-testharness ]
|
||||
needs:
|
||||
build-riscv-tests
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Download a single artifact
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
- name: Cache toolchain
|
||||
id: cache-toolchain
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-toolchain
|
||||
with:
|
||||
name: compiled-tools
|
||||
path: tools/riscv-toolchain/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('ci/install-toolchain.sh') }}
|
||||
|
||||
- name: Cache verilator
|
||||
id: cache-verilator
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-verilator
|
||||
with:
|
||||
path: tools/verilator/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-verilator.sh') }}
|
||||
|
||||
- name: Cache Spike
|
||||
id: cache-spike
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-spike
|
||||
with:
|
||||
path: tools/spike/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('verif/regress/install-spike.sh', 'verif/core-v-verif/vendor/riscv/riscv-isa-sim/') }}
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
set -x
|
||||
tar xf tools.tar
|
||||
tar xf tmp.tar
|
||||
export RISCV=$(pwd)/tools/riscv-toolchain/
|
||||
source ci/install-prereq.sh
|
||||
source verif/sim/setup-env.sh
|
||||
make run-${{ matrix.testcase}}-verilator target=${{ matrix.target }}
|
||||
DV_SIMULATORS=${{matrix.target}} bash verif/regress/${{matrix.testcase}}.sh
|
||||
|
||||
- name: Upload Lint Report to Github
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{matrix.target}}.${{matrix.testcase}}
|
||||
path: 'verif/sim/out*'
|
||||
retention-days: 10
|
||||
compression-level: 9
|
||||
|
|
8
ci/install-prereq.sh
Normal file
8
ci/install-prereq.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
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 device-tree-compiler libfl-dev help2man
|
||||
|
20
ci/install-toolchain.sh
Normal file
20
ci/install-toolchain.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
export PATH=$RISCV/bin:/bin:$PATH
|
||||
export LIBRARY_PATH=$RISCV/lib
|
||||
export LD_LIBRARY_PATH=$RISCV/lib
|
||||
export C_INCLUDE_PATH=$RISCV/include
|
||||
export CPLUS_INCLUDE_PATH=$RISCV/include
|
||||
|
||||
EMBECOSM_BASE=https://buildbot.embecosm.com/job/riscv32-gcc-ubuntu2204-release/10/artifact
|
||||
|
||||
mkdir -p $RISCV && chmod 777 $RISCV
|
||||
|
||||
[ ! -d $RISCV ] && sudo mkdir -p $RISCV && sudo chmod 777 $RISCV
|
||||
|
||||
if [ ! -d $RISCV/bin ]; then
|
||||
RISCV64_UNKNOWN_ELF_GCC=riscv32-embecosm-ubuntu2204-gcc13.2.0.tar.gz
|
||||
if [ ! -f "$RISCV64_UNKNOWN_ELF_GCC" ]; then
|
||||
wget $EMBECOSM_BASE/$RISCV64_UNKNOWN_ELF_GCC --no-check-certificate
|
||||
fi
|
||||
tar -x -f $RISCV64_UNKNOWN_ELF_GCC --strip-components=1 -C $RISCV
|
||||
fi
|
35
ci/setup.sh
35
ci/setup.sh
|
@ -3,29 +3,24 @@ set -e
|
|||
set -x
|
||||
export ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
export ROOT_PROJECT=$ROOT
|
||||
export RISCV=$ROOT_PROJECT/tools/riscv-toolchain/
|
||||
|
||||
export PATH=$RISCV/bin:/bin:$PATH
|
||||
export LIBRARY_PATH=$RISCV/lib
|
||||
export LD_LIBRARY_PATH=$RISCV/lib
|
||||
export C_INCLUDE_PATH=$RISCV/include
|
||||
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 device-tree-compiler
|
||||
export VERILATOR_INSTALL_DIR="$ROOT_PROJECT"/tools/verilator/
|
||||
|
||||
ci/make-tmp.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
|
||||
bash ci/install-prereq.sh
|
||||
|
||||
bash ci/install-toolchain.sh
|
||||
|
||||
source verif/sim/setup-env.sh
|
||||
|
||||
source verif/regress/install-verilator.sh
|
||||
if [ -d ${VERILATOR_BUILD_DIR} ]; then
|
||||
make -C ${VERILATOR_BUILD_DIR} clean
|
||||
fi
|
||||
tar -x -f $RISCV64_UNKNOWN_ELF_GCC --strip-components=1 -C $RISCV
|
||||
|
||||
sudo apt install libfl-dev help2man
|
||||
|
||||
bash verif/regress/install-verilator.sh
|
||||
(source verif/sim/setup-env.sh; bash verif/regress/install-spike.sh)
|
||||
ci/build-riscv-tests.sh
|
||||
source verif/regress/install-spike.sh
|
||||
if [ -d ${SPIKE_SRC_DIR}/build/ ]; then
|
||||
make -C ${SPIKE_SRC_DIR}/build clean
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue