forked from pulp-platform/pulpissimo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
533 lines (502 loc) · 16.9 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
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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# Copyright 2019 ETH Zurich and University of Bologna
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
before_script:
- pwd
# after_script:
# - echo "stage finished"
stages:
- fetch
- build
- test
- sim_questa_multivers
fetch_tests:
stage: fetch
script:
- echo "Fetching tests"
- make test-checkout-gitlab
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/*
fetch_ips_bender:
stage: fetch
script:
- echo "Fetching IPs using bender"
- ulimit -Sn 4096
- BENDER=1 make checkout
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
# - .bender/*
#- Bender.lock
- bender
# This jobs result is too large to produce an artifact
# fetch_sdk:
# stage: fetch
# script:
# - echo "Fetching SDK from releases and setting up paths"
# - make sdk-gitlab
# artifacts:
# paths:
# - pkg/
# - env/
build_rtl:
stage: build
before_script:
script:
- echo "Compiling RTL model and DPI libraries"
- make build
- echo "Fetching VIPs"
- ./rtl/vip/get-vips.sh --yes --gitlab
- echo "Installing scripts"
- make install
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/*
# - sim/*
- rtl/tb/remote_bitbang/* # we want to reuse bitbang lib
- rtl/vip/*
# - pkg/* # sdk is too large
lint:
stage: test
script:
- echo "Running Spyglass Lint in rtl_handoff methodology with goal lint_rtl"
- make lint
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- spyglass/working_dir/*
reports:
junit: spyglass/working_dir/reports/lint_rtl.report.xml
dependencies:
- fetch_ips_bender
needs:
- fetch_ips_bender
# Use sdk-releases to run all tests
test_sequential_bare:
stage: test
before_script:
- echo "Fetching SDK from releases and setting up paths"
- make sdk-gitlab
- echo "Compiling RTL model and DPI libraries"
- make build
- echo "Installing scripts"
- make install
script:
- echo "Running sequential bare tests"
- source env/ci-pulpissimo.sh && make test-sequential-bare
- echo "Generating junit test results"
- /usr/sepp/bin/python3.4 -m junit2htmlreport tests/sequential_bare_tests/junit-reports/TEST-*.xml
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/sequential_bare_tests/junit-reports/TEST-*.html
- tests/sequential_bare_tests/junit-reports/TEST-*.xml
reports:
junit: tests/sequential_bare_tests/junit-reports/TEST-*.xml
# test_parallel_bare:
# stage: test
# before_script:
# - echo "Fetching SDK from releases and setting up paths"
# - make sdk-gitlab
# - echo "Compiling RTL model and DPI libraries"
# - make build
# - echo "Installing scripts"
# - make install
# script:
# - echo "Running parallel bare tests"
# - source env/ci-pulpissimo.sh && make test-parallel-bare
# - echo "Generating junit test results"
# - /usr/sepp/bin/python3.4 -m junit2htmlreport tests/parallel_bare_tests/junit-reports/TEST-*.xml
# artifacts:
# name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
# paths:
# - tests/parallel_bare_tests/junit-reports/TEST-*.html
# - tests/parallel_bare_tests/junit-reports/TEST-*.xml
# reports:
# junit: tests/parallel_bare_tests/junit-reports/TEST-*.xml
# test_pulp:
# stage: test
# before_script:
# - echo "Fetching SDK from releases and setting up paths"
# - make sdk-gitlab
# - echo "Compiling RTL model and DPI libraries"
# - make scripts-bender-vsim-vips
# - make build
# - echo "Installing scripts"
# - make install
# script:
# - echo "Running pulp tests"
# - source env/ci-pulpissimo.sh && make test-pulp
# - echo "Generating junit test results"
# - /usr/sepp/bin/python3.4 -m junit2htmlreport tests/pulp_tests/junit-reports/TEST-*.xml
# artifacts:
# name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
# paths:
# - tests/pulp_tests/junit-reports/TEST-*.html
# - tests/pulp_tests/junit-reports/TEST-*.xml
# reports:
# junit: tests/pulp_tests/junit-reports/TEST-*.xml
test_ml:
stage: test
before_script:
- echo "Fetching SDK from releases and setting up paths"
- make sdk-gitlab
- echo "Compiling RTL model and DPI libraries"
- make build
- echo "Installing scripts"
- make install
script:
- echo "Running ml tests"
- source env/ci-pulpissimo.sh && make test-ml
- echo "Generating junit test results"
- /usr/sepp/bin/python3.4 -m junit2htmlreport tests/ml_tests/junit-reports/TEST-*.xml
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/ml_tests/junit-reports/TEST-*.html
- tests/ml_tests/junit-reports/TEST-*.xml
reports:
junit: tests/ml_tests/junit-reports/TEST-*.xml
test_riscv:
stage: test
before_script:
- echo "Fetching SDK from releases and setting up paths"
- make sdk-gitlab
- echo "Compiling RTL model and DPI libraries"
- make build
- echo "Installing scripts"
- make install
script:
- echo "Running riscv tests"
- source env/ci-pulpissimo.sh && make test-riscv
- echo "Generating junit test results"
- /usr/sepp/bin/python3.4 -m junit2htmlreport tests/riscv_tests/junit-reports/TEST-*.xml
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/riscv_tests/junit-reports/TEST-*.html
- tests/riscv_tests/junit-reports/TEST-*.xml
reports:
junit: tests/riscv_tests/junit-reports/TEST-*.xml
freertos_helloworld:
stage: test
before_script:
- export RISCV=/usr/pack/riscv-1.0-kgf/pulp-gcc-2.5.0
- git clone https://github.com/pulp-platform/pulp-freertos.git
- cd pulp-freertos
- git checkout d6966cae9471b7a592bd09b7acfd5b832666e3b5
- git submodule update --init --recursive
- cd ..
script:
- make scripts
- make clean build
- source setup/vsim.sh
- cd pulp-freertos
- source env/pulpissimo-cv32e40p.sh
- cd tests/hello_world_pmsis
- make all run
# test_rt:
# stage: test
# before_script:
# - echo "Fetching SDK from releases and setting up paths"
# - make sdk-gitlab
# - echo "Compiling RTL model and DPI libraries"
# - make scripts-bender-vsim-vips
# - make build
# - echo "Installing scripts"
# - make install
# script:
# - echo "Running rt tests"
# - source env/ci-pulpissimo.sh && make test-rt
# - echo "Generating junit test results"
# - /usr/sepp/bin/python3.4 -m junit2htmlreport tests/rt-tests/junit-reports/TEST-*.xml
# artifacts:
# name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
# paths:
# - tests/rt-tests/junit-reports/TEST-*.html
# - tests/rt-tests/junit-reports/TEST-*.xml
# reports:
# junit: tests/rt-tests/junit-reports/TEST-*.xml
# Use simplified pulp-runtime to run a subset of tests
# test_simplified_sw:
# stage: test
# before_script:
# - echo "Fetching Runtime"
# - make pulp-runtime
# - echo "Compiling RTL model and DPI libraries"
# - make build
# - echo "Installing scripts"
# - make install
# script:
# - echo "Running software test"
# - source pulp-runtime/configs/pulpissimo.sh && make test-runtime-gitlab
# - echo "Generating junit test results"
# - /usr/sepp/bin/python3.4 -m junit2htmlreport tests/rt-tests/junit-reports/TEST-*.xml
# artifacts:
# name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
# paths:
# - tests/*.html
# - tests/*.xml
# reports:
# junit: tests/*.xml
# Built SDK with the `make sdk` target and run all tests
# test_sw_build_sdk:
# variables:
# PULP_RISCV_GCC_TOOLCHAIN: your-compiler-path
# stage: test
# before_script:
# - echo "Compiling RTL model and DPI libraries"
# - make build
# - echo "Installing scripts" # don't call this, breaks build
# - make install
# - echo "Building SDK"
# - make sdk
# script:
# - echo "Running software tests with built SDK"
# - make test-gitlab2
# - echo "Generating junit test results"
# - /usr/sepp/bin/python3.4 -m junit2htmlreport tests/junit-reports/TEST-*.xml
# artifacts:
# paths:
# - tests/junit-reports/TEST-*.html
# - tests/junit-reports/TEST-*.xml
# reports:
# junit: tests/junit-reports/TEST-*.xml
test_dm:
stage: test
before_script:
script:
- echo "(Re)generating scripts with DPI disabled"
- make scripts
- echo "Setting up vsim path"
- source setup/vsim.sh
- echo "Running debug module testbench"
# Note that the program is irrelevant we just put something for it to not complain
- cd sim/ && make all simc VSIM_FLAGS="+jtag_dm_tests +srec=../rtl/tb/srec/min.srec"
fpga_synth_genesys2:
stage: test
before_script:
script:
- echo "(Re)generating scripts"
- make scripts
- echo "Starting synthesis with vivado"
- cd fpga/ && make genesys2 VIVADO='vivado-2019.1.1 vivado'
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- fpga/pulpissimo_genesys2.bit
- fpga/pulpissimo_genesys2.bin
- fpga/*.jou
- fpga/*.log
- fpga/*.str
- fpga/pulpissimo-genesys2/reports
- fpga/pulpissimo-genesys2/rtl
- fpga/pulpissimo-genesys2/tcl
- fpga/pulpissimo-genesys2/pulpissimo_genesys2.xpr
- fpga/pulpissimo-genesys2/fpga-settings.mk
- fpga/pulpissimo-genesys2/*.log
- fpga/pulpissimo-genesys2/*.cfg
- fpga/pulpissimo-genesys2/*.gdb
- fpga/pulpissimo-genesys2/*.jou
- fpga/pulpissimo-genesys2/*.log
fpga_synth_nexys_video:
stage: test
before_script:
script:
- echo "(Re)generating scripts"
- make scripts
- echo "Starting synthesis with vivado"
- cd fpga/ && make nexys_video VIVADO='vivado-2019.1.1 vivado'
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- fpga/pulpissimo_nexys_video.bit
- fpga/pulpissimo_nexys_video.bin
- fpga/*.jou
- fpga/*.log
- fpga/*.str
- fpga/pulpissimo-nexys_video/reports
- fpga/pulpissimo-nexys_video/rtl
- fpga/pulpissimo-nexys_video/tcl
- fpga/pulpissimo-nexys_video/pulpissimo_nexys_video.xpr
- fpga/pulpissimo-nexys_video/fpga-settings.mk
- fpga/pulpissimo-nexys_video/*.log
- fpga/pulpissimo-nexys_video/*.cfg
- fpga/pulpissimo-nexys_video/*.gdb
- fpga/pulpissimo-nexys_video/*.jou
- fpga/pulpissimo-nexys_video/*.log
fpga_synth_nexys:
stage: test
before_script:
script:
- echo "(Re)generating scripts"
- make scripts
- echo "Starting synthesis with vivado"
- cd fpga/ && make nexys rev=nexys4 VIVADO='vivado-2019.1.1 vivado'
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- fpga/pulpissimo_nexys.bit
- fpga/pulpissimo_nexys.bin
- fpga/*.jou
- fpga/*.log
- fpga/*.str
- fpga/pulpissimo-nexys/reports
- fpga/pulpissimo-nexys/rtl
- fpga/pulpissimo-nexys/tcl
- fpga/pulpissimo-nexys/pulpissimo_nexys.xpr
- fpga/pulpissimo-nexys/fpga-settings.mk
- fpga/pulpissimo-nexys/*.log
- fpga/pulpissimo-nexys/*.cfg
- fpga/pulpissimo-nexys/*.gdb
- fpga/pulpissimo-nexys/*.jou
- fpga/pulpissimo-nexys/*.log
fpga_synth_nexys_zcu104:
stage: test
before_script:
script:
- echo "(Re)generating scripts"
- make scripts
- echo "Starting synthesis with vivado"
- cd fpga/ && make zcu104 VIVADO='vivado-2019.1.1 vivado'
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- fpga/pulpissimo_zcu104.bit
- fpga/pulpissimo_zcu104.bin
- fpga/*.jou
- fpga/*.log
- fpga/*.str
- fpga/pulpissimo-zcu104/reports
- fpga/pulpissimo-zcu104/rtl
- fpga/pulpissimo-zcu104/tcl
- fpga/pulpissimo-zcu104/pulpissimo_zcu104.xpr
- fpga/pulpissimo-zcu104/fpga-settings.mk
- fpga/pulpissimo-zcu104/*.log
- fpga/pulpissimo-zcu104/*.cfg
- fpga/pulpissimo-zcu104/*.gdb
- fpga/pulpissimo-zcu104/*.jou
- fpga/pulpissimo-zcu104/*.log
# fpga_synth_zedboard:
# stage: test
# before_script:
# script:
# - echo "(Re)generating scripts"
# - make scripts
# - echo "Starting synthesis with vivado"
# - cd fpga/ && make zedboard VIVADO='vivado-2019.1.1 vivado'
# artifacts:
# name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
# paths:
# - fpga/pulpissimo_zedboard.bit
# - fpga/pulpissimo_zedboard.bin
# - fpga/*.jou
# - fpga/*.log
# - fpga/*.str
# - fpga/pulpissimo-zedboard/reports
# - fpga/pulpissimo-zedboard/rtl
# - fpga/pulpissimo-zedboard/tcl
# - fpga/pulpissimo-zedboard/pulpissimo_zedboard.xpr
# - fpga/pulpissimo-zedboard/fpga-settings.mk
# - fpga/pulpissimo-zedboard/*.log
# - fpga/pulpissimo-zedboard/*.cfg
# - fpga/pulpissimo-zedboard/*.gdb
# - fpga/pulpissimo-zedboard/*.jou
# - fpga/pulpissimo-zedboard/*.log
fpga_synth_zcu102:
stage: test
before_script:
script:
- echo "(Re)generating scripts"
- make scripts
- echo "Starting synthesis with vivado"
- cd fpga/ && make zcu102 VIVADO='vivado-2019.1.1 vivado'
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- fpga/pulpissimo_zcu102.bit
- fpga/pulpissimo_zcu102.bin
- fpga/*.jou
- fpga/*.log
- fpga/*.str
- fpga/pulpissimo-zcu102/reports
- fpga/pulpissimo-zcu102/rtl
- fpga/pulpissimo-zcu102/tcl
- fpga/pulpissimo-zcu102/pulpissimo_zcu102.xpr
- fpga/pulpissimo-zcu102/fpga-settings.mk
- fpga/pulpissimo-zcu102/*.log
- fpga/pulpissimo-zcu102/*.cfg
- fpga/pulpissimo-zcu102/*.gdb
- fpga/pulpissimo-zcu102/*.jou
- fpga/pulpissimo-zcu102/*.log
sim_questa_multivers:
stage: sim_questa_multivers
allow_failure: true
when: always
parallel:
matrix:
- QUESTA_PREFIX:
- 'vsim' # Default
- 'questa-2019.3-kgf vsim'
- 'questa-2020.1-kgf vsim'
- 'questa-2021.1-bt vsim' # Has errors
- 'questa-2021.2-bt vsim' # Has errors
- 'vsim-10.0d-kgf' # Incompatible
- 'vsim-10.1c-kgf' # Incompatible
- 'vsim-10.2c-kgf' # Incompatible
- 'vsim-10.3a-kgf' # Incompatible
- 'vsim-10.3e-kgf' # Incompatible
- 'vsim-10.4c-kgf' # Incompatible
- 'vsim-10.5a-kgf' # Incompatible
- 'vsim-10.5c-kgf'
- 'vsim-10.6b-kgf'
- 'vsim-10.7b-kgf'
- 'vsim-10.7e-kgf'
before_script:
- export VSIM="$QUESTA_PREFIX"
- export VLOG="${QUESTA_PREFIX/vsim/vlog}"
- export VOPT="${QUESTA_PREFIX/vsim/vopt}"
- export VLIB="${QUESTA_PREFIX/vsim/vlib}"
- export VMAP="${QUESTA_PREFIX/vsim/vmap}"
- export VCOM="${QUESTA_PREFIX/vsim/vcom}"
- export PULP_RISCV_GCC_TOOLCHAIN=/usr/pack/riscv-1.0-kgf/pulp-gcc-1.0.16
- git clone https://github.com/pulp-platform/pulp-runtime.git -b v0.0.15
- mkdir hello
- printf "#include <stdio.h>\nint main(){\n printf(\"Hello World\\\n\");\n return 0;\n}\n" > hello/hello.c
- printf "PULP_APP = hello\nPULP_APP_FC_SRCS = hello.c\nPULP_APP_HOST_SRCS = hello.c\nPULP_CFLAGS = -O3 -g\n\ninclude \$(PULP_SDK_HOME)/install/rules/pulp_rt.mk\n" > hello/Makefile
script:
- make scripts
- make clean build
- source setup/vsim.sh
- source pulp-runtime/configs/pulpissimo_cv32.sh
- make -C hello clean all run
dependencies:
- fetch_ips_bender
needs:
- fetch_ips_bender
spi_boot:
stage: test
before_script:
- git clone https://github.com/pulp-platform/pulp-runtime.git -b v0.0.15
- mkdir hello
- export PULP_RISCV_GCC_TOOLCHAIN=/usr/pack/riscv-1.0-kgf/pulp-gcc-2.5.0
- printf "#include <stdio.h>\nint main(){\n printf(\"Hello World\\\n\");\n return 0;\n}\n" > hello/hello.c
- printf "PULP_APP = hello\nPULP_APP_FC_SRCS = hello.c\nPULP_APP_HOST_SRCS = hello.c\nPULP_CFLAGS = -O3 -g\n\ninclude \$(PULP_SDK_HOME)/install/rules/pulp_rt.mk\n" > hello/Makefile
script:
- make scripts-bender-vsim-vips all
- source setup/vsim.sh
- source pulp-runtime/configs/pulpissimo_cv32.sh
- make -C hello clean all run bootmode=spi PULP_RUNTIME_GCC_TOOLCHAIN=/usr/pack/riscv-1.0-kgf/pulp-gcc-2.5.0