Skip to content

seal5-event

seal5-event #6

name: Build and Run ETISS RISCV Examples
on:
repository_dispatch:
types: [ seal5-event ]
env:
SEAL5_PREBUILT_DIR: /home/runner/work/seal5_prebuilt/release
ETISS_PREBUILT_DIR: /home/runner/work/etiss_prebuilt
PROG: s4emac
jobs:
compile-riscv-examples:
runs-on: ubuntu-${{ matrix.ubuntu-version }}
strategy:
fail-fast: false
matrix:
ubuntu-version:
- 22
build_type:
- Release
- Debug
tc:
- {version: 2024.09.03, variant: rv32im_zicsr_zifencei_ilp32, name: riscv32-unknown-elf, arch: rv32im_zicsr_zifencei_s4emac, abi: ilp32}
- {version: 2024.09.03_gcc14, variant: rv32im_zicsr_zifencei_ilp32, name: riscv32-unknown-elf, arch: rv32im_zicsr_zifencei_s4emac, abi: ilp32}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get current date
run: |
echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
id: date
- 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-${{ matrix.os }}-${{ steps.date.outputs.date }}
restore-keys: |
seal5-binaries-${{ matrix.os }}-
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 # TODO: add ubuntu version to artifact name
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-${{ matrix.os }}-${{ matrix.tc.version }}-${{ matrix.tc.variant }}-${{ steps.date.outputs.date }}
restore-keys: |
gcc-binaries-${{ matrix.os }}-${{ matrix.tc.version }}-${{ matrix.tc.variant }}
gcc-binaries-${{ matrix.os }}
gcc-binaries-
- if: ${{ steps.cache-gcc.outputs.cache-hit != 'true' }}
name: Download RISCV-GNU-Toolchain
# TODO: skip step on cache match
run: |
wget https://syncandshare.lrz.de/dl/fi2p5Ds5PHktjmZGKzR9tx/GCC/default/${{ matrix.tc.version }}/Ubuntu/${{ matrix.ubuntu-version }}.04/${{ matrix.tv.variant }}.tar.xz
mkdir gnu
cd gnu
tar xvf ../${{ matrix.tc.variant }}.tar.xz
cd ..
rm ${{ matrix.tc.variant }}.tar.xz
- name: Setup Dependencies
run: |
sudo apt -qq install -y cmake
# TODO: install llvm/clang if no seal5 trigger?
- name: Build ETISS RISCV Examples for Testing
run: |
export PATH=$SEAL5_PREBUILT_DIR/bin/
chmod +x $SEAL5_PREBUILT_DIR/bin/*
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=rv32gc-llvm-toolchain.cmake -DBUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DRISCV_ARCH=${{ matrix.tc.arch }} -DRISCV_ABI=${{ matrix.tc.abi }} -DRISCV_TOOLCHAIN_PREFIX=$(pwd)/gnu/ -DRISCV_TOOLCHAIN_BASENAME=${{ matrix.tc.name }} ..
cmake --build build -j$(nproc)
cmake --install build
- name: Upload ETISS RISCV Built Example Files
uses: actions/upload-artifact@v4
with:
name: etiss-riscv-examples-prebuilt-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.tc.version }}-${{ matrix.tc.variant }}-${{ matrix.tc.arch }}-${{ matrix.tc.abi }}
path: install/
run-riscv-examples:
needs: compile-riscv-examples
runs-on: ubuntu-${{ matrix.ubuntu-version }}
strategy:
fail-fast: false
matrix:
ubuntu-version:
- 22
build_type:
- Release
- Debug
tc:
- {version: 2024.09.03, variant: rv32im_zicsr_zifencei_ilp32, name: riscv32-unknown-elf, arch: rv32im_zicsr_zifencei_s4emac, abi: ilp32}
- {version: 2024.09.03_gcc14, variant: rv32im_zicsr_zifencei_ilp32, name: riscv32-unknown-elf, arch: rv32im_zicsr_zifencei_s4emac, abi: ilp32}
config:
- {prog: hello_world, etiss_arch: RV32IMCXS4EMAC}
- {prog: s4emac, etiss_arch: RV32IMCXS4EMAC}
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-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.tc.version }}-${{ matrix.tc.variant }}-${{ matrix.tc.arch }}-${{ matrix.tc.abi }}
github-token: ${{ secrets.SEAL5_ACCESS_TOKEN }}
path: install
- name: Setup Dependencies
run: |
sudo apt -qq install -y libboost-system-dev libboost-filesystem-dev libboost-program-options-dev
# TODO: install llvm/clang if no seal5 trigger?
- name: Run ETISS Example ${{ matrix.config.prog }} on ${{ matrix.config.etiss_arch }}
run: |
chmod +x $ETISS_PREBUILT_DIR/bin/bare_etiss_processor
export LD_LIBRARY_PATH=$ETISS_PREBUILT_DIR/lib:$ETISS_PREBUILT_DIR/lib/plugins:$LD_LIBRRARY_PATH
export PATH=$ETISS_PREBUILT_DIR/bin/:$PATH
bare_etiss_processor -iinstall/ini/${{ matrix.config.prog }}.ini --arch.cpu=${{ matrix.config.etiss_arch }}