lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1 | # Azure Pipelines CI build configuration |
| 2 | # Documentation at https://aka.ms/yaml |
| 3 | |
| 4 | variables: |
Pirmin Vogel | eaf8b4b | 2020-03-03 14:51:03 +0100 | [diff] [blame] | 5 | VERILATOR_VERSION: 4.028 |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 6 | VERILATOR_PATH: /opt/buildcache/verilator/$(VERILATOR_VERSION) |
Miguel Osorio | 88179fc | 2019-09-19 23:37:48 -0700 | [diff] [blame] | 7 | TOOLCHAIN_PATH: /opt/buildcache/riscv |
| 8 | # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases |
Sam Elliott | 0088155 | 2020-05-04 16:46:55 +0100 | [diff] [blame^] | 9 | # if you update this, update the definition in util/container/Dockerfile |
Philipp Wagner | 018e3a2 | 2019-10-10 15:55:56 +0100 | [diff] [blame] | 10 | TOOLCHAIN_VERSION: 20191010-1 |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 11 | # This controls where builds happen, and gets picked up by build_consts.sh. |
| 12 | BUILD_ROOT: $(Build.ArtifactStagingDirectory) |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 13 | |
| 14 | trigger: |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 15 | batch: true |
| 16 | branches: |
| 17 | include: |
Philipp Wagner | dd1706e | 2020-03-15 14:39:59 +0000 | [diff] [blame] | 18 | - '*' |
| 19 | tags: |
| 20 | include: |
| 21 | - "*" |
| 22 | pr: |
| 23 | branches: |
| 24 | include: |
| 25 | - '*' |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 26 | |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 27 | jobs: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 28 | - job: lint |
| 29 | displayName: Run code quality checks (lint) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 30 | pool: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 31 | vmImage: ubuntu-16.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 32 | steps: |
| 33 | - bash: | |
Garret Kelly | f5608d0 | 2019-11-01 16:28:11 -0400 | [diff] [blame] | 34 | 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] | 35 | displayName: Remove existing Clang installation |
| 36 | - template: ci/install-package-dependencies.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 37 | - bash: | |
| 38 | python3 --version |
| 39 | yapf --version |
| 40 | isort --version |
| 41 | clang-format -version |
Rupert Swarbrick | 2d70c75 | 2020-03-24 17:23:40 +0000 | [diff] [blame] | 42 | flake8 --version |
Philipp Wagner | b52cee6 | 2020-03-30 15:40:43 +0100 | [diff] [blame] | 43 | ninja --version |
| 44 | meson --version |
Greg Chadwick | fe07c7c | 2020-02-11 11:24:09 +0000 | [diff] [blame] | 45 | echo "PATH=$PATH" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 46 | displayName: Display tool versions |
| 47 | - bash: | |
Rupert Swarbrick | 2d70c75 | 2020-03-24 17:23:40 +0000 | [diff] [blame] | 48 | fork_origin="$(git merge-base --fork-point origin/master)" |
| 49 | git diff --name-only "$fork_origin" "*.py" \ |
| 50 | | xargs -r util/lintpy.py --tools flake8 -f |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 51 | displayName: Run Python lint |
Rupert Swarbrick | 2d70c75 | 2020-03-24 17:23:40 +0000 | [diff] [blame] | 52 | continueOnError: true |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 53 | - bash: | |
| 54 | make -C hw regs && git diff --exit-code |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 55 | if [[ $? != 0 ]]; then |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 56 | echo -n "##vso[task.logissue type=error]" |
| 57 | echo "Register headers not up-to-date. Regenerate them with 'make -C hw regs'." |
| 58 | exit 1 |
| 59 | fi |
| 60 | condition: always() |
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 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 62 | - bash: | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 63 | util/build_docs.py |
Garret Kelly | 889bf6a | 2019-11-03 13:02:27 -0500 | [diff] [blame] | 64 | condition: always() |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 65 | displayName: Render documentation |
Garret Kelly | 889bf6a | 2019-11-03 13:02:27 -0500 | [diff] [blame] | 66 | - bash: | |
Garret Kelly | 8d7da7c | 2019-11-08 14:09:34 -0500 | [diff] [blame] | 67 | cd site/landing |
| 68 | ../../build/docs-hugo/hugo |
| 69 | condition: always() |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 70 | displayName: Render landing site |
Garret Kelly | 8d7da7c | 2019-11-08 14:09:34 -0500 | [diff] [blame] | 71 | - bash: | |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 72 | # XXX: As of today, task.logissue comments with 'sourcepath' set don't |
| 73 | # get reported to GitHub Checks annotations. Upstream bug report: |
| 74 | # https://developercommunity.visualstudio.com/content/problem/689794/pipelines-logging-command-logissue-does-not-report.html |
| 75 | #echo "##vso[task.issue type=error;sourcepath=/azure-pipelines.yml;linenumber=45;columnnumber=1;code=100;]Found something that could be a problem." |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 76 | fork_origin="$(git merge-base --fork-point origin/master)" |
| 77 | changed_files="$(git diff --name-only "$fork_origin" | grep -v /vendor/ | grep -E '\.(cpp|cc|c|h)$')" |
Greg Chadwick | ffa126f | 2020-04-07 11:36:31 +0100 | [diff] [blame] | 78 | if [[ -n "$changed_files" ]]; then |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 79 | xargs git diff -U0 "$fork_origin" <<< "$changed_files" \ |
| 80 | | clang-format-diff -p1 \ |
| 81 | | tee clang-format-output |
| 82 | if [[ -s clang-format-output ]]; then |
| 83 | echo -n "##vso[task.logissue type=error]" |
| 84 | echo "C/C++ lint failed. Use 'git clang-format' with appropriate options to reformat the changed code." |
| 85 | exit 1 |
| 86 | fi |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 87 | fi |
| 88 | # This check is not idempotent, but checks changes to a base branch. |
| 89 | # Run it only on pull requests. |
| 90 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 91 | displayName: Use clang-format to check C/C++ coding style |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 92 | - bash: | |
Miguel Young de la Sota | b23dc8c | 2020-01-14 13:52:33 -0500 | [diff] [blame] | 93 | fork_origin="$(git merge-base --fork-point origin/master)" |
| 94 | changed_files="$(git diff --name-only "$fork_origin")" |
Greg Chadwick | ffa126f | 2020-04-07 11:36:31 +0100 | [diff] [blame] | 95 | if [[ -n "$changed_files" ]]; then |
Miguel Young de la Sota | b23dc8c | 2020-01-14 13:52:33 -0500 | [diff] [blame] | 96 | xargs util/fix_include_guard.py --dry-run <<< "$changed_files" | tee fix-include-guard-output |
| 97 | if [[ -s fix-include-guard-output ]]; then |
| 98 | echo -n "##vso[task.logissue type=error]" |
| 99 | echo "Include guard check failed. Please run util/fix_include_guard.py on the above files." |
| 100 | exit 1 |
| 101 | fi |
| 102 | fi |
| 103 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 104 | displayName: Check formatting on header guards |
Miguel Young de la Sota | b23dc8c | 2020-01-14 13:52:33 -0500 | [diff] [blame] | 105 | - bash: | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 106 | commit_range="$(git merge-base --fork-point origin/master)..HEAD" |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 107 | # Notes: |
| 108 | # * Merge commits are not checked. We always use rebases instead of |
| 109 | # merges to keep a linear history, which makes merge commits disappear |
| 110 | # ultimately, making them only a CI artifact which should not be |
| 111 | # checked. |
| 112 | # * 'type=error' is used even for warnings. Only "errors" are shown in |
| 113 | # the GitHub checks API. However, warnings don't return a non-zero |
| 114 | # error code and don't fail the build step. |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 115 | util/lint_commits.py \ |
| 116 | --no-merges \ |
| 117 | --error-msg-prefix="##vso[task.logissue type=error]" \ |
| 118 | --warning-msg-prefix="##vso[task.logissue type=error]" \ |
| 119 | "$commit_range" |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 120 | # Only run on pull requests to check new commits only |
| 121 | condition: eq(variables['Build.Reason'], 'PullRequest') |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 122 | displayName: Check commit metadata |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 123 | - bash: | |
| 124 | only_doc_changes=0 |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 125 | if [[ "$(Build.Reason)" = "PullRequest" ]]; then |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 126 | # Conservative way of checking for documentation-only changes. |
| 127 | # Only relevant for pipelines triggered from pull requests |
| 128 | echo "Checking for doc-only changes in this pull request" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 129 | fork_origin="$(git merge-base --fork-point origin/master)" |
| 130 | only_doc_changes="$(git diff --name-only "$fork_origin" | grep -v '\.md$' -q; echo $?)" |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 131 | fi |
| 132 | echo "##vso[task.setvariable variable=onlyDocChanges;isOutput=true]${only_doc_changes}" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 133 | displayName: Check if the commit only contains documentation changes |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 134 | name: DetermineBuildType |
Philipp Wagner | 1e64355 | 2019-09-04 15:39:14 +0100 | [diff] [blame] | 135 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 136 | - job: sw_build |
| 137 | displayName: Build Software |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 138 | dependsOn: lint |
Philipp Wagner | 9d20ee6 | 2019-11-29 14:27:28 +0000 | [diff] [blame] | 139 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 140 | pool: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 141 | vmImage: ubuntu-16.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 142 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 143 | - template: ci/install-package-dependencies.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 144 | - bash: | |
| 145 | set -x |
| 146 | sudo util/get-toolchain.py \ |
| 147 | --target-dir="${TOOLCHAIN_PATH}" \ |
| 148 | --release-version="${TOOLCHAIN_VERSION}" \ |
Philipp Wagner | 1c51441 | 2019-11-27 14:48:47 +0000 | [diff] [blame] | 149 | --update |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 150 | displayName: Install toolchain |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 151 | - bash: | |
Miguel Young de la Sota | 6379357 | 2019-11-13 14:18:51 -0600 | [diff] [blame] | 152 | . util/build_consts.sh |
Miguel Young de la Sota | 4a4946d | 2019-11-21 10:44:18 -0600 | [diff] [blame] | 153 | ./meson_init.sh -A |
Miguel Young de la Sota | 76526c3 | 2020-01-28 10:24:41 -0500 | [diff] [blame] | 154 | ninja -C "$OBJ_DIR" all |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 155 | displayName: Build embedded targets |
| 156 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | 9d20b3d | 2020-02-03 16:35:31 -0500 | [diff] [blame] | 157 | - bash: | |
| 158 | . util/build_consts.sh |
| 159 | ninja -C "$OBJ_DIR" test |
| 160 | displayName: 'Run unit tests' |
| 161 | - template: 'ci/upload-artifacts-template.yml' |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 162 | parameters: |
| 163 | artifact: sw_build |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 164 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 165 | - job: top_earlgrey_verilator |
| 166 | displayName: Build Verilator simulation of the Earl Grey toplevel design |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 167 | dependsOn: lint |
Philipp Wagner | 9d20ee6 | 2019-11-29 14:27:28 +0000 | [diff] [blame] | 168 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 169 | pool: Default |
| 170 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 171 | - template: ci/install-package-dependencies.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 172 | - bash: | |
| 173 | set -e |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 174 | if [[ ! -d "$(VERILATOR_PATH)" ]]; then |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 175 | echo "Building verilator (no cached build found)" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 176 | |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 177 | mkdir -p build/verilator |
| 178 | cd build/verilator |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 179 | curl -Ls -o verilator.tgz \ |
| 180 | "https://www.veripool.org/ftp/verilator-$(VERILATOR_VERSION).tgz" |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 181 | tar -xf verilator.tgz |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 182 | |
| 183 | cd "verilator-$(VERILATOR_VERSION)" |
| 184 | ./configure --prefix="$(VERILATOR_PATH)" |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 185 | make -j$(nproc) |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 186 | mkdir -p "$VERILATOR_PATH" |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 187 | make install |
| 188 | else |
| 189 | echo "Re-using cached verilator build" |
| 190 | fi |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 191 | displayName: Build and install Verilator |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 192 | - bash: | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 193 | export PATH="$VERILATOR_PATH/bin:$PATH" |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 194 | python3 --version |
| 195 | fusesoc --version |
| 196 | verilator --version |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 197 | displayName: Display environment |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 198 | - bash: | |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 199 | . util/build_consts.sh |
| 200 | mkdir -p "$OBJ_DIR/hw" |
| 201 | mkdir -p "$BIN_DIR/hw/top_earlgrey" |
| 202 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 203 | export PATH="$VERILATOR_PATH/bin:$PATH" |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 204 | fusesoc --cores-root=. \ |
| 205 | run --target=sim --setup --build \ |
| 206 | --build-root="$OBJ_DIR/hw" \ |
| 207 | lowrisc:systems:top_earlgrey_verilator |
| 208 | |
| 209 | cp "$OBJ_DIR/hw/sim-verilator/Vtop_earlgrey_verilator" \ |
| 210 | "$BIN_DIR/hw/top_earlgrey" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 211 | displayName: Build simulation with Verilator |
| 212 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 213 | parameters: |
| 214 | artifact: top_earlgrey_verilator |
Philipp Wagner | f4655a1 | 2019-10-30 11:59:15 +0000 | [diff] [blame] | 215 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 216 | - job: execute_verilated_tests |
| 217 | displayName: Execute tests on the Verilated system |
Timothy Chen | f7e85cb | 2019-12-10 16:24:39 -0800 | [diff] [blame] | 218 | pool: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 219 | vmImage: ubuntu-16.04 |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 220 | dependsOn: |
| 221 | - top_earlgrey_verilator |
| 222 | - sw_build |
| 223 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 224 | - template: ci/install-package-dependencies.yml |
| 225 | - template: ci/download-artifacts-template.yml |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 226 | - bash: | |
| 227 | . util/build_consts.sh |
| 228 | export VERILATED_SYSTEM_PATH="$BIN_DIR/hw/top_earlgrey/Vtop_earlgrey_verilator" |
Philipp Wagner | 57418e7 | 2019-12-02 21:25:27 +0000 | [diff] [blame] | 229 | pytest --version |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 230 | ci/run_verilator_pytest.sh |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 231 | displayName: Execute tests |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 232 | |
Greg Chadwick | bf9dc38 | 2020-04-17 09:30:40 +0100 | [diff] [blame] | 233 | - template: ci/run-riscv-compliance.yml |
| 234 | parameters: |
| 235 | rvc_test_suites: |
| 236 | - rv32i |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 237 | |
Greg Chadwick | bf9dc38 | 2020-04-17 09:30:40 +0100 | [diff] [blame] | 238 | - template: ci/run-riscv-compliance.yml |
| 239 | parameters: |
| 240 | rvc_test_suites: |
| 241 | - rv32im |
| 242 | - rv32imc |
| 243 | - rv32Zicsr |
Timothy Chen | 7d1436d | 2019-12-04 17:26:14 -0800 | [diff] [blame] | 244 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 245 | - job: top_earlgrey_nexysvideo |
| 246 | displayName: Build NexysVideo variant of the Earl Grey toplevel design using Vivado |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 247 | dependsOn: |
| 248 | - lint |
| 249 | # The bootrom is built into the FPGA image at synthesis time. |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 250 | - sw_build |
Philipp Wagner | 9d20ee6 | 2019-11-29 14:27:28 +0000 | [diff] [blame] | 251 | condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 252 | pool: Default |
| 253 | timeoutInMinutes: 120 # 2 hours |
| 254 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 255 | - template: ci/install-package-dependencies.yml |
| 256 | - template: ci/download-artifacts-template.yml |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 257 | - bash: | |
| 258 | set -e |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 259 | . util/build_consts.sh |
| 260 | mkdir -p "$OBJ_DIR/hw" |
| 261 | mkdir -p "$BIN_DIR/hw/top_earlgrey" |
| 262 | |
Greg Chadwick | 1287104 | 2020-04-20 13:42:56 +0100 | [diff] [blame] | 263 | 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] | 264 | test -f "$BOOTROM_VMEM" |
| 265 | |
| 266 | . /opt/xilinx/Vivado/2018.3/settings64.sh |
| 267 | fusesoc --cores-root=. \ |
| 268 | run --target=synth --setup --build \ |
| 269 | --build-root="$OBJ_DIR/hw" \ |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 270 | lowrisc:systems:top_earlgrey_nexysvideo \ |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 271 | --ROM_INIT_FILE="$BOOTROM_VMEM" |
| 272 | |
| 273 | cp "$OBJ_DIR/hw/synth-vivado/lowrisc_systems_top_earlgrey_nexysvideo_0.1.bit" \ |
| 274 | "$BIN_DIR/hw/top_earlgrey" |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 275 | displayName: Build bitstream with Vivado |
| 276 | - template: ci/upload-artifacts-template.yml |
Miguel Young de la Sota | b4df860 | 2019-11-21 12:44:11 -0600 | [diff] [blame] | 277 | parameters: |
| 278 | artifact: top_earlgrey_nexysvideo |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 279 | |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 280 | - job: deploy_release_artifacts |
| 281 | displayName: Package and deploy release distribution |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 282 | pool: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 283 | vmImage: ubuntu-16.04 |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 284 | dependsOn: |
| 285 | - lint |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 286 | - sw_build |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 287 | - top_earlgrey_verilator |
| 288 | - top_earlgrey_nexysvideo |
| 289 | condition: eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0') |
| 290 | steps: |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 291 | - template: ci/install-package-dependencies.yml |
| 292 | - template: ci/download-artifacts-template.yml |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 293 | - bash: | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 294 | . util/build_consts.sh |
Miguel Young de la Sota | b5be8c6 | 2019-11-20 10:01:09 -0600 | [diff] [blame] | 295 | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 296 | util/make_distribution.sh |
Philipp Wagner | 542e220 | 2019-10-30 13:10:16 +0000 | [diff] [blame] | 297 | |
Miguel Young de la Sota | d42948c | 2019-11-18 13:56:55 -0600 | [diff] [blame] | 298 | tar --list -f $BIN_DIR/opentitan-*.tar.xz |
| 299 | # Put the resulting tar file into a directory the |publish| step below can reference. |
| 300 | mkdir "$BUILD_ROOT/dist-final" |
| 301 | 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] | 302 | displayName: Create final dist directory out of partial ones |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 303 | - publish: $(Build.ArtifactStagingDirectory)/dist-final |
| 304 | artifact: opentitan-dist |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 305 | displayName: Upload release artifacts as Azure artifact |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 306 | - task: GithubRelease@0 |
Miguel Young de la Sota | a68e307 | 2020-01-02 13:59:54 -0600 | [diff] [blame] | 307 | displayName: Upload to GitHub releases (only tags) |
Philipp Wagner | 0b20f5d | 2019-11-01 16:24:52 +0000 | [diff] [blame] | 308 | condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
Philipp Wagner | bd9ae43 | 2019-11-01 14:33:30 +0000 | [diff] [blame] | 309 | inputs: |
| 310 | gitHubConnection: opentitan-release-upload |
| 311 | repositoryName: lowrisc/opentitan |
| 312 | addChangeLog: false |
| 313 | assets: | |
| 314 | $(Build.ArtifactStagingDirectory)/dist-final/* |