aboutsummaryrefslogtreecommitdiffstats
path: root/libraries
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2015-11-25 04:16:47 +0100
committerTristan Gingold <gingold@adacore.com>2015-11-25 04:16:47 +0100
commitf7cfcfe15528a1619927aa61d138bbc87b2a2b5b (patch)
tree59cb32f67befbc431450b000bbf440336804e377 /libraries
parentbd320d6260009f7d625bb70954d84bdec32b7917 (diff)
downloadghdl-f7cfcfe15528a1619927aa61d138bbc87b2a2b5b.tar.gz
ghdl-f7cfcfe15528a1619927aa61d138bbc87b2a2b5b.tar.bz2
ghdl-f7cfcfe15528a1619927aa61d138bbc87b2a2b5b.zip
Add vendor specific compile scripts (from Patrick Lehmann).
for: Altera Quartus-II (tested with 15.0), Xilinx ISE (tested with 14.7) Xilinx Vivado vunit OSVVM.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/vendors/README.md149
-rw-r--r--libraries/vendors/compile-altera.ps1544
-rw-r--r--libraries/vendors/compile-osvvm.ps1129
-rw-r--r--libraries/vendors/compile-vunit.ps1156
-rw-r--r--libraries/vendors/compile-xilinx-ise.ps1258
-rw-r--r--libraries/vendors/compile-xilinx-vivado.ps1229
-rw-r--r--libraries/vendors/config.psm153
-rw-r--r--libraries/vendors/shared.psm1135
8 files changed, 1653 insertions, 0 deletions
diff --git a/libraries/vendors/README.md b/libraries/vendors/README.md
new file mode 100644
index 000000000..e231c2c61
--- /dev/null
+++ b/libraries/vendors/README.md
@@ -0,0 +1,149 @@
+## 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.
+
+There are also popular simulation and verification libraries, 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.
+
+##### Supported Vendors Libraries
+
+ - Altera Quartus-II (15.x):
+ - lpm, sgate
+ - altera, altera_mf, altera_lnsim
+ - arriaii, arriaii_pcie_hip, arriaiigz
+ - arriav, arriavgz, arriavgz_pcie_hip
+ - cycloneiv, cycloneiv_pcie_hip, cycloneive
+ - cyclonev
+ - max, maxii, maxv
+ - stratixiv, stratixiv_pcie_hip
+ - stratixv, stratixv_pcie_hip
+ - fiftyfivenm, twentynm
+ - Xilinx ISE (14.7):
+ - unisim (incl. secureip)
+ - unimacro
+ - simprim (incl. secureip)
+ - Xilinx Vivado (2015.x):
+ - unisim
+ - unimacro
+
+##### Supported Simulation and Verification Libraries
+
+ - OSVVM (for VHDL-2008)
+ - osvvm
+ - VUnit (for VHDL-2008)
+ - vunit_lib
+
+---------------------------------------------------------------------
+### Compiling on Linux
+
+*First I should translate the scripts before writing the docu...*
+
+---------------------------------------------------------------------
+### Compiling on Windows
+
+ - **Step 1 - Configure the scripts**
+ Please open the `config.psm1` file and set the dictionary entries for the installed
+ 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"
+ }
+
+ - **Step 2 - Browse to your simulation working directory**
+ ```PowerShell
+ PS> cd <MySimulationFolder>
+ ```
+
+ - **Step 3 - Start the compilation script(s)**
+ ```PowerShell
+ PS> <GHDL>\libraries\vendors\compile-altera.ps1 -All
+ PS> <GHDL>\libraries\vendors\compile-xilinx-ise.ps1 -All
+ PS> <GHDL>\libraries\vendors\compile-xilinx-vivado.ps1 -All
+ PS> <GHDL>\libraries\vendors\compile-osvvm.ps1 -All
+ PS> <GHDL>\libraries\vendors\compile-vunit.ps1 -All
+ ```
+
+ - **Step 4 - Viewing the result**
+ This creates vendor directories in your current working directory and compiles the vendor files into them.
+
+ ```PowerShell
+ PS> dir
+ Directory: D:\temp\ghdl
+
+ Mode LastWriteTime Length Name
+ ---- ------------- ------ ----
+ d---- 20.11.2015 19:33 <DIR> altera
+ d---- 20.11.2015 19:38 <DIR> osvvm
+ d---- 20.11.2015 19:40 <DIR> vivado
+ d---- 20.11.2015 19:45 <DIR> vunit
+ d---- 20.11.2015 19:06 <DIR> xilinx
+ ```
+
+### Selectable Options for the Bash Scripts:
+
+*First I should translate the scripts before writing the docu...*
+
+ - 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.
+ - `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
+
+ - `compile-xilinx-ise.sh`
+
+ --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
+ - `compile-osvvm.sh`
+ - `compile-vunit.sh`
+
+### Selectable Options for the PowerShell Scripts:
+
+ - 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.
+ - `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
+ - `compile-xilinx-ise.ps1`
+
+ -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
+ - `compile-osvvm.ps1`
+ - `compile-vunit.ps1`
+
+------------------------
+Author: Patrick Lehmann (23.11.2015)
diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1
new file mode 100644
index 000000000..8bf97d969
--- /dev/null
+++ b/libraries/vendors/compile-altera.ps1
@@ -0,0 +1,544 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Script: Script to compile the simulation libraries from Altera
+# Quartus-II for GHDL on Windows
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a PowerShell 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.
+# ==============================================================================
+
+# .SYNOPSIS
+# This CmdLet compiles the simulation libraries from Altera.
+#
+# .DESCRIPTION
+# This CmdLet:
+# (1) creates a subdirectory in the current working directory
+# (2) compiles all Altera Quartus-II simulation libraries and packages
+# o Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim
+# o Altera device libraries:
+# - arriaii, arriaii_pcie_hip, arriaiigz
+# - arriav, arriavgz, arriavgz_pcie_hip
+# - cycloneiv, cycloneiv_pcie_hip, cycloneive
+# - cyclonev
+# - max, maxii, maxv
+# - stratixiv, stratixiv_pcie_hip
+# - stratixv, stratixv_pcie_hip
+# - fiftyfivenm, twentynm
+#
+[CmdletBinding()]
+param(
+ # Compile all libraries and packages.
+ [switch]$All = $null,
+
+ # Compile the Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim
+ [switch]$Altera = $false,
+
+ # Compile the Altera Max device libraries
+ [switch]$Max = $false,
+
+ # Compile the Altera Cyclon device libraries
+ [switch]$Cyclon = $false,
+
+ # Compile the Altera Arria device libraries
+ [switch]$Arria = $false,
+
+ # Compile the Altera Stratix device libraries
+ [switch]$Stratix = $false,
+
+ # Unknown device library
+ [switch]$Nanometer = $false,
+
+ # Clean up directory before analyzing.
+ [switch]$Clean = $false,
+
+ # Skip warning messages. (Show errors only.)
+ [switch]$SuppressWarnings = $false
+)
+
+# ---------------------------------------------
+# save working directory
+$WorkingDir = Get-Location
+
+# load modules from GHDL's 'vendors' library directory
+Import-Module $PSScriptRoot\config.psm1
+Import-Module $PSScriptRoot\shared.psm1
+
+# extract data from configuration
+$SourceDir = $InstallationDirectory["AlteraQuartusII"] + "\quartus\eda\sim_lib"
+$DestinationDir = $DestinationDirectory["Altera"]
+
+if (-not $All)
+{ $All = $false }
+elseif ($All -eq $true)
+{ $Altera = $true
+ $Max = $true
+ $Cyclon = $true
+ $Arria = $true
+ $Stratix = $true
+ $Nanometer = $true
+}
+
+$StopCompiling = $false
+
+
+# define global GHDL Options
+$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--ieee=synopsys", "--no-vital-checks", "--std=93c")
+
+# create "Altera" directory and change to it
+Write-Host "Creating vendor directory: '$DestinationDir'" -ForegroundColor Yellow
+mkdir $DestinationDir -ErrorAction SilentlyContinue | Out-Null
+cd $DestinationDir
+
+# Cleanup
+# ==============================================================================
+if ($Clean)
+{ Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow
+ rm *.cf
+}
+# compile lpm library
+if ((-not $StopCompiling) -and $Altera)
+{ Write-Host "Compiling library 'lpm' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\220pack.vhd",
+ "$SourceDir\220model.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=lpm " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile sgate library
+if ((-not $StopCompiling) -and $Altera)
+{ Write-Host "Compiling library 'sgate' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\sgate_pack.vhd",
+ "$SourceDir\sgate.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=sgate " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile altera library
+if ((-not $StopCompiling) -and $Altera)
+{ Write-Host "Compiling library 'altera' ..." -ForegroundColor Yellow
+ $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",
+ "$SourceDir\altera_syn_attributes.vhd",
+ "$SourceDir\alt_dspbuilder_package.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=altera " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile altera_mf library
+if ((-not $StopCompiling) -and $Altera)
+{ Write-Host "Compiling library 'altera_mf' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\altera_mf_components.vhd",
+ "$SourceDir\altera_mf.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=altera_mf " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile altera_lnsim library
+if ((-not $StopCompiling) -and $Altera)
+{ Write-Host "Compiling library 'altera_lnsim' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ & ghdl.exe $OPTIONS --work=altera_lnsim $SourceDir\altera_lnsim_components.vhd
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=altera_lnsim " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile max library
+if ((-not $StopCompiling) -and $Max)
+{ Write-Host "Compiling library 'max' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\max_atoms.vhd",
+ "$SourceDir\max_components.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=max " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile maxii library
+if ((-not $StopCompiling) -and $Max)
+{ Write-Host "Compiling library 'maxii' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\maxii_atoms.vhd",
+ "$SourceDir\maxii_components.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=maxii " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile maxv library
+if ((-not $StopCompiling) -and $Max)
+{ Write-Host "Compiling library 'maxv' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\maxv_atoms.vhd",
+ "$SourceDir\maxv_components.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=maxv " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile arriaii library
+if ((-not $StopCompiling) -and $Arria)
+{ Write-Host "Compiling library 'arriaii' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\arriaii_atoms.vhd",
+ "$SourceDir\arriaii_components.vhd",
+ "$SourceDir\arriaii_hssi_components.vhd",
+ "$SourceDir\arriaii_hssi_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriaii " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile arriaii_pcie_hip library
+if ((-not $StopCompiling) -and $Arria)
+{ Write-Host "Compiling library 'arriaii_pcie_hip' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\arriaii_pcie_hip_components.vhd",
+ "$SourceDir\arriaii_pcie_hip_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriaii_pcie_hip " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile arriaiigz library
+if ((-not $StopCompiling) -and $Arria)
+{ Write-Host "Compiling library 'arriaiigz' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\arriaiigz_atoms.vhd",
+ "$SourceDir\arriaiigz_components.vhd",
+ "$SourceDir\arriaiigz_hssi_components.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriaiigz " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile arriav library
+if ((-not $StopCompiling) -and $Arria)
+{ Write-Host "Compiling library 'arriav' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\arriav_atoms.vhd",
+ "$SourceDir\arriav_components.vhd",
+ "$SourceDir\arriav_hssi_components.vhd",
+ "$SourceDir\arriav_hssi_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriav " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile arriavgz library
+if ((-not $StopCompiling) -and $Arria)
+{ Write-Host "Compiling library 'arriavgz' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\arriavgz_atoms.vhd",
+ "$SourceDir\arriavgz_components.vhd",
+ "$SourceDir\arriavgz_hssi_components.vhd",
+ "$SourceDir\arriavgz_hssi_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriavgz " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile arriavgz_pcie_hip library
+if ((-not $StopCompiling) -and $Arria)
+{ Write-Host "Compiling library 'arriavgz_pcie_hip' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\arriavgz_pcie_hip_components.vhd",
+ "$SourceDir\arriavgz_pcie_hip_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriavgz_pcie_hip " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile cycloneiv library
+if ((-not $StopCompiling) -and $Cyclon)
+{ Write-Host "Compiling library 'cycloneiv' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\cycloneiv_atoms.vhd",
+ "$SourceDir\cycloneiv_components.vhd",
+ "$SourceDir\cycloneiv_hssi_components.vhd",
+ "$SourceDir\cycloneiv_hssi_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cycloneiv " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile cycloneiv_pcie_hip library
+if ((-not $StopCompiling) -and $Cyclon)
+{ Write-Host "Compiling library 'cycloneiv_pcie_hip' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\cycloneiv_pcie_hip_components.vhd",
+ "$SourceDir\cycloneiv_pcie_hip_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cycloneiv_pcie_hip " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile cycloneive library
+if ((-not $StopCompiling) -and $Cyclon)
+{ Write-Host "Compiling library 'cycloneive' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\cycloneive_atoms.vhd",
+ "$SourceDir\cycloneive_components.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cycloneive " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile cyclonev library
+if ((-not $StopCompiling) -and $Cyclon)
+{ Write-Host "Compiling library 'cyclonev' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\cyclonev_atoms.vhd",
+ "$SourceDir\cyclonev_components.vhd",
+ "$SourceDir\cyclonev_hssi_components.vhd",
+ "$SourceDir\cyclonev_hssi_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cyclonev " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile stratixiv library
+if ((-not $StopCompiling) -and $Stratix)
+{ Write-Host "Compiling library 'stratixiv' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\stratixiv_atoms.vhd",
+ "$SourceDir\stratixiv_components.vhd",
+ "$SourceDir\stratixiv_hssi_components.vhd",
+ "$SourceDir\stratixiv_hssi_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixiv " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile stratixiv_pcie_hip library
+if ((-not $StopCompiling) -and $Stratix)
+{ Write-Host "Compiling library 'stratixiv_pcie_hip' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\stratixiv_pcie_hip_components.vhd",
+ "$SourceDir\stratixiv_pcie_hip_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixiv_pcie_hip " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile stratixv library
+if ((-not $StopCompiling) -and $Stratix)
+{ Write-Host "Compiling library 'stratixv' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\stratixv_atoms.vhd",
+ "$SourceDir\stratixv_components.vhd",
+ "$SourceDir\stratixv_hssi_components.vhd",
+ "$SourceDir\stratixv_hssi_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixv " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile stratixv_pcie_hip library
+if ((-not $StopCompiling) -and $Stratix)
+{ Write-Host "Compiling library 'stratixv_pcie_hip' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\stratixv_pcie_hip_components.vhd",
+ "$SourceDir\stratixv_pcie_hip_atoms.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixv_pcie_hip " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile fiftyfivenm library
+if ((-not $StopCompiling) -and $Nanometer)
+{ Write-Host "Compiling library 'fiftyfivenm' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Files = (
+ "$SourceDir\fiftyfivenm_atoms.vhd",
+ "$SourceDir\fiftyfivenm_components.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=fiftyfivenm " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile twentynm library
+if ((-not $StopCompiling) -and $Nanometer)
+{ Write-Host "Compiling library 'twentynm' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $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")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=twentynm " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+Write-Host "--------------------------------------------------------------------------------"
+Write-Host "Compiling Altera libraries " -NoNewline
+if ($StopCompiling)
+{ Write-Host "[FAILED]" -ForegroundColor Red }
+else
+{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
+
+# unload PowerShell modules
+Remove-Module shared
+Remove-Module config
+
+# restore working directory
+cd $WorkingDir
+
diff --git a/libraries/vendors/compile-osvvm.ps1 b/libraries/vendors/compile-osvvm.ps1
new file mode 100644
index 000000000..e1a559b5e
--- /dev/null
+++ b/libraries/vendors/compile-osvvm.ps1
@@ -0,0 +1,129 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Script: Script to compile the OSVVM library for GHDL on Windows
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a PowerShell 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.
+# ==============================================================================
+
+# .SYNOPSIS
+# This CmdLet compiles the OSVVM library.
+#
+# .DESCRIPTION
+# This CmdLet:
+# (1) creates a subdirectory in the current working directory
+# (2) compiles all OSVVM packages
+#
+[CmdletBinding()]
+param(
+ # Compile all libraries and packages.
+ [switch]$All = $true,
+
+ # Clean up directory before analyzing.
+ [switch]$Clean = $false,
+
+ # Skip warning messages. (Show errors only.)
+ [switch]$SuppressWarnings = $false
+)
+
+# ---------------------------------------------
+# save working directory
+$WorkingDir = Get-Location
+
+# load modules from GHDL's 'vendors' library directory
+Import-Module $PSScriptRoot\config.psm1
+Import-Module $PSScriptRoot\shared.psm1
+
+# extract data from configuration
+$SourceDir = $InstallationDirectory["OSVVM"]
+$DestinationDir = $DestinationDirectory["OSVVM"]
+
+if (-not $All)
+{ $All = $false }
+elseif ($All -eq $true)
+{ # nothing to configure
+}
+
+$StopCompiling = $false
+
+
+# define global GHDL Options
+$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--no-vital-checks", "--std=08")
+
+# create "osvvm" directory and change to it
+Write-Host "Creating vendor directory: '$DestinationDir'" -ForegroundColor Yellow
+mkdir $DestinationDir -ErrorAction SilentlyContinue | Out-Null
+cd $DestinationDir
+
+# Cleanup
+# ==============================================================================
+if ($Clean)
+{ Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow
+ rm *.cf
+}
+
+# compile osvvm library
+if (-not $StopCompiling)
+{ Write-Host "Compiling library 'osvvm' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $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")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+Write-Host "--------------------------------------------------------------------------------"
+Write-Host "Compiling OSVVM libraries " -NoNewline
+if ($StopCompiling)
+{ Write-Host "[FAILED]" -ForegroundColor Red }
+else
+{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
+
+# unload PowerShell modules
+Remove-Module shared
+Remove-Module config
+
+# restore working directory
+cd $WorkingDir
diff --git a/libraries/vendors/compile-vunit.ps1 b/libraries/vendors/compile-vunit.ps1
new file mode 100644
index 000000000..c1ff55ed4
--- /dev/null
+++ b/libraries/vendors/compile-vunit.ps1
@@ -0,0 +1,156 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Script: Script to compile the VUnit library for GHDL on Windows
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a PowerShell 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.
+# ==============================================================================
+
+# .SYNOPSIS
+# This CmdLet compiles the VUnit library.
+#
+# .DESCRIPTION
+# This CmdLet:
+# (1) creates a subdirectory in the current working directory
+# (2) compiles all VUnit packages
+#
+[CmdletBinding()]
+param(
+ # Compile all packages.
+ [switch]$All = $true,
+
+ # Clean up directory before analyzing.
+ [switch]$Clean = $false,
+
+ #Skip warning messages. (Show errors only.)
+ [switch]$SuppressWarnings = $false
+)
+
+# ---------------------------------------------
+# save working directory
+$WorkingDir = Get-Location
+
+# load modules from GHDL's 'vendors' library directory
+Import-Module $PSScriptRoot\config.psm1
+Import-Module $PSScriptRoot\shared.psm1
+
+# extract data from configuration
+$SourceDir = $InstallationDirectory["VUnit"]
+$DestinationDir = $DestinationDirectory["VUnit"]
+
+if (-not $All)
+{ $All = $false }
+elseif ($All -eq $true)
+{ # nothing to configure
+}
+
+$StopCompiling = $false
+
+
+# define global GHDL Options
+$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--no-vital-checks", "--std=08")
+
+# create "vunit" directory and change to it
+Write-Host "Creating vendor directory: '$DestinationDir'" -ForegroundColor Yellow
+mkdir $DestinationDir -ErrorAction SilentlyContinue | Out-Null
+cd $DestinationDir
+
+# Cleanup
+# ==============================================================================
+if ($Clean)
+{ Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow
+ rm *.cf
+}
+
+# compile vunit_lib library
+if (-not $StopCompiling)
+{ Write-Host "Compiling library 'vunit_lib' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $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")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=vunit_lib " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+Write-Host "--------------------------------------------------------------------------------"
+Write-Host "Compiling VUnit libraries " -NoNewline
+if ($StopCompiling)
+{ Write-Host "[FAILED]" -ForegroundColor Red }
+else
+{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
+
+# unload PowerShell modules
+Remove-Module shared
+Remove-Module config
+
+# restore working directory
+cd $WorkingDir
+
diff --git a/libraries/vendors/compile-xilinx-ise.ps1 b/libraries/vendors/compile-xilinx-ise.ps1
new file mode 100644
index 000000000..a993f83d9
--- /dev/null
+++ b/libraries/vendors/compile-xilinx-ise.ps1
@@ -0,0 +1,258 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Script: Script to compile the simulation libraries from Xilinx ISE
+# for GHDL on Windows
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a PowerShell 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.
+# ==============================================================================
+
+# .SYNOPSIS
+# This CmdLet compiles the simulation libraries from Xilinx.
+#
+# .DESCRIPTION
+# This CmdLet:
+# (1) creates a subdirectory in the current working directory
+# (2) compiles all Xilinx ISE simulation libraries and packages
+# - unisim (incl. secureip)
+# - unimacro
+# - simprim (incl. secureip)
+#
+[CmdletBinding()]
+param(
+ # Compile all libraries and packages.
+ [switch]$All = $null,
+
+ # Compile the Xilinx simulation library.
+ [switch]$Unisim = $false,
+
+ # Compile the Xilinx macro library.
+ [switch]$Unimacro = $false,
+
+ # Compile the Xilinx post-map simulation library.
+ [switch]$Simprim = $false,
+
+ # Compile the Xilinx secureip library.
+ [switch]$SecureIP = $false,
+
+ # Clean up directory before analyzing.
+ [switch]$Clean = $false,
+
+ # Skip warning messages. (Show errors only.)
+ [switch]$SuppressWarnings = $false
+)
+
+# ---------------------------------------------
+# save working directory
+$WorkingDir = Get-Location
+
+# load modules from GHDL's 'vendors' library directory
+Import-Module $PSScriptRoot\config.psm1
+Import-Module $PSScriptRoot\shared.psm1
+
+# extract data from configuration
+$SourceDir = $InstallationDirectory["XilinxISE"] + "\ISE_DS\ISE\vhdl\src"
+$DestinationDir = $DestinationDirectory["XilinxISE"]
+
+if (-not $All)
+{ $All = $false }
+elseif ($All -eq $true)
+{ $Unisim = $true
+ $Simprim = $true
+ $Unimacro = $true
+ $SecureIP = $true
+}
+$StopCompiling = $false
+
+
+# define global GHDL Options
+$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--no-vital-checks", "--warn-binding", "--mb-comments")
+
+# create "Xilinx" directory and change to it
+Write-Host "Creating vendor directory: '$DestinationDir'" -ForegroundColor Yellow
+mkdir $DestinationDir -ErrorAction SilentlyContinue | Out-Null
+cd $DestinationDir
+
+# Cleanup
+# ==============================================================================
+if ($Clean)
+{ Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow
+ rm *.cf
+}
+
+# Library UNISIM
+# ==============================================================================
+# compile unisim packages
+if ((-not $StopCompiling) -and $Unisim)
+{ Write-Host "Compiling library 'unisim' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = (
+ "$SourceDir\unisims\unisim_VPKG.vhd",
+ "$SourceDir\unisims\unisim_VCOMP.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile unisim primitives
+if ((-not $StopCompiling) -and $Unisim)
+{ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\unisims\primitive\*.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile unisim secureip primitives
+if ((-not $StopCompiling) -and $Unisim -and $SecureIP)
+{ Write-Host "Compiling library secureip primitives ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\unisims\secureip\*.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=secureip " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ #if ($StopCompiling) { break }
+ }
+}
+
+# Library UNIMACRO
+# ==============================================================================
+# compile unimacro packages
+if ((-not $StopCompiling) -and $Unimacro)
+{ Write-Host "Compiling library 'unimacro' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = @(
+ "$SourceDir\unimacro\unimacro_VCOMP.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile unimacro macros
+if ((-not $StopCompiling) -and $Unimacro)
+{ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\unimacro\*_MACRO.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# Library SIMPRIM
+# ==============================================================================
+# compile simprim packages
+if ((-not $StopCompiling) -and $Simprim)
+{ Write-Host "Compiling library 'simprim' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = (
+ "$SourceDir\simprims\simprim_Vpackage.vhd",
+ "$SourceDir\simprims\simprim_Vcomponents.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile simprim primitives
+if ((-not $StopCompiling) -and $Simprim)
+{ Write-Host "Compiling library 'simprim' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\simprims\primitive\other\*.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ #if ($StopCompiling) { break }
+ }
+}
+
+# compile simprim secureip primitives
+if ((-not $StopCompiling) -and $Simprim -and $SecureIP)
+{ Write-Host "Compiling secureip primitives ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\simprims\secureip\other\*.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ #if ($StopCompiling) { break }
+ }
+}
+
+Write-Host "--------------------------------------------------------------------------------"
+Write-Host "Compiling Xilinx ISE libraries " -NoNewline
+if ($StopCompiling)
+{ Write-Host "[FAILED]" -ForegroundColor Red }
+else
+{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
+
+# unload PowerShell modules
+Remove-Module shared
+Remove-Module config
+
+# restore working directory
+cd $WorkingDir
diff --git a/libraries/vendors/compile-xilinx-vivado.ps1 b/libraries/vendors/compile-xilinx-vivado.ps1
new file mode 100644
index 000000000..f70289c94
--- /dev/null
+++ b/libraries/vendors/compile-xilinx-vivado.ps1
@@ -0,0 +1,229 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Script: Script to compile the simulation libraries from Xilinx
+# Vivado for GHDL on Windows
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This is a PowerShell 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.
+# ==============================================================================
+
+# .SYNOPSIS
+# This CmdLet compiles the simulation libraries from Xilinx.
+#
+# .DESCRIPTION
+# This CmdLet:
+# (1) creates a subdirectory in the current working directory
+# (2) compiles all Xilinx Vivado simulation libraries and packages
+# - unisim (incl. secureip)
+# - unimacro
+#
+[CmdletBinding()]
+param(
+ # Compile all libraries and packages.
+ [switch]$All = $null,
+
+ # Compile the Xilinx simulation library.
+ [switch]$Unisim = $false,
+
+ # Compile the Xilinx macro library.
+ [switch]$Unimacro = $false,
+
+ # Compile the Xilinx secureip library.
+ [switch]$SecureIP = $false,
+
+ # Clean up directory before analyzing.
+ [switch]$Clean = $false,
+
+ # Skip warning messages. (Show errors only.)
+ [switch]$SuppressWarnings = $false
+)
+
+# ---------------------------------------------
+# save working directory
+$WorkingDir = Get-Location
+
+# load modules from GHDL's 'vendors' library directory
+Import-Module $PSScriptRoot\config.psm1
+Import-Module $PSScriptRoot\shared.psm1
+
+# extract data from configuration
+$SourceDir = $InstallationDirectory["XilinxVivado"] + "\data\vhdl\src"
+$DestinationDir = $DestinationDirectory["XilinxVivado"]
+
+if (-not $All)
+{ $All = $false }
+elseif ($All -eq $true)
+{ $Unisim = $true
+ $Simprim = $true
+ $Unimacro = $true
+ $SecureIP = $true
+}
+$StopCompiling = $false
+
+
+# define global GHDL Options
+$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--warn-binding", "--mb-comments")
+
+# create "Vivado" directory and change to it
+Write-Host "Creating vendor directory: '$DestinationDir'" -ForegroundColor Yellow
+mkdir $DestinationDir -ErrorAction SilentlyContinue | Out-Null
+cd $DestinationDir
+
+# Cleanup
+# ==============================================================================
+if ($Clean)
+{ Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow
+ rm *.cf
+}
+
+# Library UNISIM
+# ==============================================================================
+# compile unisim packages
+if ((-not $StopCompiling) -and $Unisim)
+{ Write-Host "Compiling library 'unisim' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--no-vital-checks"
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = (
+ "$SourceDir\unisims\unisim_VPKG.vhd",
+ "$SourceDir\unisims\unisim_VCOMP.vhd",
+ "$SourceDir\unisims\retarget_VCOMP.vhd",
+ "$SourceDir\unisims\unisim_retarget_VCOMP.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile unisim primitives
+if ((-not $StopCompiling) -and $Unisim)
+{ $Options = $GlobalOptions
+ $Options += "--no-vital-checks"
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\unisims\primitive\*.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile unisim retarget primitives
+if ((-not $StopCompiling) -and $Unisim)
+{ $Options = $GlobalOptions
+ $Options += "--no-vital-checks"
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\unisims\retarget\*.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing retarget primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ #if ($StopCompiling) { break }
+ }
+}
+
+# compile unisim secureip primitives
+if ((-not $StopCompiling) -and $Unisim -and $SecureIP)
+{ Write-Host "Compiling library secureip primitives ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\unisims\secureip\*.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=secureip " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# Library UNIMACRO
+# ==============================================================================
+# compile unimacro packages
+if ((-not $StopCompiling) -and $Unimacro)
+{ Write-Host "Compiling library 'unimacro' ..." -ForegroundColor Yellow
+ $Options = $GlobalOptions
+ $Options += "--no-vital-checks"
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = @(
+ "$SourceDir\unimacro\unimacro_VCOMP.vhd")
+ foreach ($File in $Files)
+ { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ if ($StopCompiling) { break }
+ }
+}
+
+# compile unimacro macros
+if ((-not $StopCompiling) -and $Unimacro)
+{ $Options = $GlobalOptions
+ $Options += "--no-vital-checks"
+ $Options += "--ieee=synopsys"
+ $Options += "--std=93c"
+ $Files = dir "$SourceDir\unimacro\*_MACRO.vhd*"
+ foreach ($File in $Files)
+ { Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File.FullName + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ $StopCompiling = ($LastExitCode -ne 0)
+ #if ($StopCompiling) { break }
+ }
+}
+
+# Library UNIFAST
+# ==============================================================================
+# TODO:
+
+Write-Host "--------------------------------------------------------------------------------"
+Write-Host "Compiling Xilinx Vivado libraries " -NoNewline
+if ($StopCompiling)
+{ Write-Host "[FAILED]" -ForegroundColor Red }
+else
+{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
+
+# unload PowerShell modules
+Remove-Module shared
+Remove-Module config
+
+# restore working directory
+cd $WorkingDir
+
diff --git a/libraries/vendors/config.psm1 b/libraries/vendors/config.psm1
new file mode 100644
index 000000000..85fd100fa
--- /dev/null
+++ b/libraries/vendors/config.psm1
@@ -0,0 +1,53 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Module: Configurable directories to local installed tools
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This PowerShell module 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.
+# ==============================================================================
+#
+# Configure your tools here. Use absolute paths, without trailing directory
+# delimiter. Empty strings indicate not installed tools
+$InstallationDirectory = @{
+ "AlteraQuartusII" = "C:\Altera\15.0";
+ "XilinxISE" = "C:\Xilinx\14.7";
+ "XilinxVivado" = "C:\Xilinx\Vivado\2015.3";
+ "OSVVM" = "D:\git\PoC\lib\osvvm";
+ "VUnit" = "D:\git\PoC\lib\vunit"
+}
+
+$DestinationDirectory = @{
+ "Altera" = "altera";
+ "XilinxISE" = "xilinx";
+ "XilinxVivado" = "vivado";
+ "OSVVM" = "osvvm";
+ "VUnit" = "vunit"
+}
+
+Export-ModuleMember -Variable 'InstallationDirectory'
+Export-ModuleMember -Variable 'DestinationDirectory'
diff --git a/libraries/vendors/shared.psm1 b/libraries/vendors/shared.psm1
new file mode 100644
index 000000000..9685f1f00
--- /dev/null
+++ b/libraries/vendors/shared.psm1
@@ -0,0 +1,135 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Module: The module provides common CmdLets for the library
+# pre-compilation process.
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This PowerShell module provides CommandLets (CmdLets) to handle the GHDL.exe
+# output streams (stdout and stderr).
+#
+# ==============================================================================
+# 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.
+# ==============================================================================
+function Restore-NativeCommandStream
+{ <#
+ .SYNOPSIS
+ This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs
+ as a single line.
+
+ .DESCRIPTION
+ This CmdLet collects multiple ErrorRecord objects and emits one String
+ object per line.
+
+ .PARAMETER InputObject
+ A object stream is required as an input.
+ #>
+ [CmdletBinding()]
+ param(
+ [Parameter(ValueFromPipeline=$true)]
+ $InputObject
+ )
+
+ begin
+ { $LineRemainer = "" }
+
+ process
+ { if (-not $InputObject)
+ { Write-Host "Empty pipeline!" }
+ elseif ($InputObject -is [System.Management.Automation.ErrorRecord])
+ { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError")
+ { Write-Output $InputObject.ToString() }
+ elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage")
+ { $NewLine = $LineRemainer + $InputObject.ToString()
+ while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1)
+ { Write-Output $NewLine.Substring(0, $NewLinePos)
+ $NewLine = $NewLine.Substring($NewLinePos + 1)
+ }
+ $LineRemainer = $NewLine
+ }
+ }
+ elseif ($InputObject -is [String])
+ { Write-Output $InputObject }
+ else
+ { Write-Host "Unsupported object in pipeline stream" }
+ }
+
+ end
+ { if ($LineRemainer -ne "")
+ { Write-Output $LineRemainer }
+ }
+}
+
+function Write-ColoredGHDLLine
+{ <#
+ .SYNOPSIS
+ This CmdLet colors GHDL output lines.
+
+ .DESCRIPTION
+ This CmdLet colors GHDL output lines. Warnings are prefixed with 'WARNING: '
+ in yellow and errors are prefixed with 'ERROR: ' in red.
+
+ .PARAMETER InputObject
+ A object stream is required as an input.
+
+ .PARAMETER SuppressWarnings
+ Skip warning messages. (Show errors only.)
+ #>
+ [CmdletBinding()]
+ param(
+ [Parameter(ValueFromPipeline=$true)]
+ $InputObject,
+
+ [Parameter(Position=1)]
+ [switch]$SuppressWarnings = $false
+ )
+
+ begin
+ { $ErrorRecordFound = $false }
+
+ process
+ { if (-not $InputObject)
+ { Write-Host "Empty pipeline!" }
+ elseif ($InputObject -is [String])
+ { if ($InputObject.Contains("warning"))
+ { if (-not $SuppressWarnings)
+ { Write-Host "WARNING: " -NoNewline -ForegroundColor Yellow
+ Write-Host $InputObject
+ }
+ }
+ else
+ { $ErrorRecordFound = $true
+ Write-Host "ERROR: " -NoNewline -ForegroundColor Red
+ Write-Host $InputObject
+ }
+ }
+ else
+ { Write-Host "Unsupported object in pipeline stream" }
+ }
+
+ end
+ { $ErrorRecordFound }
+}
+
+Export-ModuleMember -Function 'Restore-NativeCommandStream'
+Export-ModuleMember -Function 'Write-ColoredGHDLLine'