blob: 01814ca1767bcd91d5ddfa1162c20918efbc01b5 [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:
Philipp Wagnere8ade052020-11-16 11:18:49 +00009 VERILATOR_VERSION: 4.104
Philipp Wagnerb02d9c82021-02-24 15:00:54 +000010 OPENOCD_VERSION: 0.11.0
Miguel Osorio88179fc2019-09-19 23:37:48 -070011 TOOLCHAIN_PATH: /opt/buildcache/riscv
Michael Schaffnere66fc612020-12-15 10:47:57 -080012 VERIBLE_VERSION: v0.0-808-g1e17daa
Miguel Osorio88179fc2019-09-19 23:37:48 -070013 # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases
Sam Elliott00881552020-05-04 16:46:55 +010014 # if you update this, update the definition in util/container/Dockerfile
Philipp Wagner1500b402020-10-14 11:50:24 +020015 TOOLCHAIN_VERSION: 20200904-1
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -060016 # This controls where builds happen, and gets picked up by build_consts.sh.
17 BUILD_ROOT: $(Build.ArtifactStagingDirectory)
Philipp Wagner11d2dcb2020-09-29 16:27:46 +010018 VIVADO_VERSION: "2020.1"
lowRISC Contributors802543a2019-08-31 12:12:56 +010019
20trigger:
lowRISC Contributors802543a2019-08-31 12:12:56 +010021 batch: true
22 branches:
23 include:
Philipp Wagnerf565b662020-07-22 14:04:40 +010024 - "*"
Philipp Wagnerdd1706e2020-03-15 14:39:59 +000025 tags:
26 include:
27 - "*"
28pr:
29 branches:
30 include:
Philipp Wagnerf565b662020-07-22 14:04:40 +010031 - "*"
lowRISC Contributors802543a2019-08-31 12:12:56 +010032
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000033jobs:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060034- job: lint
Sam Elliott67e30fa2020-10-06 18:08:05 +010035 displayName: Run code quality checks (quick lint)
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000036 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +010037 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000038 steps:
39 - bash: |
Garret Kellyf5608d02019-11-01 16:28:11 -040040 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 -060041 displayName: Remove existing Clang installation
42 - template: ci/install-package-dependencies.yml
Rupert Swarbrick105df012021-01-29 11:33:13 +000043 ## !!!
44 ##
45 ## The steps below here are duplicated in ci/jobs/quick-lint.sh
46 ## to allow developers to "run CI" locally. Keep them in sync.
47 ##
48 ## !!!
49 - bash: ci/scripts/show-env.sh
Philipp Wagner99862392020-07-22 13:32:34 +010050 displayName: Display environment information
Rupert Swarbrick105df012021-01-29 11:33:13 +000051 - bash: ci/scripts/lint-commits.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Philipp Wagner93cdcef2021-01-19 14:31:47 +000052 condition: eq(variables['Build.Reason'], 'PullRequest')
53 displayName: Check commit metadata
Rupert Swarbrick105df012021-01-29 11:33:13 +000054 - bash: ci/scripts/check-licence-headers.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Philipp Wagner93cdcef2021-01-19 14:31:47 +000055 condition: eq(variables['Build.Reason'], 'PullRequest')
56 displayName: Check Licence Headers
Rupert Swarbrick105df012021-01-29 11:33:13 +000057 - bash: ci/scripts/python-lint.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Rupert Swarbrickfb9fdb62021-02-01 17:30:48 +000058 condition: eq(variables['Build.Reason'], 'PullRequest')
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060059 displayName: Run Python lint
Rupert Swarbrick2d70c752020-03-24 17:23:40 +000060 continueOnError: true
Rupert Swarbrick105df012021-01-29 11:33:13 +000061 - bash: ci/scripts/check-generated.sh
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060062 displayName: Ensure all generated files are clean and up-to-date
Rupert Swarbrick105df012021-01-29 11:33:13 +000063 - bash: ci/scripts/clang-format.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000064 condition: eq(variables['Build.Reason'], 'PullRequest')
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060065 displayName: Use clang-format to check C/C++ coding style
Rupert Swarbrick105df012021-01-29 11:33:13 +000066 - bash: ci/scripts/include-guard.sh $SYSTEM_PULLREQUEST_TARGETBRANCH
Miguel Young de la Sotab23dc8c2020-01-14 13:52:33 -050067 condition: eq(variables['Build.Reason'], 'PullRequest')
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060068 displayName: Check formatting on header guards
Rupert Swarbrick105df012021-01-29 11:33:13 +000069 - bash: ci/scripts/verible-lint.sh rtl
Michael Schaffnerde326062020-07-14 17:50:35 -070070 condition: eq(variables['Build.Reason'], 'PullRequest')
Michael Schaffnera94241f2020-08-03 15:50:14 -070071 displayName: Style-Lint RTL Verilog source files with Verible
Rupert Swarbrick105df012021-01-29 11:33:13 +000072 - bash: ci/scripts/verible-lint.sh dv
Michael Schaffnera94241f2020-08-03 15:50:14 -070073 condition: eq(variables['Build.Reason'], 'PullRequest')
74 displayName: Style-Lint DV Verilog source files with Verible
Rupert Swarbrick105df012021-01-29 11:33:13 +000075 - bash: ci/scripts/build-docs.sh
Philipp Wagner93cdcef2021-01-19 14:31:47 +000076 displayName: Render documentation
Rupert Swarbrick105df012021-01-29 11:33:13 +000077 - bash: ci/scripts/build-site.sh
Philipp Wagner93cdcef2021-01-19 14:31:47 +000078 displayName: Render landing site
Rupert Swarbrickfb9fdb62021-02-01 17:30:48 +000079 - bash: ci/scripts/get-build-type.sh "$SYSTEM_PULLREQUEST_TARGETBRANCH" "$(Build.Reason)"
Greg Chadwick99fe0642020-08-04 15:42:45 +010080 displayName: Check what kinds of changes the PR contains
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000081 name: DetermineBuildType
Philipp Wagner1e643552019-09-04 15:39:14 +010082
Sam Elliott67e30fa2020-10-06 18:08:05 +010083- job: slow_lints
84 displayName: Run code quality checks (in-depth lint)
85 dependsOn: lint
86 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +010087 vmImage: ubuntu-18.04
Sam Elliott67e30fa2020-10-06 18:08:05 +010088 steps:
89 - template: ci/install-package-dependencies.yml
Rupert Swarbrick2aff11b2021-02-16 17:11:37 +000090 - bash: ci/scripts/check-vendoring.sh
Sam Elliott67e30fa2020-10-06 18:08:05 +010091 displayName: Check vendored directories are up-to-date
92
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -060093- job: sw_build
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +010094 displayName: Build Software for Earl Grey toplevel design
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000095 dependsOn: lint
Philipp Wagner9d20ee62019-11-29 14:27:28 +000096 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000097 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +010098 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000099 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600100 - template: ci/install-package-dependencies.yml
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000101 - bash: |
102 set -x
103 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800104 --install-dir="$TOOLCHAIN_PATH" \
Sam Elliotteb8ace42020-06-03 17:47:55 +0100105 --release-version="$TOOLCHAIN_VERSION" \
Philipp Wagner1c514412019-11-27 14:48:47 +0000106 --update
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600107 displayName: Install toolchain
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000108 - bash: |
Miguel Young de la Sota63793572019-11-13 14:18:51 -0600109 . util/build_consts.sh
Miguel Young de la Sota4a4946d2019-11-21 10:44:18 -0600110 ./meson_init.sh -A
Miguel Young de la Sota76526c32020-01-28 10:24:41 -0500111 ninja -C "$OBJ_DIR" all
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600112 displayName: Build embedded targets
Miguel Young de la Sota9d20b3d2020-02-03 16:35:31 -0500113 - bash: |
114 . util/build_consts.sh
115 ninja -C "$OBJ_DIR" test
Sam Elliotteb8ace42020-06-03 17:47:55 +0100116 displayName: Run unit tests
Philipp Wagner622ec3f2021-02-02 18:37:24 +0000117 - bash: |
118 . util/build_consts.sh
119 # Remove all Nexys Video-related build artifacts, which will be produced
120 # by the sw_build_nexysvideo job below (see comment there).
121 find "$BIN_DIR/sw/device" -name '*fpga_nexysvideo*' -type f -delete
122 displayName: Delete all Nexys Video build artifacts
Sam Elliotteb8ace42020-06-03 17:47:55 +0100123 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600124 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000125 includePatterns:
126 - "/sw/***"
lowRISC Contributors802543a2019-08-31 12:12:56 +0100127
Philipp Wagner622ec3f2021-02-02 18:37:24 +0000128# Software targeting the Nexys Video board is produced by patching the source
129# tree before building. This produces a full sw build tree, however only the
130# artifacts with "nexysvideo" in the name are actually the ones we're looking
131# for. Everything else will be discarded.
132# TODO: This is a rather ugly hack, which will go away once we properly support
133# building more than one top-level design with different parametrizations.
134# Work towards this goal is tracked in issue #4669.
Timothy Chenf835aa32021-01-08 16:27:50 -0800135- job: sw_build_nexysvideo
136 displayName: Build Software for Earl Grey toplevel design targeting the Nexys Video board
137 dependsOn: lint
138 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
139 pool:
140 vmImage: ubuntu-18.04
141 steps:
142 - template: ci/install-package-dependencies.yml
143 - bash: |
144 set -x
145 sudo util/get-toolchain.py \
146 --install-dir="$TOOLCHAIN_PATH" \
147 --release-version="$TOOLCHAIN_VERSION" \
148 --update
149 displayName: Install toolchain
150 - bash: |
151 . util/build_consts.sh
152 ./hw/top_earlgrey/util/top_earlgrey_reduce.py
153 ./meson_init.sh -A
154 ninja -C "$OBJ_DIR" all
Philipp Wagner622ec3f2021-02-02 18:37:24 +0000155
156 # Delete all build artifacts which are *not* for the Nexys Video board.
157 find "$BIN_DIR/sw/device" -not -name '*fpga_nexysvideo*' -type f -delete
Timothy Chenf835aa32021-01-08 16:27:50 -0800158 displayName: Build embedded targets
159 - bash: |
160 . util/build_consts.sh
161 ninja -C "$OBJ_DIR" test
162 displayName: Run unit tests
163 - template: ci/upload-artifacts-template.yml
164 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000165 includePatterns:
166 - "/sw/device/**/*nexysvideo*"
Timothy Chenf835aa32021-01-08 16:27:50 -0800167
Luís Marques5849cd12020-06-26 10:33:55 +0100168# We continue building with GCC, despite defaulting to Clang. This is a copy of
169# `sw_build` with `meson_init.sh` configured with the GCC toolchain, instead of
170# the default toolchain.
171- job: sw_build_gcc
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100172 displayName: Build Software for Earl Grey toplevel design (with GCC)
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100173 dependsOn: lint
174 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
175 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100176 vmImage: ubuntu-18.04
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100177 steps:
178 - template: ci/install-package-dependencies.yml
179 - bash: |
180 set -x
181 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800182 --install-dir="$TOOLCHAIN_PATH" \
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100183 --release-version="$TOOLCHAIN_VERSION" \
184 --update
185 displayName: Install toolchain
186 - bash: |
187 . util/build_consts.sh
188 ./meson_init.sh -A \
Luís Marques5849cd12020-06-26 10:33:55 +0100189 -t "$TOOLCHAIN_PATH/meson-riscv32-unknown-elf-gcc.txt"
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100190 ninja -C "$OBJ_DIR" all
191 displayName: Build embedded targets
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100192 - bash: |
193 . util/build_consts.sh
194 ninja -C "$OBJ_DIR" test
195 displayName: Run unit tests
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100196
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600197- job: top_earlgrey_verilator
198 displayName: Build Verilator simulation of the Earl Grey toplevel design
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000199 dependsOn: lint
Philipp Wagner9d20ee62019-11-29 14:27:28 +0000200 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
Philipp Wagner0907ca12020-04-21 12:04:32 +0100201 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100202 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000203 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600204 - template: ci/install-package-dependencies.yml
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000205 - bash: |
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000206 python3 --version
207 fusesoc --version
208 verilator --version
Michael Schaffneraa193f92020-12-16 11:16:17 -0800209 verible-verilog-lint --version
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600210 displayName: Display environment
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000211 - bash: |
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600212 . util/build_consts.sh
213 mkdir -p "$OBJ_DIR/hw"
214 mkdir -p "$BIN_DIR/hw/top_earlgrey"
215
Philipp Wagnerfa8c6922020-08-18 14:14:25 +0100216 # Compile the simulation without threading; the runners provided by
217 # Azure provide two virtual CPUs, which seems to equal one physical
218 # CPU (at most); the use of threading slows down the simulation.
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600219 fusesoc --cores-root=. \
Timothy Chenbe47dd72020-07-27 14:57:07 -0700220 run --flag=fileset_top --target=sim --setup --build \
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600221 --build-root="$OBJ_DIR/hw" \
Philipp Wagnerfa8c6922020-08-18 14:14:25 +0100222 lowrisc:systems:top_earlgrey_verilator \
223 --verilator_options="--no-threads"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600224
225 cp "$OBJ_DIR/hw/sim-verilator/Vtop_earlgrey_verilator" \
226 "$BIN_DIR/hw/top_earlgrey"
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600227 displayName: Build simulation with Verilator
228 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600229 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000230 includePatterns:
231 - "/hw/top_earlgrey/Vtop_earlgrey_verilator"
Philipp Wagnerf4655a12019-10-30 11:59:15 +0000232
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100233- job: top_englishbreakfast_verilator
234 displayName: Build Verilator simulation of the English Breakfast toplevel design
235 dependsOn: lint
236 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
237 pool:
238 vmImage: ubuntu-18.04
239 steps:
240 - template: ci/install-package-dependencies.yml
241 - bash: |
242 python3 --version
243 fusesoc --version
244 verilator --version
245 verible-verilog-lint --version
246 displayName: Display environment
247 - bash: |
248 . util/build_consts.sh
249 mkdir -p "$OBJ_DIR/hw"
250 mkdir -p "$BIN_DIR/hw/top_englishbreakfast"
251
252 # Compile the simulation without threading; the runners provided by
253 # Azure provide two virtual CPUs, which seems to equal one physical
254 # CPU (at most); the use of threading slows down the simulation.
255 fusesoc --cores-root=. \
256 run --flag=fileset_topgen --target=sim --setup --build \
257 --build-root="$OBJ_DIR/hw" \
258 lowrisc:systems:top_englishbreakfast_verilator \
259 --verilator_options="--no-threads"
260
261 cp "$OBJ_DIR/hw/sim-verilator/Vtop_englishbreakfast_verilator" \
262 "$BIN_DIR/hw/top_englishbreakfast"
263 displayName: Build simulation with Verilator
264 - template: ci/upload-artifacts-template.yml
265 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000266 includePatterns:
267 - "/hw/top_englishbreakfast/Vtop_englishbreakfast_verilator"
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100268
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600269- job: execute_verilated_tests
270 displayName: Execute tests on the Verilated system
Timothy Chenf7e85cb2019-12-10 16:24:39 -0800271 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100272 vmImage: ubuntu-18.04
Timothy Chen7d1436d2019-12-04 17:26:14 -0800273 dependsOn:
274 - top_earlgrey_verilator
275 - sw_build
276 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600277 - template: ci/install-package-dependencies.yml
278 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000279 parameters:
280 downloadPartialBuildBinFrom:
281 - top_earlgrey_verilator
282 - sw_build
Timothy Chen7d1436d2019-12-04 17:26:14 -0800283 - bash: |
Philipp Wagner33fadd02020-09-09 19:39:25 +0100284 # Install an additional pytest dependency for result upload.
285 pip3 install pytest-azurepipelines
286
Timothy Chen7d1436d2019-12-04 17:26:14 -0800287 . util/build_consts.sh
Philipp Wagner57418e72019-12-02 21:25:27 +0000288 pytest --version
Philipp Wagner03aaf322020-09-09 19:11:44 +0100289 pytest test/systemtest/earlgrey/test_sim_verilator.py \
Philipp Wagner33fadd02020-09-09 19:39:25 +0100290 --log-cli-level=DEBUG \
291 --test-run-title="Run system tests with Verilator simulation" \
292 --napoleon-docstrings
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600293 displayName: Execute tests
Timothy Chen7d1436d2019-12-04 17:26:14 -0800294
Greg Chadwickbf9dc382020-04-17 09:30:40 +0100295- template: ci/run-riscv-compliance.yml
296 parameters:
297 rvc_test_suites:
298 - rv32i
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600299
Greg Chadwickbf9dc382020-04-17 09:30:40 +0100300- template: ci/run-riscv-compliance.yml
301 parameters:
302 rvc_test_suites:
303 - rv32im
304 - rv32imc
305 - rv32Zicsr
Timothy Chen7d1436d2019-12-04 17:26:14 -0800306
Greg Chadwick99fe0642020-08-04 15:42:45 +0100307- job: otbn_standalone_tests
308 displayName: Run OTBN Smoke Test
309 dependsOn: lint
310 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.hasOTBNChanges'], '1'))
Philipp Wagner8d3e5632020-08-19 14:31:39 +0100311 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100312 vmImage: ubuntu-18.04
Philipp Wagnerbf0ab0a2020-12-15 12:03:42 +0000313 timeoutInMinutes: 10
Greg Chadwick99fe0642020-08-04 15:42:45 +0100314 steps:
315 - template: ci/install-package-dependencies.yml
316 - bash: |
317 set -x
318 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800319 --install-dir="$TOOLCHAIN_PATH" \
Greg Chadwick99fe0642020-08-04 15:42:45 +0100320 --release-version="$TOOLCHAIN_VERSION" \
321 --update
Rupert Swarbrick54278382020-08-25 12:45:47 +0100322 echo "##vso[task.prependpath]$TOOLCHAIN_PATH/bin"
Greg Chadwick99fe0642020-08-04 15:42:45 +0100323 displayName: Install toolchain
324 - bash: |
Greg Chadwick99fe0642020-08-04 15:42:45 +0100325 python3 --version
326 fusesoc --version
327 verilator --version
328 displayName: Display environment
329 - bash: |
Rupert Swarbrick7bd2a372020-10-02 12:36:12 +0100330 make -C hw/ip/otbn/dv/otbnsim test
331 displayName: OTBN ISS Test
332 - bash: |
Greg Chadwick99fe0642020-08-04 15:42:45 +0100333 ./hw/ip/otbn/dv/smoke/run_smoke.sh
334 displayName: OTBN Smoke Test
Rupert Swarbrick54278382020-08-25 12:45:47 +0100335 - bash: |
Rupert Swarbrick7087ed82020-11-13 18:16:46 +0000336 make -C hw/ip/otbn/util asm-check
Rupert Swarbrick54278382020-08-25 12:45:47 +0100337 displayName: Assemble and link code snippets
Greg Chadwick99fe0642020-08-04 15:42:45 +0100338
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600339- job: top_earlgrey_nexysvideo
340 displayName: Build NexysVideo variant of the Earl Grey toplevel design using Vivado
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000341 dependsOn:
342 - lint
343 # The bootrom is built into the FPGA image at synthesis time.
Timothy Chenf835aa32021-01-08 16:27:50 -0800344 - sw_build_nexysvideo
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800345 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Philipp Wagnerc58f6a02020-10-07 19:57:09 +0100346 pool: ci-public
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000347 timeoutInMinutes: 120 # 2 hours
348 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600349 - template: ci/install-package-dependencies.yml
350 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000351 parameters:
352 downloadPartialBuildBinFrom:
353 - sw_build_nexysvideo
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000354 - bash: |
355 set -e
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600356 . util/build_consts.sh
Philipp Wagnerc58f6a02020-10-07 19:57:09 +0100357
358 module load "xilinx/vivado/$(VIVADO_VERSION)"
359
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600360 mkdir -p "$OBJ_DIR/hw"
361 mkdir -p "$BIN_DIR/hw/top_earlgrey"
362
Timothy Chenf835aa32021-01-08 16:27:50 -0800363 ./hw/top_earlgrey/util/top_earlgrey_reduce.py
364
Greg Chadwick12871042020-04-20 13:42:56 +0100365 BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.32.vmem"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600366 test -f "$BOOTROM_VMEM"
Michael Schaffner20972a62021-02-24 18:53:46 -0800367 OTP_VMEM="$BIN_DIR/sw/device/otp_img/otp_img_fpga_nexysvideo.vmem"
368 test -f "$OTP_VMEM"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600369
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600370 fusesoc --cores-root=. \
Timothy Chenbe47dd72020-07-27 14:57:07 -0700371 run --flag=fileset_top --target=synth --setup --build \
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600372 --build-root="$OBJ_DIR/hw" \
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000373 lowrisc:systems:top_earlgrey_nexysvideo \
Michael Schaffner20972a62021-02-24 18:53:46 -0800374 --BootRomInitFile="$BOOTROM_VMEM" \
375 --OtpCtrlMemInitFile="$OTP_VMEM"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600376
377 cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_earlgrey_nexysvideo_0.1.bit" \
378 "$BIN_DIR/hw/top_earlgrey"
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600379 displayName: Build bitstream with Vivado
Philipp Wagnerf072c032020-12-08 17:16:30 +0000380 - bash: |
381 . util/build_consts.sh
382 echo Synthesis log
383 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_earlgrey_nexysvideo_0.1.runs/synth_1/runme.log || true
384
385 echo Implementation log
386 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_earlgrey_nexysvideo_0.1.runs/impl_1/runme.log || true
387 condition: always()
388 displayName: Display synthesis and implementation logs
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600389 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600390 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000391 includePatterns:
392 - "/hw/top_earlgrey/lowrisc_systems_top_earlgrey_nexysvideo_0.1.bit"
lowRISC Contributors802543a2019-08-31 12:12:56 +0100393
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100394- job: top_englishbreakfast_cw305
395 displayName: Build CW305 variant of the English Breakfast toplevel design using Vivado
396 dependsOn:
397 - lint
398 # The bootrom is built into the FPGA image at synthesis time.
Pirmin Vogelc00e37f2020-12-23 21:35:47 +0100399 # Currently, we can't have different versions of binaries in $BIN_DIR. Consequently, we are
400 # using the NexysVideo bootrom here and the resulting CW305 bitstream is not functional.
401 # By generating the CW305 bootrom binary we would break execute_fpga_tests executed on the
402 # NexysVideo.
Philipp Wagner84bfe552021-02-02 18:48:07 +0000403 - sw_build_nexysvideo
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800404 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100405 pool: ci-public
406 timeoutInMinutes: 120 # 2 hours
407 steps:
408 - template: ci/install-package-dependencies.yml
409 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000410 parameters:
411 downloadPartialBuildBinFrom:
412 - sw_build_nexysvideo
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100413 - bash: |
414 set -e
415 . util/build_consts.sh
416
417 module load "xilinx/vivado/$(VIVADO_VERSION)"
418
419 mkdir -p "$OBJ_DIR/hw"
420 mkdir -p "$BIN_DIR/hw/top_englishbreakfast"
421
422 BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.32.vmem"
423 test -f "$BOOTROM_VMEM"
424
425 fusesoc --cores-root=. \
426 run --flag=fileset_topgen --target=synth --setup --build \
427 --build-root="$OBJ_DIR/hw" \
428 lowrisc:systems:top_englishbreakfast_cw305 \
429 --BootRomInitFile="$BOOTROM_VMEM"
430
431 cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_englishbreakfast_cw305_0.1.bit" \
432 "$BIN_DIR/hw/top_englishbreakfast"
433 displayName: Build bitstream with Vivado
434 - template: ci/upload-artifacts-template.yml
435 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000436 includePatterns:
437 - "/hw/top_englishbreakfast/lowrisc_systems_top_englishbreakfast_cw305_0.1.bit"
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100438
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100439- job: execute_fpga_tests
440 displayName: Execute tests on FPGA
441 pool: FPGA
442 timeoutInMinutes: 30
443 dependsOn:
444 - top_earlgrey_nexysvideo
Timothy Chenf835aa32021-01-08 16:27:50 -0800445 - sw_build_nexysvideo
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000446 - sw_build
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100447 steps:
448 - template: ci/install-package-dependencies.yml
449 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000450 parameters:
451 downloadPartialBuildBinFrom:
452 - top_earlgrey_nexysvideo
453 - sw_build_nexysvideo
454 - sw_build
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100455 - bash: |
456 set -e
457
458 module load "xilinx/vivado/$(VIVADO_VERSION)"
459
460 # Install an additional pytest dependency for result upload.
461 pip3 install pytest-azurepipelines
462
463 . util/build_consts.sh
464 pytest --version
465 pytest test/systemtest/earlgrey/test_fpga_nexysvideo.py \
466 --log-cli-level=DEBUG \
467 --test-run-title="Run system tests on Nexys Video FPGA board" \
468 --napoleon-docstrings
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100469 displayName: Execute tests
470
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600471- job: deploy_release_artifacts
472 displayName: Package and deploy release distribution
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000473 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100474 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000475 dependsOn:
476 - lint
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600477 - sw_build
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000478 - top_earlgrey_verilator
479 - top_earlgrey_nexysvideo
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800480 condition: and(eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000481 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600482 - template: ci/install-package-dependencies.yml
483 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000484 parameters:
485 downloadPartialBuildBinFrom:
486 - sw_build
487 - sw_build_nexysvideo
488 - top_earlgrey_verilator
489 - top_earlgrey_nexysvideo
490 - top_englishbreakfast_verilator
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600491 - bash: |
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600492 . util/build_consts.sh
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600493
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600494 util/make_distribution.sh
Philipp Wagner542e2202019-10-30 13:10:16 +0000495
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600496 tar --list -f $BIN_DIR/opentitan-*.tar.xz
497 # Put the resulting tar file into a directory the |publish| step below can reference.
498 mkdir "$BUILD_ROOT/dist-final"
499 mv $BIN_DIR/opentitan-*.tar.xz "$BUILD_ROOT/dist-final"
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600500 displayName: Create final dist directory out of partial ones
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000501 - publish: $(Build.ArtifactStagingDirectory)/dist-final
502 artifact: opentitan-dist
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600503 displayName: Upload release artifacts as Azure artifact
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000504 - task: GithubRelease@0
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600505 displayName: Upload to GitHub releases (only tags)
Philipp Wagner0b20f5d2019-11-01 16:24:52 +0000506 condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000507 inputs:
508 gitHubConnection: opentitan-release-upload
509 repositoryName: lowrisc/opentitan
510 addChangeLog: false
511 assets: |
512 $(Build.ArtifactStagingDirectory)/dist-final/*
Sam Elliotte257cd02020-09-10 13:49:38 +0100513
514
515- job: build_docker_containers
516 displayName: "Build Docker Containers"
517 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100518 vmImage: ubuntu-18.04
Sam Elliotte257cd02020-09-10 13:49:38 +0100519 dependsOn:
520 - lint
521 steps:
522 - task: Docker@2
523 displayName: Build Developer Utility Container
524 inputs:
525 command: build
526 Dockerfile: ./util/container/Dockerfile
527 buildContext: .
528 - task: Docker@2
529 displayName: Build Documentation Builder Container
530 inputs:
531 command: build
532 tags: gcr.io/active-premise-257318/builder
533 Dockerfile: ./site/docs/builder.Dockerfile
534 buildContext: .
535 - task: Docker@2
536 displayName: Build Documentation Redirector Container
537 inputs:
538 command: build
539 Dockerfile: ./site/redirector/Dockerfile
540 buildContext: ./site/redirector