forked from pulp-platform/hero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
345 lines (323 loc) · 12.1 KB
/
.gitlab-ci.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
334
335
336
337
338
339
340
341
342
343
344
345
variables:
DOWNSTREAM: "false"
GIT_SUBMODULE_STRATEGY: recursive
HERO_INSTALL: '$CI_PROJECT_DIR/install'
RUST_LOG: 'memora=debug'
PATH: '/home/gitlabci/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/condor/bin:/usr/sepp/bin'
workflow:
rules:
- if: '$CI_COMMIT_BRANCH =~ /^upstream-/'
when: never # do not run branch pipelines for the CI-generated `upstream-` branches
- when: always # default rule, run job if no previous rule matched
before_script:
- env
- mkdir -p $HERO_INSTALL
- |
git config --local user.name 'GitLab CI at IIS'
git config --local user.email '[email protected]'
- >
if [ "$DOWNSTREAM" = "true" ]; then
# This is a downstream job, i.e., it has been triggered as part of an upstream pipeline.
# First, make sure that the commit of the upstream repository is available. That commit might
# exist only on GitLab.
if [ "$SUBMODULE_NAME" = "llvm-project" ]; then
cd toolchain/llvm-project
git remote set-url origin [email protected]:iis-compilers/llvm-project.git
else
echo "Error: Unknown submodule '$SUBMODULE_NAME' for downstream pipeline!"
exit 1
fi
git fetch origin
cd -
# Second, check out the branch for the tuple of commit in this repository and commit in the
# upstream repository. This branch is created by the `pre-downstream-checkout` job.
if [ "$CI_JOB_NAME" != "pre-downstream-checkout" ]; then
branch="upstream-$SUBMODULE_NAME-$SUBMODULE_COMMIT_SHA-for-$CI_COMMIT_SHA"
git checkout --quiet --recurse-submodules "$branch"
echo "Checked out '$branch', which has the following commit:"
git show
fi
fi
after_script:
- chmod -R u+w $HERO_INSTALL
stages:
- build1
- build2
- build3
- build4
- test
pre-downstream-checkout:
stage: .pre
script:
- |
if [ "$DOWNSTREAM" = "true" ]; then
# This is a downstream pipeline, so we need to create a branch with a commit that applies
# the upstream update.
branch="upstream-$SUBMODULE_NAME-$SUBMODULE_COMMIT_SHA-for-$CI_COMMIT_SHA"
git checkout -b "$branch"
if [ "$SUBMODULE_NAME" = "llvm-project" ]; then
submodule_path=toolchain/llvm-project
else
echo "Error: Unknown submodule '$SUBMODULE_NAME' for downstream pipeline!"
exit 1
fi
cd "$submodule_path"
git checkout --recurse-submodules "$SUBMODULE_COMMIT_SHA"
cd -
git add "$submodule_path"
git commit -m "$submodule_path: Update to upstream $SUBMODULE_COMMIT_SHA"
git remote set-url origin [email protected]:hero/hero.git
git push origin "$branch"
fi
tc-pulp:
stage: build1
needs: ["pre-downstream-checkout"]
script:
- >
if ! $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup tc-pulp; then
make tc-pulp
chmod -R u+w $HERO_INSTALL
$CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert tc-pulp
fi
tc-har-olinux:
stage: build1
needs: ["pre-downstream-checkout"]
script:
- >
if ! $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup tc-har-olinux; then
make tc-har-olinux
chmod -R u+w $HERO_INSTALL
$CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert tc-har-olinux
fi
tc-hrv-olinux:
stage: build1
needs: ["pre-downstream-checkout"]
script:
- >
if ! $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup tc-hrv-olinux; then
make tc-hrv-olinux
chmod -R u+w $HERO_INSTALL
$CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert tc-hrv-olinux
fi
vsim-pulp:
stage: build1
needs: ["pre-downstream-checkout"]
script:
- >
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup vsim-pulp; then
exit 0
fi
- cd hardware
- make
- cd vsim
- ./compile.sh
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert vsim-pulp
sdk-pulp-and-sdk-har-and-prem:
stage: build2
needs: ["tc-pulp", "tc-har-olinux"]
script:
- >
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup sdk-pulp-and-sdk-har; then
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup sdk-pulp-and-sdk-har-prem; then
exit 0
fi
fi
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-har-olinux
- chmod -R u-w $HERO_INSTALL
- make sdk-pulp # TODO: `sdk-pulp-har` does not seem to work?
- make sdk-har
- chmod -R u+w $HERO_INSTALL
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert sdk-pulp-and-sdk-har
- rm -r "$HERO_INSTALL/aarch64-buildroot-linux-gnu" # To allow new install
- chmod -R u-w $HERO_INSTALL
- make prem-set
- make sdk-har
- chmod -R u+w $HERO_INSTALL
- test -f $CI_PROJECT_DIR/output/br-har/target/usr/bin/cmux
- test -f $HERO_INSTALL/aarch64-buildroot-linux-gnu/sysroot/usr/bin/cmux
- test -f $CI_PROJECT_DIR/output/br-har/target/usr/lib/libpremnotify.so
- test -f $HERO_INSTALL/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libpremnotify.so
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert sdk-pulp-and-sdk-har-prem
sdk-pulp-and-sdk-hrv:
stage: build2
needs: ["tc-pulp", "tc-hrv-olinux"]
script:
- >
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup sdk-pulp-and-sdk-hrv; then
exit 0
fi
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-hrv-olinux
- chmod -R u-w $HERO_INSTALL
- make sdk-pulp-hrv
- make sdk-hrv
- chmod -R u+w $HERO_INSTALL
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert sdk-pulp-and-sdk-hrv
tc-llvm:
stage: build3
needs: ["sdk-pulp-and-sdk-har-and-prem"]
script:
- >
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup tc-llvm; then
.gitlab-ci.d/llvm-project-update-hero-branch.sh
exit 0
fi
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get sdk-pulp-and-sdk-har
- chmod -R u-w $HERO_INSTALL
- export CXX=/usr/pack/gcc-9.2.0-af/linux-x64/bin/g++ # LLVM 12 needs 5.1+
- export CC=/usr/pack/gcc-9.2.0-af/linux-x64/bin/gcc # LLVM 12 needs 5.1+
- make tc-llvm
- unset CXX # Cleanup after LLVM 12 build
- unset CC # Cleanup after LLVM 12 build
- git diff --exit-code # assert that applied patches made no difference
- chmod -R u+w $HERO_INSTALL
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert tc-llvm
- .gitlab-ci.d/llvm-project-update-hero-branch.sh
bitstream-zcu102:
stage: build3
needs: ["pre-downstream-checkout"]
script:
- >
if ! $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup bitstream-zcu102; then
cd hardware/fpga
make hero_exilzcu102
$CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert bitstream-zcu102
fi
br-har-exilzcu102-and-prem:
stage: build4
needs: ["bitstream-zcu102", "tc-har-olinux", "tc-pulp"]
script:
- >
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup br-har-exilzcu102; then
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup br-har-exilzcu102-prem; then
exit 0
fi
fi
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get bitstream-zcu102
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-har-olinux
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-pulp # required to build PULP SDK
- chmod -R u-w $HERO_INSTALL
- make sdk-pulp # TODO: `sdk-pulp-har` does not seem to work?
- echo "BR2_HERO_BITSTREAM=$CI_PROJECT_DIR/hardware/fpga/hero_exilzcu102/hero_exilzcu102.runs/impl_1/hero_exilzcu102_wrapper.bit" >> local.cfg
- make br-har-exilzcu102
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert br-har-exilzcu102
- make prem-set
- make br-har-exilzcu102
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert br-har-exilzcu102-prem
br-hrv-ediggenesys2:
stage: build4
needs: ["tc-hrv-olinux"]
script:
- >
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup br-hrv-ediggenesys2; then
exit 0
fi
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-hrv-olinux
- chmod -R u-w $HERO_INSTALL
- make br-hrv-ediggenesys2
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert br-hrv-ediggenesys2
br-hrv-eqemu:
stage: build4
needs: ["tc-hrv-olinux"]
script:
- >
if $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh lookup br-hrv-eqemu; then
exit 0
fi
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-hrv-olinux
- chmod -R u-w $HERO_INSTALL
- make br-hrv-eqemu
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh insert br-hrv-eqemu
test-zcu102-examples:
stage: test
needs: ["vsim-pulp", "tc-pulp", "tc-har-olinux", "tc-llvm", "sdk-pulp-and-sdk-har-and-prem"]
script:
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get vsim-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-har-olinux
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-llvm
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get sdk-pulp-and-sdk-har
- chmod -R u-w $HERO_INSTALL
- make sdk-pulp # PULP SDK is not relocatable
- source env/exilzcu102.sh
## build examples
- >
for d in helloworld mm-large mm-small; do
make -C openmp-examples/$d all
done
## test benchmarks: compile
- >
for d in openmp-examples/polybench-acc/*/; do
if [ $(basename $d) = "common" ]; then
continue
fi
make -C $d only=pulp clean all
make -C $d clean all
done
## test benchmarks: simulate
- source env/esim-exilzcu102.sh
- >
for d in openmp-examples/polybench-acc/*/; do
if [ $(basename $d) = "common" ]; then
continue
fi
make -C $d only=pulp clean all
.gitlab-ci.d/verify-bench.sh $(basename $d)
done
- echo "Cycle counts for Polybench:"
- cat vsim-polybench-perf-stats.txt
- >
for d in openmp-examples/polybench-acc/*/; do
if [ $(basename $d) = "common" ]; then
continue
fi
.gitlab-ci.d/track-pbench-perf.sh $(basename $d)
done
allow_failure:
exit_codes: 4
compiler-smoketest:
stage: test
needs: ["tc-pulp", "tc-har-olinux", "tc-llvm", "sdk-pulp-and-sdk-har-and-prem"]
script:
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-har-olinux
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-llvm
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get sdk-pulp-and-sdk-har
- chmod -R u-w $HERO_INSTALL
- make sdk-pulp # PULP SDK is not relocatable
- source env/exilzcu102.sh
- .gitlab-ci.d/compiler-smoketest.sh
compiler-smoketest-prem:
stage: test
needs: ["tc-pulp", "tc-har-olinux", "tc-llvm", "sdk-pulp-and-sdk-har-and-prem"]
script:
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-har-olinux
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-llvm
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get sdk-pulp-and-sdk-har-prem
- chmod -R u-w $HERO_INSTALL
- make sdk-pulp # PULP SDK is not relocatable
- export HERCULES_INSTALL=$HERO_INSTALL # Enable PREM
- source env/exilzcu102.sh
- .gitlab-ci.d/compiler-smoketest.sh test-prem # Run with PREM test
simulator-tests-pulp:
stage: test
needs: ["vsim-pulp", "tc-pulp", "tc-har-olinux", "tc-llvm", "sdk-pulp-and-sdk-har-and-prem"]
script:
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get vsim-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-pulp
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-har-olinux
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get tc-llvm
- $CI_PROJECT_DIR/.gitlab-ci.d/memora_retry.sh get sdk-pulp-and-sdk-har
- chmod -R u-w $HERO_INSTALL
- make sdk-pulp # PULP SDK is not relocatable
- source env/esim-exilzcu102.sh
- .gitlab-ci.d/tests-pulp.sh
#doc-pulp-driver:
# stage: test
# script:
# - make -C support/pulp-driver/doc
# artifacts:
# paths:
# - support/pulp-driver/doc/pulp_linux_driver_doc.pdf