Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [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 | # |
| 5 | # Azure Release Pipeline configuration |
| 6 | # Documentation at https://aka.ms/yaml |
| 7 | |
| 8 | schedules: |
| 9 | # For testing purposes, run this pipeline every day at 08:37 UTC |
| 10 | # Use a random minute value to avoid congestion on the hour |
| 11 | - cron: "37 8 * * *" |
| 12 | displayName: "OpenTitan Release build (test)" |
| 13 | branches: |
| 14 | include: |
| 15 | - "master" |
| 16 | always: True |
| 17 | |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 18 | # To run on a schedule, PR and other triggers must be disabled |
| 19 | pr: none |
| 20 | trigger: none |
| 21 | |
Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [diff] [blame] | 22 | variables: |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 23 | # If updating VERILATOR_VERSION, TOOLCHAIN_VERSION or RUST_VERSION, update the |
| 24 | # definitions in util/container/Dockerfile as well. |
| 25 | VERILATOR_VERSION: 4.210 |
| 26 | TOOLCHAIN_PATH: /opt/buildcache/riscv |
| 27 | VERIBLE_VERSION: v0.0-2135-gb534c1fe |
| 28 | RUST_VERSION: 1.60.0 |
| 29 | # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases |
| 30 | TOOLCHAIN_VERSION: 20220210-1 |
| 31 | # This controls where builds happen, and gets picked up by build_consts.sh. |
| 32 | BUILD_ROOT: $(Build.ArtifactStagingDirectory) |
| 33 | VIVADO_VERSION: "2020.2" |
Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [diff] [blame] | 34 | |
| 35 | jobs: |
| 36 | - job: checkout |
| 37 | displayName: "Checkout repository" |
| 38 | pool: |
| 39 | vmImage: ubuntu-20.04 |
| 40 | steps: |
| 41 | - checkout: self |
| 42 | path: opentitan-repo |
| 43 | - bash: | |
| 44 | tar -C $(Pipeline.Workspace)/opentitan-repo -czf $(Pipeline.Workspace)/opentitan-repo.tar.gz . |
| 45 | displayName: "Pack up repository" |
| 46 | - publish: $(Pipeline.Workspace)/opentitan-repo.tar.gz |
| 47 | artifact: opentitan-repo |
| 48 | displayName: "Upload repository" |
| 49 | |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 50 | - job: build_release |
| 51 | displayName: "Create the OpenTitan release" |
| 52 | timeoutInMinutes: 240 |
Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [diff] [blame] | 53 | dependsOn: checkout |
| 54 | pool: ci-public |
| 55 | steps: |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 56 | - template: ../ci/checkout-template.yml |
| 57 | - template: ../ci/install-package-dependencies.yml |
Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [diff] [blame] | 58 | - bash: | |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 59 | set -ex |
| 60 | trap 'get_logs' EXIT |
| 61 | get_logs() { |
| 62 | # Export the Vivado logs |
| 63 | mkdir -p $OBJ_DIR/hw/top_earlgrey/standard-release |
| 64 | mkdir -p $OBJ_DIR/hw/top_earlgrey/chip_earlgrey_cw310_hyperdebug-release/ |
| 65 | cp -rLt $OBJ_DIR/hw/top_earlgrey/standard-release \ |
| 66 | $($REPO_TOP/bazelisk.sh outquery-all //hw/bitstream/vivado:fpga_cw310) |
| 67 | cp -rLt $OBJ_DIR/hw/top_earlgrey/chip_earlgrey_cw310_hyperdebug-release/ \ |
| 68 | $($REPO_TOP/bazelisk.sh outquery-all //hw/bitstream/vivado:fpga_cw310_hyperdebug) |
| 69 | } |
| 70 | |
| 71 | . util/build_consts.sh |
| 72 | module load "xilinx/vivado/$(VIVADO_VERSION)" |
| 73 | # Build the release package |
| 74 | # --jobs=1 is necessary due to resource constraints on the build machine. |
| 75 | # Running multiple Vivado and Verilator build jobs simultaneously can |
| 76 | # cause Synthesis failures |
| 77 | ci/bazelisk.sh build release --jobs=1 |
| 78 | |
| 79 | # Set the package-path variable for the artifact-publishing step |
Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [diff] [blame] | 80 | PKG_PATH=$(./bazelisk.sh outquery //release:opentitan) |
| 81 | echo $PKG_PATH |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 82 | echo "##vso[task.setvariable variable=pkg_path]$PKG_PATH" |
Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [diff] [blame] | 83 | displayName: "Build Bazel release package" |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 84 | |
| 85 | - bash: | |
| 86 | . util/build_consts.sh |
| 87 | echo "Synthesis log" |
| 88 | cat $OBJ_DIR/hw/top_earlgrey/standard-release/build.fpga_cw310/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/synth_1/runme.log || true |
| 89 | echo "Implementation log" |
| 90 | cat $OBJ_DIR/hw/top_earlgrey/standard-release/build.fpga_cw310/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/impl_1/runme.log || true |
| 91 | displayName: "Display standard bitstream synth and impl logs" |
| 92 | |
| 93 | - bash: | |
| 94 | . util/build_consts.sh |
| 95 | echo "Synthesis log" |
| 96 | cat $OBJ_DIR/hw/top_earlgrey/chip_earlgrey_cw310_hyperdebug-release/build.fpga_cw310/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/synth_1/runme.log || true |
| 97 | echo "Implementation log" |
| 98 | cat $OBJ_DIR/hw/top_earlgrey/chip_earlgrey_cw310_hyperdebug-release/build.fpga_cw310/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.runs/impl_1/runme.log || true |
| 99 | displayName: "Display hyperdebug bitstream synth and impl logs" |
| 100 | |
Miles Dai | ac55ad8 | 2022-12-05 12:04:33 -0500 | [diff] [blame] | 101 | - publish: $(pkg_path) |
Miles Dai | 411599c | 2022-12-08 12:49:40 -0500 | [diff] [blame] | 102 | artifact: opentitan-release |
| 103 | displayName: "Upload release artifacts" |