aboutsummaryrefslogtreecommitdiffstats
path: root/libraries
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2015-12-03 04:48:15 +0100
committerTristan Gingold <gingold@adacore.com>2015-12-03 04:48:15 +0100
commit6956cc80516f1dfc74a06a75b068437afba036ed (patch)
tree53dd811d0904efe594ec1cfe9692a224bde4456c /libraries
parentf7b737b52f57a46c2f96ad87ee50741abc415ed3 (diff)
downloadghdl-6956cc80516f1dfc74a06a75b068437afba036ed.tar.gz
ghdl-6956cc80516f1dfc74a06a75b068437afba036ed.tar.bz2
ghdl-6956cc80516f1dfc74a06a75b068437afba036ed.zip
Add vendor specific library compile scripts for linux.
Merge branch from Paebbels.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/vendors/README.md138
-rw-r--r--libraries/vendors/compile-altera.ps133
-rwxr-xr-xlibraries/vendors/compile-altera.sh817
-rw-r--r--libraries/vendors/compile-osvvm.ps114
-rwxr-xr-xlibraries/vendors/compile-osvvm.sh219
-rw-r--r--libraries/vendors/compile-vunit.ps112
-rwxr-xr-xlibraries/vendors/compile-vunit.sh245
-rw-r--r--libraries/vendors/compile-xilinx-ise.ps110
-rwxr-xr-xlibraries/vendors/compile-xilinx-ise.sh401
-rw-r--r--libraries/vendors/compile-xilinx-vivado.ps110
-rwxr-xr-xlibraries/vendors/compile-xilinx-vivado.sh352
-rw-r--r--libraries/vendors/config.sh49
-rw-r--r--libraries/vendors/ghdl.grcrules15
-rw-r--r--libraries/vendors/ghdl.skipwarning.grcrules14
-rw-r--r--libraries/vendors/shared.sh48
15 files changed, 2314 insertions, 63 deletions
diff --git a/libraries/vendors/README.md b/libraries/vendors/README.md
index e231c2c61..81a3306bc 100644
--- a/libraries/vendors/README.md
+++ b/libraries/vendors/README.md
@@ -1,10 +1,14 @@
## Compile Scripts for Vendor VHDL Libraries
-Vendors like Altera and Xilinx have there own simulation libraries, especially for primitives and hard macros. These libraries can not be shipped with GHDL, but we offer prepared compile scripts to pre-compile a vendor library, if the vendor tool is present on the computer.
+Vendors like Altera and Xilinx have there own simulation libraries, especially for primitives, soft or hard macros. These libraries can not be shipped with GHDL, but we offer prepared compile scripts to pre-compile a vendor library, if the vendor tool is present on the computer.
-There are also popular simulation and verification libraries, which can be pre-compile.
+There are also popular simulation and verification libraries like [OSVVM][osvvm] and [VUnit][vunit], which can be pre-compile.
-The compilation scripts are writen in shell languages: PowerShell for Windows and Bash for Linux. There are no further requirements.
+The compilation scripts are writen in shell languages: PowerShell for Windows and Bash for Linux. The compile scripts can colorize the GHDL warning and error lines with the help of grc ([generic colourizer][grc]).
+
+ [osvvm]: http://osvvm.org/
+ [vunit]: https://github.com/LarsAsplund/vunit
+ [grc]: http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
##### Supported Vendors Libraries
@@ -24,7 +28,7 @@ The compilation scripts are writen in shell languages: PowerShell for Windows an
- unimacro
- simprim (incl. secureip)
- Xilinx Vivado (2015.x):
- - unisim
+ - unisim (incl. secureip)
- unimacro
##### Supported Simulation and Verification Libraries
@@ -37,7 +41,46 @@ The compilation scripts are writen in shell languages: PowerShell for Windows an
---------------------------------------------------------------------
### Compiling on Linux
-*First I should translate the scripts before writing the docu...*
+ - **Step 1 - Configure the scripts**
+ Please open the `config.sh` file and set the dictionary entries for the installed
+ vendor tools to the appropriate directory to your tool's installation folder.
+
+ `config.sh`:
+ ```Bash
+ declare -A InstallationDirectory
+ InstallationDirectory[AlteraQuartusII]="/opt/Altera/15.0"
+ InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7"
+ InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2015.2"
+ InstallationDirectory[OSVVM]="/home/<user>/git/GitHub/osvvm"
+ InstallationDirectory[VUnit]="/home/<user>/git/GitHub/vunit"
+ ```
+
+ - **Step 2 - Browse to your simulation working directory**
+ ```Bash
+ $ cd <MySimulationFolder>
+ ```
+
+ - **Step 3 - Start the compilation script(s)**
+ ```Bash
+ $ <GHDL>\libraries\vendors\compile-altera.sh --all
+ $ <GHDL>\libraries\vendors\compile-xilinx-ise.sh --all
+ $ <GHDL>\libraries\vendors\compile-xilinx-vivado.sh --all
+ $ <GHDL>\libraries\vendors\compile-osvvm.sh --all
+ $ <GHDL>\libraries\vendors\compile-vunit.sh --all
+ ```
+
+ - **Step 4 - Viewing the result**
+ This creates vendor directories in your current working directory and compiles the vendor files into them.
+
+ ```Bash
+ $ ls -ahl
+ ...
+ drwxr-xr-x 2 <user> <group> 56K Nov 30 17:41 altera
+ drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 osvvm
+ drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 vivado
+ drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 vunit
+ drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 xilinx
+ ```
---------------------------------------------------------------------
### Compiling on Windows
@@ -47,14 +90,15 @@ The compilation scripts are writen in shell languages: PowerShell for Windows an
vendor tools to the appropriate directory to your tool's installation folder.
`config.psm1`:
-
- $InstallationDirectory = @{
- "AlteraQuartusII" = "C:\Altera\15.0";
- "XilinxISE" = "C:\Xilinx\14.7";
- "XilinxVivado" = "C:\Xilinx\Vivado\2015.3";
- "OSVVM" = "D:\git\GitHub\osvvm";
- "VUnit" = "D:\git\GitHub\vunit"
- }
+ ```PowerShell
+ $InstallationDirectory = @{
+ "AlteraQuartusII" = "C:\Altera\15.0";
+ "XilinxISE" = "C:\Xilinx\14.7";
+ "XilinxVivado" = "C:\Xilinx\Vivado\2015.3";
+ "OSVVM" = "D:\git\GitHub\osvvm";
+ "VUnit" = "D:\git\GitHub\vunit"
+ }
+ ```
- **Step 2 - Browse to your simulation working directory**
```PowerShell
@@ -92,28 +136,31 @@ The compilation scripts are writen in shell languages: PowerShell for Windows an
- Common parameters to all scripts:
- --all Compile all libraries, including common libraries, packages and device libraries.
- --clean Cleanup directory before analyzing.
- --suppresswarnings Don't show warnings. Report errors only.
+ -h --help Print the embedded help page(s).
+ -a --all Compile all libraries, including common libraries, packages and device libraries.
+ -c --clean Cleanup directory before analyzing.
+ -n --no-warnings Don't show warnings. Report errors only.
+ -s --skip-existing Skip already compiled files (an *.o file exists).
+ -S --skip-largefiles Don't compile large entities like DSP and PCIe primitives.
+ -H --halt-on-error Stop compiling if an error occured.
- `compile-altera.sh`
- --altera Compile base libraries like 'altera' and 'altera_mf'
- --max Compile device libraries for Max CPLDs
- --arria Compile device libraries for Arria FPGAs
- --cyclone Compile device libraries for Cyclone FPGAs
- --stratix Compile device libraries for Stratix FPGAs
-
+ --altera Compile base libraries like 'altera' and 'altera_mf'
+ --max Compile device libraries for Max CPLDs
+ --arria Compile device libraries for Arria FPGAs
+ --cyclone Compile device libraries for Cyclone FPGAs
+ --stratix Compile device libraries for Stratix FPGAs
- `compile-xilinx-ise.sh`
- --unisim Compile the unisim primitives
- --unimacro Compile the unimacro macros
- --simprim Compile the simprim primitives
- --secureip Compile the secureip primitives
+ --unisim Compile the unisim primitives
+ --unimacro Compile the unimacro macros
+ --simprim Compile the simprim primitives
+ --secureip Compile the secureip primitives
- `compile-xilinx-vivado.sh`
- --unisim Compile the unisim primitives
- --unimacro Compile the unimacro macros
- --secureip Compile the secureip primitives
+ --unisim Compile the unisim primitives
+ --unimacro Compile the unimacro macros
+ --secureip Compile the secureip primitives
- `compile-osvvm.sh`
- `compile-vunit.sh`
@@ -121,29 +168,30 @@ The compilation scripts are writen in shell languages: PowerShell for Windows an
- Common parameters to all scripts:
- -All Compile all libraries, including common libraries, packages and device libraries.
- -Clean Cleanup directory before analyzing.
- -SuppressWarnings Don't show warnings. Report errors only.
+ -Help Print the embedded help page(s).
+ -All Compile all libraries, including common libraries, packages and device libraries.
+ -Clean Cleanup directory before analyzing.
+ -SuppressWarnings Don't show warnings. Report errors only.
- `compile-altera.ps1`
- -Altera Compile base libraries like 'altera' and 'altera_mf'
- -Max Compile device libraries for Max CPLDs
- -Arria Compile device libraries for Arria FPGAs
- -Cyclone Compile device libraries for Cyclone FPGAs
- -Stratix Compile device libraries for Stratix FPGAs
+ -Altera Compile base libraries like 'altera' and 'altera_mf'
+ -Max Compile device libraries for Max CPLDs
+ -Arria Compile device libraries for Arria FPGAs
+ -Cyclone Compile device libraries for Cyclone FPGAs
+ -Stratix Compile device libraries for Stratix FPGAs
- `compile-xilinx-ise.ps1`
- -Unisim Compile the unisim primitives
- -Unimacro Compile the unimacro macros
- -Simprim Compile the simprim primitives
- -Secureip Compile the secureip primitives
+ -Unisim Compile the unisim primitives
+ -Unimacro Compile the unimacro macros
+ -Simprim Compile the simprim primitives
+ -Secureip Compile the secureip primitives
- `compile-xilinx-vivado.ps1`
- -Unisim Compile the unisim primitives
- -Unimacro Compile the unimacro macros
- -Secureip Compile the secureip primitives
+ -Unisim Compile the unisim primitives
+ -Unimacro Compile the unimacro macros
+ -Secureip Compile the secureip primitives
- `compile-osvvm.ps1`
- `compile-vunit.ps1`
------------------------
-Author: Patrick Lehmann (23.11.2015)
+Author: Patrick Lehmann (30.11.2015)
diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1
index 8bf97d969..cfd4bd5fa 100644
--- a/libraries/vendors/compile-altera.ps1
+++ b/libraries/vendors/compile-altera.ps1
@@ -62,8 +62,8 @@ param(
# Compile the Altera Max device libraries
[switch]$Max = $false,
- # Compile the Altera Cyclon device libraries
- [switch]$Cyclon = $false,
+ # Compile the Altera Cyclone device libraries
+ [switch]$Cyclone = $false,
# Compile the Altera Arria device libraries
[switch]$Arria = $false,
@@ -75,12 +75,20 @@ param(
[switch]$Nanometer = $false,
# Clean up directory before analyzing.
- [switch]$Clean = $false,
+ [switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
- [switch]$SuppressWarnings = $false
+ [switch]$SuppressWarnings = $false,
+
+ # Show the embedded help page(s)
+ [switch]$Help = $false
)
+if ($Help)
+{ Get-Help $MYINVOCATION.InvocationName -Detailed
+ return
+}
+
# ---------------------------------------------
# save working directory
$WorkingDir = Get-Location
@@ -98,7 +106,7 @@ if (-not $All)
elseif ($All -eq $true)
{ $Altera = $true
$Max = $true
- $Cyclon = $true
+ $Cyclone = $true
$Arria = $true
$Stratix = $true
$Nanometer = $true
@@ -121,6 +129,9 @@ if ($Clean)
{ Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow
rm *.cf
}
+
+# Altera standard libraries
+# ==============================================================================
# compile lpm library
if ((-not $StopCompiling) -and $Altera)
{ Write-Host "Compiling library 'lpm' ..." -ForegroundColor Yellow
@@ -159,8 +170,6 @@ if ((-not $StopCompiling) -and $Altera)
$Options = $GlobalOptions
$Files = (
"$SourceDir\altera_europa_support_lib.vhd",
- "$SourceDir\altera_mf_components.vhd",
- "$SourceDir\altera_mf.vhd",
"$SourceDir\altera_primitives_components.vhd",
"$SourceDir\altera_primitives.vhd",
"$SourceDir\altera_standard_functions.vhd",
@@ -205,6 +214,8 @@ if ((-not $StopCompiling) -and $Altera)
}
}
+# Altera device libraries
+# ==============================================================================
# compile max library
if ((-not $StopCompiling) -and $Max)
{ Write-Host "Compiling library 'max' ..." -ForegroundColor Yellow
@@ -357,7 +368,7 @@ if ((-not $StopCompiling) -and $Arria)
}
# compile cycloneiv library
-if ((-not $StopCompiling) -and $Cyclon)
+if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Compiling library 'cycloneiv' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
$Files = (
@@ -375,7 +386,7 @@ if ((-not $StopCompiling) -and $Cyclon)
}
# compile cycloneiv_pcie_hip library
-if ((-not $StopCompiling) -and $Cyclon)
+if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Compiling library 'cycloneiv_pcie_hip' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
$Files = (
@@ -391,7 +402,7 @@ if ((-not $StopCompiling) -and $Cyclon)
}
# compile cycloneive library
-if ((-not $StopCompiling) -and $Cyclon)
+if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Compiling library 'cycloneive' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
$Files = (
@@ -407,7 +418,7 @@ if ((-not $StopCompiling) -and $Cyclon)
}
# compile cyclonev library
-if ((-not $StopCompiling) -and $Cyclon)
+if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Compiling library 'cyclonev' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
$Files = (
diff --git a/libraries/vendors/compile-altera.sh b/libraries/vendors/compile-altera.sh
new file mode 100755
index 000000000..fdffc99b2
--- /dev/null
+++ b/libraries/vendors/compile-altera.sh
@@ -0,0 +1,817 @@
+#! /bin/bash
+# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
+# vim: tabstop=2:shiftwidth=2:noexpandtab
+# kate: tab-width 2; replace-tabs off; indent-width 2;
+#
+# ==============================================================================
+# Bash Script: Script to compile the simulation libraries from Altera
+# Quartus-II for GHDL on Linux
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a Bash script (executable) which:
+# - creates a subdirectory in the current working directory
+# - compiles all Altera Quartus-II simulation libraries and packages
+#
+# ==============================================================================
+# Copyright (C) 2015 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+# ---------------------------------------------
+# save working directory
+WorkingDir=$(pwd)
+ScriptDir="$(dirname $0)"
+ScriptDir="$(realpath $ScriptDir)"
+
+# source configuration file from GHDL's 'vendors' library directory
+source $ScriptDir/config.sh
+source $ScriptDir/shared.sh
+
+NO_COMMAND=TRUE
+
+# command line argument processing
+while [[ $# > 0 ]]; do
+ key="$1"
+ case $key in
+ -c|--clean)
+ CLEAN=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -a|--all)
+ ALL=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -s|--skip-existing)
+ SKIP_EXISTING_FILES=TRUE
+ ;;
+ -S|--skip-largefiles)
+ SKIP_LARGE_FILES=TRUE
+ ;;
+ -n|--no-warnings)
+ SUPPRESS_WARNINGS=TRUE
+ ;;
+ -H|--halt-on-error)
+ HALT_ON_ERROR=TRUE
+ ;;
+# -v|--verbose)
+# VERBOSE=TRUE
+# ;;
+ -h|--help)
+ HELP=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --altera)
+ ALTERA=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --max)
+ MAX=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --cyclone)
+ CYCLONE=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --arria)
+ ARRIA=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --stratix)
+ STRATIX=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --nanometer)
+ NANOMETER=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ *) # unknown option
+ UNKNOWN_OPTION=TRUE
+ ;;
+ esac
+ shift # past argument or value
+done
+
+if [ "$NO_COMMAND" == "TRUE" ]; then
+ HELP=TRUE
+fi
+
+if [ "$UNKNOWN_OPTION" == "TRUE" ]; then
+ echo -e $COLORED_ERROR "Unknown command line option.${ANSI_RESET}"
+ exit -1
+elif [ "$HELP" == "TRUE" ]; then
+ if [ "$NO_COMMAND" == "TRUE" ]; then
+ echo -e $COLORED_ERROR " No command selected."
+ fi
+ echo ""
+ echo "Synopsis:"
+ echo " Script to compile the simulation libraries from Altera Quartus-II for GHDL on Linux"
+ echo ""
+ echo "Usage:"
+ echo " compile-altera.sh <common command>|<library> [<options>]"
+# [-v] [-c] [--unisim] [--unimacro] [--simprim] [--secureip] [-s|--skip-existing] [-S|--skip-largefiles] [-n|--no-warnings]
+ echo ""
+ echo "Common commands:"
+ echo " -h --help Print this help page"
+ echo " -c --clean Remove all generated files"
+ echo ""
+ echo "Libraries:"
+ echo " -a --all Compile all Altera simulation libraries."
+ echo " --altera Compile the Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim."
+ echo " --max Compile the Altera Max device libraries."
+ echo " --cyclone Compile the Altera Cyclone device libraries."
+ echo " --arria Compile the Altera Arria device libraries."
+ echo " --stratix Compile the Altera Stratix device libraries."
+ echo " --nanometer Unknown device library."
+ echo ""
+ echo "Library compile options:"
+ 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)."
+ echo ""
+ echo "Verbosity:"
+# echo " -v --verbose Print more messages"
+ echo " -n --no-warnings Suppress all warnings. Show only error messages."
+ echo ""
+ exit 0
+fi
+
+if [ "$ALL" == "TRUE" ]; then
+ ALTERA=TRUE
+ MAX=TRUE
+ CYCLONE=TRUE
+ ARRIA=TRUE
+ STRATIX=TRUE
+ NANOMETER=TRUE
+fi
+
+# extract data from configuration
+InstallDir=${InstallationDirectory[AlteraQuartusII]}
+SourceDir="$InstallDir/quartus/eda/sim_lib"
+DestinationDir=${DestinationDirectory[AlteraQuartusII]}
+
+if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+ echo -e "${COLORED_ERROR} Altera Quartus-II is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
+ exit -1
+elif [ ! -d $SourceDir ]; then
+ echo -e "${COLORED_ERROR} Path '$SourceDir' does not exist.${ANSI_RESET}"
+ exit -1
+fi
+
+# set bash options
+set -o pipefail
+
+# define global GHDL Options
+GHDL_OPTIONS=(-fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-comments)
+
+# create "altera" directory and change to it
+if [[ -d "$DestinationDir" ]]; then
+ echo -e "${ANSI_YELLOW}Vendor directory '$DestinationDir' already exists.${ANSI_RESET}"
+else
+ echo -e "${ANSI_YELLOW}Creating vendor directory: '$DestinationDir'${ANSI_RESET}"
+ mkdir "$DestinationDir"
+fi
+cd $DestinationDir
+
+if [ -z "$(which grcat)" ]; then
+ # if grcat (generic colourizer) is not installed, use a dummy pipe command like 'cat'
+ GRC_COMMAND="cat"
+else
+ if [ "$SUPPRESS_WARNINGS" == "TRUE" ]; then
+ GRC_COMMAND="grcat $ScriptDir/ghdl.skipwarning.grcrules"
+ else
+ GRC_COMMAND="grcat $ScriptDir/ghdl.grcrules"
+ fi
+fi
+
+STOPCOMPILING=FALSE
+
+# Cleanup directory
+# ==============================================================================
+if [ "$CLEAN" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_RESET}"
+ rm *.o 2> /dev/null
+fi
+
+# Altera standard libraries
+# ==============================================================================
+# compile lpm library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'lpm' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/220pack.vhd
+ $SourceDir/220model.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=lpm "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile sgate library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'sgate' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/sgate_pack.vhd
+ $SourceDir/sgate.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=sgate "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile altera library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'altera' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/altera_europa_support_lib.vhd
+ $SourceDir/altera_primitives_components.vhd
+ $SourceDir/altera_primitives.vhd
+ $SourceDir/altera_standard_functions.vhd
+ $SourceDir/altera_syn_attributes.vhd
+ $SourceDir/alt_dspbuilder_package.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=altera "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile altera_mf library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'altera_mf' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/altera_mf_components.vhd
+ $SourceDir/altera_mf.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=altera_mf "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile altera_lnsim library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'altera_lnsim' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/altera_lnsim_components.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=altera_lnsim "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# Altera device libraries
+# ==============================================================================
+# compile Max library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'max' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/max_atoms.vhd
+ $SourceDir/max_components.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=max "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile MaxII library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'maxii' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/maxii_atoms.vhd
+ $SourceDir/maxii_components.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=maxii "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile MaxV library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'maxv' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/maxv_atoms.vhd
+ $SourceDir/maxv_components.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=maxv "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile ArriaII library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'arriaii' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/arriaii_atoms.vhd
+ $SourceDir/arriaii_components.vhd
+ $SourceDir/arriaii_hssi_components.vhd
+ $SourceDir/arriaii_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=arriaii "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'arriaii_pcie_hip' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/arriaii_pcie_hip_components.vhd
+ $SourceDir/arriaii_pcie_hip_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=arriaii_pcie_hip "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile ArriaIIGZ library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'arriaiigz' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/arriaiigz_atoms.vhd
+ $SourceDir/arriaiigz_components.vhd
+ $SourceDir/arriaiigz_hssi_components.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=arriaiigz "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile ArriaV library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'arriav' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/arriav_atoms.vhd
+ $SourceDir/arriav_components.vhd
+ $SourceDir/arriav_hssi_components.vhd
+ $SourceDir/arriav_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=arriav "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile ArriaVGZ library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'arriavgz' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/arriavgz_atoms.vhd
+ $SourceDir/arriavgz_components.vhd
+ $SourceDir/arriavgz_hssi_components.vhd
+ $SourceDir/arriavgz_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=arriavgz "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'arriavgz_pcie_hip' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/arriavgz_pcie_hip_components.vhd
+ $SourceDir/arriavgz_pcie_hip_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=arriavgz_pcie_hip "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile CycloneIV library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'cycloneiv' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/cycloneiv_atoms.vhd
+ $SourceDir/cycloneiv_components.vhd
+ $SourceDir/cycloneiv_hssi_components.vhd
+ $SourceDir/cycloneiv_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=cycloneiv "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'cycloneiv_pcie_hip' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/cycloneiv_pcie_hip_components.vhd
+ $SourceDir/cycloneiv_pcie_hip_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=cycloneiv_pcie_hip "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile CycloneIVE library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'cycloneive' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/cycloneive_atoms.vhd
+ $SourceDir/cycloneive_components.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=cycloneive "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile CycloneV library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'cyclonev' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/cyclonev_atoms.vhd
+ $SourceDir/cyclonev_components.vhd
+ $SourceDir/cyclonev_hssi_components.vhd
+ $SourceDir/cyclonev_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=cyclonev "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile StratixIV library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'stratixiv' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/stratixiv_atoms.vhd
+ $SourceDir/stratixiv_components.vhd
+ $SourceDir/stratixiv_hssi_components.vhd
+ $SourceDir/stratixiv_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=stratixiv "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'stratixiv_pcie_hip' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/stratixiv_pcie_hip_components.vhd
+ $SourceDir/stratixiv_pcie_hip_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=stratixiv_pcie_hip "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile StratixV library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'stratixv' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/stratixv_atoms.vhd
+ $SourceDir/stratixv_components.vhd
+ $SourceDir/stratixv_hssi_components.vhd
+ $SourceDir/stratixv_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=stratixv "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'stratixv_pcie_hip' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/stratixv_pcie_hip_components.vhd
+ $SourceDir/stratixv_pcie_hip_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=stratixv_pcie_hip "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile fiftyfivenm library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$NANOMETER" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'fiftyfivenm' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/fiftyfivenm_atoms.vhd
+ $SourceDir/fiftyfivenm_components.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=fiftyfivenm "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+# compile twentynm library
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$NANOMETER" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'twentynm' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files=(
+ $SourceDir/twentynm_atoms.vhd
+ $SourceDir/twentynm_components.vhd
+ $SourceDir/twentynm_hip_components.vhd
+ $SourceDir/twentynm_hip_atoms.vhd
+ $SourceDir/twentynm_hssi_components.vhd
+ $SourceDir/twentynm_hssi_atoms.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=twentynm "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+echo "--------------------------------------------------------------------------------"
+echo -n "Compiling Altera Quartus-II libraries "
+if [ "$STOPCOMPILING" == "TRUE" ]; then
+ echo -e $COLORED_FAILED
+else
+ echo -e $COLORED_SUCCESSFUL
+fi
+
+cd $WorkingDir
diff --git a/libraries/vendors/compile-osvvm.ps1 b/libraries/vendors/compile-osvvm.ps1
index e1a559b5e..7f271c252 100644
--- a/libraries/vendors/compile-osvvm.ps1
+++ b/libraries/vendors/compile-osvvm.ps1
@@ -49,9 +49,17 @@ param(
[switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
- [switch]$SuppressWarnings = $false
+ [switch]$SuppressWarnings = $false,
+
+ # Show the embedded help page(s)
+ [switch]$Help = $false
)
+if ($Help)
+{ Get-Help $MYINVOCATION.InvocationName -Detailed
+ return
+}
+
# ---------------------------------------------
# save working directory
$WorkingDir = Get-Location
@@ -107,7 +115,7 @@ if (-not $StopCompiling)
"$SourceDir\OsvvmContext.vhd")
foreach ($File in $Files)
{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
- $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File + " 2>&1"
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=osvvm " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
$StopCompiling = ($LastExitCode -ne 0)
if ($StopCompiling) { break }
@@ -115,7 +123,7 @@ if (-not $StopCompiling)
}
Write-Host "--------------------------------------------------------------------------------"
-Write-Host "Compiling OSVVM libraries " -NoNewline
+Write-Host "Compiling OSVVM library " -NoNewline
if ($StopCompiling)
{ Write-Host "[FAILED]" -ForegroundColor Red }
else
diff --git a/libraries/vendors/compile-osvvm.sh b/libraries/vendors/compile-osvvm.sh
new file mode 100755
index 000000000..fe20e3872
--- /dev/null
+++ b/libraries/vendors/compile-osvvm.sh
@@ -0,0 +1,219 @@
+#! /bin/bash
+# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
+# vim: tabstop=2:shiftwidth=2:noexpandtab
+# kate: tab-width 2; replace-tabs off; indent-width 2;
+#
+# ==============================================================================
+# Bash Script: Script to compile the OSVVM library for GHDL on Linux
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a Bash script (executable) which:
+# - creates a subdirectory in the current working directory
+# - compiles all OSVVM packages
+#
+# ==============================================================================
+# Copyright (C) 2015 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+# ---------------------------------------------
+# save working directory
+WorkingDir=$(pwd)
+ScriptDir="$(dirname $0)"
+ScriptDir="$(realpath $ScriptDir)"
+
+# source configuration file from GHDL's 'vendors' library directory
+source $ScriptDir/config.sh
+source $ScriptDir/shared.sh
+
+NO_COMMAND=TRUE
+
+# command line argument processing
+while [[ $# > 0 ]]; do
+ key="$1"
+ case $key in
+ -c|--clean)
+ CLEAN=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -a|--all)
+ ALL=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -s|--skip-existing)
+ SKIP_EXISTING_FILES=TRUE
+ ;;
+ -n|--no-warnings)
+ SUPPRESS_WARNINGS=TRUE
+ ;;
+ -H|--halt-on-error)
+ HALT_ON_ERROR=TRUE
+ ;;
+# -v|--verbose)
+# VERBOSE=TRUE
+# ;;
+ -h|--help)
+ HELP=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ *) # unknown option
+ UNKNOWN_OPTION=TRUE
+ ;;
+ esac
+ shift # past argument or value
+done
+
+if [ "$NO_COMMAND" == "TRUE" ]; then
+ HELP=TRUE
+fi
+
+if [ "$UNKNOWN_OPTION" == "TRUE" ]; then
+ echo -e $COLORED_ERROR "Unknown command line option.${ANSI_RESET}"
+ exit -1
+elif [ "$HELP" == "TRUE" ]; then
+ if [ "$NO_COMMAND" == "TRUE" ]; then
+ echo -e $COLORED_ERROR " No command selected."
+ fi
+ echo ""
+ echo "Synopsis:"
+ echo " Script to compile the simulation library OSVVM for GHDL on Linux"
+ echo ""
+ echo "Usage:"
+ echo " compile-osvvm.sh <common command>|<library> [<options>]"
+# [-v] [-c] [--all] [-s|--skip-existing] [-n|--no-warnings]
+ echo ""
+ echo "Common commands:"
+ echo " -h --help Print this help page"
+ echo " -c --clean Remove all generated files"
+ echo ""
+ echo "Libraries:"
+ echo " -a --all Compile all packages."
+ echo ""
+ echo "Library compile options:"
+ echo " -s --skip-existing Skip already compiled files (an *.o file exists)."
+ echo " -H --halt-on-error Halt on error(s)."
+ echo ""
+ echo "Verbosity:"
+# echo " -v --verbose Print more messages"
+ echo " -n --no-warnings Suppress all warnings. Show only error messages."
+ echo ""
+ exit 0
+fi
+
+if [ "$ALL" == "TRUE" ]; then
+ UNISIM=TRUE
+ UNIMACRO=TRUE
+ SIMPRIM=TRUE
+ SECUREIP=TRUE
+fi
+
+# extract data from configuration
+InstallDir=${InstallationDirectory[OSVVM]}
+SourceDir="$InstallDir"
+DestinationDir=${DestinationDirectory[OSVVM]}
+
+if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+ echo -e "${COLORED_ERROR} OSVVM is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
+ exit -1
+elif [ ! -d $SourceDir ]; then
+ echo -e "${COLORED_ERROR} Path '$SourceDir' does not exist.${ANSI_RESET}"
+ exit -1
+fi
+
+# set bash options
+set -o pipefail
+
+# define global GHDL Options
+GHDL_OPTIONS=(-fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-comments)
+
+# create "osvvm" directory and change to it
+if [[ -d "$DestinationDir" ]]; then
+ echo -e "${ANSI_YELLOW}Vendor directory '$DestinationDir' already exists.${ANSI_RESET}"
+else
+ echo -e "${ANSI_YELLOW}Creating vendor directory: '$DestinationDir'${ANSI_RESET}"
+ mkdir "$DestinationDir"
+fi
+cd $DestinationDir
+
+if [ -z "$(which grcat)" ]; then
+ # if grcat (generic colourizer) is not installed, use a dummy pipe command like 'cat'
+ GRC_COMMAND="cat"
+else
+ if [ "$SUPPRESS_WARNINGS" == "TRUE" ]; then
+ GRC_COMMAND="grcat $ScriptDir/ghdl.skipwarning.grcrules"
+ else
+ GRC_COMMAND="grcat $ScriptDir/ghdl.grcrules"
+ fi
+fi
+
+STOPCOMPILING=FALSE
+
+# Cleanup directory
+# ==============================================================================
+if [ "$CLEAN" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_RESET}"
+ rm *.o 2> /dev/null
+fi
+
+# Library osvvm
+# ==============================================================================
+# compile osvvm packages
+if [ "$STOPCOMPILING" == "FALSE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'osvvm' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--std=08)
+ Files=(
+ $SourceDir/NamePkg.vhd
+ $SourceDir/OsvvmGlobalPkg.vhd
+ $SourceDir/TextUtilPkg.vhd
+ $SourceDir/TranscriptPkg.vhd
+ $SourceDir/AlertLogPkg.vhd
+ $SourceDir/MemoryPkg.vhd
+ $SourceDir/MessagePkg.vhd
+ $SourceDir/SortListPkg_int.vhd
+ $SourceDir/RandomBasePkg.vhd
+ $SourceDir/RandomPkg.vhd
+ $SourceDir/CoveragePkg.vhd
+ $SourceDir/OsvvmContext.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=osvvm "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+echo "--------------------------------------------------------------------------------"
+echo -n "Compiling OSVVM library "
+if [ "$STOPCOMPILING" == "TRUE" ]; then
+ echo -e $COLORED_FAILED
+else
+ echo -e $COLORED_SUCCESSFUL
+fi
+
+cd $WorkingDir
diff --git a/libraries/vendors/compile-vunit.ps1 b/libraries/vendors/compile-vunit.ps1
index c1ff55ed4..53c104bc5 100644
--- a/libraries/vendors/compile-vunit.ps1
+++ b/libraries/vendors/compile-vunit.ps1
@@ -49,9 +49,17 @@ param(
[switch]$Clean = $false,
#Skip warning messages. (Show errors only.)
- [switch]$SuppressWarnings = $false
+ [switch]$SuppressWarnings = $false,
+
+ # Show the embedded help page(s)
+ [switch]$Help = $false
)
+if ($Help)
+{ Get-Help $MYINVOCATION.InvocationName -Detailed
+ return
+}
+
# ---------------------------------------------
# save working directory
$WorkingDir = Get-Location
@@ -141,7 +149,7 @@ if (-not $StopCompiling)
}
Write-Host "--------------------------------------------------------------------------------"
-Write-Host "Compiling VUnit libraries " -NoNewline
+Write-Host "Compiling VUnit library " -NoNewline
if ($StopCompiling)
{ Write-Host "[FAILED]" -ForegroundColor Red }
else
diff --git a/libraries/vendors/compile-vunit.sh b/libraries/vendors/compile-vunit.sh
new file mode 100755
index 000000000..f77961be2
--- /dev/null
+++ b/libraries/vendors/compile-vunit.sh
@@ -0,0 +1,245 @@
+#! /bin/bash
+# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
+# vim: tabstop=2:shiftwidth=2:noexpandtab
+# kate: tab-width 2; replace-tabs off; indent-width 2;
+#
+# ==============================================================================
+# Bash Script: Script to compile the VUnit library for GHDL on Linux
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a Bash script (executable) which:
+# - creates a subdirectory in the current working directory
+# - compiles all VUnit packages
+#
+# ==============================================================================
+# Copyright (C) 2015 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+# ---------------------------------------------
+# save working directory
+WorkingDir=$(pwd)
+ScriptDir="$(dirname $0)"
+ScriptDir="$(realpath $ScriptDir)"
+
+# source configuration file from GHDL's 'vendors' library directory
+source $ScriptDir/config.sh
+source $ScriptDir/shared.sh
+
+NO_COMMAND=TRUE
+
+# command line argument processing
+while [[ $# > 0 ]]; do
+ key="$1"
+ case $key in
+ -c|--clean)
+ CLEAN=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -a|--all)
+ ALL=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -s|--skip-existing)
+ SKIP_EXISTING_FILES=TRUE
+ ;;
+ -n|--no-warnings)
+ SUPPRESS_WARNINGS=TRUE
+ ;;
+ -H|--halt-on-error)
+ HALT_ON_ERROR=TRUE
+ ;;
+# -v|--verbose)
+# VERBOSE=TRUE
+# ;;
+ -h|--help)
+ HELP=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ *) # unknown option
+ UNKNOWN_OPTION=TRUE
+ ;;
+ esac
+ shift # past argument or value
+done
+
+if [ "$NO_COMMAND" == "TRUE" ]; then
+ HELP=TRUE
+fi
+
+if [ "$UNKNOWN_OPTION" == "TRUE" ]; then
+ echo -e $COLORED_ERROR "Unknown command line option.${ANSI_RESET}"
+ exit -1
+elif [ "$HELP" == "TRUE" ]; then
+ if [ "$NO_COMMAND" == "TRUE" ]; then
+ echo -e $COLORED_ERROR " No command selected."
+ fi
+ echo ""
+ echo "Synopsis:"
+ echo " Script to compile the simulation library VUnit for GHDL on Linux"
+ echo ""
+ echo "Usage:"
+ echo " compile-vunit.sh <common command>|<library> [<options>]"
+# [-v] [-c] [--all] [-s|--skip-existing] [-n|--no-warnings]
+ echo ""
+ echo "Common commands:"
+ echo " -h --help Print this help page"
+ echo " -c --clean Remove all generated files"
+ echo ""
+ echo "Libraries:"
+ echo " -a --all Compile all packages."
+ echo ""
+ echo "Library compile options:"
+ echo " -s --skip-existing Skip already compiled files (an *.o file exists)."
+ echo " -H --halt-on-error Halt on error(s)."
+ echo ""
+ echo "Verbosity:"
+# echo " -v --verbose Print more messages"
+ echo " -n --no-warnings Suppress all warnings. Show only error messages."
+ echo ""
+ exit 0
+fi
+
+if [ "$ALL" == "TRUE" ]; then
+ UNISIM=TRUE
+ UNIMACRO=TRUE
+ SIMPRIM=TRUE
+ SECUREIP=TRUE
+fi
+
+# extract data from configuration
+InstallDir=${InstallationDirectory[VUnit]}
+SourceDir="$InstallDir"
+DestinationDir=${DestinationDirectory[VUnit]}
+
+if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+ echo -e "${COLORED_ERROR} VUnit is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
+ exit -1
+elif [ ! -d $SourceDir ]; then
+ echo -e "${COLORED_ERROR} Path '$SourceDir' does not exist.${ANSI_RESET}"
+ exit -1
+fi
+
+# set bash options
+set -o pipefail
+
+# define global GHDL Options
+GHDL_OPTIONS=(-fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-comments)
+
+# create "vunit" directory and change to it
+if [[ -d "$DestinationDir" ]]; then
+ echo -e "${ANSI_YELLOW}Vendor directory '$DestinationDir' already exists.${ANSI_RESET}"
+else
+ echo -e "${ANSI_YELLOW}Creating vendor directory: '$DestinationDir'${ANSI_RESET}"
+ mkdir "$DestinationDir"
+fi
+cd $DestinationDir
+
+if [ -z "$(which grcat)" ]; then
+ # if grcat (generic colourizer) is not installed, use a dummy pipe command like 'cat'
+ GRC_COMMAND="cat"
+else
+ if [ "$SUPPRESS_WARNINGS" == "TRUE" ]; then
+ GRC_COMMAND="grcat $ScriptDir/ghdl.skipwarning.grcrules"
+ else
+ GRC_COMMAND="grcat $ScriptDir/ghdl.grcrules"
+ fi
+fi
+
+STOPCOMPILING=FALSE
+
+# Cleanup directory
+# ==============================================================================
+if [ "$CLEAN" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_RESET}"
+ rm *.o 2> /dev/null
+fi
+
+# Library vunit_lib
+# ==============================================================================
+# compile vunit packages
+if [ "$STOPCOMPILING" == "FALSE" ]; then
+ echo -e "${ANSI_YELLOW}Compiling library 'vunit_lib' ...${ANSI_RESET}"
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--std=08)
+ Files=(
+ $SourceDir/vhdl/run/src/stop_api.vhd
+ $SourceDir/vhdl/vhdl/src/lib/std/textio.vhd
+ $SourceDir/vhdl/vhdl/src/lang/lang.vhd
+ $SourceDir/vhdl/com/src/com_types.vhd
+ $SourceDir/vhdl/run/src/stop_body_2008.vhd
+ $SourceDir/vhdl/com/src/com_api.vhd
+ $SourceDir/vhdl/string_ops/src/string_ops.vhd
+ $SourceDir/vhdl/path/src/path.vhd
+ $SourceDir/vhdl/logging/src/log_types.vhd
+ $SourceDir/vhdl/logging/src/log_formatting.vhd
+ $SourceDir/vhdl/logging/src/log_special_types200x.vhd
+ $SourceDir/vhdl/array/src/array_pkg.vhd
+ $SourceDir/vhdl/logging/src/log_base_api.vhd
+ $SourceDir/vhdl/logging/src/log_base.vhd
+ $SourceDir/vhdl/logging/src/log_api.vhd
+ $SourceDir/vhdl/logging/src/log.vhd
+ $SourceDir/vhdl/check/src/check_types.vhd
+ $SourceDir/vhdl/check/src/check_special_types200x.vhd
+ $SourceDir/vhdl/check/src/check_base_api.vhd
+ $SourceDir/vhdl/check/src/check_base.vhd
+ $SourceDir/vhdl/check/src/check_api.vhd
+ $SourceDir/vhdl/check/src/check.vhd
+ $SourceDir/vhdl/dictionary/src/dictionary.vhd
+ $SourceDir/vhdl/run/src/run_types.vhd
+ $SourceDir/vhdl/run/src/run_special_types200x.vhd
+ $SourceDir/vhdl/run/src/run_base_api.vhd
+ $SourceDir/vhdl/run/src/run_base.vhd
+ $SourceDir/vhdl/run/src/run_api.vhd
+ $SourceDir/vhdl/run/src/run.vhd
+ $SourceDir/vhdl/vunit_run_context.vhd
+ $SourceDir/vhdl/vunit_context.vhd
+ $SourceDir/vhdl/com/src/com_std_codec_builder.vhd
+ $SourceDir/vhdl/com/src/com_debug_codec_builder.vhd
+ $SourceDir/vhdl/com/src/com_string.vhd
+ $SourceDir/vhdl/com/src/com_codec_api.vhd
+ $SourceDir/vhdl/com/src/com_codec.vhd
+ $SourceDir/vhdl/com/src/com.vhd
+ $SourceDir/vhdl/com/src/com_context.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=vunit_lib "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
+ fi
+ done
+fi
+
+echo "--------------------------------------------------------------------------------"
+echo -n "Compiling VUnit library "
+if [ "$STOPCOMPILING" == "TRUE" ]; then
+ echo -e $COLORED_FAILED
+else
+ echo -e $COLORED_SUCCESSFUL
+fi
+
+cd $WorkingDir
diff --git a/libraries/vendors/compile-xilinx-ise.ps1 b/libraries/vendors/compile-xilinx-ise.ps1
index a993f83d9..7557a5129 100644
--- a/libraries/vendors/compile-xilinx-ise.ps1
+++ b/libraries/vendors/compile-xilinx-ise.ps1
@@ -65,9 +65,17 @@ param(
[switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
- [switch]$SuppressWarnings = $false
+ [switch]$SuppressWarnings = $false,
+
+ # Show the embedded help page(s)
+ [switch]$Help = $false
)
+if ($Help)
+{ Get-Help $MYINVOCATION.InvocationName -Detailed
+ return
+}
+
# ---------------------------------------------
# save working directory
$WorkingDir = Get-Location
diff --git a/libraries/vendors/compile-xilinx-ise.sh b/libraries/vendors/compile-xilinx-ise.sh
new file mode 100755
index 000000000..b3675289c
--- /dev/null
+++ b/libraries/vendors/compile-xilinx-ise.sh
@@ -0,0 +1,401 @@
+#! /bin/bash
+# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
+# vim: tabstop=2:shiftwidth=2:noexpandtab
+# kate: tab-width 2; replace-tabs off; indent-width 2;
+#
+# ==============================================================================
+# Bash Script: Script to compile the simulation libraries from Xilinx ISE
+# for GHDL on Linux
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a Bash script (executable) which:
+# - creates a subdirectory in the current working directory
+# - compiles all Xilinx ISE simulation libraries and packages
+#
+# ==============================================================================
+# Copyright (C) 2015 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+# ---------------------------------------------
+# save working directory
+WorkingDir=$(pwd)
+ScriptDir="$(dirname $0)"
+ScriptDir="$(realpath $ScriptDir)"
+
+# source configuration file from GHDL's 'vendors' library directory
+source $ScriptDir/config.sh
+source $ScriptDir/shared.sh
+
+NO_COMMAND=TRUE
+
+# command line argument processing
+while [[ $# > 0 ]]; do
+ key="$1"
+ case $key in
+ -c|--clean)
+ CLEAN=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -a|--all)
+ ALL=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -s|--skip-existing)
+ SKIP_EXISTING_FILES=TRUE
+ ;;
+ -S|--skip-largefiles)
+ SKIP_LARGE_FILES=TRUE
+ ;;
+ -n|--no-warnings)
+ SUPPRESS_WARNINGS=TRUE
+ ;;
+ -H|--halt-on-error)
+ HALT_ON_ERROR=TRUE
+ ;;
+# -v|--verbose)
+# VERBOSE=TRUE
+# ;;
+ -h|--help)
+ HELP=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --unisim)
+ UNISIM=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --unimacro)
+ UNIMACRO=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --simprim)
+ SIMPRIM=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --secureip)
+ SECUREIP=TRUE
+ ;;
+ *) # unknown option
+ UNKNOWN_OPTION=TRUE
+ ;;
+ esac
+ shift # past argument or value
+done
+
+if [ "$NO_COMMAND" == "TRUE" ]; then
+ HELP=TRUE
+fi
+
+if [ "$UNKNOWN_OPTION" == "TRUE" ]; then
+ echo -e $COLORED_ERROR "Unknown command line option.${ANSI_RESET}"
+ exit -1
+elif [ "$HELP" == "TRUE" ]; then
+ if [ "$NO_COMMAND" == "TRUE" ]; then
+ echo -e $COLORED_ERROR " No command selected."
+ fi
+ echo ""
+ echo "Synopsis:"
+ echo " Script to compile the simulation libraries from Xilinx ISE for GHDL on Linux"
+ echo ""
+ echo "Usage:"
+ echo " compile-xilinx-ise.sh <common command>|<library> [<options>]"
+# [-v] [-c] [--unisim] [--unimacro] [--simprim] [--secureip] [-s|--skip-existing] [-S|--skip-largefiles] [-n|--no-warnings]
+ echo ""
+ echo "Common commands:"
+ echo " -h --help Print this help page"
+ echo " -c --clean Remove all generated files"
+ echo ""
+ echo "Libraries:"
+ echo " -a --all Compile all Xilinx simulation libraries."
+ echo " --unisim Compile the unisim library."
+ echo " --unimacro Compile the unimacro library."
+ echo " --simprim Compile the simprim library."
+ echo " --secureip Compile the secureip library."
+ echo ""
+ echo "Library compile options:"
+ 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)."
+ echo ""
+ echo "Verbosity:"
+# echo " -v --verbose Print more messages"
+ echo " -n --no-warnings Suppress all warnings. Show only error messages."
+ echo ""
+ exit 0
+fi
+
+if [ "$ALL" == "TRUE" ]; then
+ UNISIM=TRUE
+ UNIMACRO=TRUE
+ SIMPRIM=TRUE
+ SECUREIP=TRUE
+fi
+
+# extract data from configuration
+InstallDir=${InstallationDirectory[XilinxISE]}
+SourceDir="$InstallDir/ISE_DS/ISE/vhdl/src"
+DestinationDir=${DestinationDirectory[XilinxISE]}
+
+if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+ echo -e "${COLORED_ERROR} Xilinx ISE is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
+ exit -1
+elif [ ! -d $SourceDir ]; then
+ echo -e "${COLORED_ERROR} Path '$SourceDir' does not exist.${ANSI_RESET}"
+ exit -1
+fi
+
+# set bash options
+set -o pipefail
+
+# define global GHDL Options
+GHDL_OPTIONS=(-fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-comments)
+
+# create "xilinx" directory and change to it
+if [[ -d "$DestinationDir" ]]; then
+ echo -e "${ANSI_YELLOW}Vendor directory '$DestinationDir' already exists.${ANSI_RESET}"
+else
+ echo -e "${ANSI_YELLOW}Creating vendor directory: '$DestinationDir'${ANSI_RESET}"
+ mkdir "$DestinationDir"
+fi
+cd $DestinationDir
+
+if [ -z "$(which grcat)" ]; then
+ # if grcat (generic colourizer) is not installed, use a dummy pipe command like 'cat'
+ GRC_COMMAND="cat"
+else
+ if [ "$SUPPRESS_WARNINGS" == "TRUE" ]; then
+ GRC_COMMAND="grcat $ScriptDir/ghdl.skipwarning.grcrules"
+ else
+ GRC_COMMAND="grcat $ScriptDir/ghdl.grcrules"
+ fi
+fi
+
+STOPCOMPILING=FALSE
+
+# Cleanup directory
+# ==============================================================================
+if [ "$CLEAN" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_RESET}"
+ rm *.o 2> /dev/null
+fi
+
+# Library unisim
+# ==============================================================================
+# compile unisim packages
+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)
+ Files=(
+ $SourceDir/unisims/unisim_VPKG.vhd
+ $SourceDir/unisims/unisim_VCOMP.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile unisim primitives
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files="$(LC_COLLATE=C ls $SourceDir/unisims/primitive/*.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ FileSize=($(wc -c $File))
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+# echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ elif [ "$SKIP_LARGE_FILES" == "TRUE" ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then
+ echo -e "${ANSI_CYAN}Skipping large '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile unisim secureip primitives
+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)
+ Files="$(LC_COLLATE=C ls $SourceDir/unisims/secureip/*.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ FileSize=($(wc -c $File))
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+# echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ elif [ "$SKIP_LARGE_FILES" == "TRUE" ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then
+ echo -e "${ANSI_CYAN}Skipping large '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# Library unimacro
+# ==============================================================================
+# compile unimacro packages
+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)
+ Files=(
+ $SourceDir/unimacro/unimacro_VCOMP.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile unimacro macros
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files="$(LC_COLLATE=C ls $SourceDir/unimacro/*_MACRO.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# Library simprim
+# ==============================================================================
+# compile simprim packages
+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)
+ Files=(
+ $SourceDir/simprims/simprim_Vpackage.vhd
+ $SourceDir/simprims/simprim_Vcomponents.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile simprim primitives
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files="$(LC_COLLATE=C ls $SourceDir/simprims/primitive/other/*.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ FileSize=($(wc -c $File))
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+# echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ elif [ "$SKIP_LARGE_FILES" == "TRUE" ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then
+ echo -e "${ANSI_CYAN}Skipping large '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile simprim secureip primitives
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ] && [ "$SECUREIP" == "TRUE" ]; then
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files="$(LC_COLLATE=C ls $SourceDir/simprims/secureip/other/*.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ FileSize=($(wc -c $File))
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+# echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ elif [ "$SKIP_LARGE_FILES" == "TRUE" ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then
+ echo -e "${ANSI_CYAN}Skipping large '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+echo "--------------------------------------------------------------------------------"
+echo -n "Compiling Xilinx ISE libraries "
+if [ "$STOPCOMPILING" == "TRUE" ]; then
+ echo -e $COLORED_FAILED
+else
+ echo -e $COLORED_SUCCESSFUL
+fi
+
+cd $WorkingDir
diff --git a/libraries/vendors/compile-xilinx-vivado.ps1 b/libraries/vendors/compile-xilinx-vivado.ps1
index f70289c94..8e46825a8 100644
--- a/libraries/vendors/compile-xilinx-vivado.ps1
+++ b/libraries/vendors/compile-xilinx-vivado.ps1
@@ -61,9 +61,17 @@ param(
[switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
- [switch]$SuppressWarnings = $false
+ [switch]$SuppressWarnings = $false,
+
+ # Show the embedded help page(s)
+ [switch]$Help = $false
)
+if ($Help)
+{ Get-Help $MYINVOCATION.InvocationName -Detailed
+ return
+}
+
# ---------------------------------------------
# save working directory
$WorkingDir = Get-Location
diff --git a/libraries/vendors/compile-xilinx-vivado.sh b/libraries/vendors/compile-xilinx-vivado.sh
new file mode 100755
index 000000000..b47a66a08
--- /dev/null
+++ b/libraries/vendors/compile-xilinx-vivado.sh
@@ -0,0 +1,352 @@
+#! /bin/bash
+# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
+# vim: tabstop=2:shiftwidth=2:noexpandtab
+# kate: tab-width 2; replace-tabs off; indent-width 2;
+#
+# ==============================================================================
+# Bash Script: Script to compile the simulation libraries from Xilinx Vivado
+# for GHDL on Linux
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a Bash script (executable) which:
+# - creates a subdirectory in the current working directory
+# - compiles all Xilinx Vivado simulation libraries and packages
+#
+# ==============================================================================
+# Copyright (C) 2015 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+# ---------------------------------------------
+# save working directory
+WorkingDir=$(pwd)
+ScriptDir="$(dirname $0)"
+ScriptDir="$(realpath $ScriptDir)"
+
+# source configuration file from GHDL's 'vendors' library directory
+source $ScriptDir/config.sh
+source $ScriptDir/shared.sh
+
+NO_COMMAND=TRUE
+
+# command line argument processing
+while [[ $# > 0 ]]; do
+ key="$1"
+ case $key in
+ -c|--clean)
+ CLEAN=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -a|--all)
+ ALL=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -s|--skip-existing)
+ SKIP_EXISTING_FILES=TRUE
+ ;;
+ -S|--skip-largefiles)
+ SKIP_LARGE_FILES=TRUE
+ ;;
+ -n|--no-warnings)
+ SUPPRESS_WARNINGS=TRUE
+ ;;
+ -H|--halt-on-error)
+ HALT_ON_ERROR=TRUE
+ ;;
+# -v|--verbose)
+# VERBOSE=TRUE
+# ;;
+ -h|--help)
+ HELP=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --unisim)
+ UNISIM=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --unimacro)
+ UNIMACRO=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ --secureip)
+ SECUREIP=TRUE
+ ;;
+ *) # unknown option
+ UNKNOWN_OPTION=TRUE
+ ;;
+ esac
+ shift # past argument or value
+done
+
+if [ "$NO_COMMAND" == "TRUE" ]; then
+ HELP=TRUE
+fi
+
+if [ "$UNKNOWN_OPTION" == "TRUE" ]; then
+ echo -e $COLORED_ERROR "Unknown command line option.${ANSI_RESET}"
+ exit -1
+elif [ "$HELP" == "TRUE" ]; then
+ if [ "$NO_COMMAND" == "TRUE" ]; then
+ echo -e $COLORED_ERROR " No command selected."
+ fi
+ echo ""
+ echo "Synopsis:"
+ echo " Script to compile the simulation libraries from Xilinx Vivado for GHDL on Linux"
+ echo ""
+ echo "Usage:"
+ echo " compile-xilinx-vivado.sh <common command>|<library> [<options>]"
+# [-v] [-c] [--unisim] [--unimacro] [--simprim] [--secureip] [-s|--skip-existing] [-S|--skip-largefiles] [-n|--no-warnings]
+ echo ""
+ echo "Common commands:"
+ echo " -h --help Print this help page"
+ echo " -c --clean Remove all generated files"
+ echo ""
+ echo "Libraries:"
+ echo " -a --all Compile all Xilinx simulation libraries."
+ echo " --unisim Compile the unisim library."
+ echo " --unimacro Compile the unimacro library."
+ echo " --secureip Compile the secureip library."
+ echo ""
+ echo "Library compile options:"
+ 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)."
+ echo ""
+ echo "Verbosity:"
+# echo " -v --verbose Print more messages"
+ echo " -n --no-warnings Suppress all warnings. Show only error messages."
+ echo ""
+ exit 0
+fi
+
+if [ "$ALL" == "TRUE" ]; then
+ UNISIM=TRUE
+ UNIMACRO=TRUE
+ SECUREIP=TRUE
+fi
+
+# extract data from configuration
+InstallDir=${InstallationDirectory[XilinxVivado]}
+SourceDir="$InstallDir/data/vhdl/src"
+DestinationDir=${DestinationDirectory[XilinxVivado]}
+
+if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+ echo -e "${COLORED_ERROR} Xilinx Vivado is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
+ exit -1
+elif [ ! -d $SourceDir ]; then
+ echo -e "${COLORED_ERROR} Path '$SourceDir' does not exist.${ANSI_RESET}"
+ exit -1
+fi
+
+# set bash options
+set -o pipefail
+
+# define global GHDL Options
+GHDL_OPTIONS=(-fexplicit -frelaxed-rules --no-vital-checks --warn-binding --mb-comments)
+
+# create "vivado" directory and change to it
+if [[ -d "$DestinationDir" ]]; then
+ echo -e "${ANSI_YELLOW}Vendor directory '$DestinationDir' already exists.${ANSI_RESET}"
+else
+ echo -e "${ANSI_YELLOW}Creating vendor directory: '$DestinationDir'${ANSI_RESET}"
+ mkdir "$DestinationDir"
+fi
+cd $DestinationDir
+
+if [ -z "$(which grcat)" ]; then
+ # if grcat (generic colourizer) is not installed, use a dummy pipe command like 'cat'
+ GRC_COMMAND="cat"
+else
+ if [ "$SUPPRESS_WARNINGS" == "TRUE" ]; then
+ GRC_COMMAND="grcat $ScriptDir/ghdl.skipwarning.grcrules"
+ else
+ GRC_COMMAND="grcat $ScriptDir/ghdl.grcrules"
+ fi
+fi
+
+STOPCOMPILING=FALSE
+
+# Cleanup directory
+# ==============================================================================
+if [ "$CLEAN" == "TRUE" ]; then
+ echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_RESET}"
+ rm *.o 2> /dev/null
+fi
+
+# Library unisim
+# ==============================================================================
+# compile unisim packages
+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)
+ Files=(
+ $SourceDir/unisims/unisim_VPKG.vhd
+ $SourceDir/unisims/unisim_VCOMP.vhd
+ $SourceDir/unisims/retarget_VCOMP.vhd
+ $SourceDir/unisims/unisim_retarget_VCOMP.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile unisim primitives
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files="$(LC_COLLATE=C ls $SourceDir/unisims/primitive/*.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ FileSize=($(wc -c $File))
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+# echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ elif [ "$SKIP_LARGE_FILES" == "TRUE" ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then
+ echo -e "${ANSI_CYAN}Skipping large '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile unisim retarget primitives
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files="$(LC_COLLATE=C ls $SourceDir/unisims/retarget/*.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ FileSize=($(wc -c $File))
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+# echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ elif [ "$SKIP_LARGE_FILES" == "TRUE" ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then
+ echo -e "${ANSI_CYAN}Skipping large '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile unisim secureip primitives
+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)
+ Files="$(LC_COLLATE=C ls $SourceDir/unisims/secureip/*.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ FileSize=($(wc -c $File))
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -n ""
+# echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ elif [ "$SKIP_LARGE_FILES" == "TRUE" ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then
+ echo -e "${ANSI_CYAN}Skipping large '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# Library unimacro
+# ==============================================================================
+# compile unimacro packages
+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)
+ Files=(
+ $SourceDir/unimacro/unimacro_VCOMP.vhd
+ )
+ for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ 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
+ fi
+ fi
+ done
+fi
+
+# compile unimacro macros
+if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
+ GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+ GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ Files="$(LC_COLLATE=C ls $SourceDir/unimacro/*_MACRO.vhd)"
+ for File in $Files; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping macro '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing macro '$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
+ fi
+ fi
+ done
+fi
+
+# Library UNIFAST
+# ==============================================================================
+# TODO:
+
+echo "--------------------------------------------------------------------------------"
+echo -n "Compiling Xilinx Vivado libraries "
+if [ "$STOPCOMPILING" == "TRUE" ]; then
+ echo -e $COLORED_FAILED
+else
+ echo -e $COLORED_SUCCESSFUL
+fi
+
+cd $WorkingDir
diff --git a/libraries/vendors/config.sh b/libraries/vendors/config.sh
new file mode 100644
index 000000000..1be343bc3
--- /dev/null
+++ b/libraries/vendors/config.sh
@@ -0,0 +1,49 @@
+#! /bin/bash
+# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
+# vim: tabstop=2:shiftwidth=2:noexpandtab
+# kate: tab-width 2; replace-tabs off; indent-width 2;
+#
+# ==============================================================================
+# Bash Script: Configurable directories to local installed tools
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This Bash file exports variables containing the users local tool environment.
+#
+# ==============================================================================
+# Copyright (C) 2015 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+declare -A InstallationDirectory
+InstallationDirectory[AlteraQuartusII]="/opt/Altera/15.0"
+InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7"
+InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2014.4"
+InstallationDirectory[OSVVM]="/home/paebbels/git/PoC/lib/osvvm"
+InstallationDirectory[VUnit]="/home/paebbels/git/PoC/lib/vunit"
+
+declare -A DestinationDirectory
+DestinationDirectory[AlteraQuartusII]="altera"
+DestinationDirectory[XilinxISE]="xilinx"
+DestinationDirectory[XilinxVivado]="vivado"
+DestinationDirectory[OSVVM]="osvvm"
+DestinationDirectory[VUnit]="vuint"
+
+# input files greater than $LARGE_FILESIZE are skipped if '--skip-largefiles' is set
+LARGE_FILESIZE=125000
diff --git a/libraries/vendors/ghdl.grcrules b/libraries/vendors/ghdl.grcrules
new file mode 100644
index 000000000..1bc607831
--- /dev/null
+++ b/libraries/vendors/ghdl.grcrules
@@ -0,0 +1,15 @@
+# color warnings
+regexp=^.*?:\d+:\d+:warning: .*
+colours=yellow
+count=stop
+=========
+
+# color errors
+regexp=^.*?:\d+:\d+: .*
+colours=red
+count=stop
+=========
+
+# skip additional message line on Linux
+regexp=^ghdl: compilation error
+skip=yes
diff --git a/libraries/vendors/ghdl.skipwarning.grcrules b/libraries/vendors/ghdl.skipwarning.grcrules
new file mode 100644
index 000000000..0609b0608
--- /dev/null
+++ b/libraries/vendors/ghdl.skipwarning.grcrules
@@ -0,0 +1,14 @@
+# skip warnings
+regexp=^.*?:\d+:\d+:warning: .*
+skip=yes
+=========
+
+# color errors
+regexp=^.*?:\d+:\d+: .*
+colours=red
+count=stop
+=========
+
+# skip additional message line on Linux
+regexp=^ghdl: compilation error
+skip=yes
diff --git a/libraries/vendors/shared.sh b/libraries/vendors/shared.sh
new file mode 100644
index 000000000..adf732081
--- /dev/null
+++ b/libraries/vendors/shared.sh
@@ -0,0 +1,48 @@
+#! /bin/bash
+# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t -*-
+# vim: tabstop=2:shiftwidth=2:noexpandtab
+# kate: tab-width 2; replace-tabs off; indent-width 2;
+#
+# ==============================================================================
+# Bash Script: This is a Bash resource file.
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# TODO
+#
+# ==============================================================================
+# Copyright (C) 2015 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+ANSI_RED="\e[31m"
+ANSI_GREEN="\e[32m"
+ANSI_YELLOW="\e[33m"
+ANSI_BLUE="\e[34m"
+ANSI_MAGENTA="\e[35m"
+ANSI_CYAN="\e[36;1m"
+ANSI_RESET="\e[0m"
+
+# red texts
+COLORED_ERROR="$ANSI_RED[ERROR]$ANSI_RESET"
+COLORED_FAILED="$ANSI_RED[FAILED]$ANSI_RESET"
+
+# green texts
+COLORED_DONE="$ANSI_GREEN[DONE]$ANSI_RESET"
+COLORED_SUCCESSFUL="$ANSI_GREEN[SUCCESSFUL]$ANSI_RESET"