Sam Elliott | d202828 | 2020-06-02 18:18:54 +0100 | [diff] [blame] | 1 | # 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 Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 5 | # Azure Pipelines CI build configuration |
| 6 | # Documentation at https://aka.ms/yaml |
| 7 | |
| 8 | variables: |
Philipp Wagner | e8ade05 | 2020-11-16 11:18:49 +0000 | [diff] [blame] | 9 | VERILATOR_VERSION: 4.104 |
Miguel Osorio | 88179fc | 2019-09-19 23:37:48 -0700 | [diff] [blame] | 10 | TOOLCHAIN_PATH: /opt/buildcache/riscv |
Michael Schaffner | e66fc61 | 2020-12-15 10:47:57 -0800 | [diff] [blame] | 11 | VERIBLE_VERSION: v0.0-808-g1e17daa |
Miguel Osorio | 88179fc | 2019-09-19 23:37:48 -0700 | [diff] [blame] | 12 | # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases |
Sam Elliott | 0088155 | 2020-05-04 16:46:55 +0100 | [diff] [blame] | 13 | # if you update this, update the definition in util/container/Dockerfile |
Philipp Wagner | 1500b40 | 2020-10-14 11:50:24 +0200 | [diff] [blame] | 14 | TOOLCHAIN_VERSION: 20200904-1 |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 15 | # This controls where builds happen, and gets picked up by build_consts.sh. |
| 16 | BUILD_ROOT: $(Build.ArtifactStagingDirectory) |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 17 | VIVADO_VERSION: "2020.1" |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 18 | |
| 19 | trigger: |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 20 | batch: true |
| 21 | branches: |
| 22 | include: |
Philipp Wagner | f565b66 | 2020-07-22 14:04:40 +0100 | [diff] [blame] | 23 | - "*" |
Philipp Wagner | dd1706e | 2020-03-15 14:39:59 +0000 | [diff] [blame] | 24 | tags: |
| 25 | include: |
| 26 | - "*" |
| 27 | pr: |
| 28 | branches: |
| 29 | include: |
Philipp Wagner | f565b66 | 2020-07-22 14:04:40 +0100 | [diff] [blame] | 30 | - "*" |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 31 | |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 32 | jobs: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 33 | - job: lint |
Sam Elliott | 67e30fa | 2020-10-06 18:08:05 +0100 | [diff] [blame] | 34 | displayName: Run code quality checks (quick lint) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 35 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 36 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 37 | steps: |
| 38 | - bash: | |
Garret Kelly | f5608d0 | 2019-11-01 16:28:11 -0400 | [diff] [blame] | 39 | sudo apt-get remove -y clang-6.0 libclang-common-6.0-dev libclang1-6.0 libllvm6.0 |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 40 | displayName: Remove existing Clang installation |
| 41 | - template: ci/install-package-dependencies.yml |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 42 | ## !!! |
| 43 | ## |
| 44 | ## The steps below here are duplicated in ci/jobs/quick-lint.sh |
| 45 | ## to allow developers to "run CI" locally. Keep them in sync. |
| 46 | ## |
| 47 | ## !!! |
| 48 | - bash: ci/scripts/show-env.sh |
Philipp Wagner | 9986239 | 2020-07-22 13:32:34 +0100 | [diff] [blame] | 49 | displayName: Display environment information |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 50 | - bash: ci/scripts/lint-commits.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 51 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 52 | displayName: Check commit metadata |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 53 | - bash: ci/scripts/check-licence-headers.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 54 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 55 | displayName: Check Licence Headers |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 56 | - bash: ci/scripts/python-lint.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Rupert Swarbrick | fb9fdb6 | 2021-02-01 17:30:48 +0000 | [diff] [blame] | 57 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 58 | displayName: Run Python lint |
Rupert Swarbrick | 2d70c75 | 2020-03-24 17:23:40 +0000 | [diff] [blame] | 59 | continueOnError: true |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 60 | - bash: ci/scripts/check-generated.sh |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 61 | displayName: Ensure all generated files are clean and up-to-date |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 62 | - bash: ci/scripts/clang-format.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 63 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 64 | displayName: Use clang-format to check C/C++ coding style |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 65 | - bash: ci/scripts/include-guard.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Miguel Young de la Sota | b23dc8c | 2020-01-14 13:52:33 -0500 | [diff] [blame] | 66 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 67 | displayName: Check formatting on header guards |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 68 | - bash: ci/scripts/verible-lint.sh rtl |
Michael Schaffner | de32606 | 2020-07-14 17:50:35 -0700 | [diff] [blame] | 69 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Michael Schaffner | a94241f | 2020-08-03 15:50:14 -0700 | [diff] [blame] | 70 | displayName: Style-Lint RTL Verilog source files with Verible |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 71 | - bash: ci/scripts/verible-lint.sh dv |
Michael Schaffner | a94241f | 2020-08-03 15:50:14 -0700 | [diff] [blame] | 72 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 73 | displayName: Style-Lint DV Verilog source files with Verible |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 74 | - bash: ci/scripts/build-docs.sh |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 75 | displayName: Render documentation |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 76 | - bash: ci/scripts/build-site.sh |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 77 | displayName: Render landing site |
Rupert Swarbrick | fb9fdb6 | 2021-02-01 17:30:48 +0000 | [diff] [blame] | 78 | - bash: ci/scripts/get-build-type.sh "$SYSTEM_PULLREQUEST_TARGETBRANCH" "$(Build.Reason)" |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 79 | displayName: Check what kinds of changes the PR contains |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 80 | name: DetermineBuildType |
Philipp Wagner | 1e64355 | 2019-09-04 15:39:14 +0100 | [diff] [blame] | 81 | |
Sam Elliott | 67e30fa | 2020-10-06 18:08:05 +0100 | [diff] [blame] | 82 | - job: slow_lints |
| 83 | displayName: Run code quality checks (in-depth lint) |
| 84 | dependsOn: lint |
| 85 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 86 | vmImage: ubuntu-18.04 |
Sam Elliott | 67e30fa | 2020-10-06 18:08:05 +0100 | [diff] [blame] | 87 | steps: |
| 88 | - template: ci/install-package-dependencies.yml |
| 89 | - bash: | |
| 90 | # Here we look for all *.vendor.hjson files in the repo to re-vendor them. |
| 91 | # We exclude the following: |
| 92 | # - Any in 'hw/vendor/lowrisc_ibex', because that directory is vendored. |
| 93 | find . \ |
| 94 | -not \( -path './hw/vendor/lowrisc_ibex' -prune \) \ |
| 95 | -name '*.vendor.hjson' \ |
| 96 | | xargs -n1 util/vendor.py --verbose \ |
| 97 | && git diff --exit-code |
| 98 | if [[ $? != 0 ]]; then |
| 99 | echo -n "##vso[task.logissue type=error]" |
| 100 | echo "Vendored repositories not up-to-date. Run util/vendor.py to fix." |
| 101 | exit 1 |
| 102 | fi |
| 103 | condition: always() |
| 104 | displayName: Check vendored directories are up-to-date |
| 105 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 106 | - job: sw_build |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 107 | displayName: Build Software for Earl Grey toplevel design |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 108 | dependsOn: lint |
Philipp Wagner | 9d20ee6 | 2019-11-29 14:27:28 +0000 | [diff] [blame] | 109 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 110 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 111 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 112 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 113 | - template: ci/install-package-dependencies.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 114 | - bash: | |
| 115 | set -x |
| 116 | sudo util/get-toolchain.py \ |
Srikrishna Iyer | 98333ba | 2020-11-16 23:12:29 -0800 | [diff] [blame] | 117 | --install-dir="$TOOLCHAIN_PATH" \ |
Sam Elliott | eb8ace4 | 2020-06-03 17:47:55 +0100 | [diff] [blame] | 118 | --release-version="$TOOLCHAIN_VERSION" \ |
Philipp Wagner | 1c51441 | 2019-11-27 14:48:47 +0000 | [diff] [blame] | 119 | --update |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 120 | displayName: Install toolchain |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 121 | - bash: | |
Miguel Young de la Sota | 6379357 | 2019-11-13 14:18:51 -0600 | [diff] [blame] | 122 | . util/build_consts.sh |
Miguel Young de la Sota | 4a4946d | 2019-11-21 10:44:18 -0600 | [diff] [blame] | 123 | ./meson_init.sh -A |
Miguel Young de la Sota | 76526c3 | 2020-01-28 10:24:41 -0500 | [diff] [blame] | 124 | ninja -C "$OBJ_DIR" all |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 125 | displayName: Build embedded targets |
Miguel Young de la Sota | 9d20b3d | 2020-02-03 16:35:31 -0500 | [diff] [blame] | 126 | - bash: | |
| 127 | . util/build_consts.sh |
| 128 | ninja -C "$OBJ_DIR" test |
Sam Elliott | eb8ace4 | 2020-06-03 17:47:55 +0100 | [diff] [blame] | 129 | displayName: Run unit tests |
| 130 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 131 | parameters: |
| 132 | artifact: sw_build |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 133 | |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 134 | - job: sw_build_nexysvideo |
| 135 | displayName: Build Software for Earl Grey toplevel design targeting the Nexys Video board |
| 136 | dependsOn: lint |
| 137 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
| 138 | pool: |
| 139 | vmImage: ubuntu-18.04 |
| 140 | steps: |
| 141 | - template: ci/install-package-dependencies.yml |
| 142 | - bash: | |
| 143 | set -x |
| 144 | sudo util/get-toolchain.py \ |
| 145 | --install-dir="$TOOLCHAIN_PATH" \ |
| 146 | --release-version="$TOOLCHAIN_VERSION" \ |
| 147 | --update |
| 148 | displayName: Install toolchain |
| 149 | - bash: | |
| 150 | . util/build_consts.sh |
| 151 | ./hw/top_earlgrey/util/top_earlgrey_reduce.py |
| 152 | ./meson_init.sh -A |
| 153 | ninja -C "$OBJ_DIR" all |
| 154 | displayName: Build embedded targets |
| 155 | - bash: | |
| 156 | . util/build_consts.sh |
| 157 | ninja -C "$OBJ_DIR" test |
| 158 | displayName: Run unit tests |
| 159 | - template: ci/upload-artifacts-template.yml |
| 160 | parameters: |
| 161 | artifact: sw_build_nexysvideo |
| 162 | |
LuÃs Marques | 5849cd1 | 2020-06-26 10:33:55 +0100 | [diff] [blame] | 163 | # We continue building with GCC, despite defaulting to Clang. This is a copy of |
| 164 | # `sw_build` with `meson_init.sh` configured with the GCC toolchain, instead of |
| 165 | # the default toolchain. |
| 166 | - job: sw_build_gcc |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 167 | displayName: Build Software for Earl Grey toplevel design (with GCC) |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 168 | dependsOn: lint |
| 169 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
| 170 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 171 | vmImage: ubuntu-18.04 |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 172 | steps: |
| 173 | - template: ci/install-package-dependencies.yml |
| 174 | - bash: | |
| 175 | set -x |
| 176 | sudo util/get-toolchain.py \ |
Srikrishna Iyer | 98333ba | 2020-11-16 23:12:29 -0800 | [diff] [blame] | 177 | --install-dir="$TOOLCHAIN_PATH" \ |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 178 | --release-version="$TOOLCHAIN_VERSION" \ |
| 179 | --update |
| 180 | displayName: Install toolchain |
| 181 | - bash: | |
| 182 | . util/build_consts.sh |
| 183 | ./meson_init.sh -A \ |
LuÃs Marques | 5849cd1 | 2020-06-26 10:33:55 +0100 | [diff] [blame] | 184 | -t "$TOOLCHAIN_PATH/meson-riscv32-unknown-elf-gcc.txt" |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 185 | ninja -C "$OBJ_DIR" all |
| 186 | displayName: Build embedded targets |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 187 | - bash: | |
| 188 | . util/build_consts.sh |
| 189 | ninja -C "$OBJ_DIR" test |
| 190 | displayName: Run unit tests |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 191 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 192 | - job: top_earlgrey_verilator |
| 193 | displayName: Build Verilator simulation of the Earl Grey toplevel design |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 194 | dependsOn: lint |
Philipp Wagner | 9d20ee6 | 2019-11-29 14:27:28 +0000 | [diff] [blame] | 195 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | 0907ca1 | 2020-04-21 12:04:32 +0100 | [diff] [blame] | 196 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 197 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 198 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 199 | - template: ci/install-package-dependencies.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 200 | - bash: | |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 201 | python3 --version |
| 202 | fusesoc --version |
| 203 | verilator --version |
Michael Schaffner | aa193f9 | 2020-12-16 11:16:17 -0800 | [diff] [blame] | 204 | verible-verilog-lint --version |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 205 | displayName: Display environment |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 206 | - bash: | |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 207 | . util/build_consts.sh |
| 208 | mkdir -p "$OBJ_DIR/hw" |
| 209 | mkdir -p "$BIN_DIR/hw/top_earlgrey" |
| 210 | |
Philipp Wagner | fa8c692 | 2020-08-18 14:14:25 +0100 | [diff] [blame] | 211 | # Compile the simulation without threading; the runners provided by |
| 212 | # Azure provide two virtual CPUs, which seems to equal one physical |
| 213 | # CPU (at most); the use of threading slows down the simulation. |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 214 | fusesoc --cores-root=. \ |
Timothy Chen | be47dd7 | 2020-07-27 14:57:07 -0700 | [diff] [blame] | 215 | run --flag=fileset_top --target=sim --setup --build \ |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 216 | --build-root="$OBJ_DIR/hw" \ |
Philipp Wagner | fa8c692 | 2020-08-18 14:14:25 +0100 | [diff] [blame] | 217 | lowrisc:systems:top_earlgrey_verilator \ |
| 218 | --verilator_options="--no-threads" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 219 | |
| 220 | cp "$OBJ_DIR/hw/sim-verilator/Vtop_earlgrey_verilator" \ |
| 221 | "$BIN_DIR/hw/top_earlgrey" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 222 | displayName: Build simulation with Verilator |
| 223 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 224 | parameters: |
| 225 | artifact: top_earlgrey_verilator |
Philipp Wagner | f4655a1 | 2019-10-30 11:59:15 +0000 | [diff] [blame] | 226 | |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 227 | - job: top_englishbreakfast_verilator |
| 228 | displayName: Build Verilator simulation of the English Breakfast toplevel design |
| 229 | dependsOn: lint |
| 230 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
| 231 | pool: |
| 232 | vmImage: ubuntu-18.04 |
| 233 | steps: |
| 234 | - template: ci/install-package-dependencies.yml |
| 235 | - bash: | |
| 236 | python3 --version |
| 237 | fusesoc --version |
| 238 | verilator --version |
| 239 | verible-verilog-lint --version |
| 240 | displayName: Display environment |
| 241 | - bash: | |
| 242 | . util/build_consts.sh |
| 243 | mkdir -p "$OBJ_DIR/hw" |
| 244 | mkdir -p "$BIN_DIR/hw/top_englishbreakfast" |
| 245 | |
| 246 | # Compile the simulation without threading; the runners provided by |
| 247 | # Azure provide two virtual CPUs, which seems to equal one physical |
| 248 | # CPU (at most); the use of threading slows down the simulation. |
| 249 | fusesoc --cores-root=. \ |
| 250 | run --flag=fileset_topgen --target=sim --setup --build \ |
| 251 | --build-root="$OBJ_DIR/hw" \ |
| 252 | lowrisc:systems:top_englishbreakfast_verilator \ |
| 253 | --verilator_options="--no-threads" |
| 254 | |
| 255 | cp "$OBJ_DIR/hw/sim-verilator/Vtop_englishbreakfast_verilator" \ |
| 256 | "$BIN_DIR/hw/top_englishbreakfast" |
| 257 | displayName: Build simulation with Verilator |
| 258 | - template: ci/upload-artifacts-template.yml |
| 259 | parameters: |
| 260 | artifact: top_englishbreakfast_verilator |
| 261 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 262 | - job: execute_verilated_tests |
| 263 | displayName: Execute tests on the Verilated system |
Timothy Chen | f7e85cb | 2019-12-10 16:24:39 -0800 | [diff] [blame] | 264 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 265 | vmImage: ubuntu-18.04 |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 266 | dependsOn: |
| 267 | - top_earlgrey_verilator |
| 268 | - sw_build |
| 269 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 270 | - template: ci/install-package-dependencies.yml |
| 271 | - template: ci/download-artifacts-template.yml |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 272 | - bash: | |
Philipp Wagner | 33fadd0 | 2020-09-09 19:39:25 +0100 | [diff] [blame] | 273 | # Install an additional pytest dependency for result upload. |
| 274 | pip3 install pytest-azurepipelines |
| 275 | |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 276 | . util/build_consts.sh |
Philipp Wagner | 57418e7 | 2019-12-02 21:25:27 +0000 | [diff] [blame] | 277 | pytest --version |
Philipp Wagner | 03aaf32 | 2020-09-09 19:11:44 +0100 | [diff] [blame] | 278 | pytest test/systemtest/earlgrey/test_sim_verilator.py \ |
Philipp Wagner | 33fadd0 | 2020-09-09 19:39:25 +0100 | [diff] [blame] | 279 | --log-cli-level=DEBUG \ |
| 280 | --test-run-title="Run system tests with Verilator simulation" \ |
| 281 | --napoleon-docstrings |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 282 | displayName: Execute tests |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 283 | |
Greg Chadwick | bf9dc38 | 2020-04-17 09:30:40 +0100 | [diff] [blame] | 284 | - template: ci/run-riscv-compliance.yml |
| 285 | parameters: |
| 286 | rvc_test_suites: |
| 287 | - rv32i |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 288 | |
Greg Chadwick | bf9dc38 | 2020-04-17 09:30:40 +0100 | [diff] [blame] | 289 | - template: ci/run-riscv-compliance.yml |
| 290 | parameters: |
| 291 | rvc_test_suites: |
| 292 | - rv32im |
| 293 | - rv32imc |
| 294 | - rv32Zicsr |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 295 | |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 296 | - job: otbn_standalone_tests |
| 297 | displayName: Run OTBN Smoke Test |
| 298 | dependsOn: lint |
| 299 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.hasOTBNChanges'], '1')) |
Philipp Wagner | 8d3e563 | 2020-08-19 14:31:39 +0100 | [diff] [blame] | 300 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 301 | vmImage: ubuntu-18.04 |
Philipp Wagner | bf0ab0a | 2020-12-15 12:03:42 +0000 | [diff] [blame] | 302 | timeoutInMinutes: 10 |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 303 | steps: |
| 304 | - template: ci/install-package-dependencies.yml |
| 305 | - bash: | |
| 306 | set -x |
| 307 | sudo util/get-toolchain.py \ |
Srikrishna Iyer | 98333ba | 2020-11-16 23:12:29 -0800 | [diff] [blame] | 308 | --install-dir="$TOOLCHAIN_PATH" \ |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 309 | --release-version="$TOOLCHAIN_VERSION" \ |
| 310 | --update |
Rupert Swarbrick | 5427838 | 2020-08-25 12:45:47 +0100 | [diff] [blame] | 311 | echo "##vso[task.prependpath]$TOOLCHAIN_PATH/bin" |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 312 | displayName: Install toolchain |
| 313 | - bash: | |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 314 | python3 --version |
| 315 | fusesoc --version |
| 316 | verilator --version |
| 317 | displayName: Display environment |
| 318 | - bash: | |
Rupert Swarbrick | 7bd2a37 | 2020-10-02 12:36:12 +0100 | [diff] [blame] | 319 | make -C hw/ip/otbn/dv/otbnsim test |
| 320 | displayName: OTBN ISS Test |
| 321 | - bash: | |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 322 | ./hw/ip/otbn/dv/smoke/run_smoke.sh |
| 323 | displayName: OTBN Smoke Test |
Rupert Swarbrick | 5427838 | 2020-08-25 12:45:47 +0100 | [diff] [blame] | 324 | - bash: | |
Rupert Swarbrick | 7087ed8 | 2020-11-13 18:16:46 +0000 | [diff] [blame] | 325 | make -C hw/ip/otbn/util asm-check |
Rupert Swarbrick | 5427838 | 2020-08-25 12:45:47 +0100 | [diff] [blame] | 326 | displayName: Assemble and link code snippets |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 327 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 328 | - job: top_earlgrey_nexysvideo |
| 329 | displayName: Build NexysVideo variant of the Earl Grey toplevel design using Vivado |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 330 | dependsOn: |
| 331 | - lint |
| 332 | # The bootrom is built into the FPGA image at synthesis time. |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 333 | - sw_build_nexysvideo |
Philipp Wagner | d0ac862 | 2021-02-01 22:03:29 +0000 | [diff] [blame] | 334 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | c58f6a0 | 2020-10-07 19:57:09 +0100 | [diff] [blame] | 335 | pool: ci-public |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 336 | timeoutInMinutes: 120 # 2 hours |
| 337 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 338 | - template: ci/install-package-dependencies.yml |
| 339 | - template: ci/download-artifacts-template.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 340 | - bash: | |
| 341 | set -e |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 342 | . util/build_consts.sh |
Philipp Wagner | c58f6a0 | 2020-10-07 19:57:09 +0100 | [diff] [blame] | 343 | |
| 344 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 345 | |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 346 | mkdir -p "$OBJ_DIR/hw" |
| 347 | mkdir -p "$BIN_DIR/hw/top_earlgrey" |
| 348 | |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 349 | ./hw/top_earlgrey/util/top_earlgrey_reduce.py |
| 350 | |
Greg Chadwick | 1287104 | 2020-04-20 13:42:56 +0100 | [diff] [blame] | 351 | BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.32.vmem" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 352 | test -f "$BOOTROM_VMEM" |
| 353 | |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 354 | fusesoc --cores-root=. \ |
Timothy Chen | be47dd7 | 2020-07-27 14:57:07 -0700 | [diff] [blame] | 355 | run --flag=fileset_top --target=synth --setup --build \ |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 356 | --build-root="$OBJ_DIR/hw" \ |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 357 | lowrisc:systems:top_earlgrey_nexysvideo \ |
Philipp Wagner | a37bcfa | 2020-05-19 22:46:41 +0100 | [diff] [blame] | 358 | --BootRomInitFile="$BOOTROM_VMEM" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 359 | |
| 360 | cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_earlgrey_nexysvideo_0.1.bit" \ |
| 361 | "$BIN_DIR/hw/top_earlgrey" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 362 | displayName: Build bitstream with Vivado |
Philipp Wagner | f072c03 | 2020-12-08 17:16:30 +0000 | [diff] [blame] | 363 | - bash: | |
| 364 | . util/build_consts.sh |
| 365 | echo Synthesis log |
| 366 | cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_earlgrey_nexysvideo_0.1.runs/synth_1/runme.log || true |
| 367 | |
| 368 | echo Implementation log |
| 369 | cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_earlgrey_nexysvideo_0.1.runs/impl_1/runme.log || true |
| 370 | condition: always() |
| 371 | displayName: Display synthesis and implementation logs |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 372 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 373 | parameters: |
| 374 | artifact: top_earlgrey_nexysvideo |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 375 | |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 376 | - job: top_englishbreakfast_cw305 |
| 377 | displayName: Build CW305 variant of the English Breakfast toplevel design using Vivado |
| 378 | dependsOn: |
| 379 | - lint |
| 380 | # The bootrom is built into the FPGA image at synthesis time. |
Pirmin Vogel | c00e37f | 2020-12-23 21:35:47 +0100 | [diff] [blame] | 381 | # Currently, we can't have different versions of binaries in $BIN_DIR. Consequently, we are |
| 382 | # using the NexysVideo bootrom here and the resulting CW305 bitstream is not functional. |
| 383 | # By generating the CW305 bootrom binary we would break execute_fpga_tests executed on the |
| 384 | # NexysVideo. |
Philipp Wagner | 84bfe55 | 2021-02-02 18:48:07 +0000 | [diff] [blame^] | 385 | - sw_build_nexysvideo |
Philipp Wagner | d0ac862 | 2021-02-01 22:03:29 +0000 | [diff] [blame] | 386 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 387 | pool: ci-public |
| 388 | timeoutInMinutes: 120 # 2 hours |
| 389 | steps: |
| 390 | - template: ci/install-package-dependencies.yml |
| 391 | - template: ci/download-artifacts-template.yml |
| 392 | - bash: | |
| 393 | set -e |
| 394 | . util/build_consts.sh |
| 395 | |
| 396 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 397 | |
| 398 | mkdir -p "$OBJ_DIR/hw" |
| 399 | mkdir -p "$BIN_DIR/hw/top_englishbreakfast" |
| 400 | |
| 401 | BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.32.vmem" |
| 402 | test -f "$BOOTROM_VMEM" |
| 403 | |
| 404 | fusesoc --cores-root=. \ |
| 405 | run --flag=fileset_topgen --target=synth --setup --build \ |
| 406 | --build-root="$OBJ_DIR/hw" \ |
| 407 | lowrisc:systems:top_englishbreakfast_cw305 \ |
| 408 | --BootRomInitFile="$BOOTROM_VMEM" |
| 409 | |
| 410 | cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_englishbreakfast_cw305_0.1.bit" \ |
| 411 | "$BIN_DIR/hw/top_englishbreakfast" |
| 412 | displayName: Build bitstream with Vivado |
| 413 | - template: ci/upload-artifacts-template.yml |
| 414 | parameters: |
| 415 | artifact: top_englishbreakfast_cw305 |
| 416 | |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 417 | - job: execute_fpga_tests |
| 418 | displayName: Execute tests on FPGA |
| 419 | pool: FPGA |
| 420 | timeoutInMinutes: 30 |
| 421 | dependsOn: |
| 422 | - top_earlgrey_nexysvideo |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 423 | - sw_build_nexysvideo |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 424 | steps: |
| 425 | - template: ci/install-package-dependencies.yml |
| 426 | - template: ci/download-artifacts-template.yml |
| 427 | - bash: | |
| 428 | set -e |
| 429 | |
| 430 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 431 | |
| 432 | # Install an additional pytest dependency for result upload. |
| 433 | pip3 install pytest-azurepipelines |
| 434 | |
| 435 | . util/build_consts.sh |
| 436 | pytest --version |
| 437 | pytest test/systemtest/earlgrey/test_fpga_nexysvideo.py \ |
| 438 | --log-cli-level=DEBUG \ |
| 439 | --test-run-title="Run system tests on Nexys Video FPGA board" \ |
| 440 | --napoleon-docstrings |
Philipp Wagner | 1d0f0c4 | 2021-02-01 10:29:33 +0000 | [diff] [blame] | 441 | # Temporary workaround, see |
| 442 | # https://github.com/lowRISC/opentitan/issues/5029 for details. |
| 443 | continueOnError: true |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 444 | displayName: Execute tests |
| 445 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 446 | - job: deploy_release_artifacts |
| 447 | displayName: Package and deploy release distribution |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 448 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 449 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 450 | dependsOn: |
| 451 | - lint |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 452 | - sw_build |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 453 | - top_earlgrey_verilator |
| 454 | - top_earlgrey_nexysvideo |
| 455 | condition: eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0') |
| 456 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 457 | - template: ci/install-package-dependencies.yml |
| 458 | - template: ci/download-artifacts-template.yml |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 459 | - bash: | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 460 | . util/build_consts.sh |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 461 | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 462 | util/make_distribution.sh |
Philipp Wagner | 542e220 | 2019-10-30 13:10:16 +0000 | [diff] [blame] | 463 | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 464 | tar --list -f $BIN_DIR/opentitan-*.tar.xz |
| 465 | # Put the resulting tar file into a directory the |publish| step below can reference. |
| 466 | mkdir "$BUILD_ROOT/dist-final" |
| 467 | mv $BIN_DIR/opentitan-*.tar.xz "$BUILD_ROOT/dist-final" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 468 | displayName: Create final dist directory out of partial ones |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 469 | - publish: $(Build.ArtifactStagingDirectory)/dist-final |
| 470 | artifact: opentitan-dist |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 471 | displayName: Upload release artifacts as Azure artifact |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 472 | - task: GithubRelease@0 |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 473 | displayName: Upload to GitHub releases (only tags) |
Philipp Wagner | 0b20f5d | 2019-11-01 16:24:52 +0000 | [diff] [blame] | 474 | condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 475 | inputs: |
| 476 | gitHubConnection: opentitan-release-upload |
| 477 | repositoryName: lowrisc/opentitan |
| 478 | addChangeLog: false |
| 479 | assets: | |
| 480 | $(Build.ArtifactStagingDirectory)/dist-final/* |
Sam Elliott | e257cd0 | 2020-09-10 13:49:38 +0100 | [diff] [blame] | 481 | |
| 482 | |
| 483 | - job: build_docker_containers |
| 484 | displayName: "Build Docker Containers" |
| 485 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 486 | vmImage: ubuntu-18.04 |
Sam Elliott | e257cd0 | 2020-09-10 13:49:38 +0100 | [diff] [blame] | 487 | dependsOn: |
| 488 | - lint |
| 489 | steps: |
| 490 | - task: Docker@2 |
| 491 | displayName: Build Developer Utility Container |
| 492 | inputs: |
| 493 | command: build |
| 494 | Dockerfile: ./util/container/Dockerfile |
| 495 | buildContext: . |
| 496 | - task: Docker@2 |
| 497 | displayName: Build Documentation Builder Container |
| 498 | inputs: |
| 499 | command: build |
| 500 | tags: gcr.io/active-premise-257318/builder |
| 501 | Dockerfile: ./site/docs/builder.Dockerfile |
| 502 | buildContext: . |
| 503 | - task: Docker@2 |
| 504 | displayName: Build Documentation Redirector Container |
| 505 | inputs: |
| 506 | command: build |
| 507 | Dockerfile: ./site/redirector/Dockerfile |
| 508 | buildContext: ./site/redirector |