aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/vendors/compile-xilinx-ise.sh
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/vendors/compile-xilinx-ise.sh')
-rwxr-xr-xlibraries/vendors/compile-xilinx-ise.sh117
1 files changed, 81 insertions, 36 deletions
diff --git a/libraries/vendors/compile-xilinx-ise.sh b/libraries/vendors/compile-xilinx-ise.sh
index b3675289c..ffbfd96d2 100755
--- a/libraries/vendors/compile-xilinx-ise.sh
+++ b/libraries/vendors/compile-xilinx-ise.sh
@@ -92,6 +92,12 @@ while [[ $# > 0 ]]; do
--secureip)
SECUREIP=TRUE
;;
+ --vhdl93)
+ VHDL93=TRUE
+ ;;
+ --vhdl2008)
+ VHDL2008=TRUE
+ ;;
*) # unknown option
UNKNOWN_OPTION=TRUE
;;
@@ -130,6 +136,8 @@ elif [ "$HELP" == "TRUE" ]; then
echo " --secureip Compile the secureip library."
echo ""
echo "Library compile options:"
+ echo " --vhdl93 Compile the libraries with VHDL-93."
+ echo " --vhdl2008 Compile the libraries with VHDL-2008."
echo " -s --skip-existing Skip already compiled files (an *.o file exists)."
echo " -S --skip-largefiles Don't compile large entities like DSP and PCIe primitives."
echo " -H --halt-on-error Halt on error(s)."
@@ -148,12 +156,24 @@ if [ "$ALL" == "TRUE" ]; then
SECUREIP=TRUE
fi
+if [ "$VHDL93" == "TRUE" ]; then
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+elif [ "$VHDL2008" == "TRUE" ]; then
+ VHDLStandard="08"
+ VHDLFlavor="standard"
+ echo -e "${ANSI_RED}Not all Xilinx primitives are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_RESET}"
+ HALT_ON_ERROR=FALSE
+else
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+fi
+
# extract data from configuration
-InstallDir=${InstallationDirectory[XilinxISE]}
-SourceDir="$InstallDir/ISE_DS/ISE/vhdl/src"
+SourceDir=${SourceDirectory[XilinxISE]}
DestinationDir=${DestinationDirectory[XilinxISE]}
-if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+if [ -z $DestinationDir ]; then
echo -e "${COLORED_ERROR} Xilinx ISE is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
exit -1
elif [ ! -d $SourceDir ]; then
@@ -188,6 +208,7 @@ else
fi
STOPCOMPILING=FALSE
+ERRORCOUNT=0
# Cleanup directory
# ==============================================================================
@@ -202,7 +223,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'unisim' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/unisims/unisim_VPKG.vhd
$SourceDir/unisims/unisim_VCOMP.vhd
@@ -214,9 +235,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unisim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -225,7 +249,7 @@ fi
# compile unisim primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unisims/primitive/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -238,9 +262,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unisim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -250,7 +277,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ] && [ "$SECUREIP" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library secureip primitives${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unisims/secureip/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -263,9 +290,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ] && [ "$SECUREIP" =
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=secureip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -277,7 +307,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'unimacro' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/unimacro/unimacro_VCOMP.vhd
)
@@ -288,9 +318,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unimacro "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -299,7 +332,7 @@ fi
# compile unimacro macros
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unimacro/*_MACRO.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -308,9 +341,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unimacro "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -322,7 +358,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'simprim' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/simprims/simprim_Vpackage.vhd
$SourceDir/simprims/simprim_Vcomponents.vhd
@@ -334,9 +370,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=simprim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -345,7 +384,7 @@ fi
# compile simprim primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/simprims/primitive/other/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -358,9 +397,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=simprim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -369,7 +411,7 @@ fi
# compile simprim secureip primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ] && [ "$SECUREIP" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/simprims/secureip/other/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -382,9 +424,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ] && [ "$SECUREIP"
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=simprim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -392,7 +437,7 @@ fi
echo "--------------------------------------------------------------------------------"
echo -n "Compiling Xilinx ISE libraries "
-if [ "$STOPCOMPILING" == "TRUE" ]; then
+if [ $ERRORCOUNT -gt 0 ]; then
echo -e $COLORED_FAILED
else
echo -e $COLORED_SUCCESSFUL