-
Notifications
You must be signed in to change notification settings - Fork 20
/
.ci.yml
354 lines (322 loc) · 10.9 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
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"
variables:
SCALENODE_RAM: 8000
SCALENODE_CPU: 8
only:
- main
- merge_requests
artifacts:
when: always
paths:
- out/
build_plugin:
<<: *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}
- make plugin install@surelog -j $(nproc) PREFIX=out
build_asan:
<<: *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}
- make install install@surelog -j $(nproc) ENABLE_ASAN=1 CC=clang CXX=clang++ CFG_BUILD_TYPE=asan PREFIX=out
build_release:
<<: *build_binary
script:
- echo "##/ Install dependencies and build \##"
- apt update && apt install -y $BUILD_DEPENDENCIES
- echo "##/ Build synlig binary \##"
- git submodule sync && git submodule update --init --recursive --checkout third_party/{surelog,yosys,sv2v}
- make install install@surelog -j $(nproc) PREFIX=out
- echo "##/ Build tools \##"
- wget -qO- https://get.haskellstack.org/ | sh -s - -f -d /usr/local/bin
- make install@sv2v install@yosys-tools -j$(nproc) PREFIX=out
build_package:
<<: *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}
- make install -j $(nproc) PREFIX=out
- 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/
plugin_read_uhdm:
<<: *parsing_test
dependencies: [build_plugin]
script:
- ./tests/scripts/run_parsing.sh install_dependencies load_submodules --type plugin read_uhdm
plugin_read_systemverilog:
<<: *parsing_test
dependencies: [build_plugin]
script:
- ./tests/scripts/run_parsing.sh install_dependencies load_submodules --type plugin read_systemverilog
asan_read_uhdm:
<<: *parsing_test
dependencies: [build_asan]
script:
- ./tests/scripts/run_parsing.sh install_dependencies load_submodules --type asan read_uhdm
asan_read_systemverilog:
<<: *parsing_test
dependencies: [build_asan]
script:
- ./tests/scripts/run_parsing.sh install_dependencies load_submodules --type asan read_systemverilog
release_read_uhdm:
<<: *parsing_test
dependencies: [build_release]
script:
- ./tests/scripts/run_parsing.sh install_dependencies load_submodules --type release read_uhdm
release_read_systemverilog:
<<: *parsing_test
dependencies: [build_release]
script:
- ./tests/scripts/run_parsing.sh install_dependencies load_submodules --type release read_systemverilog
.job_template: &formal_test
stage: "Run parsing and formal verification tests"
dependencies: [build_release]
variables:
SCALENODE_RAM: 8000
SCALENODE_CPU: 6
only:
- main
- merge_requests
artifacts:
when: always
paths:
- build/
simple_formal_verification_tests:
<<: *formal_test
script:
- ./tests/scripts/run_formal.sh --name simple install_dependencies load_submodules build_dependencies run gather_results
yosys_formal_verification_tests:
<<: *formal_test
script:
- ./tests/scripts/run_formal.sh --name yosys install_dependencies load_submodules build_dependencies run gather_results
sv2v_formal_verification_tests:
<<: *formal_test
script:
- ./tests/scripts/run_formal.sh --name sv2v install_dependencies load_submodules build_dependencies run gather_results
.job_template: &large_design_test
stage: "Run large designs tests"
dependencies: [build_release]
only:
- main
- merge_requests
artifacts:
when: always
paths:
- tests/build/
veer_synth_large_design:
<<: *large_design_test
variables:
SCALENODE_RAM: 12000
SCALENODE_CPU: 4
script:
- ./tests/scripts/run_large_designs.sh --name veer install_dependencies load_submodules run
blackparrot_synth_AMD_xilinx_large_design:
<<: *large_design_test
variables:
SCALENODE_RAM: 20000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name blackparrot_AMD install_dependencies load_submodules run
blackparrot_synth_ASIC_xilinx_large_design:
<<: *large_design_test
variables:
SCALENODE_RAM: 20000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name blackparrot_ASIC install_dependencies load_submodules run
artifacts:
paths:
- third_party/OpenROAD-flow-scripts/logs
- third_party/OpenROAD-flow-scripts/reports
- third_party/OpenROAD-flow-scripts/results
ibex_synth_large_design:
<<: *large_design_test
variables:
SCALENODE_RAM: 16000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name ibex install_dependencies
- echo "##/ Setup tools \##"
- eval $SETUP_TOOLS && export PATH="$PATH:$TOOLS_HOME/bin"
- ./tests/scripts/run_large_designs.sh --name ibex load_submodules run
opentitan_9d82960888_synth_large_design:
<<: *large_design_test
variables:
SCALENODE_RAM: 50000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name opentitan_9d82960888 install_dependencies
- echo "##/ Setup tools \##"
- eval $SETUP_TOOLS && export PATH="$PATH:$TOOLS_HOME/bin"
- ./tests/scripts/run_large_designs.sh --name opentitan_9d82960888 load_submodules run
opentitan_synth_large_design:
<<: *large_design_test
tags: ['ace-x86_64-high-mem']
when: manual
variables:
SCALENODE_RAM: 160000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name opentitan install_dependencies
- echo "##/ Setup tools \##"
- eval $SETUP_TOOLS && export PATH="$PATH:$TOOLS_HOME/bin"
- ./tests/scripts/run_large_designs.sh --name opentitan load_submodules run
.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
variables:
SCALENODE_RAM: 36000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name opentitan_parse_quick install_dependencies
- echo "##/ Setup tools \##"
- eval $SETUP_TOOLS && export PATH="$PATH:$TOOLS_HOME/bin"
- ./tests/scripts/run_large_designs.sh --name opentitan_parse_quick load_submodules run
opentitan_parse_report_full_large_design:
<<: *opentitan_parsing_test
tags: ['ace-x86_64-high-mem']
when: manual
variables:
SCALENODE_RAM: 120000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name opentitan_parse_full install_dependencies
- echo "##/ Setup tools \##"
- eval $SETUP_TOOLS && export PATH="$PATH:$TOOLS_HOME/bin"
- ./tests/scripts/run_large_designs.sh --name opentitan_parse_full load_submodules run
ibex_synth_f4pga_large_design:
stage: "Run large designs tests"
dependencies: [build_plugin]
only:
- main
- merge_requests
artifacts:
when: always
paths:
- tests/build/
variables:
SCALENODE_RAM: 20000
SCALENODE_CPU: 6
script:
- ./tests/scripts/run_large_designs.sh --name ibex_f4pga install_dependencies
- echo "##/ Setup tools \##"
- eval $SETUP_TOOLS && export PATH="$PATH:$TOOLS_HOME/bin"
- ./tests/scripts/run_large_designs.sh --name ibex_f4pga load_submodules run
check_README:
stage: "Optional tests"
only:
- main
- merge_requests
variables:
SCALENODE_RAM: 8000
SCALENODE_CPU: 6
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 -
- echo "##/ Test make install \##"
- tuttest README.md make-install | bash -
- echo "##/ Test make tools \##"
- tuttest README.md get-haskell | bash -
- tuttest README.md install-tools | bash -
- 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 -
- tuttest README.md large-designs-help | bash -
- tuttest README.md parsing-tests-help | bash -
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/