From bc3c85180ae81161dc89e64cb4977e685c07732c Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 12:41:48 -0700 Subject: [PATCH 1/8] Update util_sync to be built as dependent core for ADRV9002 Signed-off-by: Travis F. Collins --- CI/scripts/build_bsp.sh | 10 ++++++++-- CI/scripts/matlab_processors.tcl | 10 +++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CI/scripts/build_bsp.sh b/CI/scripts/build_bsp.sh index 10b4de2d..37ae7002 100644 --- a/CI/scripts/build_bsp.sh +++ b/CI/scripts/build_bsp.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -x +set -xe if [ -z "${HDLBRANCH}" ]; then HDLBRANCH='hdl_2021_r2' @@ -45,7 +45,7 @@ fi VIVADO=${VER} # Setup -source /opt/Xilinx/Vivado/$VIVADO/settings64.sh +# source /opt/Xilinx/Vivado/$VIVADO/settings64.sh # Pre-build IP library # cd hdl/library @@ -78,6 +78,12 @@ sed -i 's/16.27/30/' hdl/projects/pluto/system_constr.xdc # update .mk to .prj in zc706_plddr3_dacfifo_bd.tcl sed -i 's/.mk/.prj/' hdl/projects/common/zc706/zc706_plddr3_dacfifo_bd.tcl sed -i '10i file copy -force $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.mk $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.prj' hdl/projects/common/zc706/zc706_plddr3_dacfifo_bd.tcl +# Update ADRV9001 design to include util_sync as dependent IP +sed -i '23i # Custom Sync IP' hdl/projects/adrv9001/zcu102/Makefile +sed -i '24i LIB_DEPS += util_sync/sync_delay' hdl/projects/adrv9001/zcu102/Makefile +sed -i '25i LIB_DEPS += util_sync/sync_fast_to_slow' hdl/projects/adrv9001/zcu102/Makefile +sed -i '26i LIB_DEPS += util_sync/sync_slow_to_fast' hdl/projects/adrv9001/zcu102/Makefile + mv hdl $TARGET # Post-process ports.json diff --git a/CI/scripts/matlab_processors.tcl b/CI/scripts/matlab_processors.tcl index 2d4eb4e4..a9094c7c 100644 --- a/CI/scripts/matlab_processors.tcl +++ b/CI/scripts/matlab_processors.tcl @@ -229,11 +229,11 @@ proc data_synchronizer {rxtx number_of_inputs number_of_bits number_of_valids mu } if {$rxtx == "rxtx" || $rxtx == "txrx"} { # build synchronizer IPs - exec cp ../../../../../hdl/vendor/AnalogDevices/vivado/quiet.mk ../../../. - exec make -C ../../../library/util_sync/sync_delay - exec make -C ../../../library/util_sync/sync_fast_to_slow - exec make -C ../../../library/util_sync/sync_slow_to_fast - update_ip_catalog -rebuild + #exec cp ../../../../../hdl/vendor/AnalogDevices/vivado/quiet.mk ../../../. + #exec make -C ../../../library/util_sync/sync_delay + #exec make -C ../../../library/util_sync/sync_fast_to_slow + #exec make -C ../../../library/util_sync/sync_slow_to_fast + #update_ip_catalog -rebuild ### synchronize the input From 16cfd94c84f8a633caab1f21ced136a63e1acfe3 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 12:42:14 -0700 Subject: [PATCH 2/8] Remove HDL folder for Installer tests Signed-off-by: Travis F. Collins --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index b540ce92..8888db6f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,6 +70,7 @@ cstage("HDL Tests", "", flags) { */ cstage("Installer", branchName, flags) { unstash "builtSources" + sh 'rm -rf hdl' sh 'make -C ./CI/scripts test_installer' junit testResults: 'test/*.xml', allowEmptyResults: true archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true From 45525623ce8bd0be2434be949816ed6514258d7e Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 14:45:30 -0700 Subject: [PATCH 3/8] Put back update for util_sync Signed-off-by: Travis F. Collins --- CI/scripts/matlab_processors.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/scripts/matlab_processors.tcl b/CI/scripts/matlab_processors.tcl index a9094c7c..8c756d5c 100644 --- a/CI/scripts/matlab_processors.tcl +++ b/CI/scripts/matlab_processors.tcl @@ -233,7 +233,7 @@ proc data_synchronizer {rxtx number_of_inputs number_of_bits number_of_valids mu #exec make -C ../../../library/util_sync/sync_delay #exec make -C ../../../library/util_sync/sync_fast_to_slow #exec make -C ../../../library/util_sync/sync_slow_to_fast - #update_ip_catalog -rebuild + update_ip_catalog -rebuild ### synchronize the input From c92dd9aa4fe90b3df28325b7ca7767cf7b3e8f43 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 14:46:10 -0700 Subject: [PATCH 4/8] Update build script to update vivado across the toolbox Signed-off-by: Travis F. Collins --- CI/scripts/build_bsp.sh | 71 ++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/CI/scripts/build_bsp.sh b/CI/scripts/build_bsp.sh index 37ae7002..c8612697 100644 --- a/CI/scripts/build_bsp.sh +++ b/CI/scripts/build_bsp.sh @@ -29,20 +29,67 @@ if [ ! -d "hdl" ]; then exit 1 fi -# Get required vivado version needed for HDL -if [ -f "hdl/library/scripts/adi_ip.tcl" ]; then - TARGET="hdl/library/scripts/adi_ip.tcl" -else - TARGET="hdl/library/scripts/adi_ip_xilinx.tcl" +if [ -z "${VIVADO}" ]; then + echo "VIVADO not set, will parse HDL" + + # Get required vivado version needed for HDL + TARGET="hdl/scripts/adi_env.tcl" + # Use grep to find the line containing "set required_vivado_version" + matched_line=$(grep 'set required_vivado_version' "$TARGET") + + # Use awk to extract the version number + VIVADO=$(echo "$matched_line" | awk -F'"' '{print $2}') + + # Print the extracted version number + echo "Parsed Vivado Version: $VIVADO" fi -VER=$(awk '/set required_vivado_version/ {print $3}' $TARGET | sed 's/"//g') -echo "Required Vivado version ${VER}" -VIVADOFULL=${VER} -if [ ${#VER} = 8 ] -then -VER=${VER:0:6} + +# If not of the form 20xx.x, exit +if [[ ! $VIVADO =~ ^20[0-9]{2}\.[0-9]$ ]]; then + echo "Vivado version not of the form 20xx.x" + exit 1 fi -VIVADO=${VER} + +# Update vivado version in MATLAB files +echo "Updating toolbox files to use desired Vivado version" +cd .. +# Update Version.m +sed -i "s/Vivado = .*/Vivado = \'${VIVADO}\';/" +adi/Version.m +# Update plugin_rd +sed -i "s/hRD\.SupportedToolVersion = .*/hRD\.SupportedToolVersion = {\'${VIVADO}\'};/" hdl/vendor/AnalogDevices/+AnalogDevices/plugin_rd.m + +# Demos +cd trx_examples +# Update all occurances of hWC.ReferenceDesignToolVersion = '20XX.X'; to use new version +FILES=$(grep -lrn . -e 'hWC.ReferenceDesignToolVersion =') +for f in $FILES; do + echo "Updating: $f" + sed -i "s/hWC\.ReferenceDesignToolVersion = .*/hWC\.ReferenceDesignToolVersion = \'${VIVADO}\';/" "$f" +done +# Update all occurances of hRD.SupportedToolVersion = {'20XX.X'}; to use new version +FILES=$(grep -lr . -e 'hRD.SupportedToolVersion =') +for f in $FILES; do + echo "Updating: $f" + sed -i "s/hRD\.SupportedToolVersion = .*/hRD\.SupportedToolVersion = {\'${VIVADO}\'};/" "$f" +done +# Update all occurances of Vivado sourcing +FILES=$(grep -lrn . -e 'source /opt/Xilinx/Vivado/20') +for f in $FILES; do + echo "Updating: $f" + sed -i "s/source \/opt\/Xilinx\/Vivado\/20.*/source \/opt\/Xilinx\/Vivado\/${VIVADO}\/settings64.sh/" "$f" +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 + +cd .. + +cd CI # Setup # source /opt/Xilinx/Vivado/$VIVADO/settings64.sh From 0508ac3c32c62481cbe9e4b845b9c1287bb2e6a9 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 16:03:30 -0700 Subject: [PATCH 5/8] Change sync_delay ip so the tcl will build it Signed-off-by: Travis F. Collins --- CI/scripts/build_bsp.sh | 2 +- .../library/util_sync/{sync_delay => util_delay}/Makefile | 0 .../library/util_sync/{sync_delay => util_delay}/util_delay.v | 0 .../util_sync/{sync_delay => util_delay}/util_delay_ip.tcl | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename CI/scripts/library/util_sync/{sync_delay => util_delay}/Makefile (100%) rename CI/scripts/library/util_sync/{sync_delay => util_delay}/util_delay.v (100%) rename CI/scripts/library/util_sync/{sync_delay => util_delay}/util_delay_ip.tcl (100%) diff --git a/CI/scripts/build_bsp.sh b/CI/scripts/build_bsp.sh index c8612697..62fe78da 100644 --- a/CI/scripts/build_bsp.sh +++ b/CI/scripts/build_bsp.sh @@ -127,7 +127,7 @@ sed -i 's/.mk/.prj/' hdl/projects/common/zc706/zc706_plddr3_dacfifo_bd.tcl sed -i '10i file copy -force $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.mk $ad_hdl_dir/projects/common/zc706/zc706_plddr3_mig.prj' hdl/projects/common/zc706/zc706_plddr3_dacfifo_bd.tcl # Update ADRV9001 design to include util_sync as dependent IP sed -i '23i # Custom Sync IP' hdl/projects/adrv9001/zcu102/Makefile -sed -i '24i LIB_DEPS += util_sync/sync_delay' hdl/projects/adrv9001/zcu102/Makefile +sed -i '24i LIB_DEPS += util_sync/util_delay' hdl/projects/adrv9001/zcu102/Makefile sed -i '25i LIB_DEPS += util_sync/sync_fast_to_slow' hdl/projects/adrv9001/zcu102/Makefile sed -i '26i LIB_DEPS += util_sync/sync_slow_to_fast' hdl/projects/adrv9001/zcu102/Makefile diff --git a/CI/scripts/library/util_sync/sync_delay/Makefile b/CI/scripts/library/util_sync/util_delay/Makefile similarity index 100% rename from CI/scripts/library/util_sync/sync_delay/Makefile rename to CI/scripts/library/util_sync/util_delay/Makefile diff --git a/CI/scripts/library/util_sync/sync_delay/util_delay.v b/CI/scripts/library/util_sync/util_delay/util_delay.v similarity index 100% rename from CI/scripts/library/util_sync/sync_delay/util_delay.v rename to CI/scripts/library/util_sync/util_delay/util_delay.v diff --git a/CI/scripts/library/util_sync/sync_delay/util_delay_ip.tcl b/CI/scripts/library/util_sync/util_delay/util_delay_ip.tcl similarity index 100% rename from CI/scripts/library/util_sync/sync_delay/util_delay_ip.tcl rename to CI/scripts/library/util_sync/util_delay/util_delay_ip.tcl From 697d0b01ef5e81650da54e334f5178474899168c Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 16:05:45 -0700 Subject: [PATCH 6/8] Add quiet.mk to builds Signed-off-by: Travis F. Collins --- hdl/vendor/AnalogDevices/+AnalogDevices/plugin_rd.m | 1 + 1 file changed, 1 insertion(+) diff --git a/hdl/vendor/AnalogDevices/+AnalogDevices/plugin_rd.m b/hdl/vendor/AnalogDevices/+AnalogDevices/plugin_rd.m index 9d8cb3af..cb4a24f9 100644 --- a/hdl/vendor/AnalogDevices/+AnalogDevices/plugin_rd.m +++ b/hdl/vendor/AnalogDevices/+AnalogDevices/plugin_rd.m @@ -102,6 +102,7 @@ fullfile('projects')... fullfile('library')... fullfile('scripts')... + fullfile('quiet.mk')... }; if strcmpi(project, 'adrv9002') From cac9ce9cb1abd96818ea9877d80226d3ceef6b57 Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 16:10:05 -0700 Subject: [PATCH 7/8] Change hdl branch naming Signed-off-by: Travis F. Collins --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8888db6f..e4ac9f2d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ dockerHost = 'docker' //////////////////////////// -hdlBranches = ['master','hdl_2021_r2'] +hdlBranches = ['main','hdl_2021_r2'] stage("Build Toolbox") { dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) { From 770477e47639a8b9d47b6b6f92a0c372095522fe Mon Sep 17 00:00:00 2001 From: "Travis F. Collins" Date: Thu, 11 Jan 2024 16:16:36 -0700 Subject: [PATCH 8/8] Remove SWDownloads upload since its managed by a GH action Signed-off-by: Travis F. Collins --- Jenkinsfile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e4ac9f2d..ee4c9983 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -152,11 +152,5 @@ node('baremetal || lab_b5') { unstash "builtSources" uploadArtifactory('TransceiverToolbox','*.mltbx') } - if (env.BRANCH_NAME == 'master') { - cstage('Deploy Production', "", flags) { - unstash "builtSources" - uploadFTP('TransceiverToolbox','*.mltbx') - } - } }