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