mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-06-28 01:06:16 -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
|
name: build-riscv-tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RISCV: /riscv
|
NUM_JOBS: 8
|
||||||
NUM_JOBS: 4
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
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
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
ci/setup.sh
|
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:
|
execute-riscv-tests:
|
||||||
name: execute-riscv-tests
|
name: execute-riscv-tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SPIKE_TANDEM: 1
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
testcase: [asm-tests, mul, amo, fp, benchmarks]
|
testcase: [ dv-riscv-arch-test , smoke-tests ]
|
||||||
target: [cv64a6_imafdc_sv39, cv64a6_imafdc_sv39_wb, cv64a6_imafdc_sv39_hpdcache]
|
target: [ veri-testharness ]
|
||||||
env:
|
|
||||||
RISCV: /riscv
|
|
||||||
needs:
|
needs:
|
||||||
build-riscv-tests
|
build-riscv-tests
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
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:
|
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
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
tar xf tools.tar
|
export RISCV=$(pwd)/tools/riscv-toolchain/
|
||||||
tar xf tmp.tar
|
source ci/install-prereq.sh
|
||||||
source verif/sim/setup-env.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
|
set -x
|
||||||
export ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
export ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||||
export ROOT_PROJECT=$ROOT
|
export ROOT_PROJECT=$ROOT
|
||||||
|
export RISCV=$ROOT_PROJECT/tools/riscv-toolchain/
|
||||||
|
|
||||||
export PATH=$RISCV/bin:/bin:$PATH
|
export VERILATOR_INSTALL_DIR="$ROOT_PROJECT"/tools/verilator/
|
||||||
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
|
|
||||||
|
|
||||||
ci/make-tmp.sh
|
ci/make-tmp.sh
|
||||||
|
|
||||||
sudo mkdir -p $RISCV && sudo chmod 777 $RISCV
|
bash ci/install-prereq.sh
|
||||||
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
|
bash ci/install-toolchain.sh
|
||||||
wget https://static.dev.sifive.com/dev-tools/$RISCV64_UNKNOWN_ELF_GCC
|
|
||||||
|
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
|
fi
|
||||||
tar -x -f $RISCV64_UNKNOWN_ELF_GCC --strip-components=1 -C $RISCV
|
|
||||||
|
|
||||||
sudo apt install libfl-dev help2man
|
source verif/regress/install-spike.sh
|
||||||
|
if [ -d ${SPIKE_SRC_DIR}/build/ ]; then
|
||||||
bash verif/regress/install-verilator.sh
|
make -C ${SPIKE_SRC_DIR}/build clean
|
||||||
(source verif/sim/setup-env.sh; bash verif/regress/install-spike.sh)
|
fi
|
||||||
ci/build-riscv-tests.sh
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue