-
Notifications
You must be signed in to change notification settings - Fork 8
149 lines (132 loc) · 4.39 KB
/
build_spike.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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:
- abadfdc507d5a75b6272dc360e70a80a510c758a
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- uses: actions/checkout@v4
- name: Get dates
id: dates
run: |
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "yesterday=$(date +'%Y-%m-%d' -d yesterday)" >> $GITHUB_OUTPUT
echo "date=$(date +'%Y-%m-%d' -d 'last saturday')" >> $GITHUB_OUTPUT
- name: Download Cached GCC Binaries
id: cache-gcc
uses: actions/cache/restore@v4
env:
cache-name: cache-gcc-binaries
with:
path: |
./Toolchain
!./Toolchain/*.sh
fail-on-cache-miss: true
key: gcc-binaries-${{ steps.dates.outputs.today }}
restore-keys: |
gcc-binaries-${{ steps.dates.outputs.yesterday }}
gcc-binaries-${{ steps.dates.outputs.date }}
gcc-binaries-
- 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 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 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/rv32gc
export PATH=$PATH:$RISCV/bin
echo $PATH
mkdir build
cd build
../configure --prefix=$RISCV --host=riscv32-unknown-elf --with-arch=rv32gc_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 lp64d
working-directory: ./Sim/Spike/riscv-pk
run: |
rm -r build
export RISCV=/home/runner/work/muriscv-nn/muriscv-nn/Toolchain/rv64gc
export PATH=$PATH:$RISCV/bin
echo $PATH
mkdir build
cd build
../configure --prefix=$RISCV --host=riscv64-unknown-elf --with-arch=rv64gc_zicsr_zifencei --with-abi=lp64d
make -j$(nproc)
sudo make install
- name: Copy Spike and PK binaries to correct location
working-directory: ./Sim/Spike/bin
run: |
cp ../riscv-pk/build/pk pk_lp64d
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/rv32im_zve32x
export PATH=$PATH:$RISCV/bin
echo $PATH
mkdir build
cd build
../configure --prefix=$RISCV --host=riscv32-unknown-elf --with-arch=rv32im_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
- name: Setup Spike Cache
id: cache-Spike
uses: actions/cache/save@v4
env:
cache-name: cache-spike-binaries
with:
path: ./Sim/Spike/bin
key: spike-binaries-${{ steps.dates.outputs.today }}