-
Notifications
You must be signed in to change notification settings - Fork 0
333 lines (288 loc) · 10.5 KB
/
scenario-CoupledL2.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
name: scenario-CoupledL2
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
env:
CI_OS_NAME: linux
CI_COMMIT: ${{ github.sha }}
INSTALL_DIR: ${{ github.workspace }}/install
defaults:
run:
shell: bash
working-directory: repo
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_reqeust' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
prebuild-ootb-coupledL2:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
case:
- { id: l2l3, name: L2-L3 }
- { id: l2l3l2, name: L2-L3-L2 }
runs-on: ${{ matrix.os }}
name: Pre-Build | ${{ matrix.case.name }} | OOTB CoupledL2
env:
COUPLEDL2_ARCHIVE: coupledL2-${{ matrix.case.id }}-${{ github.sha }}.tar.gz
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
- name: Checkout CoupledL2
run: git submodule update dut/CoupledL2
- name: Extract submodule SHA
id: get_sha_CoupledL2
run: |
cd dut/CoupledL2
CURRENT_HASH=$(git rev-parse HEAD)
echo "${CURRENT_HASH}"
echo "CURRENT_HASH=${CURRENT_HASH}" >> $GITHUB_ENV
cd ../..
- name: Cache CoupledL2 Build
id: cache
uses: actions/cache@v4
env:
cache-name: coupledL2-cache-${{ env.CURRENT_HASH }}
with:
path: ${{ github.workspace }}/${{ env.COUPLEDL2_ARCHIVE }}
key: coupledL2-cache-${{ env.CURRENT_HASH }}
- name: Checkout submodules
if: steps.cache.outputs.cache-hit != 'true'
run: git submodule update --init --recursive
- name: Setup Scala
if: steps.cache.outputs.cache-hit != 'true'
uses: olafurpg/setup-scala@v10
- name: Setup Mill
if: steps.cache.outputs.cache-hit != 'true'
run: |
sh -c "curl -L https://github.com/com-lihaoyi/mill/releases/download/0.11.1/0.11.1 > /usr/local/bin/mill && chmod +x /usr/local/bin/mill"
- name: Compile
if: steps.cache.outputs.cache-hit != 'true'
run: |
make coupledL2-compile
- name: Build verilog
if: steps.cache.outputs.cache-hit != 'true'
run: |
make coupledL2-verilog-test-top-${{ matrix.case.id }}
- name: Tar up repository
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}
run: tar -zcf ${{ env.COUPLEDL2_ARCHIVE }} repo/dut/CoupledL2/build
setup-verilator:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
compiler:
- { cc: clang-16, cxx: clang++-16 }
- { cc: gcc, cxx: g++ }
exclude:
- { os: ubuntu-20.04, compiler: { cc: gcc, cxx: g++ } }
runs-on: ${{ matrix.os }}
name: Verilator | ${{ matrix.os }} | ${{ matrix.compiler.cc }}
env:
CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ${{ matrix.os }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
VERILATOR_ARCHIVE: verilator-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
steps:
- name: Cache Verilator
id: cache
uses: actions/cache@v4
env:
cache-name: verilator-cache-${{ matrix.os }}-${{ matrix.compiler.cc }}
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
key: verilator-cache-${{ matrix.os }}-${{ matrix.compiler.cc }}
- name: Setup Clang 16
if: steps.cache.outputs.cache-hit != 'true' && matrix.compiler.cc == 'clang-16'
working-directory: ${{ github.workspace }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
- name: Build Verilator
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}
run: |
sudo apt-get install -y git help2man perl python3 make autoconf g++ flex bison clang
sudo apt-get install -y libfl2 # Ubuntu only (ignore if gives error)
sudo apt-get install -y libfl-dev # Ubuntu only (ignore if gives error)
sudo apt-get install -y zlib1g zlib1g-dev # Ubuntu only (ignore if gives error)
git clone https://github.com/verilator/verilator
unset VERILATOR_ROOT
cd verilator
git checkout v5.020
autoconf
./configure CC=${{ matrix.compiler.cc }} CXX=${{ matrix.compiler.cxx }} LINK=${{ matrix.compiler.cxx }}
make -j4
- name: Tar-up Verilator
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}
run: tar -zcf ${{ env.VERILATOR_ARCHIVE }} verilator
build:
needs:
- prebuild-ootb-coupledL2
- setup-verilator
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
case:
- { id: l2l3, name: L2-L3 }
- { id: l2l3l2, name: L2-L3-L2 }
compiler:
- { cc: clang-16, cxx: clang++-16 }
- { cc: gcc, cxx: g++ }
exclude:
- { os: ubuntu-20.04, compiler: { cc: gcc, cxx: g++ } }
runs-on: ${{ matrix.os }}
name: Build | ${{ matrix.case.name }} | ${{ matrix.os }} | ${{ matrix.compiler.cc }}
env:
CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ${{ matrix.os }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
COUPLEDL2_ARCHIVE: coupledL2-${{ matrix.case.id }}-${{ github.sha }}.tar.gz
TLTEST_ARCHIVE: tl-test-new-${{ matrix.case.id }}-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
VERILATOR_ARCHIVE: verilator-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
- name: Setup Clang 16
if: matrix.compiler.cc == 'clang-16'
working-directory: ${{ github.workspace }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
- name: Fetch cached Verilator
uses: actions/cache/restore@v4
env:
cache-name: verilator-cache-${{ matrix.os }}-${{ matrix.compiler.cc }}
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
key: verilator-cache-${{ matrix.os }}-${{ matrix.compiler.cc }}
fail-on-cache-miss: true
- name: Install Verilator
working-directory: ${{ github.workspace }}
run: |
tar -zxf ${{ env.VERILATOR_ARCHIVE }}
cd verilator
sudo make install
verilator --version
- name: Extract submodule SHA
id: get_sha_CoupledL2
working-directory: ${{ github.workspace }}
run: |
cd dut/CoupledL2
CURRENT_HASH=$(git rev-parse HEAD)
echo "${CURRENT_HASH}"
echo "CURRENT_HASH=${CURRENT_HASH}" >> $GITHUB_ENV
- name: Fetch cached CoupledL2
id: cache
uses: actions/cache/restore@v4
env:
cache-name: coupledL2-cache-${{ env.CURRENT_HASH }}
with:
path: ${{ github.workspace }}/${{ env.COUPLEDL2_ARCHIVE }}
key: coupledL2-cache-${{ env.CURRENT_HASH }}
fail-on-cache-miss: true
- name: Unpack CoupledL2 artifact
working-directory: ${{ github.workspace }}
run: tar -zxf ${{ env.COUPLEDL2_ARCHIVE }}
- name: Verilate CoupledL2
run: |
make THREADS_BUILD=4 coupledL2-verilate
- name: Configurate TL-Test-New for CoupledL2
run: |
make THREADS_BUILD=4 tltest-config-coupledL2-test-${{ matrix.case.id }}
- name: Build TL-Test-New for CoupledL2
run: |
make THREADS_BUILD=4 tltest-build-all
- name: Tar up repository
working-directory: ${{ github.workspace }}
run: tar -zcf ${{ env.TLTEST_ARCHIVE }} repo/main/build repo/configs repo/scripts repo/Makefile
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.TLTEST_ARCHIVE }}
name: ${{ env.TLTEST_ARCHIVE }}
run:
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
case:
- { id: l2l3, name: L2-L3 , mode: FUZZ_ARI }
- { id: l2l3l2, name: L2-L3-L2, mode: FUZZ_ARI }
- { id: l2l3, name: L2-L3 , mode: FUZZ_STREAM }
- { id: l2l3l2, name: L2-L3-L2, mode: FUZZ_STREAM }
compiler:
- { cc: clang-16, cxx: clang++-16 }
- { cc: gcc, cxx: g++ }
exclude:
- { os: ubuntu-20.04, compiler: { cc: gcc, cxx: g++ } }
runs-on: ${{ matrix.os }}
name: Run | ${{ matrix.case.name }} | ${{ matrix.case.mode }} | ${{ matrix.os }} | ${{ matrix.compiler.cc }}
env:
CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ${{ matrix.os }}
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
TLTEST_ARCHIVE: tl-test-new-${{ matrix.case.id }}-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
RUN_ARCHIVE: tl-test-new-run-${{ matrix.case.id }}-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz
steps:
- name: Setup Clang 16
if: matrix.compiler.cc == 'clang-16'
working-directory: ${{ github.workspace }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.TLTEST_ARCHIVE }}
path: ${{ github.workspace }}
- name: Unpack artifact
working-directory: ${{ github.workspace }}
run: tar -zxvf ${{ env.TLTEST_ARCHIVE }}
- name: Setup mode configuration FUZZ_ARI
if: matrix.case.mode == 'FUZZ_ARI'
run: |
pwd
ls
sed -i 's/mode.0.*/mode.0 = FUZZ_ARI/g' ./configs/user.tltest.ini
sed -i 's/mode.1.*/mode.1 = FUZZ_ARI/g' ./configs/user.tltest.ini
cat ./configs/user.tltest.ini
- name: Setup mode configuration FUZZ_STREAM
if: matrix.case.mode == 'FUZZ_STREAM'
run: |
pwd
ls
sed -i 's/mode.0.*/mode.0 = FUZZ_STREAM/g' ./configs/user.tltest.ini
sed -i 's/mode.1.*/mode.1 = FUZZ_STREAM/g' ./configs/user.tltest.ini
cat ./configs/user.tltest.ini
- name: Run TL-Test-New for CoupledL2
run: |
make run
# - name: Tar up repository
# working-directory: ${{ github.workspace }}
# run: tar -zcf ${{ env.RUN_ARCHIVE }} repo
# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# path: ${{ github.workspace }}/${{ env.RUN_ARCHIVE }}
# name: ${{ env.RUN_ARCHIVE }}