Skip to content

Build Spike

Build Spike #97

Workflow file for this run

name: Build Spike
on:
schedule:
# 6am UTC is 7am Central European Time (CET) or 8am Central European Summer Time (CEST).
- cron: '0 7 * * SAT'
workflow_dispatch:
jobs:
Build_Spike:
runs-on: ubuntu-22.04
strategy:
matrix:
spike_ref:
- master
pk_ref:
- 1a52fa44aba49307137ea2ad5263613da33a877b
steps:
- uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "today=$(date +'%Y-%m-%d')" > $GITHUB_OUTPUT
- name: Download Cached GCC Binaries
id: cache-gcc
uses: actions/cache@v4
env:
cache-name: cache-gcc-binaries
with:
path: ./Toolchain
fail-on-cache-miss: true
key: gcc-binaries-${{ steps.date.outputs.date }}
restore-keys: |
gcc-binaries-
- name: Setup Spike Cache
id: cache-Spike
uses: actions/cache@v4
env:
cache-name: cache-spike-binaries
with:
path: ./Sim/Spike/bin
key: spike-binaries-${{ steps.date.outputs.date }}
- name: Install BOOST
run: |
sudo apt-get install libboost-all-dev
ls /usr/lib/x86_64-linux-gnu | grep regex
- name: Clone Spike Repo
working-directory: ./Sim/Spike
run: |
git clone https://github.com/riscv-software-src/riscv-isa-sim.git
git -C ./Sim/Spike/riscv-isa-sim checkout ${{ matrix.spike_ref }}
- name: Build Spike
working-directory: ./Sim/Spike/riscv-isa-sim
run: |
export RISCV=/home/runner/work/muriscv-nn/muriscv-nn/Toolchain/rv32gcv
export PATH=$PATH:$RISCV/bin
echo $PATH
sudo apt-get install device-tree-compiler
mkdir build
cd build
../configure --prefix=$RISCV
make -j$(nproc)
sudo make install
- name: Clone PK Repo
working-directory: ./Sim/Spike
run: |
git clone https://github.com/riscv-software-src/riscv-pk.git
git -C ./Sim/Spike/riscv-pk checkout ${{ matrix.pk_ref }}
- name: Build PK for ilp32d
working-directory: ./Sim/Spike/riscv-pk
run: |
export RISCV=/home/runner/work/muriscv-nn/muriscv-nn/Toolchain/rv32gcv
export PATH=$PATH:$RISCV/bin
echo $PATH
mkdir build
cd build
../configure --prefix=$RISCV --host=riscv32-unknown-elf --with-arch=rv32gcv_zicsr_zifencei --with-abi=ilp32d
make -j$(nproc)
sudo make install
- name: Copy Spike and PK binaries to correct location
working-directory: ./Sim/Spike/bin
run: |
cp ../riscv-isa-sim/build/spike spike
cp ../riscv-pk/build/pk pk_ilp32d
ls
- name: Build PK for ilp32
working-directory: ./Sim/Spike/riscv-pk
run: |
rm -r build
export RISCV=/home/runner/work/muriscv-nn/muriscv-nn/Toolchain/rv32imv
export PATH=$PATH:$RISCV/bin
echo $PATH
mkdir build
cd build
../configure --prefix=$RISCV --host=riscv32-unknown-elf --with-arch=rv32imv_zicsr_zifencei --with-abi=ilp32
make -j$(nproc)
sudo make install
- name: PK Binary to correct location
working-directory: ./Sim/Spike/bin
run: |
cp ../riscv-pk/build/pk pk_ilp32
ls