seal5-event #4
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: Build and Run ETISS RISCV Examples | |
on: | |
repository_dispatch: | |
types: [ seal5-event ] | |
env: | |
BUILD_TYPE: Release | |
SEAL5_PREBUILT_DIR: /home/runner/work/seal5_prebuilt/release | |
ETISS_PREBUILT_DIR: /home/runner/work/etiss_prebuilt | |
RISCV_GCC_PREFIX: ${{ github.workspace }}/../gnu | |
RISCV_GCC_NAME: riscv32-unknown-elf | |
ARCH: rv32im_zicsr_zifencei_xs4emac | |
ETISS_ARCH: RV32IMCXS4EMAC | |
PROG: s4emac | |
ABI: ilp32 | |
jobs: | |
compile-riscv-examples: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download Cached Seal5 Binaries | |
id: cache-seal5 | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-seal5-binaries | |
with: | |
path: /home/runner/work/seal5_prebuilt | |
key: seal5-binaries-${{ steps.date.outputs.date }} | |
restore-keys: | | |
seal5-binaries- | |
- if: ${{ steps.cache-seal5.outputs.cache-hit != 'true' && github.event_name == 'repository_dispatch' }} | |
name: Download Seal5 Pre-built | |
uses: actions/download-artifact@v4 | |
with: | |
name: demo-install | |
github-token: ${{ secrets.SEAL5_ACCESS_TOKEN }} | |
repository: tum-ei-eda/seal5 | |
path: /home/runner/work/seal5_prebuilt | |
run-id: ${{ github.event.client_payload.triggered_run_id }} | |
- name: Download Cached GCC Binaries | |
id: cache-gcc | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-gcc-binaries | |
with: | |
path: ../gnu | |
key: gcc-binaries-${{ steps.date.outputs.date }} | |
restore-keys: | | |
gcc-binaries- | |
- if: ${{ steps.cache-gcc.outputs.cache-hit != 'true' }} | |
name: Download RISCV-GNU-Toolchain | |
# TODO: skip step on cache match | |
run: | | |
cd .. | |
wget https://syncandshare.lrz.de/dl/fi2p5Ds5PHktjmZGKzR9tx/GCC/default/2024.09.03/Ubuntu/22.04/rv32im_zicsr_zifencei_ilp32.tar.xz | |
mkdir gnu | |
cd gnu | |
tar xvf ../rv32im_zicsr_zifencei_ilp32.tar.xz | |
cd .. | |
rm rv32im_zicsr_zifencei_ilp32.tar.xz | |
- name: Build ETISS RISCV Examples for Testing | |
run: | | |
sudo apt -qq install -y build-essential make clang g++ git cmake libboost-system-dev libboost-filesystem-dev libboost-program-options-dev | |
export PATH=$RISCV_GCC_PREFIX/bin/:$SEAL5_PREBUILT_DIR/bin/:/home/runner/work/etiss_prebuilt/bin:$PATH | |
export LD_LIBRARY_PATH=/home/runner/work/etiss_prebuilt/lib:/home/runner/work/etiss_prebuilt/lib/plugins:$LD_LIBRRARY_PATH | |
chmod +x $SEAL5_PREBUILT_DIR/bin/* | |
cd ${{ github.workspace }} | |
mkdir build && cd build | |
cmake -DCMAKE_TOOLCHAIN_FILE=rv32gc-llvm-toolchain.cmake -DRISCV_TOOLCHAIN_PREFIX=$RISCV_GCC_PREFIX -DCMAKE_INSTALL_PREFIX=../install -DRISCV_ARCH=$ARCH -DRISCV_ABI=$ABI -DRISCV_TOOLCHAIN_PREFIX=$RISCV_GCC_PREFIX -DRISCV_TOOLCHAIN_BASENAME=$RISCV_GCC_NAME .. | |
make -j$(nproc) install | |
make install | |
- name: Upload ETISS RISCV Built Example Files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: etiss-riscv-examples-prebuilt | |
path: | | |
install | |
run-riscv-examples: | |
runs-on: ubuntu-latest | |
needs: compile-riscv-examples | |
steps: | |
- name: Download Pre-built ETISS Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: etiss_prebuilt | |
github-token: ${{ secrets.SEAL5_ACCESS_TOKEN }} | |
path: /home/runner/work/etiss_prebuilt | |
repository: tum-ei-eda/etiss_riscv_test_env | |
run-id: ${{ github.event.client_payload.etiss_run_id }} | |
- name: Download ETISS RISCV Examples Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: etiss-riscv-examples-prebuilt | |
github-token: ${{ secrets.SEAL5_ACCESS_TOKEN }} | |
path: install | |
- name: Run ETISS Default Configuration Test | |
run: | | |
sudo apt -qq install -y build-essential make clang g++ git cmake libboost-system-dev libboost-filesystem-dev libboost-program-options-dev | |
chmod +x $ETISS_PREBUILT_DIR/bin/bare_etiss_processor | |
export LD_LIBRARY_PATH=/home/runner/work/etiss_prebuilt/lib:/home/runner/work/etiss_prebuilt/lib/plugins:$LD_LIBRRARY_PATH | |
export PATH=$RISCV_GCC_PREFIX/bin/:$SEAL5_PREBUILT_DIR/bin/:/home/runner/work/etiss_prebuilt/bin:$PATH | |
bare_etiss_processor -iinstall/ini/s4emac.ini --arch.cpu=$ETISS_ARCH |