Skip to content

Commit

Permalink
Set vivado 2023.1, Matlab R2022b, HDL main branch
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
StancaPop committed Oct 14, 2024
1 parent fe7dac3 commit 0b920cd
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 137 deletions.
2 changes: 1 addition & 1 deletion +adi/Contents.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% Analog Devices, Inc. High Speed Converter Toolbox
% Version 21.1.1 (R2021a)
% Version 21.1.1 (R2022b)
%
% ==== Table of Contents (TOC) ====
%
Expand Down
2 changes: 1 addition & 1 deletion +adi/Version.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% BSP Version information
properties(Constant)
HDL = 'hdl_2022_r2';
Vivado = '2022.2';
Vivado = '2023.1';
MATLAB = 'R2023b';
Release = '23.2.1';
AppName = 'Analog Devices, Inc. High-Speed Converter Toolbox';
Expand Down
6 changes: 3 additions & 3 deletions CI/gen_doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ SHELL := /bin/bash
MLFLAGS := -nodisplay -nodesktop -nosplash

ifeq ($(MLRELEASE),)
MLRELEASE := R2021a
MLRELEASE := R2022b
endif

ifeq ($(VIVADORELEASE),)
VIVADORELEASE := 2022.2
VIVADORELEASE := 2023.1
endif

ifeq ($(HDLBRANCH),)
HDLBRANCH := hdl_2018_r2
HDLBRANCH := main
endif

ifeq ($(OS),Windows_NT)
Expand Down
4 changes: 2 additions & 2 deletions CI/gen_doc/docs/_pages/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ The base dependencies for the toolbox requires libiio and the libiio MATLAB bind

To leverage HDL-Coder and the reference designs with the toolbox requires the following components:

- Xilinx Vivado 2021.1
- Xilinx SDK 2021.1
- Xilinx Vivado 2023.1
- Xilinx SDK 2023.1
- Simulink
- [HDL-Coder™](https://www.mathworks.com/products/hdl-coder.html)
- [HDL Coder™ Support Package for Xilinx Zynq Platform](https://www.mathworks.com/matlabcentral/fileexchange/40447-hdl-coder-support-package-for-xilinx-zynq-platform)
Expand Down
6 changes: 3 additions & 3 deletions CI/gen_doc/docs/_pages/targeting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ High-Speed Converter Toolbox supports the IP Core generation flow from MathWorks

## Getting Started

To perform targeting will require FPGA vendor tools for the FPGA system. For Xilinx this will be Vivado and the toolbox will require specific versions for each release. For the current release this is Vivado 2022.2. Using other versions are not supported. To build the necessary BOOT.BIN files will require the Xilinx Vitis as well.
To perform targeting will require FPGA vendor tools for the FPGA system. For Xilinx this will be Vivado and the toolbox will require specific versions for each release. For the current release this is Vivado 2023.1. Using other versions are not supported. To build the necessary BOOT.BIN files will require the Xilinx Vitis as well.

Once you have the installed the necessary 3rd party tools MATLAB needs to be told where they are installed by use of the [hdlsetuptoolpath](https://www.mathworks.com/help/hdlcoder/ref/hdlsetuptoolpath.html) command. For Windows the following MATLAB command can be used:

```matlab
hdlsetuptoolpath('ToolName', 'Xilinx Vivado', 'ToolPath', 'C:\Xilinx\Vivado\2022.2\bin\vivado.bat');
hdlsetuptoolpath('ToolName', 'Xilinx Vivado', 'ToolPath', 'C:\Xilinx\Vivado\2023.1\bin\vivado.bat');
```

or Linux:

```matlab
hdlsetuptoolpath('ToolName', 'Xilinx Vivado', 'ToolPath', '/opt/Xilinx/Vivado/2022.2/bin/vivado');
hdlsetuptoolpath('ToolName', 'Xilinx Vivado', 'ToolPath', '/opt/Xilinx/Vivado/2023.1/bin/vivado');
```

Please change the tool path if it is different on your system.
Expand Down
2 changes: 1 addition & 1 deletion CI/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MLRELEASE := R2023b
endif

ifeq ($(VIVADORELEASE),)
VIVADORELEASE := 2022.2
VIVADORELEASE := 2023.1
endif

ifeq ($(HDLBRANCH),)
Expand Down
73 changes: 60 additions & 13 deletions CI/scripts/build_bsp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -x

if [ -z "${HDLBRANCH}" ]; then
HDLBRANCH='hdl_2022_r2'
HDLBRANCH='main'
fi

# Script is designed to run from specific location
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ stage("Build Toolbox") {
checkout scm
sh 'git submodule update --init'
sh 'pip3 install -r ./CI/gen_doc/requirements_doc.txt'
sh 'make -C ./CI/gen_doc doc_ml'
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'
}
Expand Down
2 changes: 1 addition & 1 deletion JenkinsfileCron
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

////////////////////////////
Expand Down
110 changes: 0 additions & 110 deletions Jenkinsfile_dev

This file was deleted.

2 changes: 1 addition & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Supply the following six elements in the order specified -->
<!-- (Required) Release of MATLAB. Not currently used but required -->
<!-- to parse the file -->
<matlabrelease>R2021a</matlabrelease>
<matlabrelease>R2022b</matlabrelease>
<!-- (Required) Title of toolbox. Appears in the Contents pane -->
<name>Analog Devices, Inc. High Speed Converter Toolbox</name>
<!-- (Required) Label for the toolbox. pick one: -->
Expand Down

0 comments on commit 0b920cd

Please sign in to comment.