blob: 4c17ee8548271c8be17872a3bc43128e097d560c [file] [log] [blame]
Miles Daiac55ad82022-12-05 12:04:33 -05001# 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
8schedules:
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 Dai411599c2022-12-08 12:49:40 -050018# To run on a schedule, PR and other triggers must be disabled
19pr: none
20trigger: none
21
Miles Daiac55ad82022-12-05 12:04:33 -050022variables:
Miles Dai411599c2022-12-08 12:49:40 -050023 # 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 Daiac55ad82022-12-05 12:04:33 -050034
35jobs:
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 Dai411599c2022-12-08 12:49:40 -050050- job: build_release
51 displayName: "Create the OpenTitan release"
52 timeoutInMinutes: 240
Miles Daiac55ad82022-12-05 12:04:33 -050053 dependsOn: checkout
54 pool: ci-public
55 steps:
Miles Dai411599c2022-12-08 12:49:40 -050056 - template: ../ci/checkout-template.yml
57 - template: ../ci/install-package-dependencies.yml
Miles Daiac55ad82022-12-05 12:04:33 -050058 - bash: |
Miles Dai411599c2022-12-08 12:49:40 -050059 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 Daiac55ad82022-12-05 12:04:33 -050080 PKG_PATH=$(./bazelisk.sh outquery //release:opentitan)
81 echo $PKG_PATH
Miles Dai411599c2022-12-08 12:49:40 -050082 echo "##vso[task.setvariable variable=pkg_path]$PKG_PATH"
Miles Daiac55ad82022-12-05 12:04:33 -050083 displayName: "Build Bazel release package"
Miles Dai411599c2022-12-08 12:49:40 -050084
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 Daiac55ad82022-12-05 12:04:33 -0500101 - publish: $(pkg_path)
Miles Dai411599c2022-12-08 12:49:40 -0500102 artifact: opentitan-release
103 displayName: "Upload release artifacts"