Skip to content

Commit

Permalink
Merge pull request #231 from antmicro/64945_mkar-remove-whisper
Browse files Browse the repository at this point in the history
tests: Remove Whisper from test infrastructure
  • Loading branch information
tmichalak committed Sep 3, 2024
2 parents e81fde1 + 7ad6e66 commit 9788122
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 159 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
name: Build-Spike
uses: ./.github/workflows/build-spike.yml

Get-Renode:
name: Get-Renode
uses: ./.github/workflows/get-renode.yml

Build-OpenOCD:
name: Build-OpenOCD
uses: ./.github/workflows/build-openocd.yml
Expand All @@ -37,7 +41,7 @@ jobs:

Test-RISCV-DV:
name: Test-RISCV-DV
needs: [Build-Verilator, Build-Spike]
needs: [Build-Verilator, Build-Spike, Get-Renode]
uses: ./.github/workflows/test-riscv-dv.yml

Test-RISCOF:
Expand All @@ -52,6 +56,7 @@ jobs:

Test-Renode:
name: Test-Renode
needs: [Get-Renode]
uses: ./.github/workflows/test-renode.yml

Test-OpenOCD:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/get-renode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Get Renode

on:
workflow_call:

jobs:

#--------------#
# Renode
#--------------#
renode:
name: Get Renode
runs-on: ubuntu-latest
env:
TOOL_NAME: renode
TOOL_VERSION: latest
DEBIAN_FRONTEND: "noninteractive"

steps:
- name: Setup Cache Metadata
id: cache_metadata
run: |
cache_date=$(date +"%Y_%m_%d")
cache_name=cache_${{ env.TOOL_NAME }}_${{ env.TOOL_VERSION }}
echo "Cache date: "$cache_date
echo "Cache name: "$cache_name
echo "cache_date=$cache_date" >> "$GITHUB_ENV"
echo "cache_name=$cache_name" >> "$GITHUB_ENV"
- name: Setup cache
uses: actions/cache@v3
id: cache
timeout-minutes: 60
with:
path: |
/opt/renode
key: ${{ env.cache_name }}_${{ env.cache_date }}
restore-keys: ${{ env.cache_name }}_

- name: Get latest nightly release
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
wget https://builds.renode.io/renode-latest.linux-portable.tar.gz
- name: Rename the archive
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
mv ${{ github.workspace }}/renode-*.tar.gz ${{ github.workspace }}/renode.tar.gz
- name: Unpack binaries
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
pushd /opt
mv ${{ github.workspace }}/renode.tar.gz .
mkdir renode
tar -zxvf renode.tar.gz --strip-components=1 -C renode/
popd
28 changes: 26 additions & 2 deletions .github/workflows/test-renode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,42 @@ on:
workflow_call:

jobs:

tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
RENODE_VERSION: latest
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Cache Metadata
id: cache_metadata
run: |
date=$(date +"%Y_%m_%d")
time=$(date +"%Y%m%d_%H%M%S_%N")
cache_renode_restore_key=cache_renode_
cache_renode_key=${cache_renode_restore_key}${{ env.RENODE_VERSION }}
echo "date=$date" | tee -a "$GITHUB_ENV"
echo "time=$time" | tee -a "$GITHUB_ENV"
echo "cache_renode_restore_key=$cache_renode_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_renode_key=$cache_renode_key" | tee -a "$GITHUB_ENV"
- name: Restore Renode cache
id: cache-renode-restore
uses: actions/cache/restore@v3
with:
path: |
/opt/renode
key: ${{ env.cache_renode_key }}
restore-keys: ${{ env.cache_renode_restore_key }}
fail-on-cache-miss: true

- name: Install dependencies
run: |
sudo apt -qqy update && sudo apt -qqy --no-install-recommends install \
Expand All @@ -34,7 +57,8 @@ jobs:
- name: Run tests
run: |
cd ./tools/renode
./run-tests.sh
pip install -r /opt/renode/tests/requirements.txt
/opt/renode/renode-test veer.robot
- name: Upload artifacts
if: always()
Expand Down
148 changes: 20 additions & 128 deletions .github/workflows/test-riscv-dv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,98 +5,6 @@ on:

jobs:

#--------------#
# Renode
#--------------#
renode:
name: Download Renode
runs-on: ubuntu-latest
env:
CCACHE_DIR: "/opt/veer-el2/.cache/"
DEBIAN_FRONTEND: "noninteractive"

steps:
- name: Create Cache Timestamp
id: cache_timestamp
uses: nanzm/get-time-action@v2.0
with:
format: 'YYYY-MM-DD-HH-mm-ss'

- name: Setup cache
uses: actions/cache@v3
timeout-minutes: 60
continue-on-error: true
with:
path: "/opt/veer-el2/.cache/"
key: cache_renode_${{ steps.cache_timestamp.outputs.time }}
restore-keys: cache_renode_

- name: Get latest nightly release
run: |
wget https://builds.renode.io/renode-latest.linux-portable.tar.gz
- name: Rename the archive
run: |
mv ${{ github.workspace }}/renode-*.tar.gz ${{ github.workspace }}/renode.tar.gz
- name: Store Renode binaries
uses: actions/upload-artifact@v3
with:
name: renode
path: ${{ github.workspace }}/renode.tar.gz
retention-days: 1

#--------------#
# VeeR-ISS
#--------------#
veer-iss:
name: Build VeeR-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 ccache libboost-all-dev
- name: Create Cache Timestamp
id: cache_timestamp
uses: nanzm/get-time-action@v2.0
with:
format: 'YYYY-MM-DD-HH-mm-ss'

- name: Setup cache
uses: actions/cache@v3
timeout-minutes: 60
continue-on-error: true
with:
path: "/opt/veer-el2/.cache/"
key: cache_veer-iss_${{ steps.cache_timestamp.outputs.time }}
restore-keys: cache_veer-iss_

- name: Build VeeR-ISS
run: |
git clone https://github.com/chipsalliance/VeeR-ISS veer-iss
export CC="ccache gcc"
export CXX="ccache g++"
pushd veer-iss
git checkout 666c94e
make -j`nproc`
mkdir -p /opt/veer-iss
cp build-Linux/whisper /opt/veer-iss/
popd
cd /opt && tar -czvf veer-iss.tar.gz veer-iss/
- name: Store VeeR-ISS binaries
uses: actions/upload-artifact@v3
with:
name: veer-iss
path: /opt/*.tar.gz
retention-days: 1

#--------------#
# Tests
#--------------#
Expand Down Expand Up @@ -189,14 +97,13 @@ jobs:
run-tests:
name: Run RISC-V DV tests
runs-on: ubuntu-latest
needs: [ veer-iss, renode, generate-config, generate-code ]
needs: [ generate-config, generate-code ]
strategy:
fail-fast: false
matrix:
test: ${{ fromJSON(needs.generate-config.outputs.test-types) }}
iss:
- spike
# - whisper
- renode
coverage: ["all", "branch", "toggle"] #TODO: add functional coverage
version: [ uvm ]
Expand All @@ -217,24 +124,12 @@ jobs:

- iss: renode
test: riscv_hint_instr_test
- iss: whisper
test: riscv_full_interrupt_test

# FIXME: VeeR specific WARL CSRs behavior in PMP is not implemented
# in whisper, hence this exclusion list for PMP tests
- iss: whisper
test: riscv_pmp_disable_all_regions_test_veer
- iss: whisper
test: riscv_pmp_out_of_bounds_test_veer
- iss: whisper
test: riscv_pmp_full_random_test_veer
- iss: whisper
test: riscv_pmp_region_exec_test_veer
env:
DEBIAN_FRONTEND: "noninteractive"
CCACHE_DIR: "/opt/riscv-dv/.cache/"
VERILATOR_VERSION: v5.010
SPIKE_VERSION: d70ea67d
RENODE_VERSION: latest
CACHE_HASH: ${{ needs.generate-config.outputs.hash }}

steps:
Expand Down Expand Up @@ -263,6 +158,8 @@ jobs:
cache_verilator_key=${cache_verilator_restore_key}${{ env.VERILATOR_VERSION }}
cache_spike_restore_key=cache_spike_
cache_spike_key=${cache_spike_restore_key}${{ env.SPIKE_VERSION }}
cache_renode_restore_key=cache_renode_
cache_renode_key=${cache_renode_restore_key}${{ env.RENODE_VERSION }}
cache_test_restore_key=${{ matrix.test }}_${{ matrix.coverage }}_
cache_test_key=${cache_test_restore_key}${time}
cache_code=cache_${{ matrix.test }}_${{ matrix.version }}
Expand All @@ -273,6 +170,8 @@ jobs:
echo "cache_verilator_key=$cache_verilator_key" | tee -a "$GITHUB_ENV"
echo "cache_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_spike_key=$cache_spike_key" | tee -a "$GITHUB_ENV"
echo "cache_renode_restore_key=$cache_renode_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_renode_key=$cache_renode_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"
echo "cache_code=${cache_code}_${{ env.CACHE_HASH }}" | tee -a "$GITHUB_ENV"
Expand All @@ -299,24 +198,15 @@ jobs:
restore-keys: ${{ env.cache_spike_restore_key }}
fail-on-cache-miss: true

- name: Download Renode binaries
uses: actions/download-artifact@v3
with:
name: renode
path: /opt

- name: Download VeeR-ISS binaries
uses: actions/download-artifact@v3
- name: Restore Renode cache
id: cache-renode-restore
uses: actions/cache/restore@v3
with:
name: veer-iss
path: /opt

- name: Unpack binaries
run: |
pushd /opt
tar -zxvf veer-iss.tar.gz
tar -zxvf renode.tar.gz --strip-components=1
popd
path: |
/opt/renode
key: ${{ env.cache_renode_key }}
restore-keys: ${{ env.cache_renode_restore_key }}
fail-on-cache-miss: true

- name: Setup repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -354,14 +244,12 @@ jobs:
- name: Run test
run: |
export PATH=/opt/verilator/bin:$PATH
export PATH=/opt/veer-iss:$PATH
export RV_ROOT=`realpath .`
export RISCV_GCC=riscv64-unknown-elf-gcc
export RISCV_OBJCOPY=riscv64-unknown-elf-objcopy
export RISCV_NM=riscv64-unknown-elf-nm
export SPIKE_PATH=/opt/spike/bin
export WHISPER_ISS=/opt/veer-iss/whisper
export RENODE_PATH=/opt/renode
export RENODE_PATH=/opt/renode/renode
echo "RV_ROOT=${RV_ROOT}" >> ${GITHUB_ENV}
echo "PATH=${PATH}" >> ${GITHUB_ENV}
Expand Down Expand Up @@ -408,7 +296,7 @@ jobs:
runs-on: [ self-hosted, Linux, X64, gcp-custom-runners ]
container: centos:8
if: github.event.pull_request.merged == true
needs: [ veer-iss, renode, generate-config, generate-code ]
needs: [ generate-config, generate-code ]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -445,6 +333,8 @@ jobs:
cache_verilator_key=${cache_verilator_restore_key}${{ env.VERILATOR_VERSION }}
cache_spike_restore_key=cache_spike_
cache_spike_key=${cache_spike_restore_key}${{ env.SPIKE_VERSION }}
cache_renode_restore_key=cache_renode_
cache_renode_key=${cache_renode_restore_key}${{ env.RENODE_VERSION }}
cache_test_restore_key=${{ matrix.test }}_${{ matrix.coverage }}_
cache_test_key=${cache_test_restore_key}${time}
cache_code=cache_${{ matrix.test }}_${{ matrix.version }}
Expand All @@ -455,6 +345,8 @@ jobs:
echo "cache_verilator_key=$cache_verilator_key" | tee -a "$GITHUB_ENV"
echo "cache_spike_restore_key=$cache_spike_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_spike_key=$cache_spike_key" | tee -a "$GITHUB_ENV"
echo "cache_renode_restore_key=$cache_renode_restore_key" | tee -a "$GITHUB_ENV"
echo "cache_renode_key=$cache_renode_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"
echo "cache_code=${cache_code}_${{ env.CACHE_HASH }}" | tee -a "$GITHUB_ENV"
Expand Down
3 changes: 1 addition & 2 deletions docs/source/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ The comparison itself is done by `instr_trace_compare.py` in RISCV-DV.
The flow currently supports three ISSs:

* [Spike](https://github.com/riscv-software-src/riscv-isa-sim)
* [VeeR-ISS (a.k.a. whisper)](https://github.com/chipsalliance/VeeR-ISS)
* [Renode](https://renode.io/)

The CI workflow for RISCV-DV builds or downloads the prerequisites (Verilator, Spike, VeeR-ISS, Renode) and invokes the test flow.
The CI workflow for RISCV-DV builds or downloads the prerequisites (Verilator, Spike, Renode) and invokes the test flow.
A failure of any of RISCV-DV tests is reported as CI failure.

### Renode integration
Expand Down
Loading

0 comments on commit 9788122

Please sign in to comment.