From 932b7cbb040cef7fce0c83f81839722fd8ad5bdf Mon Sep 17 00:00:00 2001 From: Humberto Jimenez Date: Mon, 13 Apr 2020 14:48:48 -0500 Subject: fpga: tools: Option to check for full Vivado version This commits enables the FPGA build infrastructure to require a very specific Vivado version, all the way to the patch level. Vivado typically has the following version format: Year.release.update_patch This commit enables setupenv_base.sh to optionally look for the environment variable VIVADO_VER_FULL, which should contain the full Vivado version in the format specified above. Vivado is directly used to retrieve the installed version, returning an error if the requested version is not found. Example in setupenv.sh (which calls setupenv_base.sh): VIVADO_VER=2019.1 VIVADO_VER_FULL=2019.1.1_AR73068 The setupenv.sh script will setup Vivado 2019.1, but it will also verify that both Update 1 and patch AR73068 are installed. --- fpga/usrp3/tools/scripts/setupenv_base.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'fpga/usrp3/tools/scripts') diff --git a/fpga/usrp3/tools/scripts/setupenv_base.sh b/fpga/usrp3/tools/scripts/setupenv_base.sh index d401b410e..76385c598 100644 --- a/fpga/usrp3/tools/scripts/setupenv_base.sh +++ b/fpga/usrp3/tools/scripts/setupenv_base.sh @@ -199,6 +199,30 @@ if [[ -x `which tput 2>/dev/null` ]] ; then fi VIVADO_EXEC="$REPO_BASE_PATH/tools/scripts/launch_vivado.sh" +# If an extended (i.e. full) version is provided, use Vivado to check +# that the installed version is correct. +# This optional env variable may be used to check for specific Vivado +# Updates or Patches to be installed. +# If multiple patches are installed, it is recommended that the user +# runs 'vivado -version' from the installation directory to determine +# the order in which patches were applied by Vivado. +# Example: +# VIVADO_VER=2019.1 +# VIVADO_VER_FULL=2019.1.1_AR73068 +# The setupenv.sh script will setup Vivado 2019.1, but it will also +# verify that both Update 1 and patch AR73068 are installed. +if [[ -n $VIVADO_VER_FULL ]]; then + INSTALLED_VIV=$($VIVADO_PATH/bin/vivado -version | grep $VIVADO_VER_FULL) + if [[ $? -eq 0 ]]; then + echo " Installed version is $INSTALLED_VIV" + else + echo "- Vivado: ERROR! Requested version ($VIVADO_VER_FULL) not installed." + echo " Install the required updates/patches and verify that the env variable" + echo " \"VIVADO_VER_FULL\" matches the version printed by \"vivado -version\"." + return 1 + fi +fi + #---------------------------------------------------------------------------- # Prepare Modelsim environment #---------------------------------------------------------------------------- -- cgit v1.2.3