Skip to content

Commit

Permalink
Add ACT CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancarlin committed Oct 19, 2024
1 parent 81b0bf9 commit a30d9f0
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/act-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: ACT CI Test

on: [push, pull_request, workflow_dispatch]

jobs:

ACT-check:
name: ACT-check (RV${{ matrix.xlen }}${{ matrix.extensions }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
xlen: [32, 64]
extensions: [IMAFDCSUZicsr_Zicond_Zifencei_Zfa_Zfh_Zca_Zcb_Zba_Zbb_Zbc_Zbkb_Zbkc_Zbkx_Zbs_Zknd_Zkne_Zknh]
include:
- extensions: IMAFDCSUZicsr_Zicond_Zifencei_Zfa_Zfh_Zca_Zcb_Zba_Zbb_Zbc_Zbkb_Zbkc_Zbkx_Zbs_Zknd_Zkne_Zknh
misa_lower: 014112D
- xlen: 32
misa_upper: 4
- xlen: 64
misa_upper: 800000000

steps:
- name: Check out repository code
uses: actions/checkout@HEAD
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-venv
sudo apt-get install -y gcc git autoconf automake libtool curl make unzip
sudo apt-get install -y autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev pkg-config
sudo apt-get install -y device-tree-compiler libboost-regex-dev libboost-system-dev
pip3 install git+https://github.com/riscv/riscof.git
- name: Get RISCV-GNU Toolchain (${{ matrix.xlen }} bit)
run: |
wget -c https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.09.03/riscv${{ matrix.xlen }}-elf-ubuntu-22.04-gcc-nightly-2024.09.03-nightly.tar.gz
tar -xzf riscv${{ matrix.xlen }}-elf-ubuntu-22.04-gcc-nightly-2024.09.03-nightly.tar.gz
echo $GITHUB_WORKSPACE/riscv/bin >> $GITHUB_PATH
- name: Setup riscv-arch-test
run: |
git clone https://github.com/riscv-non-isa/riscv-arch-test.git
cd riscv-arch-test/riscv-isac
pip3 install --editable .
cd ../riscv-ctg
pip3 install --editable .
# Install Spike
- name: Get Latest Spike Commit
run: |
SPIKE_HASH=$(git ls-remote https://github.com/riscv/riscv-isa-sim.git HEAD | awk '{ print $1}')
echo "SPIKE_HASH=$SPIKE_HASH" >> "$GITHUB_ENV"
- name: Restore cached Spike
id: cache-spike-restore
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/spike
key: spike-${{ env.SPIKE_HASH }}-RV${{ matrix.xlen }}
- name: Install Spike
if: steps.cache-spike-restore.outputs.cache-hit != 'true'
run: |
git clone https://github.com/riscv/riscv-isa-sim.git
cd riscv-isa-sim
mkdir build
cd build
../configure --prefix=$GITHUB_WORKSPACE/spike
make -j$(nproc)
make install
- name: Save cached Spike
if: steps.cache-spike-restore.outputs.cache-hit != 'true'
id: cache-spike-save
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/spike
key: ${{ steps.cache-spike-restore.outputs.cache-primary-key }}
- name: Add Spike to PATH
run: |
echo $GITHUB_WORKSPACE/spike/bin >> $GITHUB_PATH
# Install Sail
- name: Install sail from binary
run: |
sudo mkdir -p /usr/local
curl --location https://github.com/rems-project/sail/releases/download/0.18-linux-binary/sail.tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
- name: Build Sail Model
run: |
ARCH=RV${{ matrix.xlen }} make
echo $GITHUB_WORKSPACE/c_emulator >> $GITHUB_PATH
# Run tests
- name: Config and run riscof for RV${{ matrix.xlen }}
run: |
cd riscv-arch-test/riscof-plugins/rv${{ matrix.xlen }}
sed -i '/^ ISA: /c\ ISA: RV${{ matrix.xlen }}${{ matrix.extensions }}' spike_simple/spike_simple_isa.yaml
sed -i '/^ reset-val: /c\ reset-val: 0x${{ matrix.misa_upper }}${{ matrix.misa_lower }}' spike_simple/spike_simple_isa.yaml
sed -i '/^ - extensions[25:0]/c\ - extensions[25:0] bitmask [0x${{ matrix.misa_lower}}, 0x0000000]' spike_simple/spike_simple_isa.yaml
riscof --verbose debug run --config config.ini --suite ../../riscv-test-suite/rv${{ matrix.xlen }}i_m/ --env ../../riscv-test-suite/env
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: act-tests-${{ matrix.xlen }}${{ matrix.extensions }} #.html
path: ${{ github.workspace }}/riscv-arch-test/riscof-plugins/rv${{ matrix.xlen }}/riscof_work #/report.html

0 comments on commit a30d9f0

Please sign in to comment.