Skip to content

Added README.md for RISCV-DV and RISCOF tests #38

Added README.md for RISCV-DV and RISCOF tests

Added README.md for RISCV-DV and RISCOF tests #38

Workflow file for this run

name: RISCOF tests
on:
push:
pull_request:
jobs:
spike:
name: Build Spike ISS
runs-on: ubuntu-latest
env:
CCACHE_DIR: "/opt/veer-el2/.cache/"
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Install prerequisities
run: |
sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \
git build-essential cmake ccache device-tree-compiler
- name: Create Cache Timestamp
id: cache_timestamp
uses: nanzm/[email protected]
with:
format: 'YYYY-MM-DD-HH-mm-ss'
- name: Setup cache
uses: actions/cache@v2
timeout-minutes: 3
continue-on-error: true
with:
path: "/opt/veer-el2/.cache/"
key: cache_spike_${{ steps.cache_timestamp.outputs.time }}
restore-keys: cache_spike_
- name: Build Spike
run: |
git clone https://github.com/riscv-software-src/riscv-isa-sim spike
export CC="ccache gcc"
export CXX="ccache g++"
pushd spike
git checkout d70ea67d
mkdir build
cd build
../configure --prefix=/opt/spike
make -j`nproc`
make install
popd
rm -rf /opt/spike/include # Remove include and lib to save space
rm -rf /opt/spike/lib
cd /opt && tar -czvf spike.tar.gz spike/
- name: Store Spike binaries
uses: actions/upload-artifact@v3
with:
name: spike
path: /opt/*.tar.gz
retention-days: 1
tests:
name: Run RISCOF tests
runs-on: ubuntu-latest
needs: spike
env:
DEBIAN_FRONTEND: "noninteractive"
CCACHE_DIR: "/opt/riscof/.cache/"
VERILATOR_VERSION: v5.010
steps:
- name: Install utils
run: |
sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \
git ccache python3-minimal python3-pip device-tree-compiler \
gcc-riscv64-unknown-elf cpanminus build-essential ninja-build
sudo cpanm Bit::Vector
- name: Setup Cache Metadata
id: cache_metadata
run: |
date=$(date +"%Y_%m_%d")
time=$(date +"%Y%m%d_%H%M%S_%N")
cache_verilator_restore_key=cache_verilator_
cache_verilator_key=${cache_verilator_restore_key}${{ env.VERILATOR_VERSION }}
cache_test_restore_key=${{ matrix.test }}_${{ matrix.coverage }}_
cache_test_key=${cache_test_restore_key}${time}
echo "date=$date" | tee -a "$GITHUB_ENV"
echo "time=$time" | tee -a "$GITHUB_ENV"
echo "cache_verilator_restore_key=$cache_verilator_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_verilator_key=$cache_verilator_key" | tee -a "$GITHUB_ENV"
echo "cache_test_restore_key=$cache_test_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_test_key=$cache_test_key" | tee -a "$GITHUB_ENV"
- name: Restore verilator cache
id: cache-verilator-restore
uses: actions/cache/restore@v3
with:
path: |
/opt/verilator
/opt/verilator/.cache
key: ${{ env.cache_verilator_key }}
restore-keys: ${{ env.cache_verilator_restore_key }}
- name: Setup tests cache
uses: actions/cache@v3
id: cache-test-setup
with:
path: |
${{ env.CCACHE_DIR }}
key: ${{ env.cache_test_key }}
restore-keys: ${{ env.cache_test_restore_key }}
- name: Download Spike binaries
uses: actions/download-artifact@v3
with:
name: spike
path: /opt
- name: Unpack binaries
run: |
pushd /opt
tar -zxvf spike.tar.gz
popd
- name: Create Cache Timestamp
id: cache_timestamp
uses: nanzm/[email protected]
with:
format: 'YYYY-MM-DD-HH-mm-ss'
- name: Setup cache
uses: actions/cache@v2
timeout-minutes: 3
continue-on-error: true
with:
path: "/opt/veer-el2/.cache/"
key: cache_riscof_tests_${{ steps.cache_timestamp.outputs.time }}
restore-keys: cache_riscof_tests_
- name: Setup repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install RISCOF
run: |
pip3 install git+https://github.com/riscv/riscof@a25e315
- name: Clone tests
run: |
mkdir -p riscof
pushd riscof
riscof --verbose info arch-test --clone
# FIXME: It seems impossible to turn off Zicsr extension. A
# temporary solution is to remove the tests.
rm -rf riscv-arch-test/riscv-test-suite/rv32i_m/privilege/
popd
- name: Configure RISCOF
run: |
pushd riscof
# Copy RISCOF configuration
cp ../tools/riscof/config.ini ./
cp -r ../tools/riscof/spike ./
cp -r ../tools/riscof/veer ./
# Build the test list
riscof testlist --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env
popd
- name: Build VeeR model
run: |
export PATH=/opt/verilator/bin:$PATH
export RV_ROOT=`pwd`
pushd riscof
$RV_ROOT/configs/veer.config
make -f $RV_ROOT/tools/Makefile verilator-build
popd
- name: Run tests
run: |
export PATH=/opt/spike/bin:$PATH
pushd riscof
riscof run --no-browser --config=config.ini --suite=riscv-arch-test/riscv-test-suite/ --env=riscv-arch-test/riscv-test-suite/env
popd
- name: Pack artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: riscof-report
path: |
riscof/riscof_work/report.html
riscof/riscof_work/style.css