blob: 4bb6f6cdf8b596c08cf20e49075487bb9c78b01f [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 Wagnere8ade052020-11-16 11:18:49 +000013 VERILATOR_VERSION: 4.104
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
Philipp Wagner4db8b1c2021-05-05 09:58:40 +010016 VERIBLE_VERSION: v0.0-1213-g9e5c085
Alphan Ulusoye2205892021-05-13 09:36:17 -040017 RUST_VERSION: 1.52.1
Miguel Osorio88179fc2019-09-19 23:37:48 -070018 # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases
Philipp Wagnerca403532021-04-13 09:15:28 +010019 TOOLCHAIN_VERSION: 20210412-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 Wagner11d2dcb2020-09-29 16:27:46 +010022 VIVADO_VERSION: "2020.1"
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
Rafal Kapuscik5802fd82021-04-14 16:03:31 +020082 - bash: ci/scripts/verible-format.sh
83 condition: eq(variables['Build.Reason'], 'PullRequest')
84 displayName: Check formatting of files on allow list with Verible
85 continueOnError: true
Rupert Swarbrick105df012021-01-29 11:33:13 +000086 - bash: ci/scripts/verible-lint.sh rtl
Michael Schaffnerde326062020-07-14 17:50:35 -070087 condition: eq(variables['Build.Reason'], 'PullRequest')
Michael Schaffnera94241f2020-08-03 15:50:14 -070088 displayName: Style-Lint RTL Verilog source files with Verible
Rupert Swarbrick105df012021-01-29 11:33:13 +000089 - bash: ci/scripts/verible-lint.sh dv
Michael Schaffnera94241f2020-08-03 15:50:14 -070090 condition: eq(variables['Build.Reason'], 'PullRequest')
91 displayName: Style-Lint DV Verilog source files with Verible
Rupert Swarbrick105df012021-01-29 11:33:13 +000092 - bash: ci/scripts/build-docs.sh
Philipp Wagner93cdcef2021-01-19 14:31:47 +000093 displayName: Render documentation
Rupert Swarbrick105df012021-01-29 11:33:13 +000094 - bash: ci/scripts/build-site.sh
Philipp Wagner93cdcef2021-01-19 14:31:47 +000095 displayName: Render landing site
Rupert Swarbrickfb9fdb62021-02-01 17:30:48 +000096 - bash: ci/scripts/get-build-type.sh "$SYSTEM_PULLREQUEST_TARGETBRANCH" "$(Build.Reason)"
Greg Chadwick99fe0642020-08-04 15:42:45 +010097 displayName: Check what kinds of changes the PR contains
Philipp Wagnerbd9ae432019-11-01 14:33:30 +000098 name: DetermineBuildType
Philipp Wagner1e643552019-09-04 15:39:14 +010099
Sam Elliott67e30fa2020-10-06 18:08:05 +0100100- job: slow_lints
101 displayName: Run code quality checks (in-depth lint)
102 dependsOn: lint
103 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100104 vmImage: ubuntu-18.04
Sam Elliott67e30fa2020-10-06 18:08:05 +0100105 steps:
106 - template: ci/install-package-dependencies.yml
Rupert Swarbrick2aff11b2021-02-16 17:11:37 +0000107 - bash: ci/scripts/check-vendoring.sh
Sam Elliott67e30fa2020-10-06 18:08:05 +0100108 displayName: Check vendored directories are up-to-date
109
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600110- job: sw_build
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100111 displayName: Build Software for Earl Grey toplevel design
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000112 dependsOn: lint
Philipp Wagner9d20ee62019-11-29 14:27:28 +0000113 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000114 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100115 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000116 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600117 - template: ci/install-package-dependencies.yml
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000118 - bash: |
119 set -x
120 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800121 --install-dir="$TOOLCHAIN_PATH" \
Sam Elliotteb8ace42020-06-03 17:47:55 +0100122 --release-version="$TOOLCHAIN_VERSION" \
Philipp Wagner1c514412019-11-27 14:48:47 +0000123 --update
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600124 displayName: Install toolchain
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000125 - bash: |
Miguel Young de la Sota63793572019-11-13 14:18:51 -0600126 . util/build_consts.sh
Miguel Young de la Sota4a4946d2019-11-21 10:44:18 -0600127 ./meson_init.sh -A
Miguel Young de la Sota76526c32020-01-28 10:24:41 -0500128 ninja -C "$OBJ_DIR" all
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600129 displayName: Build embedded targets
Miguel Young de la Sota9d20b3d2020-02-03 16:35:31 -0500130 - bash: |
131 . util/build_consts.sh
132 ninja -C "$OBJ_DIR" test
Sam Elliotteb8ace42020-06-03 17:47:55 +0100133 displayName: Run unit tests
Philipp Wagner622ec3f2021-02-02 18:37:24 +0000134 - bash: |
135 . util/build_consts.sh
136 # Remove all Nexys Video-related build artifacts, which will be produced
137 # by the sw_build_nexysvideo job below (see comment there).
138 find "$BIN_DIR/sw/device" -name '*fpga_nexysvideo*' -type f -delete
139 displayName: Delete all Nexys Video build artifacts
Sam Elliotteb8ace42020-06-03 17:47:55 +0100140 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600141 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000142 includePatterns:
143 - "/sw/***"
lowRISC Contributors802543a2019-08-31 12:12:56 +0100144
Philipp Wagner622ec3f2021-02-02 18:37:24 +0000145# Software targeting the Nexys Video board is produced by patching the source
146# tree before building. This produces a full sw build tree, however only the
147# artifacts with "nexysvideo" in the name are actually the ones we're looking
148# for. Everything else will be discarded.
149# TODO: This is a rather ugly hack, which will go away once we properly support
150# building more than one top-level design with different parametrizations.
151# Work towards this goal is tracked in issue #4669.
Timothy Chenf835aa32021-01-08 16:27:50 -0800152- job: sw_build_nexysvideo
153 displayName: Build Software for Earl Grey toplevel design targeting the Nexys Video board
154 dependsOn: lint
155 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
156 pool:
157 vmImage: ubuntu-18.04
158 steps:
159 - template: ci/install-package-dependencies.yml
160 - bash: |
161 set -x
162 sudo util/get-toolchain.py \
163 --install-dir="$TOOLCHAIN_PATH" \
164 --release-version="$TOOLCHAIN_VERSION" \
165 --update
166 displayName: Install toolchain
167 - bash: |
168 . util/build_consts.sh
169 ./hw/top_earlgrey/util/top_earlgrey_reduce.py
170 ./meson_init.sh -A
171 ninja -C "$OBJ_DIR" all
Philipp Wagner622ec3f2021-02-02 18:37:24 +0000172
173 # Delete all build artifacts which are *not* for the Nexys Video board.
174 find "$BIN_DIR/sw/device" -not -name '*fpga_nexysvideo*' -type f -delete
Timothy Chenf835aa32021-01-08 16:27:50 -0800175 displayName: Build embedded targets
176 - bash: |
177 . util/build_consts.sh
178 ninja -C "$OBJ_DIR" test
179 displayName: Run unit tests
180 - template: ci/upload-artifacts-template.yml
181 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000182 includePatterns:
183 - "/sw/device/**/*nexysvideo*"
Timothy Chenf835aa32021-01-08 16:27:50 -0800184
Luís Marques5849cd12020-06-26 10:33:55 +0100185# We continue building with GCC, despite defaulting to Clang. This is a copy of
186# `sw_build` with `meson_init.sh` configured with the GCC toolchain, instead of
187# the default toolchain.
188- job: sw_build_gcc
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100189 displayName: Build Software for Earl Grey toplevel design (with GCC)
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100190 dependsOn: lint
191 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
192 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100193 vmImage: ubuntu-18.04
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100194 steps:
195 - template: ci/install-package-dependencies.yml
196 - bash: |
197 set -x
198 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800199 --install-dir="$TOOLCHAIN_PATH" \
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100200 --release-version="$TOOLCHAIN_VERSION" \
201 --update
202 displayName: Install toolchain
203 - bash: |
204 . util/build_consts.sh
205 ./meson_init.sh -A \
Luís Marques5849cd12020-06-26 10:33:55 +0100206 -t "$TOOLCHAIN_PATH/meson-riscv32-unknown-elf-gcc.txt"
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100207 ninja -C "$OBJ_DIR" all
208 displayName: Build embedded targets
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100209 - bash: |
210 . util/build_consts.sh
211 ninja -C "$OBJ_DIR" test
212 displayName: Run unit tests
Sam Elliott7a00a4b2020-06-03 17:48:10 +0100213
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700214- job: chip_earlgrey_verilator
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600215 displayName: Build Verilator simulation of the Earl Grey toplevel design
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000216 dependsOn: lint
Philipp Wagner9d20ee62019-11-29 14:27:28 +0000217 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
Philipp Wagner0907ca12020-04-21 12:04:32 +0100218 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100219 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000220 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600221 - template: ci/install-package-dependencies.yml
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000222 - bash: |
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000223 python3 --version
224 fusesoc --version
225 verilator --version
Michael Schaffneraa193f92020-12-16 11:16:17 -0800226 verible-verilog-lint --version
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600227 displayName: Display environment
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000228 - bash: |
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600229 . util/build_consts.sh
230 mkdir -p "$OBJ_DIR/hw"
231 mkdir -p "$BIN_DIR/hw/top_earlgrey"
232
Philipp Wagnerfa8c6922020-08-18 14:14:25 +0100233 # Compile the simulation without threading; the runners provided by
234 # Azure provide two virtual CPUs, which seems to equal one physical
235 # CPU (at most); the use of threading slows down the simulation.
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600236 fusesoc --cores-root=. \
Timothy Chenbe47dd72020-07-27 14:57:07 -0700237 run --flag=fileset_top --target=sim --setup --build \
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600238 --build-root="$OBJ_DIR/hw" \
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700239 lowrisc:systems:chip_earlgrey_verilator \
Philipp Wagnera4b89b92021-05-20 22:25:42 +0100240 --verilator_options="--threads 4"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600241
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700242 cp "$OBJ_DIR/hw/sim-verilator/Vchip_earlgrey_verilator" \
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600243 "$BIN_DIR/hw/top_earlgrey"
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600244 displayName: Build simulation with Verilator
245 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600246 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000247 includePatterns:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700248 - "/hw/top_earlgrey/Vchip_earlgrey_verilator"
Philipp Wagnerf4655a12019-10-30 11:59:15 +0000249
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700250- job: chip_englishbreakfast_verilator
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100251 displayName: Build Verilator simulation of the English Breakfast toplevel design
252 dependsOn: lint
253 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
254 pool:
255 vmImage: ubuntu-18.04
256 steps:
257 - template: ci/install-package-dependencies.yml
258 - bash: |
259 python3 --version
260 fusesoc --version
261 verilator --version
262 verible-verilog-lint --version
263 displayName: Display environment
264 - bash: |
265 . util/build_consts.sh
266 mkdir -p "$OBJ_DIR/hw"
267 mkdir -p "$BIN_DIR/hw/top_englishbreakfast"
268
269 # Compile the simulation without threading; the runners provided by
270 # Azure provide two virtual CPUs, which seems to equal one physical
271 # CPU (at most); the use of threading slows down the simulation.
272 fusesoc --cores-root=. \
273 run --flag=fileset_topgen --target=sim --setup --build \
274 --build-root="$OBJ_DIR/hw" \
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700275 lowrisc:systems:chip_englishbreakfast_verilator \
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100276 --verilator_options="--no-threads"
277
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700278 cp "$OBJ_DIR/hw/sim-verilator/Vchip_englishbreakfast_verilator" \
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100279 "$BIN_DIR/hw/top_englishbreakfast"
280 displayName: Build simulation with Verilator
281 - template: ci/upload-artifacts-template.yml
282 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000283 includePatterns:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700284 - "/hw/top_englishbreakfast/Vchip_englishbreakfast_verilator"
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100285
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600286- job: execute_verilated_tests
Alphan Ulusoya628be12021-05-14 16:24:02 -0400287 displayName: Execute tests on the Verilated system (excl. slow tests)
Philipp Wagnera4b89b92021-05-20 22:25:42 +0100288 pool: ci-public
Timothy Chen7d1436d2019-12-04 17:26:14 -0800289 dependsOn:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700290 - chip_earlgrey_verilator
Timothy Chen7d1436d2019-12-04 17:26:14 -0800291 - sw_build
292 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600293 - template: ci/install-package-dependencies.yml
294 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000295 parameters:
296 downloadPartialBuildBinFrom:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700297 - chip_earlgrey_verilator
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000298 - sw_build
Timothy Chen7d1436d2019-12-04 17:26:14 -0800299 - bash: |
Philipp Wagner33fadd02020-09-09 19:39:25 +0100300 # Install an additional pytest dependency for result upload.
301 pip3 install pytest-azurepipelines
302
Timothy Chen7d1436d2019-12-04 17:26:14 -0800303 . util/build_consts.sh
Philipp Wagner57418e72019-12-02 21:25:27 +0000304 pytest --version
Philipp Wagner03aaf322020-09-09 19:11:44 +0100305 pytest test/systemtest/earlgrey/test_sim_verilator.py \
Alphan Ulusoya628be12021-05-14 16:24:02 -0400306 -m "not slow" \
Philipp Wagner33fadd02020-09-09 19:39:25 +0100307 --log-cli-level=DEBUG \
Alphan Ulusoya628be12021-05-14 16:24:02 -0400308 --test-run-title="Run system tests with Verilator simulation (excl. slow tests)" \
Philipp Wagner33fadd02020-09-09 19:39:25 +0100309 --napoleon-docstrings
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600310 displayName: Execute tests
Timothy Chen7d1436d2019-12-04 17:26:14 -0800311
Alphan Ulusoya628be12021-05-14 16:24:02 -0400312# This test is in a separate job becuase it takes longer to complete.
313- job: execute_silicon_creator_verilated_test
314 displayName: Execute silicon_creator test on the Verilated system
Philipp Wagnera4b89b92021-05-20 22:25:42 +0100315 pool: ci-public
Alphan Ulusoya628be12021-05-14 16:24:02 -0400316 dependsOn:
317 - chip_earlgrey_verilator
318 - sw_build
319 steps:
320 - template: ci/install-package-dependencies.yml
321 - template: ci/download-artifacts-template.yml
322 parameters:
323 downloadPartialBuildBinFrom:
324 - chip_earlgrey_verilator
325 - sw_build
326 - bash: |
327 # Install an additional pytest dependency for result upload.
328 pip3 install pytest-azurepipelines
329
330 . util/build_consts.sh
331 pytest --version
332 pytest test/systemtest/earlgrey/test_sim_verilator.py \
333 -k test_apps_selfchecking_silicon_creator[dif_uart_smoketest] \
334 --log-cli-level=DEBUG \
335 --test-run-title="Run silicon_creator system test with Verilator simulation" \
336 --napoleon-docstrings
337 displayName: Execute silicon_creator test
338
Greg Chadwickbf9dc382020-04-17 09:30:40 +0100339- template: ci/run-riscv-compliance.yml
340 parameters:
341 rvc_test_suites:
342 - rv32i
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600343
Greg Chadwickbf9dc382020-04-17 09:30:40 +0100344- template: ci/run-riscv-compliance.yml
345 parameters:
346 rvc_test_suites:
347 - rv32im
348 - rv32imc
349 - rv32Zicsr
Timothy Chen7d1436d2019-12-04 17:26:14 -0800350
Greg Chadwick99fe0642020-08-04 15:42:45 +0100351- job: otbn_standalone_tests
352 displayName: Run OTBN Smoke Test
353 dependsOn: lint
354 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.hasOTBNChanges'], '1'))
Philipp Wagner8d3e5632020-08-19 14:31:39 +0100355 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100356 vmImage: ubuntu-18.04
Philipp Wagnerbf0ab0a2020-12-15 12:03:42 +0000357 timeoutInMinutes: 10
Greg Chadwick99fe0642020-08-04 15:42:45 +0100358 steps:
359 - template: ci/install-package-dependencies.yml
360 - bash: |
361 set -x
362 sudo util/get-toolchain.py \
Srikrishna Iyer98333ba2020-11-16 23:12:29 -0800363 --install-dir="$TOOLCHAIN_PATH" \
Greg Chadwick99fe0642020-08-04 15:42:45 +0100364 --release-version="$TOOLCHAIN_VERSION" \
365 --update
Rupert Swarbrick54278382020-08-25 12:45:47 +0100366 echo "##vso[task.prependpath]$TOOLCHAIN_PATH/bin"
Greg Chadwick99fe0642020-08-04 15:42:45 +0100367 displayName: Install toolchain
368 - bash: |
Greg Chadwick99fe0642020-08-04 15:42:45 +0100369 python3 --version
370 fusesoc --version
371 verilator --version
372 displayName: Display environment
373 - bash: |
Rupert Swarbrick7bd2a372020-10-02 12:36:12 +0100374 make -C hw/ip/otbn/dv/otbnsim test
375 displayName: OTBN ISS Test
376 - bash: |
Greg Chadwick99fe0642020-08-04 15:42:45 +0100377 ./hw/ip/otbn/dv/smoke/run_smoke.sh
378 displayName: OTBN Smoke Test
Rupert Swarbrick54278382020-08-25 12:45:47 +0100379 - bash: |
Rupert Swarbrick7087ed82020-11-13 18:16:46 +0000380 make -C hw/ip/otbn/util asm-check
Rupert Swarbrick54278382020-08-25 12:45:47 +0100381 displayName: Assemble and link code snippets
Greg Chadwick99fe0642020-08-04 15:42:45 +0100382
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200383- job: chip_earlgrey_cw310
384 displayName: Build CW310 variant of the Earl Grey toplevel design using Vivado
385 dependsOn:
386 - lint
387 # The bootrom is built into the FPGA image at synthesis time.
388 # Currently, we are still using the reduce script for the CW310 meaning we can re-use the
389 # software binaries built for the NexysVideo board.
390 - sw_build_nexysvideo
391 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
392 pool: ci-public
393 timeoutInMinutes: 120 # 2 hours
394 steps:
395 - template: ci/install-package-dependencies.yml
396 - template: ci/download-artifacts-template.yml
397 parameters:
398 downloadPartialBuildBinFrom:
399 - sw_build_nexysvideo
400 - bash: |
401 set -e
402 . util/build_consts.sh
403
404 module load "xilinx/vivado/$(VIVADO_VERSION)"
405
406 mkdir -p "$OBJ_DIR/hw"
407 mkdir -p "$BIN_DIR/hw/top_earlgrey"
408
409 ./hw/top_earlgrey/util/top_earlgrey_reduce.py
410
411 BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.scr.40.vmem"
412 test -f "$BOOTROM_VMEM"
413 OTP_VMEM="$BIN_DIR/sw/device/otp_img/otp_img_fpga_nexysvideo.vmem"
414 test -f "$OTP_VMEM"
415
416 fusesoc --cores-root=. \
417 run --flag=fileset_top --target=synth --setup --build \
418 --build-root="$OBJ_DIR/hw" \
419 lowrisc:systems:chip_earlgrey_cw310 \
420 --BootRomInitFile="$BOOTROM_VMEM" \
421 --OtpCtrlMemInitFile="$OTP_VMEM"
422
423 cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.bit" \
424 "$BIN_DIR/hw/top_earlgrey"
425 displayName: Build bitstream with Vivado
426 - bash: |
427 . util/build_consts.sh
428 echo Synthesis log
429 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/synth_1/runme.log || true
430
431 echo Implementation log
432 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/impl_1/runme.log || true
433 condition: always()
434 displayName: Display synthesis and implementation logs
435 - template: ci/upload-artifacts-template.yml
436 parameters:
437 includePatterns:
438 - "/hw/top_earlgrey/lowrisc_systems_chip_earlgrey_cw310_0.1.bit"
Philipp Wagner9b37c342021-02-01 16:21:38 +0000439 - publish: "$(Build.ArtifactStagingDirectory)"
440 artifact: chip_earlgrey_cw310-build-out
441 displayName: Upload all Vivado artifacts for CW310
442 condition: failed()
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200443
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700444- job: chip_earlgrey_nexysvideo
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600445 displayName: Build NexysVideo variant of the Earl Grey toplevel design using Vivado
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000446 dependsOn:
447 - lint
448 # The bootrom is built into the FPGA image at synthesis time.
Timothy Chenf835aa32021-01-08 16:27:50 -0800449 - sw_build_nexysvideo
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800450 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Philipp Wagnerc58f6a02020-10-07 19:57:09 +0100451 pool: ci-public
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000452 timeoutInMinutes: 120 # 2 hours
453 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600454 - template: ci/install-package-dependencies.yml
455 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000456 parameters:
457 downloadPartialBuildBinFrom:
458 - sw_build_nexysvideo
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000459 - bash: |
460 set -e
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600461 . util/build_consts.sh
Philipp Wagnerc58f6a02020-10-07 19:57:09 +0100462
463 module load "xilinx/vivado/$(VIVADO_VERSION)"
464
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600465 mkdir -p "$OBJ_DIR/hw"
466 mkdir -p "$BIN_DIR/hw/top_earlgrey"
467
Timothy Chenf835aa32021-01-08 16:27:50 -0800468 ./hw/top_earlgrey/util/top_earlgrey_reduce.py
469
Rupert Swarbrick830aac52021-03-19 17:00:18 +0000470 BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.scr.40.vmem"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600471 test -f "$BOOTROM_VMEM"
Michael Schaffner20972a62021-02-24 18:53:46 -0800472 OTP_VMEM="$BIN_DIR/sw/device/otp_img/otp_img_fpga_nexysvideo.vmem"
473 test -f "$OTP_VMEM"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600474
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600475 fusesoc --cores-root=. \
Timothy Chenbe47dd72020-07-27 14:57:07 -0700476 run --flag=fileset_top --target=synth --setup --build \
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600477 --build-root="$OBJ_DIR/hw" \
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700478 lowrisc:systems:chip_earlgrey_nexysvideo \
Michael Schaffner20972a62021-02-24 18:53:46 -0800479 --BootRomInitFile="$BOOTROM_VMEM" \
480 --OtpCtrlMemInitFile="$OTP_VMEM"
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600481
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700482 cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.bit" \
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600483 "$BIN_DIR/hw/top_earlgrey"
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600484 displayName: Build bitstream with Vivado
Philipp Wagnerf072c032020-12-08 17:16:30 +0000485 - bash: |
486 . util/build_consts.sh
487 echo Synthesis log
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700488 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.runs/synth_1/runme.log || true
Philipp Wagnerf072c032020-12-08 17:16:30 +0000489
490 echo Implementation log
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700491 cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.runs/impl_1/runme.log || true
Philipp Wagnerf072c032020-12-08 17:16:30 +0000492 condition: always()
493 displayName: Display synthesis and implementation logs
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600494 - template: ci/upload-artifacts-template.yml
Miguel Young de la Sotab4df8602019-11-21 12:44:11 -0600495 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000496 includePatterns:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700497 - "/hw/top_earlgrey/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.bit"
Philipp Wagner9b37c342021-02-01 16:21:38 +0000498 - publish: "$(Build.ArtifactStagingDirectory)"
499 artifact: chip_earlgrey_nexysvideo-build-out
500 displayName: Upload all Vivado artifacts for Nexys Video
501 condition: failed()
lowRISC Contributors802543a2019-08-31 12:12:56 +0100502
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700503- job: chip_englishbreakfast_cw305
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100504 displayName: Build CW305 variant of the English Breakfast toplevel design using Vivado
505 dependsOn:
506 - lint
507 # The bootrom is built into the FPGA image at synthesis time.
Pirmin Vogelc00e37f2020-12-23 21:35:47 +0100508 # Currently, we can't have different versions of binaries in $BIN_DIR. Consequently, we are
509 # using the NexysVideo bootrom here and the resulting CW305 bitstream is not functional.
510 # By generating the CW305 bootrom binary we would break execute_fpga_tests executed on the
511 # NexysVideo.
Philipp Wagner84bfe552021-02-02 18:48:07 +0000512 - sw_build_nexysvideo
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800513 condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100514 pool: ci-public
515 timeoutInMinutes: 120 # 2 hours
516 steps:
517 - template: ci/install-package-dependencies.yml
518 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000519 parameters:
520 downloadPartialBuildBinFrom:
521 - sw_build_nexysvideo
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100522 - bash: |
523 set -e
524 . util/build_consts.sh
525
526 module load "xilinx/vivado/$(VIVADO_VERSION)"
527
528 mkdir -p "$OBJ_DIR/hw"
529 mkdir -p "$BIN_DIR/hw/top_englishbreakfast"
530
Rupert Swarbrick830aac52021-03-19 17:00:18 +0000531 BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.scr.40.vmem"
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100532 test -f "$BOOTROM_VMEM"
533
534 fusesoc --cores-root=. \
535 run --flag=fileset_topgen --target=synth --setup --build \
536 --build-root="$OBJ_DIR/hw" \
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700537 lowrisc:systems:chip_englishbreakfast_cw305 \
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100538 --BootRomInitFile="$BOOTROM_VMEM"
539
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700540 cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit" \
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100541 "$BIN_DIR/hw/top_englishbreakfast"
542 displayName: Build bitstream with Vivado
543 - template: ci/upload-artifacts-template.yml
544 parameters:
Philipp Wagner5aa7ed32021-02-02 18:53:36 +0000545 includePatterns:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700546 - "/hw/top_englishbreakfast/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit"
Pirmin Vogel2f42ccd2020-12-22 20:19:30 +0100547
Pirmin Vogelad2afea2021-05-20 10:43:40 +0200548- job: execute_fpga_tests_cw310
549 displayName: Execute tests on ChipWhisperer CW310 FPGA board
550 pool: FPGA
551 timeoutInMinutes: 30
552 dependsOn:
553 - chip_earlgrey_cw310
554 - sw_build_nexysvideo
555 - sw_build
556 steps:
557 - template: ci/install-package-dependencies.yml
558 - template: ci/download-artifacts-template.yml
559 parameters:
560 downloadPartialBuildBinFrom:
561 - chip_earlgrey_cw310
562 - sw_build_nexysvideo
563 - sw_build
564 - bash: |
565 set -e
566
567 # Install an additional pytest dependency for result upload.
568 pip3 install pytest-azurepipelines
569
570 . util/build_consts.sh
571 pytest --version
572 pytest test/systemtest/earlgrey/test_fpga_cw310.py \
573 --log-cli-level=DEBUG \
574 --test-run-title="Run system tests on ChipWhisperer CW310 FPGA board" \
575 --napoleon-docstrings
576 displayName: Execute tests
577
578- job: execute_fpga_tests_nexysvideo
579 displayName: Execute tests on Nexys Video FPGA board
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100580 pool: FPGA
581 timeoutInMinutes: 30
582 dependsOn:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700583 - chip_earlgrey_nexysvideo
Timothy Chenf835aa32021-01-08 16:27:50 -0800584 - sw_build_nexysvideo
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000585 - sw_build
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100586 steps:
587 - template: ci/install-package-dependencies.yml
588 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000589 parameters:
590 downloadPartialBuildBinFrom:
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700591 - chip_earlgrey_nexysvideo
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000592 - sw_build_nexysvideo
593 - sw_build
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100594 - bash: |
595 set -e
596
597 module load "xilinx/vivado/$(VIVADO_VERSION)"
598
599 # Install an additional pytest dependency for result upload.
600 pip3 install pytest-azurepipelines
601
602 . util/build_consts.sh
603 pytest --version
604 pytest test/systemtest/earlgrey/test_fpga_nexysvideo.py \
605 --log-cli-level=DEBUG \
606 --test-run-title="Run system tests on Nexys Video FPGA board" \
607 --napoleon-docstrings
Philipp Wagner11d2dcb2020-09-29 16:27:46 +0100608 displayName: Execute tests
609
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600610- job: deploy_release_artifacts
611 displayName: Package and deploy release distribution
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000612 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100613 vmImage: ubuntu-18.04
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000614 dependsOn:
615 - lint
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600616 - sw_build
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700617 - chip_earlgrey_verilator
618 - chip_earlgrey_nexysvideo
Timothy Chen64f6a5a2021-02-05 17:04:40 -0800619 condition: and(eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000620 steps:
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600621 - template: ci/install-package-dependencies.yml
622 - template: ci/download-artifacts-template.yml
Philipp Wagnerbdfb9332021-02-02 18:10:06 +0000623 parameters:
624 downloadPartialBuildBinFrom:
625 - sw_build
626 - sw_build_nexysvideo
Michael Schaffner93fe50c2021-03-31 16:25:42 -0700627 - chip_earlgrey_verilator
628 - chip_earlgrey_nexysvideo
629 - chip_englishbreakfast_verilator
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600630 - bash: |
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600631 . util/build_consts.sh
Miguel Young de la Sotab5be8c62019-11-20 10:01:09 -0600632
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600633 util/make_distribution.sh
Philipp Wagner542e2202019-10-30 13:10:16 +0000634
Miguel Young de la Sotad42948c2019-11-18 13:56:55 -0600635 tar --list -f $BIN_DIR/opentitan-*.tar.xz
636 # Put the resulting tar file into a directory the |publish| step below can reference.
637 mkdir "$BUILD_ROOT/dist-final"
638 mv $BIN_DIR/opentitan-*.tar.xz "$BUILD_ROOT/dist-final"
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600639 displayName: Create final dist directory out of partial ones
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000640 - publish: $(Build.ArtifactStagingDirectory)/dist-final
641 artifact: opentitan-dist
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600642 displayName: Upload release artifacts as Azure artifact
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000643 - task: GithubRelease@0
Miguel Young de la Sotaa68e3072020-01-02 13:59:54 -0600644 displayName: Upload to GitHub releases (only tags)
Philipp Wagner0b20f5d2019-11-01 16:24:52 +0000645 condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
Philipp Wagnerbd9ae432019-11-01 14:33:30 +0000646 inputs:
647 gitHubConnection: opentitan-release-upload
648 repositoryName: lowrisc/opentitan
649 addChangeLog: false
650 assets: |
651 $(Build.ArtifactStagingDirectory)/dist-final/*
Sam Elliotte257cd02020-09-10 13:49:38 +0100652
653
654- job: build_docker_containers
655 displayName: "Build Docker Containers"
656 pool:
Philipp Wagner5d1450c2020-10-06 12:26:36 +0100657 vmImage: ubuntu-18.04
Sam Elliotte257cd02020-09-10 13:49:38 +0100658 dependsOn:
659 - lint
660 steps:
661 - task: Docker@2
662 displayName: Build Developer Utility Container
663 inputs:
664 command: build
665 Dockerfile: ./util/container/Dockerfile
666 buildContext: .
667 - task: Docker@2
668 displayName: Build Documentation Builder Container
669 inputs:
670 command: build
671 tags: gcr.io/active-premise-257318/builder
672 Dockerfile: ./site/docs/builder.Dockerfile
673 buildContext: .
674 - task: Docker@2
675 displayName: Build Documentation Redirector Container
676 inputs:
677 command: build
678 Dockerfile: ./site/redirector/Dockerfile
679 buildContext: ./site/redirector