Add ACT CI #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ACT CI Test | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
ACT-check: | |
name: ACT-check (RV${{ matrix.xlen }}${{ matrix.isa }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
xlen: [32, 64] | |
isa: [RV64IMAFDCSUZicsr_Zicond_Zifencei_Zfa_Zfh_Zca_Zcb_Zba_Zbb_Zbc_Zbkb_Zbkc_Zbkx_Zbs_Zknd_Zkne_Zknh] | |
include: | |
- isa: RV64IMAFDCSUZicsr_Zicond_Zifencei_Zfa_Zfh_Zca_Zcb_Zba_Zbb_Zbc_Zbkb_Zbkc_Zbkx_Zbs_Zknd_Zkne_Zknh | |
misa_lower: 000112D | |
- 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.ISA }}' 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]' | |
riscof 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 }}.html | |
path: ${{ github.workspace }}/riscv-arch-test/riscof-plugins/rv${{ matrix.xlen }}/riscof_work/report.html |