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: |
Rupert Swarbrick | df23712 | 2021-04-20 14:43:48 +0100 | [diff] [blame] | 9 | # |
Alphan Ulusoy | e220589 | 2021-05-13 09:36:17 -0400 | [diff] [blame] | 10 | # If updating VERILATOR_VERSION, OPENOCD_VERSION, TOOLCHAIN_VERSION or RUST_VERSION |
| 11 | # update the definitions in util/container/Dockerfile as well. |
Rupert Swarbrick | df23712 | 2021-04-20 14:43:48 +0100 | [diff] [blame] | 12 | # |
Philipp Wagner | e8ade05 | 2020-11-16 11:18:49 +0000 | [diff] [blame] | 13 | VERILATOR_VERSION: 4.104 |
Philipp Wagner | b02d9c8 | 2021-02-24 15:00:54 +0000 | [diff] [blame] | 14 | OPENOCD_VERSION: 0.11.0 |
Miguel Osorio | 88179fc | 2019-09-19 23:37:48 -0700 | [diff] [blame] | 15 | TOOLCHAIN_PATH: /opt/buildcache/riscv |
Philipp Wagner | 4db8b1c | 2021-05-05 09:58:40 +0100 | [diff] [blame] | 16 | VERIBLE_VERSION: v0.0-1213-g9e5c085 |
Alphan Ulusoy | e220589 | 2021-05-13 09:36:17 -0400 | [diff] [blame] | 17 | RUST_VERSION: 1.52.1 |
Miguel Osorio | 88179fc | 2019-09-19 23:37:48 -0700 | [diff] [blame] | 18 | # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases |
Philipp Wagner | ca40353 | 2021-04-13 09:15:28 +0100 | [diff] [blame] | 19 | TOOLCHAIN_VERSION: 20210412-1 |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 20 | # This controls where builds happen, and gets picked up by build_consts.sh. |
| 21 | BUILD_ROOT: $(Build.ArtifactStagingDirectory) |
Philipp Wagner | b8b053f | 2021-05-25 09:26:34 +0100 | [diff] [blame] | 22 | VIVADO_VERSION: "2020.2" |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 23 | |
| 24 | trigger: |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 25 | batch: true |
| 26 | branches: |
| 27 | include: |
Philipp Wagner | f565b66 | 2020-07-22 14:04:40 +0100 | [diff] [blame] | 28 | - "*" |
Philipp Wagner | dd1706e | 2020-03-15 14:39:59 +0000 | [diff] [blame] | 29 | tags: |
| 30 | include: |
| 31 | - "*" |
| 32 | pr: |
| 33 | branches: |
| 34 | include: |
Philipp Wagner | f565b66 | 2020-07-22 14:04:40 +0100 | [diff] [blame] | 35 | - "*" |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 36 | |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 37 | jobs: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 38 | - job: lint |
Sam Elliott | 67e30fa | 2020-10-06 18:08:05 +0100 | [diff] [blame] | 39 | displayName: Run code quality checks (quick lint) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 40 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 41 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 42 | steps: |
| 43 | - bash: | |
Garret Kelly | f5608d0 | 2019-11-01 16:28:11 -0400 | [diff] [blame] | 44 | 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] | 45 | displayName: Remove existing Clang installation |
| 46 | - template: ci/install-package-dependencies.yml |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 47 | ## !!! |
| 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 Wagner | 9986239 | 2020-07-22 13:32:34 +0100 | [diff] [blame] | 54 | displayName: Display environment information |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 55 | - bash: ci/scripts/lint-commits.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 56 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 57 | displayName: Check commit metadata |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 58 | - bash: ci/scripts/check-licence-headers.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 59 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 60 | displayName: Check Licence Headers |
Rupert Swarbrick | f0d5b0c | 2021-03-26 11:48:42 +0000 | [diff] [blame] | 61 | - bash: ci/scripts/exec-check.sh |
| 62 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 63 | displayName: Check executable bits |
Rupert Swarbrick | 5dc62b0 | 2021-04-28 09:39:18 +0100 | [diff] [blame] | 64 | - bash: ci/scripts/check-ascii.sh |
| 65 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 66 | displayName: Check for non-ASCII characters in source code |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 67 | - bash: ci/scripts/python-lint.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Rupert Swarbrick | fb9fdb6 | 2021-02-01 17:30:48 +0000 | [diff] [blame] | 68 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Rupert Swarbrick | 746f9b1 | 2021-03-26 17:19:00 +0000 | [diff] [blame] | 69 | displayName: Run Python lint (flake8) |
Rupert Swarbrick | 2d70c75 | 2020-03-24 17:23:40 +0000 | [diff] [blame] | 70 | continueOnError: true |
Rupert Swarbrick | 746f9b1 | 2021-03-26 17:19:00 +0000 | [diff] [blame] | 71 | - bash: ci/scripts/mypy.sh |
| 72 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 73 | displayName: Run Python lint (mypy) |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 74 | - bash: ci/scripts/check-generated.sh |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 75 | displayName: Ensure all generated files are clean and up-to-date |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 76 | - bash: ci/scripts/clang-format.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 77 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 78 | displayName: Use clang-format to check C/C++ coding style |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 79 | - bash: ci/scripts/include-guard.sh $SYSTEM_PULLREQUEST_TARGETBRANCH |
Miguel Young de la Sota | b23dc8c | 2020-01-14 13:52:33 -0500 | [diff] [blame] | 80 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 81 | displayName: Check formatting on header guards |
Rafal Kapuscik | 5802fd8 | 2021-04-14 16:03:31 +0200 | [diff] [blame] | 82 | - 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 Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 86 | - bash: ci/scripts/verible-lint.sh rtl |
Michael Schaffner | de32606 | 2020-07-14 17:50:35 -0700 | [diff] [blame] | 87 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Michael Schaffner | a94241f | 2020-08-03 15:50:14 -0700 | [diff] [blame] | 88 | displayName: Style-Lint RTL Verilog source files with Verible |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 89 | - bash: ci/scripts/verible-lint.sh dv |
Michael Schaffner | a94241f | 2020-08-03 15:50:14 -0700 | [diff] [blame] | 90 | condition: eq(variables['Build.Reason'], 'PullRequest') |
| 91 | displayName: Style-Lint DV Verilog source files with Verible |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 92 | - bash: ci/scripts/build-docs.sh |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 93 | displayName: Render documentation |
Rupert Swarbrick | 105df01 | 2021-01-29 11:33:13 +0000 | [diff] [blame] | 94 | - bash: ci/scripts/build-site.sh |
Philipp Wagner | 93cdcef | 2021-01-19 14:31:47 +0000 | [diff] [blame] | 95 | displayName: Render landing site |
Rupert Swarbrick | fb9fdb6 | 2021-02-01 17:30:48 +0000 | [diff] [blame] | 96 | - bash: ci/scripts/get-build-type.sh "$SYSTEM_PULLREQUEST_TARGETBRANCH" "$(Build.Reason)" |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 97 | displayName: Check what kinds of changes the PR contains |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 98 | name: DetermineBuildType |
Philipp Wagner | 1e64355 | 2019-09-04 15:39:14 +0100 | [diff] [blame] | 99 | |
Sam Elliott | 67e30fa | 2020-10-06 18:08:05 +0100 | [diff] [blame] | 100 | - job: slow_lints |
| 101 | displayName: Run code quality checks (in-depth lint) |
| 102 | dependsOn: lint |
| 103 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 104 | vmImage: ubuntu-18.04 |
Sam Elliott | 67e30fa | 2020-10-06 18:08:05 +0100 | [diff] [blame] | 105 | steps: |
| 106 | - template: ci/install-package-dependencies.yml |
Rupert Swarbrick | 2aff11b | 2021-02-16 17:11:37 +0000 | [diff] [blame] | 107 | - bash: ci/scripts/check-vendoring.sh |
Sam Elliott | 67e30fa | 2020-10-06 18:08:05 +0100 | [diff] [blame] | 108 | displayName: Check vendored directories are up-to-date |
| 109 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 110 | - job: sw_build |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 111 | displayName: Build Software for Earl Grey toplevel design |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 112 | dependsOn: lint |
Philipp Wagner | 9d20ee6 | 2019-11-29 14:27:28 +0000 | [diff] [blame] | 113 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 114 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 115 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 116 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 117 | - template: ci/install-package-dependencies.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 118 | - bash: | |
| 119 | set -x |
| 120 | sudo util/get-toolchain.py \ |
Srikrishna Iyer | 98333ba | 2020-11-16 23:12:29 -0800 | [diff] [blame] | 121 | --install-dir="$TOOLCHAIN_PATH" \ |
Sam Elliott | eb8ace4 | 2020-06-03 17:47:55 +0100 | [diff] [blame] | 122 | --release-version="$TOOLCHAIN_VERSION" \ |
Philipp Wagner | 1c51441 | 2019-11-27 14:48:47 +0000 | [diff] [blame] | 123 | --update |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 124 | displayName: Install toolchain |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 125 | - bash: | |
Miguel Young de la Sota | 6379357 | 2019-11-13 14:18:51 -0600 | [diff] [blame] | 126 | . util/build_consts.sh |
Miguel Young de la Sota | 4a4946d | 2019-11-21 10:44:18 -0600 | [diff] [blame] | 127 | ./meson_init.sh -A |
Miguel Young de la Sota | 76526c3 | 2020-01-28 10:24:41 -0500 | [diff] [blame] | 128 | ninja -C "$OBJ_DIR" all |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 129 | displayName: Build embedded targets |
Miguel Young de la Sota | 9d20b3d | 2020-02-03 16:35:31 -0500 | [diff] [blame] | 130 | - bash: | |
| 131 | . util/build_consts.sh |
| 132 | ninja -C "$OBJ_DIR" test |
Sam Elliott | eb8ace4 | 2020-06-03 17:47:55 +0100 | [diff] [blame] | 133 | displayName: Run unit tests |
Philipp Wagner | 622ec3f | 2021-02-02 18:37:24 +0000 | [diff] [blame] | 134 | - 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 Elliott | eb8ace4 | 2020-06-03 17:47:55 +0100 | [diff] [blame] | 140 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 141 | parameters: |
Philipp Wagner | 5aa7ed3 | 2021-02-02 18:53:36 +0000 | [diff] [blame] | 142 | includePatterns: |
| 143 | - "/sw/***" |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 144 | |
Philipp Wagner | 622ec3f | 2021-02-02 18:37:24 +0000 | [diff] [blame] | 145 | # 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 Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 152 | - job: sw_build_nexysvideo |
| 153 | displayName: Build Software for Earl Grey toplevel design targeting the Nexys Video board |
| 154 | dependsOn: lint |
Timothy Chen | ac28d1e | 2021-08-18 10:58:23 -0700 | [diff] [blame] | 155 | # Make the following condition always false for now, see #7814. |
| 156 | condition: and(succeeded(), False, eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 157 | pool: |
| 158 | vmImage: ubuntu-18.04 |
| 159 | steps: |
| 160 | - template: ci/install-package-dependencies.yml |
| 161 | - bash: | |
| 162 | set -x |
| 163 | sudo util/get-toolchain.py \ |
| 164 | --install-dir="$TOOLCHAIN_PATH" \ |
| 165 | --release-version="$TOOLCHAIN_VERSION" \ |
| 166 | --update |
| 167 | displayName: Install toolchain |
| 168 | - bash: | |
| 169 | . util/build_consts.sh |
| 170 | ./hw/top_earlgrey/util/top_earlgrey_reduce.py |
| 171 | ./meson_init.sh -A |
| 172 | ninja -C "$OBJ_DIR" all |
Philipp Wagner | 622ec3f | 2021-02-02 18:37:24 +0000 | [diff] [blame] | 173 | |
| 174 | # Delete all build artifacts which are *not* for the Nexys Video board. |
| 175 | find "$BIN_DIR/sw/device" -not -name '*fpga_nexysvideo*' -type f -delete |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 176 | displayName: Build embedded targets |
| 177 | - bash: | |
| 178 | . util/build_consts.sh |
| 179 | ninja -C "$OBJ_DIR" test |
| 180 | displayName: Run unit tests |
| 181 | - template: ci/upload-artifacts-template.yml |
| 182 | parameters: |
Philipp Wagner | 5aa7ed3 | 2021-02-02 18:53:36 +0000 | [diff] [blame] | 183 | includePatterns: |
| 184 | - "/sw/device/**/*nexysvideo*" |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 185 | |
Pirmin Vogel | 18d8e13 | 2021-08-03 14:35:29 +0200 | [diff] [blame] | 186 | # Software targeting the English Breakfast top level is produced by patching |
| 187 | # the source tree before building. This builds a selected subset of software |
| 188 | # only. |
| 189 | # TODO: This is a rather ugly hack, which will go away once we properly support |
| 190 | # building more than one top-level design with different parametrizations. |
| 191 | # Work towards this goal is tracked in issue #4669. |
| 192 | - job: sw_build_englishbreakfast |
| 193 | displayName: Build Software for English Breakfast toplevel design |
| 194 | dependsOn: lint |
| 195 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
| 196 | pool: |
| 197 | vmImage: ubuntu-18.04 |
| 198 | steps: |
| 199 | - template: ci/install-package-dependencies.yml |
| 200 | - bash: | |
| 201 | set -x |
| 202 | sudo util/get-toolchain.py \ |
| 203 | --install-dir="$TOOLCHAIN_PATH" \ |
| 204 | --release-version="$TOOLCHAIN_VERSION" \ |
| 205 | --update |
| 206 | displayName: Install toolchain |
| 207 | - bash: | |
| 208 | . util/build_consts.sh |
| 209 | ./meson_init.sh -A |
| 210 | # Patch software. |
| 211 | ./hw/top_englishbreakfast/util/prepare_sw.py |
| 212 | # Build FPGA boot ROM and aes_serial binary for FPGA SCA. |
| 213 | ninja -C "$OBJ_DIR" sw/device/boot_rom/boot_rom_export_fpga_nexysvideo |
| 214 | ninja -C "$OBJ_DIR" sw/device/sca/aes_serial_export_fpga_nexysvideo |
| 215 | # Build binaries for Verilator simulation. |
| 216 | ninja -C "$OBJ_DIR" sw/device/boot_rom/boot_rom_export_sim_verilator |
| 217 | ninja -C "$OBJ_DIR" sw/device/tests/dif_aes_smoketest_export_sim_verilator |
| 218 | ninja -C "$OBJ_DIR" sw/device/examples/hello_world/hello_world_export_sim_verilator |
| 219 | displayName: Build embedded targets |
| 220 | - template: ci/upload-artifacts-template.yml |
| 221 | parameters: |
| 222 | includePatterns: |
| 223 | - "/sw/device/***" |
| 224 | |
LuÃs Marques | 5849cd1 | 2020-06-26 10:33:55 +0100 | [diff] [blame] | 225 | # We continue building with GCC, despite defaulting to Clang. This is a copy of |
| 226 | # `sw_build` with `meson_init.sh` configured with the GCC toolchain, instead of |
| 227 | # the default toolchain. |
| 228 | - job: sw_build_gcc |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 229 | displayName: Build Software for Earl Grey toplevel design (with GCC) |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 230 | dependsOn: lint |
| 231 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
| 232 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 233 | vmImage: ubuntu-18.04 |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 234 | steps: |
| 235 | - template: ci/install-package-dependencies.yml |
| 236 | - bash: | |
| 237 | set -x |
| 238 | sudo util/get-toolchain.py \ |
Srikrishna Iyer | 98333ba | 2020-11-16 23:12:29 -0800 | [diff] [blame] | 239 | --install-dir="$TOOLCHAIN_PATH" \ |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 240 | --release-version="$TOOLCHAIN_VERSION" \ |
| 241 | --update |
| 242 | displayName: Install toolchain |
| 243 | - bash: | |
| 244 | . util/build_consts.sh |
| 245 | ./meson_init.sh -A \ |
LuÃs Marques | 5849cd1 | 2020-06-26 10:33:55 +0100 | [diff] [blame] | 246 | -t "$TOOLCHAIN_PATH/meson-riscv32-unknown-elf-gcc.txt" |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 247 | ninja -C "$OBJ_DIR" all |
| 248 | displayName: Build embedded targets |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 249 | - bash: | |
| 250 | . util/build_consts.sh |
| 251 | ninja -C "$OBJ_DIR" test |
| 252 | displayName: Run unit tests |
Sam Elliott | 7a00a4b | 2020-06-03 17:48:10 +0100 | [diff] [blame] | 253 | |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 254 | - job: chip_earlgrey_verilator |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 255 | displayName: Build Verilator simulation of the Earl Grey toplevel design |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 256 | dependsOn: lint |
Philipp Wagner | 9d20ee6 | 2019-11-29 14:27:28 +0000 | [diff] [blame] | 257 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | 0907ca1 | 2020-04-21 12:04:32 +0100 | [diff] [blame] | 258 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 259 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 260 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 261 | - template: ci/install-package-dependencies.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 262 | - bash: | |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 263 | python3 --version |
| 264 | fusesoc --version |
| 265 | verilator --version |
Michael Schaffner | aa193f9 | 2020-12-16 11:16:17 -0800 | [diff] [blame] | 266 | verible-verilog-lint --version |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 267 | displayName: Display environment |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 268 | - bash: | |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 269 | . util/build_consts.sh |
| 270 | mkdir -p "$OBJ_DIR/hw" |
| 271 | mkdir -p "$BIN_DIR/hw/top_earlgrey" |
| 272 | |
Philipp Wagner | fa8c692 | 2020-08-18 14:14:25 +0100 | [diff] [blame] | 273 | # Compile the simulation without threading; the runners provided by |
| 274 | # Azure provide two virtual CPUs, which seems to equal one physical |
| 275 | # 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] | 276 | fusesoc --cores-root=. \ |
Timothy Chen | be47dd7 | 2020-07-27 14:57:07 -0700 | [diff] [blame] | 277 | run --flag=fileset_top --target=sim --setup --build \ |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 278 | --build-root="$OBJ_DIR/hw" \ |
Timothy Chen | b7d0c27 | 2021-08-05 17:11:17 -0700 | [diff] [blame] | 279 | lowrisc:dv:chip_verilator_sim \ |
Philipp Wagner | a4b89b9 | 2021-05-20 22:25:42 +0100 | [diff] [blame] | 280 | --verilator_options="--threads 4" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 281 | |
Timothy Chen | b7d0c27 | 2021-08-05 17:11:17 -0700 | [diff] [blame] | 282 | cp "$OBJ_DIR/hw/sim-verilator/Vchip_sim_tb" \ |
Timothy Chen | 2816108 | 2021-07-30 13:14:58 -0700 | [diff] [blame] | 283 | "$BIN_DIR/hw/top_earlgrey/Vchip_earlgrey_verilator" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 284 | displayName: Build simulation with Verilator |
| 285 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 286 | parameters: |
Philipp Wagner | 5aa7ed3 | 2021-02-02 18:53:36 +0000 | [diff] [blame] | 287 | includePatterns: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 288 | - "/hw/top_earlgrey/Vchip_earlgrey_verilator" |
Philipp Wagner | f4655a1 | 2019-10-30 11:59:15 +0000 | [diff] [blame] | 289 | |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 290 | - job: chip_englishbreakfast_verilator |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 291 | displayName: Build Verilator simulation of the English Breakfast toplevel design |
| 292 | dependsOn: lint |
| 293 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
| 294 | pool: |
| 295 | vmImage: ubuntu-18.04 |
| 296 | steps: |
| 297 | - template: ci/install-package-dependencies.yml |
| 298 | - bash: | |
| 299 | python3 --version |
| 300 | fusesoc --version |
| 301 | verilator --version |
| 302 | verible-verilog-lint --version |
| 303 | displayName: Display environment |
| 304 | - bash: | |
| 305 | . util/build_consts.sh |
| 306 | mkdir -p "$OBJ_DIR/hw" |
| 307 | mkdir -p "$BIN_DIR/hw/top_englishbreakfast" |
| 308 | |
| 309 | # Compile the simulation without threading; the runners provided by |
| 310 | # Azure provide two virtual CPUs, which seems to equal one physical |
| 311 | # CPU (at most); the use of threading slows down the simulation. |
| 312 | fusesoc --cores-root=. \ |
| 313 | run --flag=fileset_topgen --target=sim --setup --build \ |
| 314 | --build-root="$OBJ_DIR/hw" \ |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 315 | lowrisc:systems:chip_englishbreakfast_verilator \ |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 316 | --verilator_options="--no-threads" |
| 317 | |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 318 | cp "$OBJ_DIR/hw/sim-verilator/Vchip_englishbreakfast_verilator" \ |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 319 | "$BIN_DIR/hw/top_englishbreakfast" |
| 320 | displayName: Build simulation with Verilator |
| 321 | - template: ci/upload-artifacts-template.yml |
| 322 | parameters: |
Philipp Wagner | 5aa7ed3 | 2021-02-02 18:53:36 +0000 | [diff] [blame] | 323 | includePatterns: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 324 | - "/hw/top_englishbreakfast/Vchip_englishbreakfast_verilator" |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 325 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 326 | - job: execute_verilated_tests |
Alphan Ulusoy | a628be1 | 2021-05-14 16:24:02 -0400 | [diff] [blame] | 327 | displayName: Execute tests on the Verilated system (excl. slow tests) |
Philipp Wagner | a4b89b9 | 2021-05-20 22:25:42 +0100 | [diff] [blame] | 328 | pool: ci-public |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 329 | dependsOn: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 330 | - chip_earlgrey_verilator |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 331 | - sw_build |
| 332 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 333 | - template: ci/install-package-dependencies.yml |
| 334 | - template: ci/download-artifacts-template.yml |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 335 | parameters: |
| 336 | downloadPartialBuildBinFrom: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 337 | - chip_earlgrey_verilator |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 338 | - sw_build |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 339 | - bash: | |
Philipp Wagner | 33fadd0 | 2020-09-09 19:39:25 +0100 | [diff] [blame] | 340 | # Install an additional pytest dependency for result upload. |
| 341 | pip3 install pytest-azurepipelines |
| 342 | |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 343 | . util/build_consts.sh |
Philipp Wagner | 57418e7 | 2019-12-02 21:25:27 +0000 | [diff] [blame] | 344 | pytest --version |
Philipp Wagner | 03aaf32 | 2020-09-09 19:11:44 +0100 | [diff] [blame] | 345 | pytest test/systemtest/earlgrey/test_sim_verilator.py \ |
Alphan Ulusoy | a628be1 | 2021-05-14 16:24:02 -0400 | [diff] [blame] | 346 | -m "not slow" \ |
Philipp Wagner | 33fadd0 | 2020-09-09 19:39:25 +0100 | [diff] [blame] | 347 | --log-cli-level=DEBUG \ |
Alphan Ulusoy | a628be1 | 2021-05-14 16:24:02 -0400 | [diff] [blame] | 348 | --test-run-title="Run system tests with Verilator simulation (excl. slow tests)" \ |
Philipp Wagner | 33fadd0 | 2020-09-09 19:39:25 +0100 | [diff] [blame] | 349 | --napoleon-docstrings |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 350 | displayName: Execute tests |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 351 | |
Pirmin Vogel | 18d8e13 | 2021-08-03 14:35:29 +0200 | [diff] [blame] | 352 | - job: execute_verilated_tests_englishbreakfast |
| 353 | displayName: Execute tests on the Verilated English Breakfast toplevel design |
| 354 | pool: ci-public |
| 355 | dependsOn: |
| 356 | - chip_englishbreakfast_verilator |
| 357 | - sw_build_englishbreakfast |
| 358 | steps: |
| 359 | - template: ci/install-package-dependencies.yml |
| 360 | - template: ci/download-artifacts-template.yml |
| 361 | parameters: |
| 362 | downloadPartialBuildBinFrom: |
| 363 | - chip_englishbreakfast_verilator |
| 364 | - sw_build_englishbreakfast |
| 365 | - bash: | |
| 366 | # Install an additional pytest dependency for result upload. |
| 367 | pip3 install pytest-azurepipelines |
| 368 | |
| 369 | . util/build_consts.sh |
| 370 | pytest --version |
| 371 | pytest test/systemtest/englishbreakfast/test_sim_verilator.py \ |
| 372 | -m "not slow" \ |
| 373 | --log-cli-level=DEBUG \ |
| 374 | --test-run-title="Run English Breakfast system tests with Verilator simulation" \ |
| 375 | --napoleon-docstrings |
| 376 | displayName: Execute tests |
| 377 | |
Alphan Ulusoy | a628be1 | 2021-05-14 16:24:02 -0400 | [diff] [blame] | 378 | # This test is in a separate job becuase it takes longer to complete. |
| 379 | - job: execute_silicon_creator_verilated_test |
| 380 | displayName: Execute silicon_creator test on the Verilated system |
Philipp Wagner | a4b89b9 | 2021-05-20 22:25:42 +0100 | [diff] [blame] | 381 | pool: ci-public |
Alphan Ulusoy | a628be1 | 2021-05-14 16:24:02 -0400 | [diff] [blame] | 382 | dependsOn: |
| 383 | - chip_earlgrey_verilator |
| 384 | - sw_build |
| 385 | steps: |
| 386 | - template: ci/install-package-dependencies.yml |
| 387 | - template: ci/download-artifacts-template.yml |
| 388 | parameters: |
| 389 | downloadPartialBuildBinFrom: |
| 390 | - chip_earlgrey_verilator |
| 391 | - sw_build |
| 392 | - bash: | |
| 393 | # Install an additional pytest dependency for result upload. |
| 394 | pip3 install pytest-azurepipelines |
| 395 | |
| 396 | . util/build_consts.sh |
| 397 | pytest --version |
| 398 | pytest test/systemtest/earlgrey/test_sim_verilator.py \ |
| 399 | -k test_apps_selfchecking_silicon_creator[dif_uart_smoketest] \ |
| 400 | --log-cli-level=DEBUG \ |
| 401 | --test-run-title="Run silicon_creator system test with Verilator simulation" \ |
| 402 | --napoleon-docstrings |
| 403 | displayName: Execute silicon_creator test |
| 404 | |
Greg Chadwick | bf9dc38 | 2020-04-17 09:30:40 +0100 | [diff] [blame] | 405 | - template: ci/run-riscv-compliance.yml |
| 406 | parameters: |
| 407 | rvc_test_suites: |
| 408 | - rv32i |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 409 | |
Greg Chadwick | bf9dc38 | 2020-04-17 09:30:40 +0100 | [diff] [blame] | 410 | - template: ci/run-riscv-compliance.yml |
| 411 | parameters: |
| 412 | rvc_test_suites: |
| 413 | - rv32im |
| 414 | - rv32imc |
| 415 | - rv32Zicsr |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 416 | |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 417 | - job: otbn_standalone_tests |
| 418 | displayName: Run OTBN Smoke Test |
| 419 | dependsOn: lint |
Philipp Wagner | 8d3e563 | 2020-08-19 14:31:39 +0100 | [diff] [blame] | 420 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 421 | vmImage: ubuntu-18.04 |
Philipp Wagner | bf0ab0a | 2020-12-15 12:03:42 +0000 | [diff] [blame] | 422 | timeoutInMinutes: 10 |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 423 | steps: |
| 424 | - template: ci/install-package-dependencies.yml |
| 425 | - bash: | |
| 426 | set -x |
| 427 | sudo util/get-toolchain.py \ |
Srikrishna Iyer | 98333ba | 2020-11-16 23:12:29 -0800 | [diff] [blame] | 428 | --install-dir="$TOOLCHAIN_PATH" \ |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 429 | --release-version="$TOOLCHAIN_VERSION" \ |
| 430 | --update |
Rupert Swarbrick | 5427838 | 2020-08-25 12:45:47 +0100 | [diff] [blame] | 431 | echo "##vso[task.prependpath]$TOOLCHAIN_PATH/bin" |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 432 | displayName: Install toolchain |
| 433 | - bash: | |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 434 | python3 --version |
| 435 | fusesoc --version |
| 436 | verilator --version |
| 437 | displayName: Display environment |
| 438 | - bash: | |
Rupert Swarbrick | 7bd2a37 | 2020-10-02 12:36:12 +0100 | [diff] [blame] | 439 | make -C hw/ip/otbn/dv/otbnsim test |
| 440 | displayName: OTBN ISS Test |
| 441 | - bash: | |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 442 | ./hw/ip/otbn/dv/smoke/run_smoke.sh |
| 443 | displayName: OTBN Smoke Test |
Rupert Swarbrick | 5427838 | 2020-08-25 12:45:47 +0100 | [diff] [blame] | 444 | - bash: | |
Rupert Swarbrick | 7087ed8 | 2020-11-13 18:16:46 +0000 | [diff] [blame] | 445 | make -C hw/ip/otbn/util asm-check |
Rupert Swarbrick | 5427838 | 2020-08-25 12:45:47 +0100 | [diff] [blame] | 446 | displayName: Assemble and link code snippets |
Greg Chadwick | 99fe064 | 2020-08-04 15:42:45 +0100 | [diff] [blame] | 447 | |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 448 | - job: chip_earlgrey_cw310 |
| 449 | displayName: Build CW310 variant of the Earl Grey toplevel design using Vivado |
| 450 | dependsOn: |
| 451 | - lint |
| 452 | # The bootrom is built into the FPGA image at synthesis time. |
Pirmin Vogel | b41684f | 2021-07-20 09:49:50 +0200 | [diff] [blame] | 453 | - sw_build |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 454 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0')) |
| 455 | pool: ci-public |
| 456 | timeoutInMinutes: 120 # 2 hours |
| 457 | steps: |
| 458 | - template: ci/install-package-dependencies.yml |
| 459 | - template: ci/download-artifacts-template.yml |
| 460 | parameters: |
| 461 | downloadPartialBuildBinFrom: |
Pirmin Vogel | b41684f | 2021-07-20 09:49:50 +0200 | [diff] [blame] | 462 | - sw_build |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 463 | - bash: | |
| 464 | set -e |
| 465 | . util/build_consts.sh |
| 466 | |
| 467 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 468 | |
| 469 | mkdir -p "$OBJ_DIR/hw" |
| 470 | mkdir -p "$BIN_DIR/hw/top_earlgrey" |
| 471 | |
Pirmin Vogel | b41684f | 2021-07-20 09:49:50 +0200 | [diff] [blame] | 472 | BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_cw310.scr.39.vmem" |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 473 | test -f "$BOOTROM_VMEM" |
Pirmin Vogel | b41684f | 2021-07-20 09:49:50 +0200 | [diff] [blame] | 474 | OTP_VMEM="$BIN_DIR/sw/device/otp_img/otp_img_fpga_cw310.vmem" |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 475 | test -f "$OTP_VMEM" |
| 476 | |
| 477 | fusesoc --cores-root=. \ |
| 478 | run --flag=fileset_top --target=synth --setup --build \ |
| 479 | --build-root="$OBJ_DIR/hw" \ |
| 480 | lowrisc:systems:chip_earlgrey_cw310 \ |
| 481 | --BootRomInitFile="$BOOTROM_VMEM" \ |
| 482 | --OtpCtrlMemInitFile="$OTP_VMEM" |
| 483 | |
| 484 | cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.bit" \ |
| 485 | "$BIN_DIR/hw/top_earlgrey" |
| 486 | displayName: Build bitstream with Vivado |
| 487 | - bash: | |
| 488 | . util/build_consts.sh |
| 489 | echo Synthesis log |
| 490 | cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/synth_1/runme.log || true |
| 491 | |
| 492 | echo Implementation log |
| 493 | cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/impl_1/runme.log || true |
| 494 | condition: always() |
| 495 | displayName: Display synthesis and implementation logs |
| 496 | - template: ci/upload-artifacts-template.yml |
| 497 | parameters: |
| 498 | includePatterns: |
| 499 | - "/hw/top_earlgrey/lowrisc_systems_chip_earlgrey_cw310_0.1.bit" |
Philipp Wagner | 9b37c34 | 2021-02-01 16:21:38 +0000 | [diff] [blame] | 500 | - publish: "$(Build.ArtifactStagingDirectory)" |
| 501 | artifact: chip_earlgrey_cw310-build-out |
| 502 | displayName: Upload all Vivado artifacts for CW310 |
| 503 | condition: failed() |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 504 | |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 505 | - job: chip_earlgrey_nexysvideo |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 506 | displayName: Build NexysVideo variant of the Earl Grey toplevel design using Vivado |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 507 | dependsOn: |
| 508 | - lint |
| 509 | # The bootrom is built into the FPGA image at synthesis time. |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 510 | - sw_build_nexysvideo |
Timothy Chen | ac28d1e | 2021-08-18 10:58:23 -0700 | [diff] [blame] | 511 | # Make the following condition always false for now, see #7814. |
| 512 | condition: and(succeeded(), False, eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0')) |
Philipp Wagner | c58f6a0 | 2020-10-07 19:57:09 +0100 | [diff] [blame] | 513 | pool: ci-public |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 514 | timeoutInMinutes: 120 # 2 hours |
| 515 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 516 | - template: ci/install-package-dependencies.yml |
| 517 | - template: ci/download-artifacts-template.yml |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 518 | parameters: |
| 519 | downloadPartialBuildBinFrom: |
| 520 | - sw_build_nexysvideo |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 521 | - bash: | |
| 522 | set -e |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 523 | . util/build_consts.sh |
Philipp Wagner | c58f6a0 | 2020-10-07 19:57:09 +0100 | [diff] [blame] | 524 | |
| 525 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 526 | |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 527 | mkdir -p "$OBJ_DIR/hw" |
| 528 | mkdir -p "$BIN_DIR/hw/top_earlgrey" |
| 529 | |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 530 | ./hw/top_earlgrey/util/top_earlgrey_reduce.py |
| 531 | |
Rupert Swarbrick | 54c37c4 | 2021-07-15 15:06:42 +0100 | [diff] [blame] | 532 | BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.scr.39.vmem" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 533 | test -f "$BOOTROM_VMEM" |
Michael Schaffner | 20972a6 | 2021-02-24 18:53:46 -0800 | [diff] [blame] | 534 | OTP_VMEM="$BIN_DIR/sw/device/otp_img/otp_img_fpga_nexysvideo.vmem" |
| 535 | test -f "$OTP_VMEM" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 536 | |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 537 | fusesoc --cores-root=. \ |
Timothy Chen | be47dd7 | 2020-07-27 14:57:07 -0700 | [diff] [blame] | 538 | run --flag=fileset_top --target=synth --setup --build \ |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 539 | --build-root="$OBJ_DIR/hw" \ |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 540 | lowrisc:systems:chip_earlgrey_nexysvideo \ |
Michael Schaffner | 20972a6 | 2021-02-24 18:53:46 -0800 | [diff] [blame] | 541 | --BootRomInitFile="$BOOTROM_VMEM" \ |
| 542 | --OtpCtrlMemInitFile="$OTP_VMEM" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 543 | |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 544 | cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.bit" \ |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 545 | "$BIN_DIR/hw/top_earlgrey" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 546 | displayName: Build bitstream with Vivado |
Philipp Wagner | f072c03 | 2020-12-08 17:16:30 +0000 | [diff] [blame] | 547 | - bash: | |
| 548 | . util/build_consts.sh |
| 549 | echo Synthesis log |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 550 | cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.runs/synth_1/runme.log || true |
Philipp Wagner | f072c03 | 2020-12-08 17:16:30 +0000 | [diff] [blame] | 551 | |
| 552 | echo Implementation log |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 553 | cat $OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.runs/impl_1/runme.log || true |
Philipp Wagner | f072c03 | 2020-12-08 17:16:30 +0000 | [diff] [blame] | 554 | condition: always() |
| 555 | displayName: Display synthesis and implementation logs |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 556 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 557 | parameters: |
Philipp Wagner | 5aa7ed3 | 2021-02-02 18:53:36 +0000 | [diff] [blame] | 558 | includePatterns: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 559 | - "/hw/top_earlgrey/lowrisc_systems_chip_earlgrey_nexysvideo_0.1.bit" |
Philipp Wagner | 9b37c34 | 2021-02-01 16:21:38 +0000 | [diff] [blame] | 560 | - publish: "$(Build.ArtifactStagingDirectory)" |
| 561 | artifact: chip_earlgrey_nexysvideo-build-out |
| 562 | displayName: Upload all Vivado artifacts for Nexys Video |
| 563 | condition: failed() |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 564 | |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 565 | - job: chip_englishbreakfast_cw305 |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 566 | displayName: Build CW305 variant of the English Breakfast toplevel design using Vivado |
| 567 | dependsOn: |
| 568 | - lint |
Pirmin Vogel | 18d8e13 | 2021-08-03 14:35:29 +0200 | [diff] [blame] | 569 | - sw_build_englishbreakfast |
Timothy Chen | 64f6a5a | 2021-02-05 17:04:40 -0800 | [diff] [blame] | 570 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0')) |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 571 | pool: ci-public |
| 572 | timeoutInMinutes: 120 # 2 hours |
| 573 | steps: |
| 574 | - template: ci/install-package-dependencies.yml |
| 575 | - template: ci/download-artifacts-template.yml |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 576 | parameters: |
| 577 | downloadPartialBuildBinFrom: |
Pirmin Vogel | 18d8e13 | 2021-08-03 14:35:29 +0200 | [diff] [blame] | 578 | - sw_build_englishbreakfast |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 579 | - bash: | |
| 580 | set -e |
| 581 | . util/build_consts.sh |
| 582 | |
| 583 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 584 | |
| 585 | mkdir -p "$OBJ_DIR/hw" |
| 586 | mkdir -p "$BIN_DIR/hw/top_englishbreakfast" |
| 587 | |
Rupert Swarbrick | 97fe6a8 | 2021-07-16 11:27:50 +0100 | [diff] [blame] | 588 | BOOTROM_VMEM="$BIN_DIR/sw/device/boot_rom/boot_rom_fpga_nexysvideo.32.vmem" |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 589 | test -f "$BOOTROM_VMEM" |
| 590 | |
| 591 | fusesoc --cores-root=. \ |
| 592 | run --flag=fileset_topgen --target=synth --setup --build \ |
| 593 | --build-root="$OBJ_DIR/hw" \ |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 594 | lowrisc:systems:chip_englishbreakfast_cw305 \ |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 595 | --BootRomInitFile="$BOOTROM_VMEM" |
| 596 | |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 597 | cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit" \ |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 598 | "$BIN_DIR/hw/top_englishbreakfast" |
| 599 | displayName: Build bitstream with Vivado |
| 600 | - template: ci/upload-artifacts-template.yml |
| 601 | parameters: |
Philipp Wagner | 5aa7ed3 | 2021-02-02 18:53:36 +0000 | [diff] [blame] | 602 | includePatterns: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 603 | - "/hw/top_englishbreakfast/lowrisc_systems_chip_englishbreakfast_cw305_0.1.bit" |
Pirmin Vogel | 2f42ccd | 2020-12-22 20:19:30 +0100 | [diff] [blame] | 604 | |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 605 | - job: execute_fpga_tests_cw310 |
| 606 | displayName: Execute tests on ChipWhisperer CW310 FPGA board |
| 607 | pool: FPGA |
| 608 | timeoutInMinutes: 30 |
| 609 | dependsOn: |
| 610 | - chip_earlgrey_cw310 |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 611 | - sw_build |
| 612 | steps: |
| 613 | - template: ci/install-package-dependencies.yml |
| 614 | - template: ci/download-artifacts-template.yml |
| 615 | parameters: |
| 616 | downloadPartialBuildBinFrom: |
| 617 | - chip_earlgrey_cw310 |
Pirmin Vogel | ad2afea | 2021-05-20 10:43:40 +0200 | [diff] [blame] | 618 | - sw_build |
| 619 | - bash: | |
| 620 | set -e |
| 621 | |
| 622 | # Install an additional pytest dependency for result upload. |
| 623 | pip3 install pytest-azurepipelines |
| 624 | |
| 625 | . util/build_consts.sh |
| 626 | pytest --version |
| 627 | pytest test/systemtest/earlgrey/test_fpga_cw310.py \ |
| 628 | --log-cli-level=DEBUG \ |
| 629 | --test-run-title="Run system tests on ChipWhisperer CW310 FPGA board" \ |
| 630 | --napoleon-docstrings |
| 631 | displayName: Execute tests |
| 632 | |
| 633 | - job: execute_fpga_tests_nexysvideo |
| 634 | displayName: Execute tests on Nexys Video FPGA board |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 635 | pool: FPGA |
| 636 | timeoutInMinutes: 30 |
| 637 | dependsOn: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 638 | - chip_earlgrey_nexysvideo |
Timothy Chen | f835aa3 | 2021-01-08 16:27:50 -0800 | [diff] [blame] | 639 | - sw_build_nexysvideo |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 640 | - sw_build |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 641 | steps: |
| 642 | - template: ci/install-package-dependencies.yml |
| 643 | - template: ci/download-artifacts-template.yml |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 644 | parameters: |
| 645 | downloadPartialBuildBinFrom: |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 646 | - chip_earlgrey_nexysvideo |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 647 | - sw_build_nexysvideo |
| 648 | - sw_build |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 649 | - bash: | |
| 650 | set -e |
| 651 | |
| 652 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 653 | |
| 654 | # Install an additional pytest dependency for result upload. |
| 655 | pip3 install pytest-azurepipelines |
| 656 | |
| 657 | . util/build_consts.sh |
| 658 | pytest --version |
| 659 | pytest test/systemtest/earlgrey/test_fpga_nexysvideo.py \ |
| 660 | --log-cli-level=DEBUG \ |
| 661 | --test-run-title="Run system tests on Nexys Video FPGA board" \ |
| 662 | --napoleon-docstrings |
Philipp Wagner | 11d2dcb | 2020-09-29 16:27:46 +0100 | [diff] [blame] | 663 | displayName: Execute tests |
| 664 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 665 | - job: deploy_release_artifacts |
| 666 | displayName: Package and deploy release distribution |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 667 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 668 | vmImage: ubuntu-18.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 669 | dependsOn: |
| 670 | - lint |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 671 | - sw_build |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 672 | - chip_earlgrey_verilator |
| 673 | - chip_earlgrey_nexysvideo |
Philipp Wagner | a0a35a5 | 2021-08-04 16:39:35 +0100 | [diff] [blame] | 674 | - chip_earlgrey_cw310 |
Timothy Chen | 64f6a5a | 2021-02-05 17:04:40 -0800 | [diff] [blame] | 675 | condition: and(eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'), eq(dependencies.lint.outputs['DetermineBuildType.onlyDvChanges'], '0')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 676 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 677 | - template: ci/install-package-dependencies.yml |
| 678 | - template: ci/download-artifacts-template.yml |
Philipp Wagner | bdfb933 | 2021-02-02 18:10:06 +0000 | [diff] [blame] | 679 | parameters: |
| 680 | downloadPartialBuildBinFrom: |
| 681 | - sw_build |
Timothy Chen | ac28d1e | 2021-08-18 10:58:23 -0700 | [diff] [blame] | 682 | #- sw_build_nexysvideo |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 683 | - chip_earlgrey_verilator |
Timothy Chen | ac28d1e | 2021-08-18 10:58:23 -0700 | [diff] [blame] | 684 | #- chip_earlgrey_nexysvideo |
Philipp Wagner | a0a35a5 | 2021-08-04 16:39:35 +0100 | [diff] [blame] | 685 | - chip_earlgrey_cw310 |
Michael Schaffner | 93fe50c | 2021-03-31 16:25:42 -0700 | [diff] [blame] | 686 | - chip_englishbreakfast_verilator |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 687 | - bash: | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 688 | . util/build_consts.sh |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 689 | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 690 | util/make_distribution.sh |
Philipp Wagner | 542e220 | 2019-10-30 13:10:16 +0000 | [diff] [blame] | 691 | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 692 | tar --list -f $BIN_DIR/opentitan-*.tar.xz |
| 693 | # Put the resulting tar file into a directory the |publish| step below can reference. |
| 694 | mkdir "$BUILD_ROOT/dist-final" |
| 695 | 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] | 696 | displayName: Create final dist directory out of partial ones |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 697 | - publish: $(Build.ArtifactStagingDirectory)/dist-final |
| 698 | artifact: opentitan-dist |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 699 | displayName: Upload release artifacts as Azure artifact |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 700 | - task: GithubRelease@0 |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 701 | displayName: Upload to GitHub releases (only tags) |
Philipp Wagner | 0b20f5d | 2019-11-01 16:24:52 +0000 | [diff] [blame] | 702 | condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 703 | inputs: |
| 704 | gitHubConnection: opentitan-release-upload |
| 705 | repositoryName: lowrisc/opentitan |
| 706 | addChangeLog: false |
| 707 | assets: | |
| 708 | $(Build.ArtifactStagingDirectory)/dist-final/* |
Sam Elliott | e257cd0 | 2020-09-10 13:49:38 +0100 | [diff] [blame] | 709 | |
| 710 | |
| 711 | - job: build_docker_containers |
| 712 | displayName: "Build Docker Containers" |
| 713 | pool: |
Philipp Wagner | 5d1450c | 2020-10-06 12:26:36 +0100 | [diff] [blame] | 714 | vmImage: ubuntu-18.04 |
Sam Elliott | e257cd0 | 2020-09-10 13:49:38 +0100 | [diff] [blame] | 715 | dependsOn: |
| 716 | - lint |
| 717 | steps: |
| 718 | - task: Docker@2 |
| 719 | displayName: Build Developer Utility Container |
| 720 | inputs: |
| 721 | command: build |
| 722 | Dockerfile: ./util/container/Dockerfile |
| 723 | buildContext: . |
| 724 | - task: Docker@2 |
| 725 | displayName: Build Documentation Builder Container |
| 726 | inputs: |
| 727 | command: build |
| 728 | tags: gcr.io/active-premise-257318/builder |
| 729 | Dockerfile: ./site/docs/builder.Dockerfile |
| 730 | buildContext: . |
| 731 | - task: Docker@2 |
| 732 | displayName: Build Documentation Redirector Container |
| 733 | inputs: |
| 734 | command: build |
| 735 | Dockerfile: ./site/redirector/Dockerfile |
| 736 | buildContext: ./site/redirector |