blob: d415ef714ef9916dbf65920d5fa42367385aad2f (
plain) (
blame)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
#
# Copyright 2022 Ettus Research, a National Instruments Brand
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#
# Description:
#
# This template shall be used for FPGA builds within the uhddev
# repository. Exports the FPGA build results (bitfile, device tree and build
# report from build directory) as artifacts '<target>'.
#
# See description for the parameters below.
#
parameters:
### Required parameters
# FPGA targets to be built.
# E.g.
# targets_matrix:
# X410_XG_100:
# target: X410_XG_100
# timeout: 480
# X410_X4_200:
# target: X410_X4_200
# timeout: 480
- name: targets_matrix
type: object
# IP artifact name (from pipeline) to be used
- name: ip_artifact
type: string
# PATH to device's top directory (where Makefile is located)
- name: top_dir
type: string
### Optional parameters
# Set to true if the intermediate files from build-<target> directory should
# be exported for debugging as artifact 'Build artifacts <target> (Attempt <attempt>)'
- name: publish_int_files
type: boolean
default: false
jobs:
- job: build_fpga
displayName: 'Build FPGA'
timeoutInMinutes: $[ variables['timeout'] ]
pool:
name: Drivers-NIBuildFarm-RFMIBUILD
demands:
- Agent.OS -equals Linux
variables:
- group: sdr-pipeline-vars
strategy:
matrix:
${{ parameters.targets_matrix }}
steps:
- checkout: self
clean: true
fetchDepth: 1
- checkout: hwtools
clean: true
path: s/hwtools/head
persistCredentials: true
fetchDepth: 1
- download: current
artifact: ${{ parameters.ip_artifact }}
displayName: 'Download ${{ parameters.ip_artifact }}'
- bash: |
mv $(Pipeline.Workspace)/${{ parameters.ip_artifact }} \
${{ parameters.top_dir }}/build-ip/
displayName: 'Populate build-ip'
- bash: |
mkdir -p $(Build.BinariesDirectory)/prefix
# hwtools hwsetup.sh will setup a venv, so we'll reuse that for the
# image builder! That's also why we install the image builder in the
# same step as building the bitfile: To avoid having to run hwsetup.sh
# twice.
source $(Build.SourcesDirectory)/uhddev/fpga/.ci/scripts/run_setup.sh ./
pip3 install -U numpy mako "ruamel.yaml<0.18.0" jsonschema
set -o xtrace
# hwsetup.sh injects garbage cmake versions into PATH, so avoid that by
# going straight to /usr/bin/cmake
/usr/bin/cmake -S $(Build.SourcesDirectory)/uhddev/host \
-B $(Build.BinariesDirectory)/build_image_builder \
-DCMAKE_INSTALL_PREFIX=$(Build.BinariesDirectory)/prefix \
-DUHD_BOOST_REQUIRED=OFF \
-DENABLE_LIBUHD=OFF -DENABLE_PYMOD_UTILS=ON \
-DENABLE_DOXYGEN=OFF -DENABLE_MAN_PAGES=OFF -DENABLE_MANUAL=OFF
/usr/bin/cmake --build $(Build.BinariesDirectory)/build_image_builder
/usr/bin/cmake --install $(Build.BinariesDirectory)/build_image_builder
# rfnoc_image_builder does not currently get installed to a bin/ folder
# via pip, so we add it to PATH
export PATH=$BUILD_BINARIESDIRECTORY/prefix/bin:$VIRTUAL_ENV/bin:$PATH
python3 ../../tools/utils/repeat_fpga_build.py --target $(target_name) --image-core $(image_core) --num $(max_attempts) --seed $(($(System.JobAttempt)-1)) --persistent
workingDirectory: ${{ parameters.top_dir }}
env:
PATCHES_PATH: $(sdr-vivado-patches)
displayName: 'Build Target'
# Publish the final result only if all previous steps passed
- publish: ${{ parameters.top_dir }}/build
artifact: '$(target_name)'
displayName: 'Publish FPGA'
# Publish intermediate files.
- publish: ${{ parameters.top_dir }}/build-$(target_name)
artifact: 'Build artifacts $(target_name) (Attempt $(System.JobAttempt))'
condition: and(always(), eq('${{ parameters.publish_int_files }}', true))
displayName: 'Publish Build Directory'
# Check if FPGA build left any untracked files.
- template: check_clean_repo_steps.yml
parameters:
directory: ${{ parameters.top_dir }}
|