forked from riscv/sail-riscv
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81b0bf9
commit 4d4021a
Showing
1 changed file
with
81 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: ACT CI Test | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
|
||
ACT-check: | ||
name: ACT-check (RV${{ matrix.xlen }}) | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
xlen: [32, 64] | ||
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-20.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 }} | ||
riscof run --config config.ini --suite ../../riscv-test-suite/rv${{ matrix.xlen }}i_m/ --env ../../riscv-test-suite/env |