-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.gitlab-ci.yml
277 lines (268 loc) · 8.55 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
VIVADO_PATH_SH: '/nfs/data41/software/Xilinx/Vivado/${VIVADO_VERSION}/settings64.sh'
CLANG_TIDY_PATH: '/opt/rh/llvm-toolset-7.0/root/bin/clang-tidy'
CLANG_TIDY_OPTIONS: '-format-style=file' #-config='' does not work because of the quotes; -header-filter in .clang-tidy
CLANG_TIDY_COMP_OPTIONS: '-std=c++11 -I../TrackletAlgorithm -I../TrackletAlgorithm/TestBench -I../TopFunctions/CombinedConfig_FPGA2 -I../TopFunctions/CombinedConfig -I../TestBenches -I/nfs/data41/software/Xilinx/Vivado/${VIVADO_VERSION}/include'
stages: # ---------------------------------------------------------------------
- lint
- download
- quality-check
- hls-build
- topTF-sim
- check-results
- topTF-synth
# Job templates ---------------------------------------------------------------
.job_template: &template_base
tags:
- xilinx-tools
before_script:
- source $VIVADO_PATH_SH
.job_template: &template_static-check-python
tags:
- xilinx-tools
stage: lint
before_script:
- which python3
- python3 --version
- python3 -m pylint --version
.job_template: &template_quality-check
needs: ["download"]
tags:
- xilinx-tools
stage: quality-check
before_script:
# Needed for new tool version
- source /opt/rh/llvm-toolset-7.0/enable
script:
- pwd; ls -la; ls -la TrackletAlgorithm/;
- cd project
- pwd; ls -la; # Debug
# Hard coded -config='' because the quotes do not work in the variable
- ${CLANG_TIDY_PATH} -config='' ${CLANG_TIDY_OPTIONS} ${CLANG_TIDY_FILES} -- ${CLANG_TIDY_COMP_OPTIONS} ${CLANG_TIDY_INCLUDES}
.job_template: &template_hls-build
<<: *template_base
stage: hls-build
script:
- cd project
- pwd; ls -la; # Debug
- ${EXECUTABLE} -f "script_${PROJ_NAME}.tcl"
artifacts:
when: on_success
name: "$CI_JOB_NAME-$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- ./project/
expire_in: 1 week
.job_template: &template_topTF-sim
<<: *template_base
stage: topTF-sim
script:
- cd IntegrationTests/${PROJ_NAME}/script
- pwd; ls -la; #debug
- make -j`nproc` Work
- vivado -mode batch -source ./runSim.tcl | awk 'BEGIN{IGNORECASE=1} /^error/ {exit_code=1;} // {print $0;} END{exit exit_code}'
artifacts:
when: on_success
name: "$CI_JOB_NAME-$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- ./IntegrationTests/${PROJ_NAME}/script/
expire_in: 1 week
.job_template: &template_check-results
<<: *template_base
stage: check-results
script:
- cd IntegrationTests/${PROJ_NAME}/script
# Compare HDL sim output with Mem/Prints
- python3 common/script/CompareMemPrintsFW.py -p -s
artifacts:
when: on_success
name: "$CI_JOB_NAME-$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- ./IntegrationTests/${PROJ_NAME}/script/dataOut/*.txt
expire_in: 10 week
.job_template: &template_topTF-synth
<<: *template_base
stage: topTF-synth
script:
- cd IntegrationTests/${PROJ_NAME}/script
- pwd; ls -la; #debug
- make Work/Work.runs/synth_1 | awk 'BEGIN{IGNORECASE=1} /^error/ {exit_code=1;} // {print $0;} END{exit exit_code}'
artifacts:
when: on_success
name: "$CI_JOB_NAME-$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- ./IntegrationTests/${PROJ_NAME}/script/Work/Work.runs/synth_1/*.rpt
expire_in: 1 week
# Jobs ------------------------------------------------------------------------
# Lint ------------
py3check:
<<: *template_static-check-python
script:
# If changes need to be made you might refer to: https://portingguide.readthedocs.io/en/latest/tools.html#automated-fixer-python-modernize
- python3 -m pylint --py3k emData/*.py # Check for python3 compatibility
lint:
<<: *template_static-check-python
allow_failure: true
script:
- python3 -m pylint emData/*.py # Static code checker
# Download ------------
download:
tags:
- xilinx-tools
stage: download
needs: ["py3check", "lint"]
script:
- cd emData
- ./download.sh
artifacts:
when: on_success
name: "$CI_JOB_NAME-$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- ./emData/
- ./TopFunctions/
- ./IntegrationTests/
expire_in: 1 week
# Quality checks ------------
IR-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/InputRouter_test.cpp ../TopFunctions/CombinedConfig/InputRouterTop.cc'
VMRCM-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/VMRouterCM_test.cpp ../TopFunctions/CombinedConfig/VMRouterCMTop_L2PHIA.cc'
VMSMER-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/VMStubMERouter_test.cpp ../TopFunctions/CombinedConfig_FPGA2/VMStubMERouterTop_D1PHIA.cc'
TP-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/TrackletProcessor_test.cpp ../TopFunctions/CombinedConfig/TrackletProcessorTop.cc'
PC-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/ProjectionCalculator_test.cpp ../TopFunctions/CombinedConfig_FPGA2/ProjectionCalculatorTop.cc'
MP-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/MatchProcessor_test.cpp ../TopFunctions/CombinedConfig_FPGA2/MatchProcessorTop.cc'
TB-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/TrackBuilder_test.cpp ../TopFunctions/CombinedConfig_FPGA2/TrackBuilderTop.cc'
TM-quality-check:
<<: *template_quality-check
variables:
VIVADO_VERSION: "2019.2"
CLANG_TIDY_FILES: '../TestBenches/TrackMerger_test.cpp ../TopFunctions/TrackMergerTop.cc'
# HLS builds ---------------
IR-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "IR-quality-check"]
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "IR"
VMRCM-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "VMRCM-quality-check"]
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "VMRCM"
VMSMER-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "VMSMER-quality-check"]
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "VMSMER"
TP-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "TP-quality-check"]
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "TP"
PC-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "PC-quality-check"]
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "PC"
MP-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "MP-quality-check"]
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "MP"
TB-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "TB-quality-check"]
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "TB"
TM-vivado-hls-build:
<<: *template_hls-build
needs: ["download", "TM-quality-check"]
allow_failure: false # FIXME: testbench currently always passes
variables:
EXECUTABLE: 'vivado_hls'
VIVADO_VERSION: "2019.2"
PROJ_NAME: "TM"
# FW simulation ---------------
topReducedCombined-sim:
<<: *template_topTF-sim
allow_failure: true
variables:
VIVADO_VERSION: "2019.2"
PROJ_NAME: "ReducedCombinedConfig"
needs:
- job: download
- job: IR-vivado-hls-build
artifacts: false
- job: VMRCM-vivado-hls-build
artifacts: false
- job: VMSMER-vivado-hls-build
artifacts: false
- job: TP-vivado-hls-build
artifacts: false
- job: PC-vivado-hls-build
artifacts: false
- job: MP-vivado-hls-build
artifacts: false
- job: TB-vivado-hls-build
artifacts: false
# Check FW results ---------------
topReducedCombined-check-results:
<<: *template_check-results
allow_failure: true # FIXME: remove after all errors are fixed
variables:
VIVADO_VERSION: "2019.2" # Vivado not needed but it is part of the path that is called
PROJ_NAME: "ReducedCombinedConfig"
needs:
- download
- topReducedCombined-sim
# FW synthesis ---------------
topReducedCombined-synth:
<<: *template_topTF-synth
allow_failure: true
variables:
VIVADO_VERSION: "2019.2"
PROJ_NAME: "ReducedCombinedConfig"
needs:
- job: download
- job: topReducedCombined-sim
- job: topReducedCombined-check-results
artifacts: false