aboutsummaryrefslogtreecommitdiffstats
path: root/libraries
diff options
context:
space:
mode:
authortgingold <tgingold@users.noreply.github.com>2016-06-24 15:44:38 +0200
committerGitHub <noreply@github.com>2016-06-24 15:44:38 +0200
commit10aa0ce818defb49f9602ec2c1f09af436830065 (patch)
treefdfb0c1ba2c8d12fea5f0eaedfc91b68e6d70edd /libraries
parent00bedc57ef340ed6271b695bf08b6d2ac7778edd (diff)
parentf4c8c6bc32d1d082dc1e3d3d35f40a5dc969ac7d (diff)
downloadghdl-10aa0ce818defb49f9602ec2c1f09af436830065.tar.gz
ghdl-10aa0ce818defb49f9602ec2c1f09af436830065.tar.bz2
ghdl-10aa0ce818defb49f9602ec2c1f09af436830065.zip
Merge pull request #95 from Paebbels/paebbels/compile-vendor-library
Added missing Lattice compile script.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/vendors/README.md154
-rw-r--r--libraries/vendors/compile-altera.ps14
-rwxr-xr-xlibraries/vendors/compile-altera.sh13
-rw-r--r--libraries/vendors/compile-lattice.ps1377
-rwxr-xr-xlibraries/vendors/compile-lattice.sh9
-rw-r--r--libraries/vendors/shared.psm12
-rw-r--r--libraries/vendors/shared.sh2
7 files changed, 495 insertions, 66 deletions
diff --git a/libraries/vendors/README.md b/libraries/vendors/README.md
index 31e455a4c..d39b2d9ee 100644
--- a/libraries/vendors/README.md
+++ b/libraries/vendors/README.md
@@ -1,14 +1,14 @@
## Compile Scripts for Vendor VHDL Libraries
-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.
+Vendors like Altera, Lattice and Xilinx have their own simulation libraries,
+especially for FPGA primitives, soft and hard macros. These libraries can not be
+shipped with GHDL, but we offer prepared compile scripts to pre-compile the
+vendor libraries, if the vendor tool is present on the computer.
There are also popular simulation and verification libraries like [OSVVM][osvvm]
-and [VUnit][vunit], which can be pre-compile.
+and [VUnit][vunit], which can be pre-compile, too.
-The compilation scripts are writen in shell languages: PowerShell for Windows
+The compilation scripts are writen in the 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/grcat ([generic colourizer][grc]).
@@ -52,84 +52,91 @@ lines with the help of grc/grcat ([generic colourizer][grc]).
- vunit_lib
---------------------------------------------------------------------
-### Compiling on Linux
+### Script Configuration
- - **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.
+The vendor library compile scripts need to know where the used / latest vendor
+tool chain is installed. Therefore, the script implement a default installation
+directory search as well as environment variable checks. If a vendor tool could
+not be detected or the script choses the wrong vendor library source directory,
+then it's possible to provide the path via `--source` or `-Source`.
- `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"
- ```
+The generated output is stored relative to the current working directory. The
+scripts create a sub-directory for each vendor. The default output directory can
+be overwritten by the parameter `--output` or `-Output`.
+
+To compile all source files with GHDL, the simulator executable is searched in
+`PATH`. The found default GHDL executable can be overwritten by setting the
+environment variable `GHDL` or by passing the parameter `--ghdl` or `-GHDL` to
+the scripts.
+
+If the vendor library compilation is used very often, we recommend to configure
+these parameters in `config.sh` or `config.psm1`, so the command line can be
+shortened to the essential parts.
+
+---------------------------------------------------------------------
+### Compiling on Linux
- - **Step 2 - Browse to your simulation working directory**
+ - **Step 0 - Configure the scripts (optional)**
+ See next section for how to configure `config.sh`.
+
+ - **Step 1 - Browse to your simulation working directory**
```Bash
$ cd <MySimulationFolder>
```
- - **Step 3 - Start the compilation script(s)**
+ - **Step 2 - 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
+ $ /usr/local/lib/ghdl/vendors/compile-altera.sh --all
+ $ /usr/local/lib/ghdl/vendors/compile-lattice.sh --all
+ $ /usr/local/lib/ghdl/vendors/compile-xilinx-ise.sh --all
+ $ /usr/local/lib/ghdl/vendors/compile-xilinx-vivado.sh --all
+ $ /usr/local/lib/ghdl/vendors/compile-osvvm.sh --all
+ $ /usr/local/lib/ghdl/vendors/compile-vunit.sh --all
```
+
+ In most cases GHDL is installed into `/usr/local/`. The scripts are
+ installed into the `lib` directory.
- - **Step 4 - Viewing the result**
- This creates vendor directories in your current working directory and compiles the vendor files into them.
+ - **Step 3 - 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:42 lattice
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
+ drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 xilinx-ise
+ drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 xilinx-vivado
```
+
---------------------------------------------------------------------
### 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. Use an
- empty string `""` for not installed tools.
-
- `config.psm1`:
- ```PowerShell
- $InstallationDirectory = @{
- "AlteraQuartusII" = "C:\Altera\15.0";
- "XilinxISE" = "C:\Xilinx\14.7";
- "XilinxVivado" = "C:\Xilinx\Vivado\2015.4";
- "OSVVM" = "D:\git\GitHub\osvvm";
- "VUnit" = "D:\git\GitHub\vunit"
- }
- ```
+ - **Step 0 - Configure the scripts (optional)**
+ See next section for how to configure `config.psm1`.
- - **Step 2 - Browse to your simulation working directory**
+ - **Step 1 - Browse to your simulation working directory**
```PowerShell
PS> cd <MySimulationFolder>
```
- - **Step 3 - Start the compilation script(s)**
+ - **Step 2 - Start the compilation script(s)**
```PowerShell
PS> <GHDL>\libraries\vendors\compile-altera.ps1 -All
+ PS> <GHDL>\libraries\vendors\compile-lattice.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.
+ - **Step 3 - Viewing the result**
+ This creates vendor directories in your current working directory and
+ compiles the vendor files into them.
```PowerShell
PS> dir
@@ -138,21 +145,60 @@ lines with the help of grc/grcat ([generic colourizer][grc]).
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 20.11.2015 19:33 <DIR> altera
+ d---- 20.11.2015 19:38 <DIR> lattice
d---- 20.11.2015 19:38 <DIR> osvvm
d---- 20.11.2015 19:45 <DIR> vunit_lib
d---- 20.11.2015 19:06 <DIR> xilinx-ise
d---- 20.11.2015 19:40 <DIR> xilinx-vivado
```
+---------------------------------------------------------------------
+### Configuration Files
+
+#### For Linux: `config.sh`
+
+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
+directories. Use an empty string `""` for not installed tools.
+
+`config.sh`:
+```Bash
+declare -A InstallationDirectory
+InstallationDirectory[AlteraQuartus]="/opt/Altera/15.0"
+InstallationDirectory[LatticeDiamond]="/opt/Diamond/3.7_x64"
+InstallationDirectory[OSVVM]="/home/<user>/git/GitHub/osvvm"
+InstallationDirectory[VUnit]="/home/<user>/git/GitHub/vunit"
+InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7"
+InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2015.2"
+```
+
+#### For Windows: `config.psm1`
+
+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. Use an empty string `""` for not installed tools.
+
+`config.psm1`:
+```PowerShell
+$InstallationDirectory = @{
+ "AlteraQuartus" = "C:\Altera\16.0";
+ "LatticeDiamond" = "C:\Lattice\Diamond\3.7_x64";
+ "XilinxISE" = "C:\Xilinx\14.7\ISE_DS";
+ "XilinxVivado" = "C:\Xilinx\Vivado\2016.2";
+ "OSVVM" = "D:\git\GitHub\osvvm";
+ "VUnit" = "D:\git\GitHub\vunit"
+}
+```
+
### Selectable Options for the Bash Scripts:
*First I should translate the scripts before writing the docu...*
- - Common parameters to all scripts:
+ - Common parameters to most scripts:
-h --help Print the embedded help page(s).
-c --clean Cleanup directory before analyzing.
- -n --no-warnings Don't show warnings. Report errors only.
+ -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.
@@ -196,10 +242,12 @@ lines with the help of grc/grcat ([generic colourizer][grc]).
Selectable libraries:
-a --all Compile all.
+ --osvvm Compile the OSVVM library.
- `compile-vunit.sh`
Selectable libraries:
-a --all Compile all.
+ --osvvm Compile the VUnit library.
### Selectable Options for the PowerShell Scripts:
@@ -248,10 +296,12 @@ lines with the help of grc/grcat ([generic colourizer][grc]).
Selectable libraries:
-All Compile all.
+ -OSVVM Compile the OSVVM library.
- `compile-vunit.ps1`
Selectable libraries:
-All Compile all.
+ -VUnit Compile the VUnit library.
------------------------
-Author: Patrick Lehmann (30.11.2015)
+Author: Patrick Lehmann (22.06.2016)
diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1
index 2f703e527..e4275e622 100644
--- a/libraries/vendors/compile-altera.ps1
+++ b/libraries/vendors/compile-altera.ps1
@@ -12,7 +12,7 @@
# ------------------------------------
# This is a PowerShell script (executable) which:
# - creates a subdirectory in the current working directory
-# - compiles all Altera Quartus-II simulation libraries and packages
+# - compiles all Altera Quartus simulation libraries and packages
#
# ==============================================================================
# Copyright (C) 2015-2016 Patrick Lehmann
@@ -39,7 +39,7 @@
# .DESCRIPTION
# This CmdLet:
# (1) creates a subdirectory in the current working directory
-# (2) compiles all Altera Quartus-II simulation libraries and packages
+# (2) compiles all Altera Quartus simulation libraries and packages
# o Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim
# o Altera device libraries:
# - arriaii, arriaii_pcie_hip, arriaiigz
diff --git a/libraries/vendors/compile-altera.sh b/libraries/vendors/compile-altera.sh
index e943dac3a..d6830abc6 100755
--- a/libraries/vendors/compile-altera.sh
+++ b/libraries/vendors/compile-altera.sh
@@ -113,10 +113,6 @@ while [[ $# > 0 ]]; do
;;
--vhdl2008)
VHDLStandard=2008
- echo 1>&2 -e "${COLORED_ERROR} VHDL-2008 is not yet supported by Altera.${ANSI_NOCOLOR}"
- echo 1>&2 -e "${ANSI_YELLOW}Possible workaround: ${ANSI_NOCOLOR}"
- echo 1>&2 -e "${ANSI_YELLOW} Compile 'std_logic_arith' and 'std_logic_unsigned' into library IEEE.${ANSI_NOCOLOR}"
- exit -1
;;
--ghdl)
GHDLBinDir="$2"
@@ -193,6 +189,11 @@ if [ "$COMPILE_ALL" == "TRUE" ]; then
COMPILE_NM=TRUE
fi
+if [ $VHDLStandard -eq 2008 ]; then
+ echo -e "${ANSI_RED}Not all Altera packages are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_NOCOLOR}"
+ HALT_ON_ERROR=0
+fi
+
DefaultDirectories=("/opt/Altera" "/opt/altera")
if [ ! -z $QUARTUS_ROOTDIR ]; then
EnvSourceDir=$QUARTUS_ROOTDIR/${SourceDirectories[AlteraQuartus]}
@@ -660,7 +661,7 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_STRATIX" == "TRUE" ] && [ $SKIP_LARGE
fi
# compile fiftyfivenm library
-if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NANOMETER" == "TRUE" ]; then
+if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NM" == "TRUE" ]; then
Library="fiftyfivenm"
Files=(
fiftyfivenm_atoms.vhd
@@ -676,7 +677,7 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NANOMETER" == "TRUE" ]; then
fi
# compile twentynm library
-if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NANOMETER" == "TRUE" ]; then
+if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_NM" == "TRUE" ]; then
Library="twentynm"
Files=(
twentynm_atoms.vhd
diff --git a/libraries/vendors/compile-lattice.ps1 b/libraries/vendors/compile-lattice.ps1
new file mode 100644
index 000000000..462685018
--- /dev/null
+++ b/libraries/vendors/compile-lattice.ps1
@@ -0,0 +1,377 @@
+# 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;
+#
+# ==============================================================================
+# Authors: Patrick Lehmann
+#
+# PowerShell Script: Script to compile the simulation libraries from Lattice
+# Diamond for GHDL on Windows
+#
+# Description:
+# ------------------------------------
+# This is a PowerShell script (executable) which:
+# - creates a subdirectory in the current working directory
+# - compiles all Lattice Diamond simulation libraries and packages
+#
+# ==============================================================================
+# Copyright (C) 2015-2016 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 Lattice.
+#
+# .DESCRIPTION
+# This CmdLet:
+# (1) creates a subdirectory in the current working directory
+# (2) compiles all Lattice Diamond simulation libraries and packages
+# o Lattice device libraries:
+# - EC, ECP, ECP2, ECP3, ECP5U
+# - LPTM, LPTM2
+# - MachXO, MachXO2, MachXO3L
+# - SC, SCM
+# - XP, XP2
+#
+[CmdletBinding()]
+param(
+ # Show the embedded help page(s)
+ [switch]$Help = $false,
+
+ # Compile all libraries and packages.
+ [switch]$All = $false,
+
+ # Compile the Lattice EC device libraries
+ [switch]$ec = $false,
+ # Compile the Lattice ECP device libraries
+ [switch]$ecp = $false,
+ # Compile the Lattice ECP2 device libraries
+ [switch]$ecp2 = $false,
+ # Compile the Lattice ECP3 device libraries
+ [switch]$ecp3 = $false,
+ # Compile the Lattice ECP5U device libraries
+ [switch]$ecp5u = $false,
+
+ # Compile the Lattice LPTM device libraries
+ [switch]$lptm = $false,
+ # Compile the Lattice LPTM2 device libraries
+ [switch]$lptm2 = $false,
+
+ # Compile the Lattice MachXO device libraries
+ [switch]$MachXO = $false,
+ # Compile the Lattice MachXO2 device libraries
+ [switch]$MachXO2 = $false,
+ # Compile the Lattice MachXO3L device libraries
+ [switch]$MachXO3L = $false,
+
+ # Compile the Lattice SC device libraries
+ [switch]$sc = $false,
+ # Compile the Lattice SCM device libraries
+ [switch]$scm = $false,
+
+ # Compile the Lattice XP device libraries
+ [switch]$xp = $false,
+ # Compile the Lattice XP2 device libraries
+ [switch]$xp2 = $false,
+
+ # Clean up directory before analyzing.
+ [switch]$Clean = $false,
+
+ # Set VHDL Standard to '93
+ [switch]$VHDL93 = $false,
+ # Set VHDL Standard to '08
+ [switch]$VHDL2008 = $false,
+
+ # Skip warning messages. (Show errors only.)
+ [switch]$SuppressWarnings = $false,
+ # Halt on errors
+ [switch]$HaltOnError = $false,
+
+ # Set vendor library source directory
+ [string]$Source = "",
+ # Set output directory name
+ [string]$Output = "",
+ # Set GHDL executable
+ [string]$GHDL = ""
+)
+
+# ---------------------------------------------
+# save working directory
+$WorkingDir = Get-Location
+
+# load modules from GHDL's 'vendors' library directory
+Import-Module $PSScriptRoot\config.psm1 -ArgumentList "LatticeDiamond"
+Import-Module $PSScriptRoot\shared.psm1 -ArgumentList @("Lattice Diamond", "$WorkingDir")
+
+# Display help if no command was selected
+$Help = $Help -or (-not ($All -or
+ ($ec -or $ecp -or $ecp2 -or $ecp3 -or $ecp5u) -or
+ ($lptm -or $lptm2) -or
+ ($MachXO -or $MachXO2 -or $MachXO3L) -or
+ ($sc -or $scm) -or
+ ($xp -or $xp2)
+ ))
+
+if ($Help)
+{ Get-Help $MYINVOCATION.InvocationName -Detailed
+ Exit-CompileScript
+}
+if ($All)
+{ $ec = $true
+ $ecp = $true
+ $ecp2 = $true
+ $ecp3 = $true
+ $ecp5u = $true
+ $lptm = $true
+ $lptm2 = $true
+ $MachXO = $true
+ $MachXO2 = $true
+ $MachXO3L = $true
+ $sc = $true
+ $scm = $true
+ $xp = $true
+ $xp2 = $true
+}
+
+function Get-LatticeDiamondDirectory
+{ if (Test-Path env:FOUNDRY)
+ { return $FOUNDRY + "\..\" + (Get-VendorToolSourceDirectory) }
+ else
+ { $EnvSourceDir = ""
+ foreach ($Drive in Get-DriveInfo)
+ { $Path = $Drive.Name + "Lattice\Diamond"
+ if (Test-Path $Path -PathType Container)
+ { foreach ($Major in 4..3)
+ { foreach ($Minor in 9..0)
+ { $Dir = $Path + "\" + $Major + "." + $Minor + "_x64"
+ if (Test-Path $Dir -PathType Container)
+ { $EnvSourceDir = $Dir + "\" + (Get-VendorToolSourceDirectory)
+ return $EnvSourceDir
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+$SourceDirectory = Get-SourceDirectory $Source (Get-LatticeDiamondDirectory)
+$DestinationDirectory = Get-DestinationDirectory $Output
+$GHDLBinary = Get-GHDLBinary $GHDL
+
+# create "Lattice" directory and change to it
+New-DestinationDirectory $DestinationDirectory
+cd $DestinationDirectory
+
+$VHDLVersion,$VHDLStandard,$VHDLFlavor = Get-VHDLVariables $VHDL93 $VHDL2008
+
+# define global GHDL Options
+$GHDLOptions = @("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--ieee=$VHDLFlavor", "--no-vital-checks", "--std=$VHDLStandard", "-P$DestinationDirectory")
+
+$StopCompiling = $false
+$ErrorCount = 0
+
+$FileLists = @{
+ "ec" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_LUT.vhd", "ORCA_MISC.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd");
+ "ecp" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_LUT.vhd", "ORCA_MISC.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd");
+ "ecp2" = @("ECP2_CMB.vhd", "ECP2_SEQ.vhd", "ECP2COMP.vhd", "ECP2_CNT.vhd", "ECP2_IO.vhd", "ECP2_LUT.vhd", "ECP2_MEM.vhd", "ECP2_MISC.vhd", "ECP2_MULT.vhd", "ECP2_SL.vhd");
+ "ecp3" = @("ECP3_CMB.vhd", "ECP3_SEQ.vhd", "ECP3COMP.vhd", "ECP3_CNT.vhd", "ECP3_IO.vhd", "ECP3_LUT.vhd", "ECP3_MEM.vhd", "ECP3_MISC.vhd", "ECP3_MULT.vhd", "ECP3_SL.vhd");
+ "ecp5u" = @("ECP5U_CMB.vhd", "ECP5U_SEQ.vhd", "ECP5UCOMP.vhd", "ECP5U_IO.vhd", "ECP5U_LUT.vhd", "ECP5U_MEM.vhd", "ECP5U_MISC.vhd", "ECP5U_SL.vhd", "gsr_pur_assign.vhd");
+ "lptm" = @("MACHXO_CMB.vhd", "MACHXO_SEQ.vhd", "MACHXOCOMP.vhd", "MACHXO_CNT.vhd", "MACHXO_IO.vhd", "MACHXO_LUT.vhd", "MACHXO_MEM.vhd", "MACHXO_MISC.vhd");
+ "lptm2" = @("MACHXO2_CMB.vhd", "MACHXO2_SEQ.vhd", "MACHXO2COMP.vhd", "gsr_pur_assign.vhd", "MACHXO2_CNT.vhd", "MACHXO2_IO.vhd", "MACHXO2_LUT.vhd", "MACHXO2_MEM.vhd", "MACHXO2_MISC.vhd");
+ "machxo" = @("MACHXO_CMB.vhd", "MACHXO_SEQ.vhd", "MACHXOCOMP.vhd", "MACHXO_CNT.vhd", "MACHXO_IO.vhd", "MACHXO_LUT.vhd", "MACHXO_MEM.vhd", "MACHXO_MISC.vhd");
+ "machxo2" = @("MACHXO2_CMB.vhd", "MACHXO2_SEQ.vhd", "MACHXO2COMP.vhd", "MACHXO2_CNT.vhd", "gsr_pur_assign.vhd", "MACHXO2_IO.vhd", "MACHXO2_LUT.vhd", "MACHXO2_MEM.vhd", "MACHXO2_MISC.vhd");
+ "machxo3l" = @("MACHXO3L_CMB.vhd", "MACHXO3L_SEQ.vhd", "MACHXO3LCOMP.vhd", "gsr_pur_assign.vhd", "MACHXO3L_CNT.vhd", "MACHXO3L_IO.vhd", "MACHXO3L_LUT.vhd", "MACHXO3L_MEM.vhd", "MACHXO3L_MISC.vhd");
+ "sc" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd", "ORCA_MIS.vhd", "ORCA_SL.vhd");
+ "scm" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd", "ORCA_MIS.vhd", "ORCA_SL.vhd");
+ "xp" = @("ORCA_CMB.vhd", "ORCA_SEQ.vhd", "ORCACOMP.vhd", "ORCA_LUT.vhd", "ORCA_MISC.vhd", "ORCA_CNT.vhd", "ORCA_IO.vhd", "ORCA_MEM.vhd");
+ "xp2" = @("XP2_CMB.vhd", "XP2_SEQ.vhd", "XP2COMP.vhd", "XP2_CNT.vhd", "XP2_IO.vhd", "XP2_LUT.vhd", "XP2_MEM.vhd", "XP2_MISC.vhd", "XP2_MULT.vhd", "XP2_SL.vhd")
+}
+
+# Cleanup directories
+# ==============================================================================
+if ($Clean)
+{ Write-Host "[ERROR]: '-Clean' is not implemented!"
+ Exit-CompileScript -1
+
+ Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow
+ rm *.cf
+}
+
+
+# Lattice EC library
+# ==============================================================================
+if ((-not $StopCompiling) -and $ec)
+{ $Library = "ec"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice ECP library
+# ==============================================================================
+if ((-not $StopCompiling) -and $ecp)
+{ $Library = "ecp"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice ECP2 library
+# ==============================================================================
+if ((-not $StopCompiling) -and $ecp2)
+{ $Library = "ecp2"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice ECP3 library
+# ==============================================================================
+if ((-not $StopCompiling) -and $ecp3)
+{ $Library = "ecp3"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice ECP5U library
+# ==============================================================================
+if ((-not $StopCompiling) -and $ecp5u)
+{ $Library = "ecp5u"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice LPTM library
+# ==============================================================================
+if ((-not $StopCompiling) -and $lptm)
+{ $Library = "lptm"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice LPTM2 library
+# ==============================================================================
+if ((-not $StopCompiling) -and $lptm2)
+{ $Library = "lptm2"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice MachXO library
+# ==============================================================================
+if ((-not $StopCompiling) -and $MachXO)
+{ $Library = "MachXO"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice MachXO2 library
+# ==============================================================================
+if ((-not $StopCompiling) -and $MachXO2)
+{ $Library = "MachXO2"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice MachXO3L library
+# ==============================================================================
+if ((-not $StopCompiling) -and $machxo3l)
+{ $Library = "machxo3l"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice SC library
+# ==============================================================================
+if ((-not $StopCompiling) -and $sc)
+{ $Library = "sc"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice SCM library
+# ==============================================================================
+if ((-not $StopCompiling) -and $scm)
+{ $Library = "scm"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice XP library
+# ==============================================================================
+if ((-not $StopCompiling) -and $xp)
+{ $Library = "xp"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+# Lattice XP2 library
+# ==============================================================================
+if ((-not $StopCompiling) -and $xp2)
+{ $Library = "xp2"
+ $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" }
+
+ $ErrorCount += 0
+ Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError
+ $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0)
+}
+
+Write-Host "--------------------------------------------------------------------------------"
+Write-Host "Compiling Lattice libraries " -NoNewline
+if ($ErrorCount -gt 0)
+{ Write-Host "[FAILED]" -ForegroundColor Red }
+else
+{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
+
+Exit-CompileScript
diff --git a/libraries/vendors/compile-lattice.sh b/libraries/vendors/compile-lattice.sh
index 57d7f883a..8e64b1898 100755
--- a/libraries/vendors/compile-lattice.sh
+++ b/libraries/vendors/compile-lattice.sh
@@ -93,10 +93,6 @@ while [[ $# > 0 ]]; do
;;
--vhdl2008)
VHDLStandard=2008
- echo 1>&2 -e "${COLORED_ERROR} VHDL-2008 is not yet supported by Lattice.${ANSI_NOCOLOR}"
- # echo 1>&2 -e "${ANSI_YELLOW}Possible workaround: ${ANSI_NOCOLOR}"
- # echo 1>&2 -e "${ANSI_YELLOW} Compile 'std_logic_arith' and 'std_logic_unsigned' into library IEEE.${ANSI_NOCOLOR}"
- exit -1
;;
--ghdl)
GHDLBinDir="$2"
@@ -177,6 +173,11 @@ else
done
fi
+if [ $VHDLStandard -eq 2008 ]; then
+ echo -e "${ANSI_RED}Not all Lattice packages are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_NOCOLOR}"
+ HALT_ON_ERROR=0
+fi
+
# -> $SourceDirectories
# -> $DestinationDirectories
# -> $SrcDir
diff --git a/libraries/vendors/shared.psm1 b/libraries/vendors/shared.psm1
index 97a196fd3..912f86be4 100644
--- a/libraries/vendors/shared.psm1
+++ b/libraries/vendors/shared.psm1
@@ -14,7 +14,7 @@
# output streams (stdout and stderr).
#
# ==============================================================================
-# Copyright (C) 2015 Patrick Lehmann
+# Copyright (C) 2015-2016 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
diff --git a/libraries/vendors/shared.sh b/libraries/vendors/shared.sh
index 0193223e5..689e78964 100644
--- a/libraries/vendors/shared.sh
+++ b/libraries/vendors/shared.sh
@@ -143,7 +143,7 @@ GHDLSetup() {
elif [ $VHDLStandard -eq 2008 ]; then
VHDLVersion="v08"
VHDLStandard="08"
- VHDLFlavor="standard"
+ VHDLFlavor="synopsys"
fi
}