#!/bin/bash
|
#!/bin/bash
|
# $Id: xtwv 554 2014-04-21 14:01:51Z mueller $
|
# $Id: xtwv 554 2014-04-21 14:01:51Z mueller $
|
#
|
#
|
# Xilinx Tool Wrapper script for Vivado
|
# Xilinx Tool Wrapper script for Vivado
|
# define XTWV_PATH
|
# define XTWV_PATH
|
# usage xwtv
|
# usage xwtv
|
#
|
#
|
# Revision History:
|
# Revision History:
|
# Date Rev Version Comment
|
# Date Rev Version Comment
|
# 2014-04-18 554 1.0.1 fake XILINX_VIVADO, 2014.1 doesn't define it anymore
|
# 2014-04-18 554 1.0.1 fake XILINX_VIVADO, 2014.1 doesn't define it anymore
|
# 2013-10-12 539 1.0 Initial version (cloned from xtwi)
|
# 2013-10-12 539 1.0 Initial version (cloned from xtwi)
|
#
|
#
|
# Note: For Xilinx Vivado installations with an install path holds
|
# Note: For Xilinx Vivado installations with an install path holds
|
# dir with settings(32|64).sh
|
# dir with settings(32|64).sh
|
#
|
#
|
|
|
# store arg list on vars (will be dropped later to source scripts)
|
# store arg list on vars (will be dropped later to source scripts)
|
arglist_val=$@
|
arglist_val=$@
|
arglist_num=$#
|
arglist_num=$#
|
#
|
#
|
# check whether Vivado already setup ($XILINX_VIVADO defined)
|
# check whether Vivado already setup ($XILINX_VIVADO defined)
|
if [ -z "$XILINX_VIVADO" ]
|
if [ -z "$XILINX_VIVADO" ]
|
then
|
then
|
# check whether $XTWV_PATH defined
|
# check whether $XTWV_PATH defined
|
if [ -z "$XTWV_PATH" ]
|
if [ -z "$XTWV_PATH" ]
|
then
|
then
|
echo "XTWV_PATH not defined"
|
echo "XTWV_PATH not defined"
|
exit 1
|
exit 1
|
fi
|
fi
|
|
|
# check whether 32 or 64 bit system (uname -m gives 'i686' or 'x86_64')
|
# check whether 32 or 64 bit system (uname -m gives 'i686' or 'x86_64')
|
if [ `uname -m` = "x86_64" ]
|
if [ `uname -m` = "x86_64" ]
|
then
|
then
|
settings_filename=$XTWV_PATH/settings64.sh
|
settings_filename=$XTWV_PATH/settings64.sh
|
else
|
else
|
settings_filename=$XTWV_PATH/settings32.sh
|
settings_filename=$XTWV_PATH/settings32.sh
|
fi
|
fi
|
if [ ! -e "$settings_filename" ]
|
if [ ! -e "$settings_filename" ]
|
then
|
then
|
echo "can't locate init script '$settings_filename'"
|
echo "can't locate init script '$settings_filename'"
|
exit 1
|
exit 1
|
fi
|
fi
|
|
|
# drop arg list, suppress output
|
# drop arg list, suppress output
|
set --
|
set --
|
. $settings_filename > /dev/null
|
. $settings_filename > /dev/null
|
|
|
# check that XILINX_VIVADO defined
|
# check that XILINX_VIVADO defined
|
if [ -z "$XILINX_VIVADO" ]
|
if [ -z "$XILINX_VIVADO" ]
|
then
|
then
|
export XILINX_VIVADO=$XTWV_PATH/.
|
export XILINX_VIVADO=$XTWV_PATH/.
|
fi
|
fi
|
|
|
else
|
else
|
echo "XILINX_VIVADO already defined"
|
echo "XILINX_VIVADO already defined"
|
fi
|
fi
|
|
|
if [ $arglist_num != 0 ]
|
if [ $arglist_num != 0 ]
|
then
|
then
|
exec $arglist_val
|
exec $arglist_val
|
fi
|
fi
|
|
|