Skip to content

Commit

Permalink
Merge pull request #144 from analogdevicesinc/hdl_2021_r2
Browse files Browse the repository at this point in the history
Hdl 2021 r2
  • Loading branch information
tfcollins authored Aug 9, 2023
2 parents 5bb16b4 + 6158e25 commit b720445
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 51 deletions.
8 changes: 4 additions & 4 deletions +adi/Version.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
%Version
% BSP Version information
properties(Constant)
HDL = 'hdl_2021_r1';
Vivado = '2021.1';
MATLAB = 'R2022a';
Release = '22.1.1';
HDL = 'hdl_2021_r2';
Vivado = '2021.2';
MATLAB = 'R2022b';
Release = '22.2.1';
AppName = 'Analog Devices, Inc. High-Speed Converter Toolbox';
ToolboxName = 'HighSpeedConverterToolbox';
ToolboxNameShort = 'hsx';
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 2021.1. Using other versions are not supported. To build the necessary BOOT.BIN files will require the Xilinx SDK 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 2021.2. Using other versions are not supported. To build the necessary BOOT.BIN files will require the Xilinx SDK 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\2021.1\bin\vivado.bat');
hdlsetuptoolpath('ToolName', 'Xilinx Vivado', 'ToolPath', 'C:\Xilinx\Vivado\2021.2\bin\vivado.bat');
```

or Linux:

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

Please change the tool path if it is different on your system.
Expand Down
2 changes: 1 addition & 1 deletion CI/gen_doc/requirements_doc.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy
mkdocs
mkdocs<1.5
mkdocs-material
mkdocs-awesome-pages-plugin
mkdocs-mermaid2-plugin
Expand Down
4 changes: 2 additions & 2 deletions CI/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ SHELL := /bin/bash
MLFLAGS := -nodisplay -nodesktop -nosplash

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

ifeq ($(HDLBRANCH),)
HDLBRANCH := hdl_2021_r1
HDLBRANCH := hdl_2021_r2
endif

ifeq ($(OS),Windows_NT)
Expand Down
30 changes: 10 additions & 20 deletions CI/scripts/adi_project_xilinx.tcl
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@

## Define the supported tool version
set required_vivado_version "2021.1"
if {[info exists ::env(REQUIRED_VIVADO_VERSION)]} {
set required_vivado_version $::env(REQUIRED_VIVADO_VERSION)
} elseif {[info exists REQUIRED_VIVADO_VERSION]} {
set required_vivado_version $REQUIRED_VIVADO_VERSION
}

## Define the ADI_IGNORE_VERSION_CHECK environment variable to skip version check
if {[info exists ::env(ADI_IGNORE_VERSION_CHECK)]} {
set IGNORE_VERSION_CHECK 1
} elseif {![info exists IGNORE_VERSION_CHECK]} {
set IGNORE_VERSION_CHECK 0
}

## Define the ADI_USE_OOC_SYNTHESIS environment variable to enable out of context
# synthesis
if {[info exists ::env(ADI_USE_OOC_SYNTHESIS)]} {
Expand Down Expand Up @@ -134,7 +118,7 @@ proc adi_project {project_name {mode 0} {parameter_list {}} } {
set board [lindex [lsearch -all -inline [get_board_parts] *vck190*] end]
}
if [regexp "_vc709$" $project_name] {
set device "xc7vx690tffg1761-2"
set device "xc7vx690tffg1761-2"
set board [lindex [lsearch -all -inline [get_board_parts] *vc709*] end]
}

Expand Down Expand Up @@ -167,7 +151,7 @@ proc adi_project_create {project_name mode parameter_list device {board "not-app
## update the value of $p_device only if it was not already updated elsewhere
if {$p_device eq "none"} {
set p_device $device
}
}
set p_board $board

if [regexp "^xc7z" $p_device] {
Expand Down Expand Up @@ -234,8 +218,12 @@ proc adi_project_create {project_name mode parameter_list device {board "not-app
set lib_dirs [get_property ip_repo_paths [current_fileset]]
lappend lib_dirs $ad_hdl_dir/library
}
if {$ad_hdl_dir ne $ad_ghdl_dir} {
lappend lib_dirs $ad_ghdl_dir/library
if {[info exists ::env(ADI_GHDL_DIR)]} {
if {$ad_hdl_dir ne $ad_ghdl_dir} {
lappend lib_dirs $ad_ghdl_dir/library
}
} else {
# puts -nonew-line "INFO: ADI_GHDL_DIR not defined.\n"
}

# Set a common IP cache for all projects
Expand Down Expand Up @@ -312,6 +300,8 @@ proc adi_project_files {project_name project_files} {
foreach pfile $project_files {
if {[string range $pfile [expr 1 + [string last . $pfile]] end] == "xdc"} {
add_files -norecurse -fileset constrs_1 $pfile
} elseif [regexp "_constr.tcl" $pfile] {
add_files -norecurse -fileset sources_1 $pfile
} else {
add_files -norecurse -fileset sources_1 $pfile
}
Expand Down
2 changes: 1 addition & 1 deletion 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_2021_r1'
HDLBRANCH='hdl_2021_r2'
fi

# Script is designed to run from specific location
Expand Down
11 changes: 7 additions & 4 deletions CI/scripts/synth_designs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ MLFLAGS="-nodisplay -nodesktop -nosplash"

if [ -z "$MLRELEASE" ]
then
MLRELEASE=R2022a
MLRELEASE=R2022b
fi

MLPATH=/usr/local/MATLAB

cd ../..
cp hdl/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m
sed -i "s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m
source /opt/Xilinx/Vivado/2021.1/settings64.sh
source /opt/Xilinx/Vivado/2021.2/settings64.sh
Xvfb :77 &
export DISPLAY=:77
export SWT_GTK3=0
source /opt/Xilinx/Vivado/2021.1/settings64.sh
source /opt/Xilinx/Vivado/2021.2/settings64.sh
$MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "cd('test');runSynthTests('$BOARD');"
kill -9 `pidof Xvfb`
pidof Xvfb
if [ $? -eq 0 ]; then
kill -9 `pidof Xvfb`
fi
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
flags = gitParseFlags()

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

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

hdlBranches = ['master','hdl_2021_r1']
hdlBranches = ['master','hdl_2021_r2']

stage("Build Toolbox") {
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
Expand All @@ -23,14 +23,14 @@ stage("Build Toolbox") {
sh 'make -C ./CI/scripts gen_tlbx'
}
} catch(Exception ex) {
if (branchName == 'hdl_2021_r1') {
if (branchName == 'hdl_2021_r2') {
error('Production Toolbox Build Failed')
}
else {
unstable('Development Build Failed')
}
}
if (branchName == 'hdl_2021_r1') {
if (branchName == 'hdl_2021_r2') {
archiveArtifacts artifacts: '*.mltbx'
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
}
Expand All @@ -40,7 +40,7 @@ stage("Build Toolbox") {
/////////////////////////////////////////////////////

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

cstage("HDL Tests", "", flags) {
dockerParallelBuild(boardNames, dockerHost, dockerConfig) {
Expand Down
10 changes: 5 additions & 5 deletions JenkinsfileCron
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@Library('tfc-lib') _

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

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

hdlBranches = ['hdl_2021_r1']
hdlBranches = ['hdl_2021_r2']

stage("Build Toolbox") {
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
Expand All @@ -19,14 +19,14 @@ stage("Build Toolbox") {
sh 'make -C ./CI/scripts gen_tlbx'
}
} catch(Exception ex) {
if (branchName == 'hdl_2021_r1') {
if (branchName == 'hdl_2021_r2') {
error('Production Toolbox Build Failed')
}
else {
unstable('Development Build Failed')
}
}
if (branchName == 'hdl_2021_r1') {
if (branchName == 'hdl_2021_r2') {
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
}
}
Expand All @@ -47,7 +47,7 @@ for (int i=0; i < boardNames.size(); i++) {
nodeLabel = 'baremetal && high_memory';
deployments[board] = { node(nodeLabel) {
stage("Synthesis Tests") {
withEnv(['BOARD='+board,'MLRELEASE=R2022a','HDLBRANCH=hdl_2021_r1','LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
withEnv(['BOARD='+board,'MLRELEASE=R2022b','HDLBRANCH=hdl_2021_r2','LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
try {
stage("Synth") {
echo "Node: ${env.NODE_NAME}"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ As with many open source packages, we use [GitHub](https://github.com/analogdevi

| HDL Branch | MATLAB Release | Installer Package |
|:------------------:|:--------------:|:-------------------:|
| 2021_R1 | R2022a | <a href="http://swdownloads.analog.com/cse/toolboxes/hsx/master/AnalogDevicesHighSpeedConverterToolbox_v22.1.1.mltbx"><img src="https://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png" data-canonical-src="https://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png" height="40" /></a>|
| 2021_R2 | R2022b | <a href="http://swdownloads.analog.com/cse/toolboxes/hsx/master/AnalogDevicesHighSpeedConverterToolbox_v22.2.1.mltbx"><img src="https://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png" data-canonical-src="https://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png" height="40" /></a>|

If you use it, and like it - please let us know. If you use it, and hate it - please let us know that too.

## Supported Tools and Releases

We provide support for certain releases of MATLAB. This does not mean older releases will not work but they are not maintained. Currently supported tools are:
- Bug fixes: MATLAB R2021b with Vivado 2021.1
- Bug fixes and new features: MATLAB R2022a with Vivado 2021.1
- Bug fixes: MATLAB R2022a with Vivado 2021.1
- Bug fixes and new features: MATLAB R2022b with Vivado 2021.2

## Support and Documentation

Expand Down
7 changes: 4 additions & 3 deletions hdl/vendor/AnalogDevices/+AnalogDevices/plugin_rd.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

% Tool information
%hRD.SupportedToolVersion = {adi.Version.Vivado}; % FIXME
hRD.SupportedToolVersion = {'2021.1'};
hRD.SupportedToolVersion = {'2021.2'};

% Get the root directory
rootDir = fileparts(strtok(mfilename('fullpath'), '+'));
Expand Down Expand Up @@ -75,8 +75,9 @@

% custom source files
hRD.CustomFiles = {...
fullfile('projects')...,
fullfile('library')...,
fullfile('projects')...
fullfile('library')...
fullfile('scripts')...
};

hRD.addParameter( ...
Expand Down

0 comments on commit b720445

Please sign in to comment.