From 5310b38479cafd53da76c1111a819a647f465c00 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Mon, 5 Feb 2024 11:54:56 -0700 Subject: [PATCH] Create Jenkins canary build for upstream HDL main Signed-off-by: Travis F. Collins --- CI/scripts/build_bsp.sh | 23 +++------- JenkinsfileCanary | 93 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 18 deletions(-) create mode 100644 JenkinsfileCanary diff --git a/CI/scripts/build_bsp.sh b/CI/scripts/build_bsp.sh index 2843a5e..35181b3 100644 --- a/CI/scripts/build_bsp.sh +++ b/CI/scripts/build_bsp.sh @@ -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) @@ -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 @@ -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 diff --git a/JenkinsfileCanary b/JenkinsfileCanary new file mode 100644 index 0000000..8b3f517 --- /dev/null +++ b/JenkinsfileCanary @@ -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