blob: 01a03f167294d59d62170f2773003c37743f697b [file] [log] [blame]
Sam Elliottd2028282020-06-02 18:18:54 +01001# Copyright lowRISC contributors.
2# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3# SPDX-License-Identifier: Apache-2.0
4#
lowRISC Contributors802543a2019-08-31 12:12:56 +01005# Azure Pipelines CI build configuration
6# Documentation at https://aka.ms/yaml
7
8variables:
Rupert Swarbrickdf237122021-04-20 14:43:48 +01009 #
Alphan Ulusoye2205892021-05-13 09:36:17 -040010 # If updating VERILATOR_VERSION, OPENOCD_VERSION, TOOLCHAIN_VERSION or RUST_VERSION
11 # update the definitions in util/container/Dockerfile as well.
Rupert Swarbrickdf237122021-04-20 14:43:48 +010012 #
Philipp Wagnerb27f72d2021-07-23 14:41:20 +010013 VERILATOR_VERSION: 4.210
Philipp Wagnerb02d9c82021-02-24 15:00:54 +000014 OPENOCD_VERSION: 0.11.0
Miguel Osorio88179fc2019-09-19 23:37:48 -070015 TOOLCHAIN_PATH: /opt/buildcache/riscv
Michael Schaffner6c1f1da2022-04-19 12:40:58 -070016 VERIBLE_VERSION: v0.0-2135-gb534c1fe
Jon Flatleyaa91c772022-02-16 17:00:27 -050017 RUST_VERSION: 1.58.0
Miguel Osorio88179fc2019-09-19 23:37:48 -070018 # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases
Luís Marques01b2cac2022-02-10 21:48:11 +000019 TOOLCHAIN_VERSION: 20220210-1
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -060020 # This controls where builds happen, and gets picked up by build_consts.sh.
21 BUILD_ROOT: $(Build.ArtifactStagingDirectory)
Philipp Wagnerb8b053f2021-05-25 09:26:34 +010022 VIVADO_VERSION: "2020.2"
lowRISC Contributors802543a2019-08-31 12:12:56 +010023
24trigger:
lowRISC Contributors802543a2019-08-31 12:12:56 +010025 batch: true
26 branches:
27 include:
Philipp Wagnerf565b662020-07-22 14:04:40 +010028 - "*"
Philipp Wagnerdd1706e2020-03-15 14:39:59 +000029 tags:
30 include:
31 - "*"
32pr:
33 branches:
34 include:
Philipp Wagnerf565b662020-07-22 14:04:40 +010035 - "*"
lowRISC Contributors802543a2019-08-31 12:12:56 +010036
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000037jobs:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060038- job: lint
Sam Elliott67e30fa2020-10-06 18:08:05 +010039 displayName: Run code quality checks (quick lint)
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000040 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +010041 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000042 steps:
43 - bash: |
Garret Kellyf5608d02019-11-01 16:28:11 -040044 sudo apt-get remove -y clang-6.0 libclang-common-6.0-dev libclang1-6.0 libllvm6.0
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060045 displayName: Remove existing Clang installation
46 - template: ci/install-package-dependencies.yml
Rupert Swarbrick105df012021-01-29 11:33:13 +000047 ## !!!
48 ##
49 ## The steps below here are duplicated in ci/jobs/quick-lint.sh
50 ## to allow developers to "run CI" locally. Keep them in sync.
51 ##
52 ## !!!
53 - bash: ci/scripts/show-env.sh
Philipp Wagner99862392020-07-22 13:32:34 +010054 displayName: Display environment information
Rupert Swarbrick105df012021-01-29 11:33:13 +000055 - bash: ci/scripts/lint-commits.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Philipp Wagner93cdcef2021-01-19 14:31:47 +000056 condition: eq(variables['Build.Reason'], 'PullRequest')
57 displayName: Check commit metadata
Rupert Swarbrick105df012021-01-29 11:33:13 +000058 - bash: ci/scripts/check-licence-headers.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Philipp Wagner93cdcef2021-01-19 14:31:47 +000059 condition: eq(variables['Build.Reason'], 'PullRequest')
60 displayName: Check Licence Headers
Rupert Swarbrickf0d5b0c2021-03-26 11:48:42 +000061 - bash: ci/scripts/exec-check.sh
62 condition: eq(variables['Build.Reason'], 'PullRequest')
63 displayName: Check executable bits
Rupert Swarbrick5dc62b02021-04-28 09:39:18 +010064 - bash: ci/scripts/check-ascii.sh
65 condition: eq(variables['Build.Reason'], 'PullRequest')
66 displayName: Check for non-ASCII characters in source code
Rupert Swarbrick105df012021-01-29 11:33:13 +000067 - bash: ci/scripts/python-lint.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Rupert Swarbrickfb9fdb62021-02-01 17:30:48 +000068 condition: eq(variables['Build.Reason'], 'PullRequest')
Rupert Swarbrick746f9b12021-03-26 17:19:00 +000069 displayName: Run Python lint (flake8)
Rupert Swarbrick2d70c752020-03-24 17:23:40 +000070 continueOnError: true
Rupert Swarbrick746f9b12021-03-26 17:19:00 +000071 - bash: ci/scripts/mypy.sh
72 condition: eq(variables['Build.Reason'], 'PullRequest')
73 displayName: Run Python lint (mypy)
Rupert Swarbrick105df012021-01-29 11:33:13 +000074 - bash: ci/scripts/check-generated.sh
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060075 displayName: Ensure all generated files are clean and up-to-date
Rupert Swarbrick105df012021-01-29 11:33:13 +000076 - bash: ci/scripts/clang-format.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000077 condition: eq(variables['Build.Reason'], 'PullRequest')
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060078 displayName: Use clang-format to check C/C++ coding style
Rupert Swarbrick105df012021-01-29 11:33:13 +000079 - bash: ci/scripts/include-guard.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Miguel Young de la Sotab23dc8c2020-01-14 13:52:33 -050080 condition: eq(variables['Build.Reason'], 'PullRequest')
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060081 displayName: Check formatting on header guards
Miguel Young de la Sotacf77e212022-04-21 12:03:48 -040082 - bash: ci/scripts/whitespace.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
83 condition: eq(variables['Build.Reason'], 'PullRequest')
84 displayName: Check trailing whitespace
Rupert Swarbrick105df012021-01-29 11:33:13 +000085 - bash: ci/scripts/verible-lint.sh rtl
Michael Schaffnerde326062020-07-14 17:50:35 -070086 condition: eq(variables['Build.Reason'], 'PullRequest')
Michael Schaffnera94241f2020-08-03 15:50:14 -070087 displayName: Style-Lint RTL Verilog source files with Verible
Rupert Swarbrick105df012021-01-29 11:33:13 +000088 - bash: ci/scripts/verible-lint.sh dv
Michael Schaffnera94241f2020-08-03 15:50:14 -070089 condition: eq(variables['Build.Reason'], 'PullRequest')
90 displayName: Style-Lint DV Verilog source files with Verible
Philipp Wagnerd5837ab2021-10-01 16:59:49 +010091 - bash: ci/scripts/verible-lint.sh fpv
92 condition: eq(variables['Build.Reason'], 'PullRequest')
93 displayName: Style-Lint FPV Verilog source files with Verible
Rupert Swarbrick105df012021-01-29 11:33:13 +000094 - bash: ci/scripts/build-docs.sh
Philipp Wagner93cdcef2021-01-19 14:31:47 +000095 displayName: Render documentation
Rupert Swarbrick105df012021-01-29 11:33:13 +000096 - bash: ci/scripts/build-site.sh
Philipp Wagner93cdcef2021-01-19 14:31:47 +000097 displayName: Render landing site
Rupert Swarbrickfb9fdb62021-02-01 17:30:48 +000098 - bash: ci/scripts/get-build-type.sh "$SYSTEM_PULLREQUEST_TARGETBRANCH" "$(Build.Reason)"
Greg Chadwick99fe0642020-08-04 15:42:45 +010099 displayName: Check what kinds of changes the PR contains
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000100 name: DetermineBuildType
Philipp Wagner1e643552019-09-04 15:39:14 +0100101
Sam Elliott67e30fa2020-10-06 18:08:05 +0100102- job: slow_lints
103 displayName: Run code quality checks (in-depth lint)
104 dependsOn: lint
105 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100106 vmImage: ubuntu-18.04
Sam Elliott67e30fa2020-10-06 18:08:05 +0100107 steps:
108 - template: ci/install-package-dependencies.yml
Miguel Young de la Sota369e0272022-04-21 13:14:23 -0400109 - bash: ci/bazelisk.sh run buildifier_check
Drew Macrae932a70a2022-04-18 16:34:13 -0400110 displayName: Use buildifier to check Bazel coding style
Rupert Swarbrick2aff11b2021-02-16 17:11:37 +0000111 - bash: ci/scripts/check-vendoring.sh
Sam Elliott67e30fa2020-10-06 18:08:05 +0100112 displayName: Check vendored directories are up-to-date
113
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600114- job: sw_build
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100115 displayName: Build Software for Earl Grey toplevel design
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000116 dependsOn: lint
Philipp Wagner9d20ee62019-11-29 14:27:28 +0000117 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
Miles Dai9125a782022-04-13 11:35:09 -0400118 pool: ci-public
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000119 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600120 - template: ci/install-package-dependencies.yml
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000121 - bash: |
122 set -x
123 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800124 --install-dir="$TOOLCHAIN_PATH" \
Sam Elliotteb8ace42020-06-03 17:47:55 +0100125 --release-version="$TOOLCHAIN_VERSION" \
Philipp Wagner1c514412019-11-27 14:48:47 +0000126 --update
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600127 displayName: Install toolchain
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000128 - bash: |
Miguel Young de la Sota63793572019-11-13 14:18:51 -0600129 . util/build_consts.sh
Miguel Young de la Sota4a4946d2019-11-21 10:44:18 -0600130 ./meson_init.sh -A
Miguel Young de la Sota76526c32020-01-28 10:24:41 -0500131 ninja -C "$OBJ_DIR" all
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600132 displayName: Build embedded targets
Miguel Young de la Sota9d20b3d2020-02-03 16:35:31 -0500133 - bash: |
134 . util/build_consts.sh
135 ninja -C "$OBJ_DIR" test
Sam Elliotteb8ace42020-06-03 17:47:55 +0100136 displayName: Run unit tests
137 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600138 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000139 includePatterns:
140 - "/sw/***"
lowRISC Contributors802543a2019-08-31 12:12:56 +0100141
Greg Chadwickb045dd82022-02-15 11:29:24 +0000142- job: cw310_sw_build
143 displayName: Build Software required for CW310 FPGA synthesis
144 dependsOn: lint
145 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
146 pool:
147 vmImage: ubuntu-18.04
148 steps:
149 - template: ci/install-package-dependencies.yml
150 - bash: |
151 set -x
152 sudo util/get-toolchain.py \
153 --install-dir="$TOOLCHAIN_PATH" \
154 --release-version="$TOOLCHAIN_VERSION" \
155 --update
156 displayName: Install toolchain
157 - bash: |
158 . util/build_consts.sh
159 ./meson_init.sh -A
160 ninja -C "$OBJ_DIR" \
161 sw/device/otp_img/otp_img_export_fpga_cw310 \
162 sw/device/lib/testing/test_rom/test_rom_export_fpga_cw310
163 displayName: Build embedded targets
164 - template: ci/upload-artifacts-template.yml
165 parameters:
166 includePatterns:
167 - "/sw/***"
168
Pirmin Vogel18d8e132021-08-03 14:35:29 +0200169# Software targeting the English Breakfast top level is produced by patching
170# the source tree before building. This builds a selected subset of software
171# only.
172# TODO: This is a rather ugly hack, which will go away once we properly support
173# building more than one top-level design with different parametrizations.
174# Work towards this goal is tracked in issue #4669.
175- job: sw_build_englishbreakfast
176 displayName: Build Software for English Breakfast toplevel design
177 dependsOn: lint
178 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
179 pool:
180 vmImage: ubuntu-18.04
181 steps:
182 - template: ci/install-package-dependencies.yml
183 - bash: |
184 set -x
185 sudo util/get-toolchain.py \
186 --install-dir="$TOOLCHAIN_PATH" \
187 --release-version="$TOOLCHAIN_VERSION" \
188 --update
189 displayName: Install toolchain
190 - bash: |
191 . util/build_consts.sh
192 ./meson_init.sh -A
193 # Patch software.
194 ./hw/top_englishbreakfast/util/prepare_sw.py
195 # Build FPGA boot ROM and aes_serial binary for FPGA SCA.
Timothy Trippel961b2cd2021-12-14 22:28:58 +0000196 ninja -C "$OBJ_DIR" sw/device/lib/testing/test_rom/test_rom_export_fpga_nexysvideo
Pirmin Vogel18d8e132021-08-03 14:35:29 +0200197 ninja -C "$OBJ_DIR" sw/device/sca/aes_serial_export_fpga_nexysvideo
198 # Build binaries for Verilator simulation.
Timothy Trippel961b2cd2021-12-14 22:28:58 +0000199 ninja -C "$OBJ_DIR" sw/device/lib/testing/test_rom/test_rom_export_sim_verilator
Timothy Trippel0703f962021-09-02 21:08:20 +0000200 ninja -C "$OBJ_DIR" sw/device/tests/aes_smoketest_export_sim_verilator
Pirmin Vogel18d8e132021-08-03 14:35:29 +0200201 ninja -C "$OBJ_DIR" sw/device/examples/hello_world/hello_world_export_sim_verilator
202 displayName: Build embedded targets
203 - template: ci/upload-artifacts-template.yml
204 parameters:
205 includePatterns:
206 - "/sw/device/***"
207
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700208- job: chip_earlgrey_verilator
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600209 displayName: Build Verilator simulation of the Earl Grey toplevel design
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000210 dependsOn: lint
Philipp Wagner9d20ee62019-11-29 14:27:28 +0000211 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
Greg Chadwick424a57d2022-02-15 16:33:00 +0000212 pool: ci-public
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000213 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600214 - template: ci/install-package-dependencies.yml
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000215 - bash: |
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000216 python3 --version
217 fusesoc --version
218 verilator --version
Michael Schaffneraa193f92020-12-16 11:16:17 -0800219 verible-verilog-lint --version
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600220 displayName: Display environment
Rupert Swarbricke77e2f12021-09-03 18:09:53 +0100221 - bash: ci/scripts/build-chip-verilator.sh earlgrey
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600222 displayName: Build simulation with Verilator
223 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600224 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000225 includePatterns:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700226 - "/hw/top_earlgrey/Vchip_earlgrey_verilator"
Philipp Wagnerf4655a12019-10-30 11:59:15 +0000227
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700228- job: chip_englishbreakfast_verilator
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100229 displayName: Build Verilator simulation of the English Breakfast toplevel design
230 dependsOn: lint
231 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
232 pool:
233 vmImage: ubuntu-18.04
234 steps:
235 - template: ci/install-package-dependencies.yml
236 - bash: |
237 python3 --version
238 fusesoc --version
239 verilator --version
240 verible-verilog-lint --version
241 displayName: Display environment
Rupert Swarbricke77e2f12021-09-03 18:09:53 +0100242 - bash: ci/scripts/build-chip-verilator.sh englishbreakfast
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100243 displayName: Build simulation with Verilator
244 - template: ci/upload-artifacts-template.yml
245 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000246 includePatterns:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700247 - "/hw/top_englishbreakfast/Vchip_englishbreakfast_verilator"
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100248
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600249- job: execute_verilated_tests
Alphan Ulusoya628be12021-05-14 16:24:02 -0400250 displayName: Execute tests on the Verilated system (excl. slow tests)
Philipp Wagnera4b89b92021-05-20 22:25:42 +0100251 pool: ci-public
Philipp Wagnere7d41342021-10-18 12:19:52 +0100252 timeoutInMinutes: 120
Timothy Chen7d1436d2019-12-04 17:26:14 -0800253 dependsOn:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700254 - chip_earlgrey_verilator
Timothy Chen7d1436d2019-12-04 17:26:14 -0800255 - sw_build
256 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600257 - template: ci/install-package-dependencies.yml
258 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000259 parameters:
260 downloadPartialBuildBinFrom:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700261 - chip_earlgrey_verilator
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000262 - sw_build
Timothy Chen7d1436d2019-12-04 17:26:14 -0800263 - bash: |
Philipp Wagner33fadd02020-09-09 19:39:25 +0100264 # Install an additional pytest dependency for result upload.
265 pip3 install pytest-azurepipelines
266
Timothy Chen7d1436d2019-12-04 17:26:14 -0800267 . util/build_consts.sh
Philipp Wagner57418e72019-12-02 21:25:27 +0000268 pytest --version
Philipp Wagner03aaf322020-09-09 19:11:44 +0100269 pytest test/systemtest/earlgrey/test_sim_verilator.py \
Alphan Ulusoya628be12021-05-14 16:24:02 -0400270 -m "not slow" \
Philipp Wagner33fadd02020-09-09 19:39:25 +0100271 --log-cli-level=DEBUG \
Alphan Ulusoya628be12021-05-14 16:24:02 -0400272 --test-run-title="Run system tests with Verilator simulation (excl. slow tests)" \
Philipp Wagner33fadd02020-09-09 19:39:25 +0100273 --napoleon-docstrings
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600274 displayName: Execute tests
Timothy Chen7d1436d2019-12-04 17:26:14 -0800275
Pirmin Vogel18d8e132021-08-03 14:35:29 +0200276- job: execute_verilated_tests_englishbreakfast
277 displayName: Execute tests on the Verilated English Breakfast toplevel design
278 pool: ci-public
279 dependsOn:
280 - chip_englishbreakfast_verilator
281 - sw_build_englishbreakfast
282 steps:
283 - template: ci/install-package-dependencies.yml
284 - template: ci/download-artifacts-template.yml
285 parameters:
286 downloadPartialBuildBinFrom:
287 - chip_englishbreakfast_verilator
288 - sw_build_englishbreakfast
289 - bash: |
290 # Install an additional pytest dependency for result upload.
291 pip3 install pytest-azurepipelines
292
293 . util/build_consts.sh
294 pytest --version
295 pytest test/systemtest/englishbreakfast/test_sim_verilator.py \
296 -m "not slow" \
297 --log-cli-level=DEBUG \
298 --test-run-title="Run English Breakfast system tests with Verilator simulation" \
299 --napoleon-docstrings
300 displayName: Execute tests
301
Greg Chadwick99fe0642020-08-04 15:42:45 +0100302- job: otbn_standalone_tests
303 displayName: Run OTBN Smoke Test
304 dependsOn: lint
Philipp Wagner8d3e5632020-08-19 14:31:39 +0100305 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100306 vmImage: ubuntu-18.04
Philipp Wagnerbf0ab0a2020-12-15 12:03:42 +0000307 timeoutInMinutes: 10
Greg Chadwick99fe0642020-08-04 15:42:45 +0100308 steps:
309 - template: ci/install-package-dependencies.yml
310 - bash: |
311 set -x
312 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800313 --install-dir="$TOOLCHAIN_PATH" \
Greg Chadwick99fe0642020-08-04 15:42:45 +0100314 --release-version="$TOOLCHAIN_VERSION" \
315 --update
Rupert Swarbrick54278382020-08-25 12:45:47 +0100316 echo "##vso[task.prependpath]$TOOLCHAIN_PATH/bin"
Greg Chadwick99fe0642020-08-04 15:42:45 +0100317 displayName: Install toolchain
318 - bash: |
Greg Chadwick99fe0642020-08-04 15:42:45 +0100319 python3 --version
320 fusesoc --version
321 verilator --version
322 displayName: Display environment
323 - bash: |
Rupert Swarbrick7bd2a372020-10-02 12:36:12 +0100324 make -C hw/ip/otbn/dv/otbnsim test
325 displayName: OTBN ISS Test
326 - bash: |
Greg Chadwick99fe0642020-08-04 15:42:45 +0100327 ./hw/ip/otbn/dv/smoke/run_smoke.sh
328 displayName: OTBN Smoke Test
Rupert Swarbrick54278382020-08-25 12:45:47 +0100329 - bash: |
Rupert Swarbrick7087ed82020-11-13 18:16:46 +0000330 make -C hw/ip/otbn/util asm-check
Rupert Swarbrick54278382020-08-25 12:45:47 +0100331 displayName: Assemble and link code snippets
Greg Chadwick99fe0642020-08-04 15:42:45 +0100332
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200333- job: chip_earlgrey_cw310
334 displayName: Build CW310 variant of the Earl Grey toplevel design using Vivado
335 dependsOn:
336 - lint
337 # The bootrom is built into the FPGA image at synthesis time.
Greg Chadwickb045dd82022-02-15 11:29:24 +0000338 - cw310_sw_build
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200339 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
340 pool: ci-public
341 timeoutInMinutes: 120 # 2 hours
342 steps:
343 - template: ci/install-package-dependencies.yml
344 - template: ci/download-artifacts-template.yml
345 parameters:
346 downloadPartialBuildBinFrom:
Greg Chadwickb045dd82022-02-15 11:29:24 +0000347 - cw310_sw_build
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200348 - bash: |
349 set -e
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200350 module load "xilinx/vivado/$(VIVADO_VERSION)"
Rupert Swarbrickd9b83ce2022-04-07 14:27:59 +0100351 ci/scripts/build-bitstream-vivado.sh top_earlgrey cw310
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200352 displayName: Build bitstream with Vivado
353 - bash: |
354 . util/build_consts.sh
355 echo Synthesis log
356 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/synth_1/runme.log || true
357
358 echo Implementation log
359 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/impl_1/runme.log || true
360 condition: always()
361 displayName: Display synthesis and implementation logs
362 - template: ci/upload-artifacts-template.yml
363 parameters:
364 includePatterns:
Miguel Osorio45e08ff2021-11-30 20:39:32 -0800365 - "/hw/***"
Philipp Wagner9b37c342021-02-01 16:21:38 +0000366 - publish: "$(Build.ArtifactStagingDirectory)"
367 artifact: chip_earlgrey_cw310-build-out
368 displayName: Upload all Vivado artifacts for CW310
369 condition: failed()
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200370
Miguel Osorio45e08ff2021-11-30 20:39:32 -0800371- job: chip_earlgrey_cw310_splice_mask_rom
372 displayName: Splice mask ROM binary into CW310 bitstream using Vivado
373 dependsOn:
374 - chip_earlgrey_cw310
375 - sw_build
376 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
377 pool: ci-public
378 timeoutInMinutes: 10
379 steps:
380 - template: ci/install-package-dependencies.yml
381 - template: ci/download-artifacts-template.yml
382 parameters:
383 downloadPartialBuildBinFrom:
384 - chip_earlgrey_cw310
385 - sw_build
386 - bash: |
387 set -e
388 . util/build_consts.sh
389
390 module load "xilinx/vivado/$(VIVADO_VERSION)"
391
392 util/fpga/splice_rom.sh -t cw310 -T earlgrey -b PROD
393
394 displayName: Splicing bitstream with Vivado
395 - template: ci/upload-artifacts-template.yml
396 parameters:
397 includePatterns:
398 - "/hw/***"
Miles Daica6be0f2022-04-06 15:27:05 -0400399 - ${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
400 - template: ci/gcp-upload-bitstream-template.yml
401 parameters:
402 parentDir: "$BIN_DIR/hw/top_earlgrey"
403 includeFiles:
404 - "lowrisc_systems_chip_earlgrey_cw310_0.1.bit.orig"
405 - "lowrisc_systems_chip_earlgrey_cw310_0.1.bit.splice"
406 gcpKeyFile: "gcpkey.json"
407 bucketURI: "gs://opentitan-bitstreams/master"
Miguel Osorio45e08ff2021-11-30 20:39:32 -0800408 - publish: "$(Build.ArtifactStagingDirectory)"
409 artifact: chip_earlgrey_cw310-splice-mask-rom-build-out
410 displayName: Upload all Vivado artifacts for CW310
411 condition: failed()
412
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700413- job: chip_englishbreakfast_cw305
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100414 displayName: Build CW305 variant of the English Breakfast toplevel design using Vivado
415 dependsOn:
416 - lint
Pirmin Vogel18d8e132021-08-03 14:35:29 +0200417 - sw_build_englishbreakfast
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800418 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100419 pool: ci-public
420 timeoutInMinutes: 120 # 2 hours
421 steps:
422 - template: ci/install-package-dependencies.yml
423 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000424 parameters:
425 downloadPartialBuildBinFrom:
Pirmin Vogel18d8e132021-08-03 14:35:29 +0200426 - sw_build_englishbreakfast
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100427 - bash: |
428 set -e
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100429 module load "xilinx/vivado/$(VIVADO_VERSION)"
Rupert Swarbrickd9b83ce2022-04-07 14:27:59 +0100430 ci/scripts/build-bitstream-vivado.sh top_englishbreakfast cw305
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100431 displayName: Build bitstream with Vivado
432 - template: ci/upload-artifacts-template.yml
433 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000434 includePatterns:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700435 - "/hw/top_englishbreakfast/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit"
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100436
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200437- job: execute_fpga_tests_cw310
438 displayName: Execute tests on ChipWhisperer CW310 FPGA board
439 pool: FPGA
Miles Daid6691ca2022-04-13 11:28:05 -0400440 timeoutInMinutes: 8
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200441 dependsOn:
442 - chip_earlgrey_cw310
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200443 - sw_build
444 steps:
445 - template: ci/install-package-dependencies.yml
446 - template: ci/download-artifacts-template.yml
447 parameters:
448 downloadPartialBuildBinFrom:
449 - chip_earlgrey_cw310
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200450 - sw_build
451 - bash: |
452 set -e
453
454 # Install an additional pytest dependency for result upload.
455 pip3 install pytest-azurepipelines
456
457 . util/build_consts.sh
458 pytest --version
459 pytest test/systemtest/earlgrey/test_fpga_cw310.py \
460 --log-cli-level=DEBUG \
461 --test-run-title="Run system tests on ChipWhisperer CW310 FPGA board" \
462 --napoleon-docstrings
463 displayName: Execute tests
464
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600465- job: deploy_release_artifacts
466 displayName: Package and deploy release distribution
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000467 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100468 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000469 dependsOn:
470 - lint
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600471 - sw_build
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700472 - chip_earlgrey_verilator
Philipp Wagnera0a35a52021-08-04 16:39:35 +0100473 - chip_earlgrey_cw310
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800474 condition: and(eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000475 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600476 - template: ci/install-package-dependencies.yml
477 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000478 parameters:
479 downloadPartialBuildBinFrom:
480 - sw_build
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700481 - chip_earlgrey_verilator
Philipp Wagnera0a35a52021-08-04 16:39:35 +0100482 - chip_earlgrey_cw310
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700483 - chip_englishbreakfast_verilator
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600484 - bash: |
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600485 . util/build_consts.sh
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600486
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600487 util/make_distribution.sh
Philipp Wagner542e2202019-10-30 13:10:16 +0000488
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600489 tar --list -f $BIN_DIR/opentitan-*.tar.xz
490 # Put the resulting tar file into a directory the |publish| step below can reference.
491 mkdir "$BUILD_ROOT/dist-final"
492 mv $BIN_DIR/opentitan-*.tar.xz "$BUILD_ROOT/dist-final"
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600493 displayName: Create final dist directory out of partial ones
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000494 - publish: $(Build.ArtifactStagingDirectory)/dist-final
495 artifact: opentitan-dist
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600496 displayName: Upload release artifacts as Azure artifact
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000497 - task: GithubRelease@0
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600498 displayName: Upload to GitHub releases (only tags)
Philipp Wagner0b20f5d2019-11-01 16:24:52 +0000499 condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000500 inputs:
501 gitHubConnection: opentitan-release-upload
502 repositoryName: lowrisc/opentitan
503 addChangeLog: false
504 assets: |
505 $(Build.ArtifactStagingDirectory)/dist-final/*
Sam Elliotte257cd02020-09-10 13:49:38 +0100506
507
508- job: build_docker_containers
509 displayName: "Build Docker Containers"
510 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100511 vmImage: ubuntu-18.04
Sam Elliotte257cd02020-09-10 13:49:38 +0100512 dependsOn:
513 - lint
514 steps:
515 - task: Docker@2
516 displayName: Build Developer Utility Container
517 inputs:
518 command: build
519 Dockerfile: ./util/container/Dockerfile
520 buildContext: .
521 - task: Docker@2
522 displayName: Build Documentation Builder Container
523 inputs:
524 command: build
525 tags: gcr.io/active-premise-257318/builder
526 Dockerfile: ./site/docs/builder.Dockerfile
527 buildContext: .
528 - task: Docker@2
529 displayName: Build Documentation Redirector Container
530 inputs:
531 command: build
532 Dockerfile: ./site/redirector/Dockerfile
533 buildContext: ./site/redirector
Drew Macrae8a358142022-01-26 07:20:04 -0800534
Drew Macraeb90a49c2022-04-05 12:17:49 -0400535- job: bazel_test
536 displayName: Bazel Software Build and Test
Miles Dai28acbee2022-04-22 16:52:17 -0400537 timeoutInMinutes: 120
Drew Macraeb90a49c2022-04-05 12:17:49 -0400538 dependsOn: lint
539 pool:
540 vmImage: ubuntu-18.04
Miles Dai1c42d292022-04-16 00:33:23 -0400541 variables:
542 - name: bazelCacheGcpKeyPath
543 value: ''
Drew Macraeb90a49c2022-04-05 12:17:49 -0400544 steps:
545 - template: ci/install-package-dependencies.yml
Miles Dai1c42d292022-04-16 00:33:23 -0400546 - task: DownloadSecureFile@1
547 condition: eq(variables['Build.SourceBranchName'], 'master')
548 name: bazelCacheGcpKey
549 inputs:
550 secureFile: "bazel_cache_gcp_key.json"
551 - bash: echo "##vso[task.setvariable variable=bazelCacheGcpKeyPath]$(bazelCacheGcpKey.secureFilePath)"
552 condition: eq(variables['Build.SourceBranchName'], 'master')
553 displayName: Set the remote cache GCP key path
Miguel Young de la Sota369e0272022-04-21 13:14:23 -0400554 - bash: |
555 # This command builds all software and runs all unit tests that run on
556 # the host.
557 export GCP_BAZEL_CACHE_KEY=$(bazelCacheGcpKeyPath)
558 ci/bazelisk.sh test \
559 --build_tests_only=false \
Miguel Young de la Sota634aceb2022-04-21 13:38:37 -0400560 --define DISABLE_VERILATOR_BUILD=true \
Miguel Young de la Sota369e0272022-04-21 13:14:23 -0400561 --test_tag_filters=-broken,-cw310,-verilator,-dv \
562 //sw/...
563 displayName: "Build and Unit Test Software with Bazel"