-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
257 lines (224 loc) · 6.92 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
257 lines (224 loc) · 6.92 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
# 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
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=$RISCV_GCC_BINROOT:$PATH
- export PATH=$PYENV_BINROOT:$PATH
- export LLVM_INSTALL_DIR=$LLVM_DIR
stages:
- clone
- python_setup
- build_tiles_4
- test_tiles_4
- build_tiles_1
- test_tiles_1
- 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 && 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_v2_tiles_4:
extends: .MAGIA
stage: build_tiles_4
variables:
tiles: 4
target_platform: magia_v2
dependencies:
- clone_magia
magia_v2_tiles_1:
extends: .MAGIA
stage: build_tiles_1
variables:
tiles: 1
target_platform: magia_v2
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_v2_tiles_4:
extends: .build
stage: build_tiles_4
variables:
tiles: 4
target_platform: magia_v2
compiler: GCC_PULP
CMAKE: cmake-3.28.3
dependencies:
- python_gvsoc
build_test_magia_v2_tiles_1:
extends: .build
stage: build_tiles_1
variables:
tiles: 1
target_platform: magia_v2
compiler: GCC_PULP
CMAKE: cmake-3.28.3
dependencies:
- python_gvsoc
.sim:
extends: [.base, .export_path]
script:
- export TESTLOG="${TESTNAME##*/}"
- make run MAGIA_RTL_DIR=$MAGIA platform=${platform} test=$TESTNAME tiles=${tiles} > $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_v2_tiles_4_rtl_sim:
extends: [.sim]
stage: test_tiles_4
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_div, onnx_floor, onnx_relu, onnx_sub]
dependencies:
- clone_magia
- magia_v2_tiles_4
- build_test_magia_v2_tiles_4
magia_v2_tiles_4_gvsoc_sim:
extends: [.sim_gvsoc]
stage: test_tiles_4
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_v2_tiles_4
- clone_gvsoc
- gvsoc_tiles_4
- build_test_magia_v2_tiles_4
- python_gvsoc
magia_v2_tiles_1_rtl_sim:
extends: [.sim]
stage: test_tiles_1
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_div, onnx_floor, onnx_relu, onnx_sub]
dependencies:
- clone_magia
- magia_v2_tiles_1
- build_test_magia_v2_tiles_1
magia_v2_tiles_1_gvsoc_sim:
extends: [.sim_gvsoc]
stage: test_tiles_1
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_v2_tiles_1
- clone_gvsoc
- gvsoc_tiles_1
- build_test_magia_v2_tiles_1
- python_gvsoc
cleanup:
stage: postscript
when: always
script:
- test -n "$CI_PIPELINE_ID"
- rm -rf "$CI_BUILDS_DIR"/*/"$CI_PIPELINE_ID" || true