forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
707 lines (654 loc) · 24.5 KB
/
azure-pipelines.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
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
#
# Azure Pipelines CI build configuration
# Documentation at https://aka.ms/yaml
variables:
#
# If updating VERILATOR_VERSION, OPENOCD_VERSION, TOOLCHAIN_VERSION or RUST_VERSION
# update the definitions in util/container/Dockerfile as well.
#
VERILATOR_VERSION: 4.210
OPENOCD_VERSION: 0.11.0
TOOLCHAIN_PATH: /opt/buildcache/riscv
VERIBLE_VERSION: v0.0-1213-g9e5c085
RUST_VERSION: 1.55.0
# Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases
TOOLCHAIN_VERSION: 20210412-1
# This controls where builds happen, and gets picked up by build_consts.sh.
BUILD_ROOT: $(Build.ArtifactStagingDirectory)
VIVADO_VERSION: "2020.2"
trigger:
batch: true
branches:
include:
- "*"
tags:
include:
- "*"
pr:
branches:
include:
- "*"
jobs:
- job: lint
displayName: Run code quality checks (quick lint)
pool:
vmImage: ubuntu-18.04
steps:
- bash: |
sudo apt-get remove -y clang-6.0 libclang-common-6.0-dev libclang1-6.0 libllvm6.0
displayName: Remove existing Clang installation
- template: ci/install-package-dependencies.yml
## !!!
##
## The steps below here are duplicated in ci/jobs/quick-lint.sh
## to allow developers to "run CI" locally. Keep them in sync.
##
## !!!
- bash: ci/scripts/show-env.sh
displayName: Display environment information
- bash: ci/scripts/lint-commits.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Check commit metadata
- bash: ci/scripts/check-licence-headers.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Check Licence Headers
- bash: ci/scripts/exec-check.sh
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Check executable bits
- bash: ci/scripts/check-ascii.sh
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Check for non-ASCII characters in source code
- bash: ci/scripts/python-lint.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Run Python lint (flake8)
continueOnError: true
- bash: ci/scripts/mypy.sh
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Run Python lint (mypy)
- bash: ci/scripts/check-generated.sh
displayName: Ensure all generated files are clean and up-to-date
- bash: ci/scripts/clang-format.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Use clang-format to check C/C++ coding style
- bash: ci/scripts/include-guard.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Check formatting on header guards
- bash: ci/scripts/verible-format.sh
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Check formatting of files on allow list with Verible
continueOnError: true
- bash: ci/scripts/verible-lint.sh rtl
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Style-Lint RTL Verilog source files with Verible
- bash: ci/scripts/verible-lint.sh dv
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Style-Lint DV Verilog source files with Verible
- bash: ci/scripts/build-docs.sh
displayName: Render documentation
- bash: ci/scripts/build-site.sh
displayName: Render landing site
- bash: ci/scripts/get-build-type.sh "$SYSTEM_PULLREQUEST_TARGETBRANCH" "$(Build.Reason)"
displayName: Check what kinds of changes the PR contains
name: DetermineBuildType
- job: slow_lints
displayName: Run code quality checks (in-depth lint)
dependsOn: lint
pool:
vmImage: ubuntu-18.04
steps:
- template: ci/install-package-dependencies.yml
- bash: ci/scripts/check-vendoring.sh
displayName: Check vendored directories are up-to-date
- job: sw_build
displayName: Build Software for Earl Grey toplevel design
dependsOn: lint
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
pool:
vmImage: ubuntu-18.04
steps:
- template: ci/install-package-dependencies.yml
- bash: |
set -x
sudo util/get-toolchain.py \
--install-dir="$TOOLCHAIN_PATH" \
--release-version="$TOOLCHAIN_VERSION" \
--update
displayName: Install toolchain
- bash: |
. util/build_consts.sh
./meson_init.sh -A
ninja -C "$OBJ_DIR" all
displayName: Build embedded targets
- bash: |
. util/build_consts.sh
ninja -C "$OBJ_DIR" test
displayName: Run unit tests
- bash: |
. util/build_consts.sh
# Remove all Nexys Video-related build artifacts, which will be produced
# by the sw_build_nexysvideo job below (see comment there).
find "$BIN_DIR/sw/device" -name '*fpga_nexysvideo*' -type f -delete
displayName: Delete all Nexys Video build artifacts
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/sw/***"
# Software targeting the Nexys Video board is produced by patching the source
# tree before building. This produces a full sw build tree, however only the
# artifacts with "nexysvideo" in the name are actually the ones we're looking
# for. Everything else will be discarded.
# TODO: This is a rather ugly hack, which will go away once we properly support
# building more than one top-level design with different parametrizations.
# Work towards this goal is tracked in issue #4669.
- job: sw_build_nexysvideo
displayName: Build Software for Earl Grey toplevel design targeting the Nexys Video board
dependsOn: lint
# Make the following condition always false for now, see #7814.
condition: and(succeeded(), False, eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
pool:
vmImage: ubuntu-18.04
steps:
- template: ci/install-package-dependencies.yml
- bash: |
set -x
sudo util/get-toolchain.py \
--install-dir="$TOOLCHAIN_PATH" \
--release-version="$TOOLCHAIN_VERSION" \
--update
displayName: Install toolchain
- bash: |
. util/build_consts.sh
./hw/top_earlgrey/util/top_earlgrey_reduce.py
./meson_init.sh -A
ninja -C "$OBJ_DIR" all
# Delete all build artifacts which are *not* for the Nexys Video board.
find "$BIN_DIR/sw/device" -not -name '*fpga_nexysvideo*' -type f -delete
displayName: Build embedded targets
- bash: |
. util/build_consts.sh
ninja -C "$OBJ_DIR" test
displayName: Run unit tests
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/sw/device/**/*nexysvideo*"
# Software targeting the English Breakfast top level is produced by patching
# the source tree before building. This builds a selected subset of software
# only.
# TODO: This is a rather ugly hack, which will go away once we properly support
# building more than one top-level design with different parametrizations.
# Work towards this goal is tracked in issue #4669.
- job: sw_build_englishbreakfast
displayName: Build Software for English Breakfast toplevel design
dependsOn: lint
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
pool:
vmImage: ubuntu-18.04
steps:
- template: ci/install-package-dependencies.yml
- bash: |
set -x
sudo util/get-toolchain.py \
--install-dir="$TOOLCHAIN_PATH" \
--release-version="$TOOLCHAIN_VERSION" \
--update
displayName: Install toolchain
- bash: |
. util/build_consts.sh
./meson_init.sh -A
# Patch software.
./hw/top_englishbreakfast/util/prepare_sw.py
# Build FPGA boot ROM and aes_serial binary for FPGA SCA.
ninja -C "$OBJ_DIR" sw/device/boot_rom/boot_rom_export_fpga_nexysvideo
ninja -C "$OBJ_DIR" sw/device/sca/aes_serial_export_fpga_nexysvideo
# Build binaries for Verilator simulation.
ninja -C "$OBJ_DIR" sw/device/boot_rom/boot_rom_export_sim_verilator
ninja -C "$OBJ_DIR" sw/device/tests/aes_smoketest_export_sim_verilator
ninja -C "$OBJ_DIR" sw/device/examples/hello_world/hello_world_export_sim_verilator
displayName: Build embedded targets
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/sw/device/***"
# We continue building with GCC, despite defaulting to Clang. This is a copy of
# `sw_build` with `meson_init.sh` configured with the GCC toolchain, instead of
# the default toolchain.
- job: sw_build_gcc
displayName: Build Software for Earl Grey toplevel design (with GCC)
dependsOn: lint
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
pool:
vmImage: ubuntu-18.04
steps:
- template: ci/install-package-dependencies.yml
- bash: |
set -x
sudo util/get-toolchain.py \
--install-dir="$TOOLCHAIN_PATH" \
--release-version="$TOOLCHAIN_VERSION" \
--update
displayName: Install toolchain
- bash: |
. util/build_consts.sh
./meson_init.sh -A \
-t "$TOOLCHAIN_PATH/meson-riscv32-unknown-elf-gcc.txt"
ninja -C "$OBJ_DIR" all
displayName: Build embedded targets
- bash: |
. util/build_consts.sh
ninja -C "$OBJ_DIR" test
displayName: Run unit tests
- job: chip_earlgrey_verilator
displayName: Build Verilator simulation of the Earl Grey toplevel design
dependsOn: lint
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
pool:
vmImage: ubuntu-18.04
steps:
- template: ci/install-package-dependencies.yml
- bash: |
python3 --version
fusesoc --version
verilator --version
verible-verilog-lint --version
displayName: Display environment
- bash: ci/scripts/build-chip-verilator.sh earlgrey
displayName: Build simulation with Verilator
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/hw/top_earlgrey/Vchip_earlgrey_verilator"
- job: chip_englishbreakfast_verilator
displayName: Build Verilator simulation of the English Breakfast toplevel design
dependsOn: lint
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
pool:
vmImage: ubuntu-18.04
steps:
- template: ci/install-package-dependencies.yml
- bash: |
python3 --version
fusesoc --version
verilator --version
verible-verilog-lint --version
displayName: Display environment
- bash: ci/scripts/build-chip-verilator.sh englishbreakfast
displayName: Build simulation with Verilator
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/hw/top_englishbreakfast/Vchip_englishbreakfast_verilator"
- job: execute_verilated_tests
displayName: Execute tests on the Verilated system (excl. slow tests)
pool: ci-public
dependsOn:
- chip_earlgrey_verilator
- sw_build
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- chip_earlgrey_verilator
- sw_build
- bash: |
# Install an additional pytest dependency for result upload.
pip3 install pytest-azurepipelines
. util/build_consts.sh
pytest --version
pytest test/systemtest/earlgrey/test_sim_verilator.py \
-m "not slow" \
--log-cli-level=DEBUG \
--test-run-title="Run system tests with Verilator simulation (excl. slow tests)" \
--napoleon-docstrings
displayName: Execute tests
- job: execute_verilated_tests_englishbreakfast
displayName: Execute tests on the Verilated English Breakfast toplevel design
pool: ci-public
dependsOn:
- chip_englishbreakfast_verilator
- sw_build_englishbreakfast
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- chip_englishbreakfast_verilator
- sw_build_englishbreakfast
- bash: |
# Install an additional pytest dependency for result upload.
pip3 install pytest-azurepipelines
. util/build_consts.sh
pytest --version
pytest test/systemtest/englishbreakfast/test_sim_verilator.py \
-m "not slow" \
--log-cli-level=DEBUG \
--test-run-title="Run English Breakfast system tests with Verilator simulation" \
--napoleon-docstrings
displayName: Execute tests
# This test is in a separate job becuase it takes longer to complete.
- job: execute_silicon_creator_verilated_test
displayName: Execute silicon_creator test on the Verilated system
pool: ci-public
dependsOn:
- chip_earlgrey_verilator
- sw_build
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- chip_earlgrey_verilator
- sw_build
- bash: |
# Install an additional pytest dependency for result upload.
pip3 install pytest-azurepipelines
. util/build_consts.sh
pytest --version
pytest test/systemtest/earlgrey/test_sim_verilator.py \
-k test_apps_selfchecking_silicon_creator[uart_smoketest] \
--log-cli-level=DEBUG \
--test-run-title="Run silicon_creator system test with Verilator simulation" \
--napoleon-docstrings
displayName: Execute silicon_creator test
- template: ci/run-riscv-compliance.yml
parameters:
rvc_test_suites:
- rv32i
- template: ci/run-riscv-compliance.yml
parameters:
rvc_test_suites:
- rv32im
- rv32imc
- rv32Zicsr
- job: otbn_standalone_tests
displayName: Run OTBN Smoke Test
dependsOn: lint
pool:
vmImage: ubuntu-18.04
timeoutInMinutes: 10
steps:
- template: ci/install-package-dependencies.yml
- bash: |
set -x
sudo util/get-toolchain.py \
--install-dir="$TOOLCHAIN_PATH" \
--release-version="$TOOLCHAIN_VERSION" \
--update
echo "##vso[task.prependpath]$TOOLCHAIN_PATH/bin"
displayName: Install toolchain
- bash: |
python3 --version
fusesoc --version
verilator --version
displayName: Display environment
- bash: |
make -C hw/ip/otbn/dv/otbnsim test
displayName: OTBN ISS Test
- bash: |
./hw/ip/otbn/dv/smoke/run_smoke.sh
displayName: OTBN Smoke Test
- bash: |
make -C hw/ip/otbn/util asm-check
displayName: Assemble and link code snippets
- job: chip_earlgrey_cw310
displayName: Build CW310 variant of the Earl Grey toplevel design using Vivado
dependsOn:
- lint
# The bootrom is built into the FPGA image at synthesis time.
- sw_build
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
pool: ci-public
timeoutInMinutes: 120 # 2 hours
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- sw_build
- bash: |
set -e
. util/build_consts.sh
module load "xilinx/vivado/$(VIVADO_VERSION)"
mkdir -p "$OBJ_DIR/hw"
mkdir -p "$BIN_DIR/hw/top_earlgrey"
BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_cw310.scr.39.vmem"
test -f "$BOOTROM_VMEM"
OTP_VMEM="$BIN_DIR/sw/device/otp_img/otp_img_fpga_cw310.vmem"
test -f "$OTP_VMEM"
fusesoc --cores-root=. \
run --flag=fileset_top --target=synth --setup --build \
--build-root="$OBJ_DIR/hw" \
lowrisc:systems:chip_earlgrey_cw310 \
--BootRomInitFile="$BOOTROM_VMEM" \
--OtpCtrlMemInitFile="$OTP_VMEM"
cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.bit" \
"$BIN_DIR/hw/top_earlgrey"
displayName: Build bitstream with Vivado
- bash: |
. util/build_consts.sh
echo Synthesis log
cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/synth_1/runme.log || true
echo Implementation log
cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/impl_1/runme.log || true
condition: always()
displayName: Display synthesis and implementation logs
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/hw/top_earlgrey/lowrisc_systems_chip_earlgrey_cw310_0.1.bit"
- publish: "$(Build.ArtifactStagingDirectory)"
artifact: chip_earlgrey_cw310-build-out
displayName: Upload all Vivado artifacts for CW310
condition: failed()
- job: chip_earlgrey_nexysvideo
displayName: Build NexysVideo variant of the Earl Grey toplevel design using Vivado
dependsOn:
- lint
# The bootrom is built into the FPGA image at synthesis time.
- sw_build_nexysvideo
# Make the following condition always false for now, see #7814.
condition: and(succeeded(), False, eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
pool: ci-public
timeoutInMinutes: 120 # 2 hours
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- sw_build_nexysvideo
- bash: |
set -e
. util/build_consts.sh
module load "xilinx/vivado/$(VIVADO_VERSION)"
mkdir -p "$OBJ_DIR/hw"
mkdir -p "$BIN_DIR/hw/top_earlgrey"
./hw/top_earlgrey/util/top_earlgrey_reduce.py
BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.scr.39.vmem"
test -f "$BOOTROM_VMEM"
OTP_VMEM="$BIN_DIR/sw/device/otp_img/otp_img_fpga_nexysvideo.vmem"
test -f "$OTP_VMEM"
fusesoc --cores-root=. \
run --flag=fileset_top --target=synth --setup --build \
--build-root="$OBJ_DIR/hw" \
lowrisc:systems:chip_earlgrey_nexysvideo \
--BootRomInitFile="$BOOTROM_VMEM" \
--OtpCtrlMemInitFile="$OTP_VMEM"
cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.bit" \
"$BIN_DIR/hw/top_earlgrey"
displayName: Build bitstream with Vivado
- bash: |
. util/build_consts.sh
echo Synthesis log
cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.runs/synth_1/runme.log || true
echo Implementation log
cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.runs/impl_1/runme.log || true
condition: always()
displayName: Display synthesis and implementation logs
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/hw/top_earlgrey/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.bit"
- publish: "$(Build.ArtifactStagingDirectory)"
artifact: chip_earlgrey_nexysvideo-build-out
displayName: Upload all Vivado artifacts for Nexys Video
condition: failed()
- job: chip_englishbreakfast_cw305
displayName: Build CW305 variant of the English Breakfast toplevel design using Vivado
dependsOn:
- lint
- sw_build_englishbreakfast
condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
pool: ci-public
timeoutInMinutes: 120 # 2 hours
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- sw_build_englishbreakfast
- bash: |
set -e
. util/build_consts.sh
module load "xilinx/vivado/$(VIVADO_VERSION)"
mkdir -p "$OBJ_DIR/hw"
mkdir -p "$BIN_DIR/hw/top_englishbreakfast"
BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.32.vmem"
test -f "$BOOTROM_VMEM"
util/topgen-fusesoc.py --files-root=. --topname=top_englishbreakfast
fusesoc --cores-root=. \
run --flag=fileset_topgen --target=synth --setup --build \
--build-root="$OBJ_DIR/hw" \
lowrisc:systems:chip_englishbreakfast_cw305 \
--BootRomInitFile="$BOOTROM_VMEM"
cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit" \
"$BIN_DIR/hw/top_englishbreakfast"
displayName: Build bitstream with Vivado
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
- "/hw/top_englishbreakfast/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit"
- job: execute_fpga_tests_cw310
displayName: Execute tests on ChipWhisperer CW310 FPGA board
pool: FPGA
timeoutInMinutes: 30
dependsOn:
- chip_earlgrey_cw310
- sw_build
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- chip_earlgrey_cw310
- sw_build
- bash: |
set -e
# Install an additional pytest dependency for result upload.
pip3 install pytest-azurepipelines
. util/build_consts.sh
pytest --version
pytest test/systemtest/earlgrey/test_fpga_cw310.py \
--log-cli-level=DEBUG \
--test-run-title="Run system tests on ChipWhisperer CW310 FPGA board" \
--napoleon-docstrings
displayName: Execute tests
- job: execute_fpga_tests_nexysvideo
displayName: Execute tests on Nexys Video FPGA board
pool: FPGA
timeoutInMinutes: 30
dependsOn:
- chip_earlgrey_nexysvideo
- sw_build_nexysvideo
- sw_build
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- chip_earlgrey_nexysvideo
- sw_build_nexysvideo
- sw_build
- bash: |
set -e
module load "xilinx/vivado/$(VIVADO_VERSION)"
# Install an additional pytest dependency for result upload.
pip3 install pytest-azurepipelines
. util/build_consts.sh
pytest --version
pytest test/systemtest/earlgrey/test_fpga_nexysvideo.py \
--log-cli-level=DEBUG \
--test-run-title="Run system tests on Nexys Video FPGA board" \
--napoleon-docstrings
displayName: Execute tests
- job: deploy_release_artifacts
displayName: Package and deploy release distribution
pool:
vmImage: ubuntu-18.04
dependsOn:
- lint
- sw_build
- chip_earlgrey_verilator
- chip_earlgrey_nexysvideo
- chip_earlgrey_cw310
condition: and(eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
steps:
- template: ci/install-package-dependencies.yml
- template: ci/download-artifacts-template.yml
parameters:
downloadPartialBuildBinFrom:
- sw_build
#- sw_build_nexysvideo
- chip_earlgrey_verilator
#- chip_earlgrey_nexysvideo
- chip_earlgrey_cw310
- chip_englishbreakfast_verilator
- bash: |
. util/build_consts.sh
util/make_distribution.sh
tar --list -f $BIN_DIR/opentitan-*.tar.xz
# Put the resulting tar file into a directory the |publish| step below can reference.
mkdir "$BUILD_ROOT/dist-final"
mv $BIN_DIR/opentitan-*.tar.xz "$BUILD_ROOT/dist-final"
displayName: Create final dist directory out of partial ones
- publish: $(Build.ArtifactStagingDirectory)/dist-final
artifact: opentitan-dist
displayName: Upload release artifacts as Azure artifact
- task: GithubRelease@0
displayName: Upload to GitHub releases (only tags)
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
gitHubConnection: opentitan-release-upload
repositoryName: lowrisc/opentitan
addChangeLog: false
assets: |
$(Build.ArtifactStagingDirectory)/dist-final/*
- job: build_docker_containers
displayName: "Build Docker Containers"
pool:
vmImage: ubuntu-18.04
dependsOn:
- lint
steps:
- task: Docker@2
displayName: Build Developer Utility Container
inputs:
command: build
Dockerfile: ./util/container/Dockerfile
buildContext: .
- task: Docker@2
displayName: Build Documentation Builder Container
inputs:
command: build
tags: gcr.io/active-premise-257318/builder
Dockerfile: ./site/docs/builder.Dockerfile
buildContext: .
- task: Docker@2
displayName: Build Documentation Redirector Container
inputs:
command: build
Dockerfile: ./site/redirector/Dockerfile
buildContext: ./site/redirector