aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/vendors/compile-xilinx-vivado.sh
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@tu-dresden.de>2016-06-20 07:52:44 +0200
committertgingold <tgingold@users.noreply.github.com>2016-06-20 07:52:44 +0200
commitf2b83716c79e7c6123aa9b6215a6dc6ac1c9d83b (patch)
tree0c8aa39c2da9eee985242342f9ef7718a023075e /libraries/vendors/compile-xilinx-vivado.sh
parente2587eb9137f627f4ec51a80dfe641394197d975 (diff)
downloadghdl-f2b83716c79e7c6123aa9b6215a6dc6ac1c9d83b.tar.gz
ghdl-f2b83716c79e7c6123aa9b6215a6dc6ac1c9d83b.tar.bz2
ghdl-f2b83716c79e7c6123aa9b6215a6dc6ac1c9d83b.zip
Compile scripts: Implemented a default installation directory guessing. Fixed minor issues (see #85). (#88)
Diffstat (limited to 'libraries/vendors/compile-xilinx-vivado.sh')
-rwxr-xr-xlibraries/vendors/compile-xilinx-vivado.sh32
1 files changed, 24 insertions, 8 deletions
diff --git a/libraries/vendors/compile-xilinx-vivado.sh b/libraries/vendors/compile-xilinx-vivado.sh
index f319b0e02..f825c3a1e 100755
--- a/libraries/vendors/compile-xilinx-vivado.sh
+++ b/libraries/vendors/compile-xilinx-vivado.sh
@@ -63,7 +63,7 @@ while [[ $# > 0 ]]; do
;;
-a|--all)
COMPILE_ALL=TRUE
- NO_COMMAND=FALSE
+ NO_COMMAND=0
;;
--unisim)
COMPILE_UNISIM=TRUE
@@ -118,12 +118,12 @@ while [[ $# > 0 ]]; do
shift # past argument or value
done
-if [ "$NO_COMMAND" == "TRUE" ]; then
+if [ $NO_COMMAND -eq 1 ]; then
HELP=TRUE
fi
if [ "$HELP" == "TRUE" ]; then
- test "$NO_COMMAND" == "TRUE" && echo 1>&2 -e "${COLORED_ERROR} No command selected."
+ test $NO_COMMAND -eq 1 && echo 1>&2 -e "\n${COLORED_ERROR} No command selected."
echo ""
echo "Synopsis:"
echo " A script to compile the Xilinx Vivado simulation libraries for GHDL on Linux."
@@ -151,9 +151,9 @@ if [ "$HELP" == "TRUE" ]; then
echo " -H --halt-on-error Halt on error(s)."
echo ""
echo "Advanced options:"
- echo " --ghdl <GHDL BinDir> Path to GHDL binary directory e.g. /usr/bin."
+ echo " --ghdl <GHDL Binary> Path to GHDL's binary e.g. /usr/local/bin/ghdl."
echo " --out <dir name> Name of the output directory."
- echo " --src <Path to OSVVM> Name of the output directory."
+ echo " --src <Path to OSVVM> Path to the source directory."
echo ""
echo "Verbosity:"
echo " -n --no-warnings Suppress all warnings. Show only error messages."
@@ -169,13 +169,31 @@ fi
if [ $VHDLStandard -eq 2008 ]; then
echo -e "${ANSI_RED}Not all Xilinx primitives are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_RESET}"
- HALT_ON_ERROR=FALSE
+ HALT_ON_ERROR=0
fi
+DefaultDirectories=("/opt/Xilinx/Vivado" "/opt/xilinx/Vivado")
+if [ ! -z $XILINX_VIVADO ]; then
+ EnvSourceDir=$XILINX_VIVADO/vhdl/src
+else
+ for DefaultDir in ${DefaultDirectories[@]}; do
+ for Major in 2017 2016 2015 2014; do
+ for Minor in 4 3 2 1; do
+ Dir=$DefaultDir/${Major}.${Minor}
+ if [ -d $Dir ]; then
+ EnvSourceDir=$Dir/${SourceDirectories[XilinxVivado]}
+ break 3
+ fi
+ done
+ done
+ done
+fi
+
# -> $SourceDirectories
# -> $DestinationDirectories
# -> $SrcDir
+# -> $EnvSourceDir
# -> $DestDir
# -> $GHDLBinDir
# <= $SourceDirectory
@@ -200,11 +218,9 @@ SetupGRCat
# <= $VHDLFlavor
GHDLSetup
-
# define global GHDL Options
GHDL_OPTIONS=(-fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-comments)
-
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard -P$DestinationDirectory)