aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/.ci/templates/mb_cpld_build.yml
blob: 53aa0736fd83742f6d569222ff7563da56477f5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Copyright 2021 Ettus Research, a National Instruments Brand
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# Description:
#
#   This template is used to build the MB CPLD within the uhddev repository.
#   Exports the CPLD build results (from build directory) as artifacts 'MB CPLD
#   image'.
#
#   See description for the parameters below.
#

parameters:
  ### Optional parameters
  # Set to true if the intermediate files from build-<target> directory should
  # be exported for debugging as artifact 'MB CPLD build (<attempt>)'
  - name: debug
    type: boolean
    default: false
  # Checkout repository in a clean state as described in
  # https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#checkout
  - name: clean
    type: boolean
    default: true

jobs:
- job: MB_CPLD
  displayName: 'Build MB CPLD'
  pool:
    name: de-dre-lab
    demands:
    - ettus_fpga_build
    - quartus18.1_lite
  timeoutInMinutes: 30
  steps:
    # Currently limited to be executed in same repo.
    # Removes all unversioned files if necessary.
    # Checkout path defined by single repository case in
    # https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path
    - checkout: self
      clean: ${{ parameters.clean }}

    # Run CPLD build
    # Increase license server timeout as there might appear timeouts during
    # static timing analysis which end up setting the build to fail.
    - script: |
        call set FLEXLM_TIMEOUT=20000000
        call make
      workingDirectory: $(Agent.BuildDirectory)/s/fpga/usrp3/top/x400/cpld
      displayName: 'Build CPLD'

    # Publish the final result only if all previous steps passed
    - publish: $(Agent.BuildDirectory)/s/fpga/usrp3/top/x400/cpld/build
      artifact: 'MB CPLD image'
      displayName: 'Publish CPLD'

    # always publish intermediate files
    - publish: $(Agent.BuildDirectory)/s/fpga/usrp3/top/x400/cpld/output_files
      artifact: 'MB CPLD build ($(System.JobAttempt))'
      condition: and(always(), eq('${{ parameters.debug }}', true))
      displayName: 'Publish Build Directory'

    # Check if FPGA build left any untracked files.
    - ${{ if eq(parameters.debug, true) }}:
      - template: check_clean_repo_steps.yml