-
Notifications
You must be signed in to change notification settings - Fork 23
/
.ci.yml
356 lines (316 loc) · 9.65 KB
/
.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
include:
- project: repositories/synlig-ci
ref: master
file: .ci.yml
stages:
- "Check code format"
- "Build binaries"
- "Run parsing and formal verification tests"
- "Run large designs tests"
- "Optional tests"
image: debian:bookworm
check_format:
stage: "Check code format"
script:
- echo "##/ Install dependencies \##"
- apt update && apt install -y git clang-format python3 jq
- echo "##/ Check code format \##"
- ./.github/scripts/format_sources.sh
- exit_code=0
- if ! git diff --exit-code; then
- echo "| Format locally using ./.github/scripts/format_sources.sh"
- exit_code=1
- fi
- ./.github/scripts/sort_passlists.sh
- if ! git diff --exit-code; then
- echo "| Format locally using ./.github/scripts/format_sources.sh"
- exit_code=1
- fi
- exit $exit_code
variables:
BUILD_DEPENDENCIES: >
google-perftools libgoogle-perftools-dev
libffi-dev python3-orderedmultidict git
tclsh ant default-jre swig clang gcc-11
pkg-config libreadline-dev bison g++-11
python3 python3-dev python3-pip uuid
uuid-dev tcl-dev flex libfl-dev wget
build-essential cmake
.job_template: &build_binary
stage: "Build binaries"
only:
- main
- merge_requests
artifacts:
when: always
paths:
- out/
.common_build_prefix: &common_build_prefix |-
echo "##/ Install dependencies and build \##"
apt update && apt install -y $BUILD_DEPENDENCIES
echo "##/ Load submodules \##"
git submodule sync && git submodule update --init --recursive third_party/{surelog,yosys}
echo "##/ Build binaries \##"
build_plugin:
<<: *build_binary
script:
- *common_build_prefix
- make install-plugin install@surelog -j $(nproc) PREFIX=out
build_asan:
<<: *build_binary
script:
- *common_build_prefix
- make install@surelog install@asan -j $(nproc) CC=clang CXX=clang++ PREFIX=out
build_release:
<<: *build_binary
script:
- *common_build_prefix
- make install install@surelog -j $(nproc) PREFIX=out
- echo "##/ Build tools \##"
- git submodule update --init --recursive --checkout third_party/sv2v
- wget -qO- https://get.haskellstack.org/ | sh -s - -f -d /usr/local/bin
- make install@sv2v install@yosys-tools -j$(nproc) PREFIX=out
build_pysynlig:
<<: *build_binary
script:
- echo "##/ Install dependencies and build \##"
- apt update && apt install -y $BUILD_DEPENDENCIES
- echo "##/ Build yosys, surelog and synlig binaries \##"
- git submodule sync && git submodule update --init --recursive third_party/{surelog,yosys,pybind11}
- make install@surelog install@pysynlig -j $(nproc) PREFIX=out
build_package:
<<: *build_binary
script:
- *common_build_prefix
- make install -j $(nproc) PREFIX=out
- echo "##/ Prepare release \##"
- mkdir synlig
- cp out/bin/synlig synlig/
- cp -r out/share/synlig synlig/share
- tar -zcvf release.tar.gz synlig
artifacts:
paths:
- release.tar.gz
.job_template: &parsing_test
stage: "Run parsing and formal verification tests"
only:
- main
- merge_requests
artifacts:
when: always
paths:
- build/
.parsing_tests_script: &parsing_tests_script |-
./tests/scripts/run_parsing.sh install_dependencies load_submodules --type $BUILD_TYPE $COMMAND
./tests/scripts/run_parsing.sh --type $BUILD_TYPE gather_results
plugin_read_uhdm:
<<: *parsing_test
dependencies: [build_plugin]
script:
- BUILD_TYPE=plugin
- COMMAND=read_uhdm
- *parsing_tests_script
plugin_read_systemverilog:
<<: *parsing_test
dependencies: [build_plugin]
script:
- BUILD_TYPE=plugin
- COMMAND=read_systemverilog
- *parsing_tests_script
asan_read_uhdm:
<<: *parsing_test
dependencies: [build_asan]
script:
- BUILD_TYPE=asan
- COMMAND=read_uhdm
- *parsing_tests_script
asan_read_systemverilog:
<<: *parsing_test
dependencies: [build_asan]
script:
- BUILD_TYPE=asan
- COMMAND=read_systemverilog
- *parsing_tests_script
release_read_uhdm:
<<: *parsing_test
dependencies: [build_release]
script:
- BUILD_TYPE=release
- COMMAND=read_uhdm
- *parsing_tests_script
release_read_systemverilog:
<<: *parsing_test
dependencies: [build_release]
script:
- BUILD_TYPE=release
- COMMAND=read_systemverilog
- *parsing_tests_script
.job_template: &formal_test
stage: "Run parsing and formal verification tests"
dependencies: [build_release]
only:
- main
- merge_requests
artifacts:
when: always
paths:
- ./*_formal_verification_logs.tar.gz
.formal_tests_script: &formal_tests_script |-
./tests/scripts/run_formal.sh --name $TESTS_SUITE_NAME install_dependencies load_submodules build_dependencies run pack_logs gather_results
simple_formal_verification_tests:
<<: *formal_test
script:
- TESTS_SUITE_NAME=simple
- *formal_tests_script
yosys_formal_verification_tests:
<<: *formal_test
script:
- TESTS_SUITE_NAME=yosys
- *formal_tests_script
sv2v_formal_verification_tests:
<<: *formal_test
script:
- TESTS_SUITE_NAME=sv2v
- *formal_tests_script
.job_template: &large_design_test
stage: "Run large designs tests"
dependencies: [build_release]
only:
- main
- merge_requests
artifacts:
when: always
paths:
- tests/build/
.large_design_script: &large_design_script |-
./tests/scripts/run_large_designs.sh --name $TEST_NAME install_dependencies load_submodules run
veer_synth_large_design:
<<: *large_design_test
script:
- TEST_NAME=veer
- *large_design_script
blackparrot_synth_AMD_xilinx_large_design:
<<: *large_design_test
script:
- TEST_NAME=blackparrot_AMD
- *large_design_script
blackparrot_synth_ASIC_xilinx_large_design:
<<: *large_design_test
script:
- TEST_NAME=blackparrot_ASIC
- *large_design_script
artifacts:
paths:
- tests/build/
- third_party/OpenROAD-flow-scripts/logs
- third_party/OpenROAD-flow-scripts/reports
- third_party/OpenROAD-flow-scripts/results
.large_design_script_with_tools: &large_design_script_with_tools |-
./tests/scripts/run_large_designs.sh --name $TEST_NAME install_dependencies
echo "##/ Setup tools \##"
eval $SETUP_TOOLS && export PATH="$PATH:$TOOLS_HOME/bin"
./tests/scripts/run_large_designs.sh --name $TEST_NAME load_submodules run
ibex_synth_large_design:
<<: *large_design_test
script:
- TEST_NAME=ibex
- *large_design_script_with_tools
opentitan_9d82960888_synth_large_design:
<<: *large_design_test
script:
- TEST_NAME=opentitan_9d82960888
- *large_design_script_with_tools
opentitan_synth_large_design:
<<: *large_design_test
when: manual
script:
- TEST_NAME=opentitan
- *large_design_script_with_tools
.job_template: &opentitan_parsing_test
stage: "Run large designs tests"
dependencies: [build_release]
only:
- main
- merge_requests
artifacts:
when: always
paths:
- tests/opentitan/opentitan_parsing_test/build/
opentitan_parse_report_quick_large_design:
<<: *opentitan_parsing_test
script:
- TEST_NAME=opentitan_parse_quick
- *large_design_script_with_tools
opentitan_parse_report_full_large_design:
<<: *opentitan_parsing_test
when: manual
script:
- TEST_NAME=opentitan_parse_full
- *large_design_script_with_tools
ibex_synth_f4pga_large_design:
stage: "Run large designs tests"
dependencies: [build_plugin]
only:
- main
- merge_requests
artifacts:
when: always
paths:
- tests/build/
script:
- TEST_NAME=ibex_f4pga
- *large_design_script_with_tools
check_README:
stage: "Build binaries"
only:
- main
- merge_requests
script:
- echo "##/ Install Prerequisites \##"
- apt update && apt install -y pipx git wget
- pipx install git+https://github.com/antmicro/tuttest#egg=tuttest
- export PATH=$PATH:/root/.local/bin
- echo "##/ Set pipefail \##"
- set -o pipefail
- echo "##/ Install dependencies \##"
- tuttest README.md install-dependencies | bash -eo pipefail -
- echo "##/ Test make install \##"
- tuttest README.md make-install | bash -eo pipefail -
- echo "##/ Test make tools \##"
- tuttest README.md get-haskell | bash -eo pipefail -
- tuttest README.md install-tools | bash -eo pipefail -
- echo "##/ Test counter.sv synthesis \##"
- tuttest README.md counter.sv > counter.sv
- tuttest README.md synthesis-example | grep ">" | cut -d ">" -f 2 | synlig
- echo "##/ Test parsing multiple files \##"
- tuttest README.md example-multiple-files | synlig
- echo "##/ Test testing scripts commands \##"
- tuttest README.md formal-verification-help | bash -eo pipefail -
- tuttest README.md large-designs-help | bash -eo pipefail -
- tuttest README.md parsing-tests-help | bash -eo pipefail -
blackparrot_synth_AMD_xilinx_large_design_python:
<<: *large_design_test
dependencies: [build_pysynlig]
script:
- ./tests/scripts/run_large_designs.sh --name blackparrot_AMD_python install_dependencies load_submodules run
bsg_test_diff:
stage: "Optional tests"
dependencies: [build_plugin]
when: manual
only:
- main
- merge_requests
script:
- echo "##/ Install dependencies \##"
- ./tests/scripts/run_large_designs.sh --name opentitan install_dependencies
- echo "##/ Load submodules \##"
- git submodule sync
- git submodule update --depth 1 --init --recursive --checkout third_party/bsg_micro_designs
- echo "##/ Start bsg diff test \##"
- export PATH="$PWD/out/bin:$PATH"
- python3 ./tests/bsg_micro_designs/generate_bsg_tests.py
- cat tests/bsg_micro_designs/build/bsg_micro_designs_summary.md
artifacts:
when: always
paths:
- tests/bsg_micro_designs/build/