-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
453 lines (403 loc) · 11.3 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
453 lines (403 loc) · 11.3 KB
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# Copyright 2025 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE.APACHE for details.
# SPDX-License-Identifier: Apache-2.0
# Author: Alessandro Nadalini <alessandro.nadalini3@unibo.it>
# Alberto Dequino <alberto.dequino@unibo.it>
# Victor Jung <junvi@iis.ee.ethz.ch>
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
variables:
MAGIA: './MAGIA'
RISCV_GCC_BINROOT: /usr/pack/pulpsdk-1.0-kgf/artifactory/pulp-sdk-release/pkg/pulp_riscv_gcc/1.0.16/bin
OPENHW_GCC_BINROOT: /usr/scratch2/lagrev5/anadalini/cv32e40p-gcc-toolchain/bin
PYENV_BINROOT: /home/adequi/.pyenv/bin
LLVM_DIR: /usr/pack/riscv-1.0-kgf/spatz-llvm-2023.08.10/
GIT_CLONE_PATH: "$CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PIPELINE_ID/$CI_JOB_ID"
GIT_STRATEGY: clone
GIT_CLEAN_FLAGS: "-ffdx"
.export_path:
before_script:
- export PATH=$OPENHW_GCC_BINROOT:$PATH
- export PATH=$PYENV_BINROOT:$PATH
- export LLVM_INSTALL_DIR=$LLVM_DIR
stages:
- clone
- python_setup
- build_tiles_4
- build_test_tiles_4_spatz
- test_tiles_4_spatz
- build_test_tiles_4_cluster
- test_tiles_4_cluster
- build_test_tiles_4_spatz+cluster
- test_tiles_4_spatz+cluster
- build_tiles_1
- build_test_tiles_1_spatz
- test_tiles_1_spatz
- build_test_tiles_1_cluster
- test_tiles_1_cluster
- build_test_tiles_1_spatz+cluster
- test_tiles_1_spatz+cluster
- postscript
python_gvsoc:
extends: [.base, .export_path]
stage: python_setup
variables:
UV_CACHE_DIR: "$CI_PROJECT_DIR/.uv-cache"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip-cache"
script:
- eval "$(pyenv init -)"
- pyenv local 3.12
- python -m venv gvsoc_venv
- source gvsoc_venv/bin/activate && pip install uv
- source gvsoc_venv/bin/activate && uv pip install .
artifacts:
paths: [ "gvsoc_venv" ]
.base:
artifacts:
when: always
expire_in: 4 week
clone_magia:
extends: .base
stage: clone
script:
- source scripts/deps.env
- git clone https://github.com/pulp-platform/MAGIA.git
- cd MAGIA && git fetch origin "$MAGIA_COMMIT" && git checkout "$MAGIA_COMMIT"
artifacts:
paths: [ "MAGIA" ]
clone_gvsoc:
extends: .base
stage: clone
script:
- make gvsoc_init
artifacts:
paths: [ "gvsoc" ]
.gvsoc:
extends: [.base]
script:
- source gvsoc_venv/bin/activate && export CC=/usr/sepp/bin/gcc-11.2.0 && export CXX=/usr/sepp/bin/g++-11.2.0 && make gvsoc tiles=${tiles}
artifacts:
paths: [ "gvsoc/install" , "gvsoc/pulp/pulp/chips/magia_v2/arch.py"]
gvsoc_tiles_4:
extends: .gvsoc
stage: build_tiles_4
variables:
tiles: 4
artifacts:
paths: [ "gvsoc/install" ]
dependencies:
- clone_gvsoc
- python_gvsoc
gvsoc_tiles_1:
extends: .gvsoc
stage: build_tiles_1
variables:
tiles: 1
artifacts:
paths: [ "gvsoc/install" ]
dependencies:
- clone_gvsoc
- python_gvsoc
.MAGIA:
extends: [.base]
script:
- make rtl-clean MAGIA_RTL_DIR=$MAGIA
- make MAGIA MAGIA_RTL_DIR=$MAGIA tiles=${tiles} target_platform=${target_platform} fast_sim=1
artifacts:
paths: [ "$MAGIA/work", "$MAGIA/sim/work", "$MAGIA/sim/modelsim.ini", "$MAGIA/scripts/sim_ret_errors.sh", "$MAGIA/scripts/compile.tcl", "$MAGIA/Makefile", "$MAGIA/hw/mesh/magia_pkg.sv", "$MAGIA/hw/tile/magia_tile_pkg.sv" ]
magia_v3_tiles_4:
extends: .MAGIA
stage: build_tiles_4
variables:
tiles: 4
target_platform: magia_v3
dependencies:
- clone_magia
magia_v3_tiles_1:
extends: .MAGIA
stage: build_tiles_1
variables:
tiles: 1
target_platform: magia_v3
dependencies:
- clone_magia
.build:
extends: [.base, .export_path]
script:
- make clean build tiles=${tiles} target_platform=${target_platform} compiler=${compiler} CMAKE=${CMAKE}
artifacts:
paths: [ "build", "targets/${target_platform}/include/addr_map/tile_addr_map.h" ]
build_test_magia_v3_tiles_4_spatz:
extends: .build
stage: build_test_tiles_4_spatz
variables:
tiles: 4
target_platform: magia_v3
compiler: GCC_MULTILIB
CMAKE: cmake-3.28.3
spatz: 1
pulp_cores: 0
dependencies:
- python_gvsoc
build_test_magia_v3_tiles_1_spatz:
extends: .build
stage: build_test_tiles_1_spatz
variables:
tiles: 1
target_platform: magia_v3
compiler: GCC_MULTILIB
CMAKE: cmake-3.28.3
spatz: 1
pulp_cores: 0
dependencies:
- python_gvsoc
build_test_magia_v3_tiles_4_cluster:
extends: .build
stage: build_test_tiles_4_cluster
variables:
tiles: 4
target_platform: magia_v3
compiler: GCC_MULTILIB
CMAKE: cmake-3.28.3
spatz: 0
pulp_cores: 8
dependencies:
- python_gvsoc
build_test_magia_v3_tiles_1_cluster:
extends: .build
stage: build_test_tiles_1_cluster
variables:
tiles: 1
target_platform: magia_v3
compiler: GCC_MULTILIB
CMAKE: cmake-3.28.3
spatz: 0
pulp_cores: 8
dependencies:
- python_gvsoc
build_test_magia_v3_tiles_4_spatz+cluster:
extends: .build
stage: build_test_tiles_4_spatz+cluster
variables:
tiles: 4
target_platform: magia_v3
compiler: GCC_MULTILIB
CMAKE: cmake-3.28.3
spatz: 1
pulp_cores: 8
dependencies:
- python_gvsoc
build_test_magia_v3_tiles_1_spatz+cluster:
extends: .build
stage: build_test_tiles_1_spatz+cluster
variables:
tiles: 1
target_platform: magia_v3
compiler: GCC_MULTILIB
CMAKE: cmake-3.28.3
spatz: 1
pulp_cores: 8
dependencies:
- python_gvsoc
.sim:
extends: [.base, .export_path]
script:
- export TESTLOG="${TESTNAME##*/}"
- make run MAGIA_RTL_DIR=$MAGIA platform=${platform} test=$TESTNAME tiles=${tiles} fast_sim=1 > $TESTLOG.log
- ./scripts/sim_ret_errors.sh $TESTLOG.log
artifacts:
paths: [ "*.log" ]
expire_in: 2 weeks
.sim_gvsoc:
extends: [.base, .export_path]
script:
- export TESTLOG="${TESTNAME##*/}"
- source gvsoc_venv/bin/activate && make run MAGIA_RTL_DIR=$MAGIA platform=${platform} test=$TESTNAME tiles=${tiles} > $TESTLOG.log
- ./scripts/sim_ret_errors_gvsoc.sh $TESTLOG.log
artifacts:
paths: [ "*.log" ]
expire_in: 2 weeks
magia_v3_tiles_4_rtl_sim_spatz:
extends: [.sim]
stage: test_tiles_4_spatz
variables:
platform: rtl
tiles: 4
parallel:
matrix:
- TESTNAME: [test_helloworld, test_fsync_levels, test_fsync_rc, test_fsync_diag, test_mm_is, test_mm_ws, test_mm_os, test_idma_2d, test_idma_1d, test_cemm_global, test_mm_is_2, test_mm_os_2, test_mm_ws_2, test_fsync_lr, test_gemv, test_alloc, onnx_add, onnx_ceil, onnx_clip, onnx_floor, onnx_relu, onnx_sub]
dependencies:
- clone_magia
- magia_v3_tiles_4
- build_test_magia_v3_tiles_4_spatz
magia_v3_tiles_4_gvsoc_sim_spatz:
extends: [.sim_gvsoc]
stage: test_tiles_4_spatz
variables:
platform: gvsoc
tiles: 4
parallel:
matrix:
- TESTNAME: [test_helloworld, test_fsync_levels, test_fsync_rc, test_fsync_diag, test_mm_is, test_mm_ws, test_mm_os, test_idma_2d, test_idma_1d, test_cemm_global, test_mm_is_2, test_mm_os_2, test_mm_ws_2, test_fsync_lr, test_gemv, test_alloc, onnx_add, onnx_ceil, onnx_clip, onnx_div, onnx_floor, onnx_relu, onnx_sub]
dependencies:
- clone_magia
- magia_v3_tiles_4
- clone_gvsoc
- gvsoc_tiles_4
- build_test_magia_v3_tiles_4_spatz
- python_gvsoc
magia_v3_tiles_1_rtl_sim_spatz:
extends: [.sim]
stage: test_tiles_1_spatz
variables:
platform: rtl
tiles: 1
parallel:
matrix:
- TESTNAME: [test_helloworld, test_fsync_levels, test_fsync_rc, test_fsync_diag, test_mm_is, test_mm_ws, test_mm_os, test_idma_2d, test_idma_1d, test_cemm_global, test_mm_is_2, test_mm_os_2, test_mm_ws_2, test_fsync_lr, test_gemv, test_alloc, onnx_add, onnx_ceil, onnx_clip, onnx_floor, onnx_relu, onnx_sub]
dependencies:
- clone_magia
- magia_v3_tiles_1
- build_test_magia_v3_tiles_1_spatz
magia_v2_tiles_1_gvsoc_sim_spatz:
extends: [.sim_gvsoc]
stage: test_tiles_1_spatz
variables:
platform: gvsoc
tiles: 1
parallel:
matrix:
- TESTNAME: [test_helloworld, test_fsync_levels, test_fsync_rc, test_fsync_diag, test_mm_is, test_mm_ws, test_mm_os, test_idma_2d, test_idma_1d, test_cemm_global, test_mm_is_2, test_mm_os_2, test_mm_ws_2, test_fsync_lr, test_gemv, test_alloc, onnx_add, onnx_ceil, onnx_clip, onnx_div, onnx_floor, onnx_relu, onnx_sub]
dependencies:
- clone_magia
- magia_v3_tiles_1
- clone_gvsoc
- gvsoc_tiles_1
- build_test_magia_v3_tiles_1_spatz
- python_gvsoc
magia_v3_tiles_4_rtl_sim_cluster:
extends: [.sim]
stage: test_tiles_4_cluster
variables:
platform: rtl
tiles: 4
parallel:
matrix:
- TESTNAME: [hello_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_4
- build_test_magia_v3_tiles_4_cluster
magia_v3_tiles_4_gvsoc_sim_cluster:
extends: [.sim_gvsoc]
stage: test_tiles_4_cluster
variables:
platform: gvsoc
tiles: 4
parallel:
matrix:
- TESTNAME: [hello_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_4
- clone_gvsoc
- gvsoc_tiles_4
- build_test_magia_v3_tiles_4_cluster
- python_gvsoc
magia_v3_tiles_1_rtl_sim_cluster:
extends: [.sim]
stage: test_tiles_1_cluster
variables:
platform: rtl
tiles: 1
parallel:
matrix:
- TESTNAME: [hello_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_1
- build_test_magia_v3_tiles_1_cluster
magia_v2_tiles_1_gvsoc_sim_cluster:
extends: [.sim_gvsoc]
stage: test_tiles_1_cluster
variables:
platform: gvsoc
tiles: 1
parallel:
matrix:
- TESTNAME: [hello_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_1
- clone_gvsoc
- gvsoc_tiles_1
- build_test_magia_v3_tiles_1_cluster
- python_gvsoc
magia_v3_tiles_4_rtl_sim_spatz+cluster:
extends: [.sim]
stage: test_tiles_4_spatz+cluster
variables:
platform: rtl
tiles: 4
parallel:
matrix:
- TESTNAME: [hello_spatz_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_4
- build_test_magia_v3_tiles_4_spatz+cluster
magia_v3_tiles_4_gvsoc_sim_spatz+cluster:
extends: [.sim_gvsoc]
stage: test_tiles_4_spatz+cluster
variables:
platform: gvsoc
tiles: 4
parallel:
matrix:
- TESTNAME: [hello_spatz_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_4
- clone_gvsoc
- gvsoc_tiles_4
- build_test_magia_v3_tiles_4_spatz+cluster
- python_gvsoc
magia_v3_tiles_1_rtl_sim_spatz+cluster:
extends: [.sim]
stage: test_tiles_1_spatz+cluster
variables:
platform: rtl
tiles: 1
parallel:
matrix:
- TESTNAME: [hello_spatz_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_1
- build_test_magia_v3_tiles_1_spatz+cluster
magia_v2_tiles_1_gvsoc_sim_spatz+cluster:
extends: [.sim_gvsoc]
stage: test_tiles_1_spatz+cluster
variables:
platform: gvsoc
tiles: 1
parallel:
matrix:
- TESTNAME: [hello_spatz_pulp_2, multi_task]
dependencies:
- clone_magia
- magia_v3_tiles_1
- clone_gvsoc
- gvsoc_tiles_1
- build_test_magia_v3_tiles_1_spatz+cluster
- python_gvsoc
cleanup:
stage: postscript
when: always
script:
- test -n "$CI_PIPELINE_ID"
- rm -rf "$CI_BUILDS_DIR"/*/"$CI_PIPELINE_ID" || true