scripts: Add logic for vivado version check

main
LIacob106 2021-10-05 14:40:39 +01:00 committed by Filip Gherman
parent 812baf9022
commit e34346360d
3 changed files with 26 additions and 15 deletions

View File

@ -3,8 +3,11 @@ source $ad_hdl_dir/library/scripts/adi_xilinx_device_info_enc.tcl
# check tool version
if {![info exists REQUIRED_VIVADO_VERSION]} {
set REQUIRED_VIVADO_VERSION "2021.1"
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
}
if {[info exists ::env(ADI_IGNORE_VERSION_CHECK)]} {
@ -260,20 +263,20 @@ proc adi_ip_create {ip_name} {
global ad_hdl_dir
global ad_ghdl_dir
global REQUIRED_VIVADO_VERSION
global required_vivado_version
global IGNORE_VERSION_CHECK
set VIVADO_VERSION [version -short]
if {$IGNORE_VERSION_CHECK} {
if {[string compare $VIVADO_VERSION $REQUIRED_VIVADO_VERSION] != 0} {
if {[string compare $VIVADO_VERSION $required_vivado_version] != 0} {
puts -nonewline "CRITICAL WARNING: vivado version mismatch; "
puts -nonewline "expected $REQUIRED_VIVADO_VERSION, "
puts -nonewline "expected $required_vivado_version, "
puts -nonewline "got $VIVADO_VERSION.\n"
}
} else {
if {[string compare $VIVADO_VERSION $REQUIRED_VIVADO_VERSION] != 0} {
if {[string compare $VIVADO_VERSION $required_vivado_version] != 0} {
puts -nonewline "ERROR: vivado version mismatch; "
puts -nonewline "expected $REQUIRED_VIVADO_VERSION, "
puts -nonewline "expected $required_vivado_version, "
puts -nonewline "got $VIVADO_VERSION.\n"
puts -nonewline "This ERROR message can be down-graded to CRITICAL WARNING by setting ADI_IGNORE_VERSION_CHECK environment variable to 1. Be aware that ADI will not support you, if you are using a different tool version.\n"
exit 2

View File

@ -1,7 +1,10 @@
## Define the supported tool version
if {![info exists REQUIRED_VIVADO_VERSION]} {
set REQUIRED_VIVADO_VERSION "2021.1"
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
@ -147,7 +150,7 @@ proc adi_project_create {project_name mode parameter_list device {board "not-app
global p_board
global p_device
global sys_zynq
global REQUIRED_VIVADO_VERSION
global required_vivado_version
global IGNORE_VERSION_CHECK
global ADI_USE_OOC_SYNTHESIS
global ADI_USE_INCR_COMP
@ -170,15 +173,15 @@ proc adi_project_create {project_name mode parameter_list device {board "not-app
set VIVADO_VERSION [version -short]
if {$IGNORE_VERSION_CHECK} {
if {[string compare $VIVADO_VERSION $REQUIRED_VIVADO_VERSION] != 0} {
if {[string compare $VIVADO_VERSION $required_vivado_version] != 0} {
puts -nonewline "CRITICAL WARNING: vivado version mismatch; "
puts -nonewline "expected $REQUIRED_VIVADO_VERSION, "
puts -nonewline "expected $required_vivado_version, "
puts -nonewline "got $VIVADO_VERSION.\n"
}
} else {
if {[string compare $VIVADO_VERSION $REQUIRED_VIVADO_VERSION] != 0} {
if {[string compare $VIVADO_VERSION $required_vivado_version] != 0} {
puts -nonewline "ERROR: vivado version mismatch; "
puts -nonewline "expected $REQUIRED_VIVADO_VERSION, "
puts -nonewline "expected $required_vivado_version, "
puts -nonewline "got $VIVADO_VERSION.\n"
puts -nonewline "This ERROR message can be down-graded to CRITICAL WARNING by setting ADI_IGNORE_VERSION_CHECK environment variable to 1. Be aware that ADI will not support you, if you are using a different tool version.\n"
exit 2

View File

@ -79,5 +79,10 @@ $(PROJECT_NAME).sdk/system_top.xsa: $(M_DEPS)
lib:
@for lib in $(LIB_DEPS); do \
if [ -n "${REQUIRED_VIVADO_VERSION}" ]; then \
$(MAKE) -C $(HDL_LIBRARY_PATH)$${lib} xilinx REQUIRED_VIVADO_VERSION=${REQUIRED_VIVADO_VERSION} || exit $$?; \
else \
$(MAKE) -C $(HDL_LIBRARY_PATH)$${lib} xilinx || exit $$?; \
fi; \
done