diff --git a/library/scripts/adi_ip_xilinx.tcl b/library/scripts/adi_ip_xilinx.tcl index 32b1b1861..dd196177e 100644 --- a/library/scripts/adi_ip_xilinx.tcl +++ b/library/scripts/adi_ip_xilinx.tcl @@ -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 diff --git a/projects/scripts/adi_project_xilinx.tcl b/projects/scripts/adi_project_xilinx.tcl index 4bf496a91..3b3325707 100644 --- a/projects/scripts/adi_project_xilinx.tcl +++ b/projects/scripts/adi_project_xilinx.tcl @@ -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 diff --git a/projects/scripts/project-xilinx.mk b/projects/scripts/project-xilinx.mk index 3a013ad72..2091f9483 100644 --- a/projects/scripts/project-xilinx.mk +++ b/projects/scripts/project-xilinx.mk @@ -79,5 +79,10 @@ $(PROJECT_NAME).sdk/system_top.xsa: $(M_DEPS) lib: @for lib in $(LIB_DEPS); do \ - $(MAKE) -C $(HDL_LIBRARY_PATH)$${lib} xilinx || exit $$?; \ + 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 +