Add Vivado version check to adi_project_create

The scripts generating the projects files typically only work correctly with
one specific version of Vivado. If a incorrect version is used the script
may fail at some point with a cryptic error message or may not fail but
create a bitstream that is not working as expected, e.g. unconnected
signals, etc. This patch adds a version check to adi_project_create that
will error out early on stating that the wrong version of Vivado was used
and which is the right version to use.

By default the required version will be the version that is required by the
common scripts. Individual projects can overwrite the required version by
setting the REQUIRED_VIVADO_VERSION variable to the required version or can
bypass the version check completely by setting the IGNORE_VERSION_CHECK
variable to 1.

Callers of the script can also disable the version check by setting the
ADI_IGNORE_VERSION_CHECK environment variable.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
main
Lars-Peter Clausen 2014-11-25 18:34:44 +01:00
parent 2e72a2cc0c
commit 81f0e417d4
1 changed files with 16 additions and 0 deletions

View File

@ -1,11 +1,23 @@
set xl_board "none"
if {![info exists REQUIRED_VIVADO_VERSION]} {
set REQUIRED_VIVADO_VERSION "2014.2"
}
if {[info exists ::env(ADI_IGNORE_VERSION_CHECK)]} {
set IGNORE_VERSION_CHECK 1
} elseif {![info exists IGNORE_VERSION_CHECK]} {
set IGNORE_VERSION_CHECK 0
}
proc adi_project_create {project_name} {
global ad_hdl_dir
global ad_phdl_dir
global xl_board
global REQUIRED_VIVADO_VERSION
global IGNORE_VERSION_CHECK
set xl_board "none"
set project_part "none"
@ -78,6 +90,10 @@ proc adi_project_create {project_name} {
# vivado - 7 and up
if {!$IGNORE_VERSION_CHECK && [string compare [version -short] $REQUIRED_VIVADO_VERSION] != 0} {
return -code error [format "ERROR: This project requires Vivado %s." $REQUIRED_VIVADO_VERSION]
}
set project_system_dir "./$project_name.srcs/sources_1/bd/system"
create_project $project_name . -part $project_part -force