Skip to content

Commit

Permalink
Create Jenkins canary build for upstream HDL main
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Feb 5, 2024
1 parent 16a8391 commit 5310b38
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 18 deletions.
23 changes: 5 additions & 18 deletions CI/scripts/build_bsp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,15 @@ for f in $FILES; do
done
cd ..

# Tests
cd test
# Update line 35 of DemoTests.m to use new version
sed -i "35s/.*/ testCase.setupVivado('${VIVADO}');/" DemoTests.m
sed -i "47s/.*/ testCase.setupVivado('${VIVADO}');/" DemoTests.m
sed -i "59s/.*/ testCase.setupVivado('${VIVADO}');/" DemoTests.m
# # Tests
# cd test
# # Update line 35 of DemoTests.m to use new version
# # sed -i "35s/.*/ testCase.setupVivado('${VIVADO}');/" DemoTests.m

cd ..
# cd ..

cd CI

# Setup
source /opt/Xilinx/Vivado/$VIVADO/settings64.sh

# Pre-build IP library
# cd hdl/library
# make
# cd ../..

# Rename .prj files since MATLAB ignores then during packaging
FILES=$(grep -lrn hdl/projects/common -e '.prj' | grep -v Makefile | grep -v .git)
Expand All @@ -120,8 +111,6 @@ TARGET="../hdl/vendor/AnalogDevices/vivado"
if [ -d "$TARGET" ]; then
rm -rf "$TARGET"
fi
# Increase rx_clk period to fix timing failures for Pluto designs in R2021b
sed -i 's/16.27/30/' hdl/projects/pluto/system_constr.xdc
mv hdl $TARGET

# Post-process ports.json
Expand All @@ -144,5 +133,3 @@ cp scripts/fixmake.sh ../hdl/vendor/AnalogDevices/vivado/projects/scripts/fixma
# Copy boot files
mkdir ../hdl/vendor/AnalogDevices/vivado/projects/common/boot/
cp -r scripts/boot/* ../hdl/vendor/AnalogDevices/vivado/projects/common/boot/

echo 'puts "Skipping"' > ../hdl/vendor/AnalogDevices/vivado/library/axi_ad9361/axi_ad9361_delay.tcl
93 changes: 93 additions & 0 deletions JenkinsfileCanary
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Canary build for High Speed Converter Toolbox with HDL main branch

@Library('tfc-lib') _

flags = gitParseFlags()

dockerConfig = getDockerConfig(['MATLAB','Vivado'], matlabHSPro=false)
dockerConfig.add("-e MLRELEASE=R2022b")
// dockerConfig.add("-e VIVADORELEASE=2023.1")
dockerHost = 'docker'

////////////////////////////

hdlBranches = ['main']

stage("Build Toolbox") {
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
branchName ->
try {
withEnv(['HDLBRANCH='+branchName]) {
checkout scm
sh 'git submodule update --init'
sh 'pip3 install -r ./CI/gen_doc/requirements_doc.txt'
sh 'rm -rf doc || true'
sh 'make -C ./CI/gen_doc doc_ml'
sh 'make -C ./CI/scripts build'
sh 'make -C ./CI/scripts gen_tlbx'
}
} catch(Exception ex) {
if (branchName == 'main') {
error('Production Toolbox Build Failed')
}
else {
unstable('Development Build Failed')
}
}
if (branchName == 'main') {
archiveArtifacts artifacts: '*.mltbx'
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
}
}
}

/////////////////////////////////////////////////////

boardNames = ['daq2','ad9081','ad9434','ad9739a','ad9265', 'fmcjesdadc1','ad9783']
dockerConfig.add("-e HDLBRANCH=main")

cstage("HDL Tests", "", flags) {
dockerParallelBuild(boardNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['BOARD='+branchName]) {
cstage("Source", branchName, flags) {
unstash "builtSources"
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
cstage("Installer", branchName, flags) {
unstash "builtSources"
sh 'make -C ./CI/scripts test_installer'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
}
}

/////////////////////////////////////////////////////

def deployments = [:];
def board = 'ad9208';
def nodeLabel = 'baremetal && high_memory';
deployments[board] = { node(nodeLabel) {
cstage("Baremetal HDL Test", "", flags) {
withEnv(['BOARD='+board,'MLRELEASE=R2022b','VIVADORELEASE=2022.2','HDLBRANCH=main','LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
try {
cstage("AD9208 HDL Test", "", flags) {
echo "Node: ${env.NODE_NAME}"
unstash "builtSources"
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
finally {
cleanWs();
}
}
}
}}

parallel deployments

0 comments on commit 5310b38

Please sign in to comment.