Skip to content

Merge pull request #5 from Peter-Herrmann/tb-speedup #75

Merge pull request #5 from Peter-Herrmann/tb-speedup

Merge pull request #5 from Peter-Herrmann/tb-speedup #75

Workflow file for this run

name: RISC-V Arch Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
setup:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install OSS-CAD-Suite
uses: YosysHQ/setup-oss-cad-suite@v3
- name: Setup Python 3.6
uses: actions/setup-python@v5
with:
python-version: '3.6.7'
- name: Create and activate Python virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
- name: Install RISCOF
run: |
source venv/bin/activate
pip install git+https://github.com/riscv/riscof.git
- name: Install Test Suite
run: |
source venv/bin/activate
riscof --verbose info arch-test --clone
sed -i '158s/TEST_JALR_OP(x7, x0, x4, -0x401, x6, 48,0)/TEST_JALR_OP(x7, x1, x4, -0x401, x6, 48,0)/' riscv-arch-test/riscv-test-suite/rv64i_m/I/src/jalr-01.S
- name: Install RISC-V GNU Toolchain
run: |
wget -nv https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.04.12/riscv64-elf-ubuntu-20.04-gcc-nightly-2024.04.12-nightly.tar.gz -P ~/riscv-toolchain
mkdir -p ${{ github.workspace }}/rv64-gcc
tar -xzf ~/riscv-toolchain/riscv64-elf-ubuntu-20.04-gcc-nightly-2024.04.12-nightly.tar.gz -C ${{ github.workspace }}/rv64-gcc
${{ github.workspace }}/rv64-gcc/riscv/bin/riscv64-unknown-elf-gcc --version
- name: Install Sail RISC-V Emulator
run: |
mkdir -p c_emulator/
tar -xzvf bin/riscv_sim_RV64.tar.gz -C c_emulator/ riscv_sim_RV64
echo "TODO - Gather bare minimum binaries for c_emulator/riscv_sim_RV64 on x64 Ubuntu 20.04 and install into ${{ github.workspace }}"
- name: Verify Dependency Installations
run: |
export PATH=$PATH:${{ github.workspace }}/rv64-gcc/riscv/bin:${{ github.workspace }}/c_emulator/riscv_sim_RV64
source venv/bin/activate
verilator --version
riscv64-unknown-elf-gcc --version
riscof --version
sudo apt-get install lcov -y
- name: Run RISC-V Architectural Tests
run: |
export PATH=$PATH:${{ github.workspace }}/rv64-gcc/riscv/bin:${{ github.workspace }}/c_emulator
source venv/bin/activate
riscof run --no-browser --config=config.ini --suite=${{ github.workspace }}/riscv-arch-test/riscv-test-suite/ --env=${{ github.workspace }}/riscv-arch-test/riscv-test-suite/env
- name: Generate Reports
run: |
echo "Merging Coverage Data..."
cd riscof_work
verilator_coverage --write-info coverage.info rv64i_m/*/src/*/dut/coverage.dat
echo "Generating HTML Coverage Report..."
genhtml coverage.info -s --legend -o coverage
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: reports
path: |
riscof_work/report.html
riscof_work/style.css
riscof_work/coverage/
sim/log.txt
sim/output.vcd
- name: Logs
if: failure()
run: |
tree