From 4d68bc3139f3fe6d6642b1d2df4bf9bf63711477 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 27 Oct 2016 23:09:05 +0200 Subject: VendorLib: Added switch to compile XilinxCoreLib for ISE. Adjusted behavior between PowerShell and Bash scripts. Updated embedded help pages. --- libraries/vendors/README.md | 16 ++++++---- libraries/vendors/compile-altera.ps1 | 10 +++--- libraries/vendors/compile-altera.sh | 40 ++++++++++++------------ libraries/vendors/compile-lattice.ps1 | 12 ++++---- libraries/vendors/compile-lattice.sh | 15 +++++---- libraries/vendors/compile-osvvm.ps1 | 10 +++--- libraries/vendors/compile-osvvm.sh | 18 +++++------ libraries/vendors/compile-vunit.ps1 | 10 +++--- libraries/vendors/compile-vunit.sh | 14 +++++---- libraries/vendors/compile-xilinx-ise.ps1 | 47 +++++++++++++++++++++++------ libraries/vendors/compile-xilinx-ise.sh | 34 ++++++++++++++++++--- libraries/vendors/compile-xilinx-vivado.ps1 | 4 +-- libraries/vendors/compile-xilinx-vivado.sh | 12 +++++--- libraries/vendors/config.psm1 | 8 ++--- libraries/vendors/config.sh | 3 +- libraries/vendors/shared.psm1 | 10 +++--- libraries/vendors/shared.sh | 7 +++-- 17 files changed, 168 insertions(+), 102 deletions(-) (limited to 'libraries') diff --git a/libraries/vendors/README.md b/libraries/vendors/README.md index d39b2d9ee..429cc54a5 100644 --- a/libraries/vendors/README.md +++ b/libraries/vendors/README.md @@ -40,6 +40,7 @@ lines with the help of grc/grcat ([generic colourizer][grc]). - unisim (incl. secureip) - unimacro - simprim (incl. secureip) + - xilinxcorelib - Xilinx Vivado (≥2014.1): - unisim (incl. secureip) - unimacro @@ -164,12 +165,12 @@ 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[AlteraQuartus]="/opt/Altera/16.0" +InstallationDirectory[LatticeDiamond]="/opt/Diamond/3.8_x64" InstallationDirectory[OSVVM]="/home//git/GitHub/osvvm" InstallationDirectory[VUnit]="/home//git/GitHub/vunit" InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7" -InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2015.2" +InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2016.3" ``` #### For Windows: `config.psm1` @@ -182,9 +183,9 @@ folder. Use an empty string `""` for not installed tools. ```PowerShell $InstallationDirectory = @{ "AlteraQuartus" = "C:\Altera\16.0"; - "LatticeDiamond" = "C:\Lattice\Diamond\3.7_x64"; + "LatticeDiamond" = "C:\Lattice\Diamond\3.8_x64"; "XilinxISE" = "C:\Xilinx\14.7\ISE_DS"; - "XilinxVivado" = "C:\Xilinx\Vivado\2016.2"; + "XilinxVivado" = "C:\Xilinx\Vivado\2016.3"; "OSVVM" = "D:\git\GitHub\osvvm"; "VUnit" = "D:\git\GitHub\vunit" } @@ -222,6 +223,7 @@ $InstallationDirectory = @{ --unisim Compile the unisim primitives --unimacro Compile the unimacro macros --simprim Compile the simprim primitives + --corelib Compile the xilinxcorelib macros --secureip Compile the secureip primitives Compile options: @@ -276,6 +278,7 @@ $InstallationDirectory = @{ -Unisim Compile the unisim primitives -Unimacro Compile the unimacro macros -Simprim Compile the simprim primitives + -CoreLib Compile the xilinxcorelib macros -Secureip Compile the secureip primitives Compile options: @@ -304,4 +307,5 @@ $InstallationDirectory = @{ -VUnit Compile the VUnit library. ------------------------ -Author: Patrick Lehmann (22.06.2016) +Author: Patrick Lehmann +Last update: 28.10.2016 diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1 index e45812538..80f36637e 100644 --- a/libraries/vendors/compile-altera.ps1 +++ b/libraries/vendors/compile-altera.ps1 @@ -15,7 +15,7 @@ # - compiles all Altera Quartus simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -103,11 +103,11 @@ param( $WorkingDir = Get-Location # load modules from GHDL's 'vendors' library directory -Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -ArgumentList "AlteraQuartus" -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList @("Altera Quartus", "$WorkingDir") +Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "AlteraQuartus" +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("Altera Quartus", "$WorkingDir") # Display help if no command was selected -$Help = $Help -or (-not ($All -or $Altera -or $Max -or $Cyclone -or $Arria -or $Stratix -or $Nanometer)) +$Help = $Help -or (-not ($All -or $Altera -or $Max -or $Cyclone -or $Arria -or $Stratix -or $Nanometer -or $Clean)) if ($Help) { Get-Help $MYINVOCATION.InvocationName -Detailed @@ -167,7 +167,7 @@ $ErrorCount = 0 # Cleanup directories # ============================================================================== if ($Clean) -{ Write-Host "[ERROR]: '-Clean' is not implemented!" +{ Write-Host "[ERROR]: '-Clean' is not implemented!" -ForegroundColor Red Exit-CompileScript -1 Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow diff --git a/libraries/vendors/compile-altera.sh b/libraries/vendors/compile-altera.sh index d6830abc6..c3daf4d94 100755 --- a/libraries/vendors/compile-altera.sh +++ b/libraries/vendors/compile-altera.sh @@ -16,7 +16,7 @@ # - compiles all Altera Quartus-II simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -146,36 +146,38 @@ if [ "$HELP" == "TRUE" ]; then echo " One library folder 'lib/v??' per VHDL library will be created relative to the current" echo " working directory." echo "" + echo " Use the adv. options or edit 'config.sh' to supply paths and default params." + echo "" echo "Usage:" echo " compile-altera.sh | [] []" echo "" echo "Common commands:" - echo " -h --help Print this help page" - echo " -c --clean Remove all generated files" + echo " -h --help Print this help page" + echo " -c --clean Remove all generated files" echo "" echo "Libraries:" - echo " -a --all Compile all Altera simulation libraries." - echo " --altera Compile the Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim." - echo " --max Compile the Altera Max device libraries." - echo " --cyclone Compile the Altera Cyclone device libraries." - echo " --arria Compile the Altera Arria device libraries." - echo " --stratix Compile the Altera Stratix device libraries." - echo " --nanometer Unknown device library." + echo " -a --all Compile all Altera simulation libraries." + echo " --altera Compile the Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim." + echo " --max Compile the Altera Max device libraries." + echo " --cyclone Compile the Altera Cyclone device libraries." + echo " --arria Compile the Altera Arria device libraries." + echo " --stratix Compile the Altera Stratix device libraries." + echo " --nanometer Unknown device library." echo "" echo "Library compile options:" - echo " --vhdl93 Compile the libraries with VHDL-93." - echo " --vhdl2008 Compile the libraries with VHDL-2008." - echo " -s --skip-existing Skip already compiled files (an *.o file exists)." - echo " -S --skip-largefiles Don't compile large files. Exclude *HSSI* and *HIP* files." - echo " -H --halt-on-error Halt on error(s)." + echo " --vhdl93 Compile the libraries with VHDL-93." + echo " --vhdl2008 Compile the libraries with VHDL-2008." + echo " -s --skip-existing Skip already compiled files (an *.o file exists)." + echo " -S --skip-largefiles Don't compile large files. Exclude *HSSI* and *HIP* files." + echo " -H --halt-on-error Halt on error(s)." echo "" echo "Advanced options:" - echo " --ghdl Path to GHDL's binary e.g. /usr/local/bin/ghdl." - echo " --out Name of the output directory." - echo " --src Path to the source directory." + echo " --ghdl Path to GHDL's binary directory, e.g. /usr/local/bin" + echo " --out Name of the output directory, e.g. xilinx-vivado" + echo " --src Path to the sources, e.g. /opt/altera/16.0/quartus/eda/sim_lib" echo "" echo "Verbosity:" - echo " -n --no-warnings Suppress all warnings. Show only error messages." + echo " -n --no-warnings Suppress all warnings. Show only error messages." echo "" exit 0 fi diff --git a/libraries/vendors/compile-lattice.ps1 b/libraries/vendors/compile-lattice.ps1 index c2c6069ca..991cb7012 100644 --- a/libraries/vendors/compile-lattice.ps1 +++ b/libraries/vendors/compile-lattice.ps1 @@ -15,7 +15,7 @@ # - compiles all Lattice Diamond simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -114,8 +114,8 @@ param( $WorkingDir = Get-Location # load modules from GHDL's 'vendors' library directory -Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -ArgumentList "LatticeDiamond" -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList @("Lattice Diamond", "$WorkingDir") +Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "LatticeDiamond" +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("Lattice Diamond", "$WorkingDir") # Display help if no command was selected $Help = $Help -or (-not ($All -or @@ -123,8 +123,8 @@ $Help = $Help -or (-not ($All -or ($lptm -or $lptm2) -or ($MachXO -or $MachXO2 -or $MachXO3L) -or ($sc -or $scm) -or - ($xp -or $xp2) - )) + ($xp -or $xp2) -or + $Clean)) if ($Help) { Get-Help $MYINVOCATION.InvocationName -Detailed @@ -205,7 +205,7 @@ $FileLists = @{ # Cleanup directories # ============================================================================== if ($Clean) -{ Write-Host "[ERROR]: '-Clean' is not implemented!" +{ Write-Host "[ERROR]: '-Clean' is not implemented!" -ForegroundColor Red Exit-CompileScript -1 Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow diff --git a/libraries/vendors/compile-lattice.sh b/libraries/vendors/compile-lattice.sh index 8e64b1898..b32871d00 100755 --- a/libraries/vendors/compile-lattice.sh +++ b/libraries/vendors/compile-lattice.sh @@ -17,7 +17,8 @@ # - compiles all Lattice Diamond simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann and Markus Koch +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany +# Copyright (C) 2015-2016 Markus Koch # # 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 @@ -126,6 +127,8 @@ if [ "$HELP" == "TRUE" ]; then echo " One library folder 'lib/v??' per VHDL library will be created relative to the current" echo " working directory." echo "" + echo " Use the adv. options or edit 'config.sh' to supply paths and default params." + echo "" echo "Usage:" echo " compile-lattice.sh | [] []" echo "" @@ -139,15 +142,15 @@ if [ "$HELP" == "TRUE" ]; then echo " \"$deviceList\"" echo "" echo "Library compile options:" - echo " --vhdl93 Compile the libraries with VHDL-93." - echo " --vhdl2008 Compile the libraries with VHDL-2008." + echo " --vhdl93 Compile the libraries with VHDL-93." + echo " --vhdl2008 Compile the libraries with VHDL-2008." echo " -s --skip-existing Skip already compiled files (an *.o file exists)." echo " -H --halt-on-error Halt on error(s)." echo "" echo "Advanced options:" - echo " --ghdl Path to GHDL's binary e.g. /usr/local/bin/ghdl." - echo " --out Name of the output directory." - echo " --src Path to the source directory." + echo " --ghdl Path to GHDL's binary directory, e.g. /usr/local/bin" + echo " --out Name of the output directory, e.g. xilinx-vivado" + echo " --src Path to the sources." echo "" echo "Verbosity:" echo " -n --no-warnings Suppress all warnings. Show only error messages." diff --git a/libraries/vendors/compile-osvvm.ps1 b/libraries/vendors/compile-osvvm.ps1 index e732d87ff..3d4a1b28d 100644 --- a/libraries/vendors/compile-osvvm.ps1 +++ b/libraries/vendors/compile-osvvm.ps1 @@ -14,7 +14,7 @@ # - compiles all OSVVM packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -72,11 +72,11 @@ param( $WorkingDir = Get-Location # load modules from GHDL's 'vendors' library directory -Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -ArgumentList "OSVVM" -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList @("OSVVM", "$WorkingDir") +Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "OSVVM" +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("OSVVM", "$WorkingDir") # Display help if no command was selected -$Help = $Help -or (-not ($All -or $OSVVM)) +$Help = $Help -or (-not ($All -or $OSVVM -or $Clean)) if ($Help) { Get-Help $MYINVOCATION.InvocationName -Detailed @@ -109,7 +109,7 @@ $ErrorCount = 0 # Cleanup directories # ============================================================================== if ($Clean) -{ Write-Host "[ERROR]: '-Clean' is not implemented!" +{ Write-Host "[ERROR]: '-Clean' is not implemented!" -ForegroundColor Red Exit-CompileScript -1 Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow diff --git a/libraries/vendors/compile-osvvm.sh b/libraries/vendors/compile-osvvm.sh index f9f3b05d3..4cd8ce670 100755 --- a/libraries/vendors/compile-osvvm.sh +++ b/libraries/vendors/compile-osvvm.sh @@ -15,7 +15,7 @@ # - compiles all OSVVM packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -119,20 +119,20 @@ if [ "$HELP" == "TRUE" ]; then echo " compile-osvvm.sh | [] []" echo "" echo "Common commands:" - echo " -h --help Print this help page" - echo " -c --clean Remove all generated files" + echo " -h --help Print this help page" + echo " -c --clean Remove all generated files" echo "" echo "Libraries:" - echo " -a --all Compile all libraries." - echo " --osvvm Compile library osvvm." + echo " -a --all Compile all libraries." + echo " --osvvm Compile library osvvm." echo "" echo "Library compile options:" - echo " -H --halt-on-error Halt on error(s)." + echo " -H --halt-on-error Halt on error(s)." echo "" echo "Advanced options:" - echo " --ghdl Path to GHDL's binary e.g. /usr/local/bin/ghdl." - echo " --out Name of the output directory." - echo " --src Path to the source directory." + echo " --ghdl Path to GHDL's binary directory, e.g. /usr/local/bin" + echo " --out Name of the output directory, e.g. vunit" + echo " --src Path to the sources." echo "" echo "Verbosity:" echo " -n --no-warnings Suppress all warnings. Show only error messages." diff --git a/libraries/vendors/compile-vunit.ps1 b/libraries/vendors/compile-vunit.ps1 index f17d151f8..2f2732f31 100644 --- a/libraries/vendors/compile-vunit.ps1 +++ b/libraries/vendors/compile-vunit.ps1 @@ -14,7 +14,7 @@ # - compiles all VUnit packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -72,11 +72,11 @@ param( $WorkingDir = Get-Location # load modules from GHDL's 'vendors' library directory -Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -ArgumentList "VUnit" -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList @("VUnit", "$WorkingDir") +Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "VUnit" +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("VUnit", "$WorkingDir") # Display help if no command was selected -$Help = $Help -or (-not ($All -or $VUnit)) +$Help = $Help -or (-not ($All -or $VUnit -or $Clean)) if ($Help) { Get-Help $MYINVOCATION.InvocationName -Detailed @@ -109,7 +109,7 @@ $ErrorCount = 0 # Cleanup directories # ============================================================================== if ($Clean) -{ Write-Host "[ERROR]: '-Clean' is not implemented!" +{ Write-Host "[ERROR]: '-Clean' is not implemented!" -ForegroundColor Red Exit-CompileScript -1 Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow diff --git a/libraries/vendors/compile-vunit.sh b/libraries/vendors/compile-vunit.sh index f5a7c64e0..0f98d2cd6 100755 --- a/libraries/vendors/compile-vunit.sh +++ b/libraries/vendors/compile-vunit.sh @@ -15,7 +15,7 @@ # - compiles all VUnit packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -113,6 +113,8 @@ if [ "$HELP" == "TRUE" ]; then echo " A library folder 'vunit/v08' will be created relative to the current" echo " working directory." echo "" + echo " Use the adv. options or edit 'config.sh' to supply paths and default params." + echo "" echo "Usage:" echo " compile-vunit.sh | [] []" echo "" @@ -121,16 +123,16 @@ if [ "$HELP" == "TRUE" ]; then echo " -c --clean Remove all generated files" echo "" echo "Libraries:" - echo " -a --all Compile all libraries." - echo " --vunit Compile library vunit_lib." + echo " -a --all Compile all libraries." + echo " --vunit Compile library vunit_lib." echo "" echo "Library compile options:" echo " -H --halt-on-error Halt on error(s)." echo "" echo "Advanced options:" - echo " --ghdl Path to GHDL's binary e.g. /usr/local/bin/ghdl." - echo " --out Name of the output directory." - echo " --src Path to the source directory." + echo " --ghdl Path to GHDL's binary directory, e.g. /usr/local/bin" + echo " --out Name of the output directory, e.g. vunit" + echo " --src Path to the sources." echo "" echo "Verbosity:" echo " -n --no-warnings Suppress all warnings. Show only error messages." diff --git a/libraries/vendors/compile-xilinx-ise.ps1 b/libraries/vendors/compile-xilinx-ise.ps1 index 1e47ea9fe..51680def9 100644 --- a/libraries/vendors/compile-xilinx-ise.ps1 +++ b/libraries/vendors/compile-xilinx-ise.ps1 @@ -15,7 +15,7 @@ # - compiles all Xilinx ISE simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -43,6 +43,7 @@ # - unisim (incl. secureip) # - unimacro # - simprim (incl. secureip) +# - xilinxcorelib # [CmdletBinding()] param( @@ -61,6 +62,9 @@ param( # Compile the Xilinx post-map simulation library. [switch]$Simprim = $false, + # Compile the Xilinx CoreLib simulation library. + [switch]$CoreLib = $false, + # Compile the Xilinx secureip library. [switch]$SecureIP = $false, @@ -95,21 +99,22 @@ if ($Help) $WorkingDir = Get-Location # load modules from GHDL's 'vendors' library directory -Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -ArgumentList "XilinxISE" -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList @("Xilinx ISE", "$WorkingDir") +Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "XilinxISE" +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("Xilinx ISE", "$WorkingDir") # Display help if no command was selected -$Help = $Help -or (-not ($All -or $Unisim -or $Simprim -or $Unimacro)) +$Help = $Help -or (-not ($All -or $Unisim -or $Simprim -or $Unimacro -or $CoreLib -or $Clean)) if ($Help) { Get-Help $MYINVOCATION.InvocationName -Detailed Exit-CompileScript } if ($All) -{ $Unisim = $true - $Simprim = $true - $Unimacro = $true - $SecureIP = $true +{ $Unisim = $true + $Simprim = $true + $Unimacro = $true + $CoreLib = $true + $SecureIP = $true } function Get-XilinxISEDirectory @@ -161,7 +166,7 @@ $ErrorCount = 0 # Cleanup directories # ============================================================================== if ($Clean) -{ Write-Host "[ERROR]: '-Clean' is not implemented!" +{ Write-Host "[ERROR]: '-Clean' is not implemented!" -ForegroundColor Red Exit-CompileScript -1 Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow @@ -266,6 +271,30 @@ if ((-not $StopCompiling) -and $Simprim -and $SecureIP) $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } +# Library XilinxCoreLib +# ============================================================================== +# compile CoreLib primitives +if ((-not $StopCompiling) -and $CoreLib) +{ $Library = "xilinxcorelib" + + $AnalyzeFile = "$SourceDirectory\XilinxCoreLib\vhdl_analyze_order" + if (-not (Test-Path $AnalyzeFile -PathType Leaf)) + { Write-Host "[ERROR]: Analyze file '$AnalyzeFile' not found!" + Exit-CompileScript -1 + } + + $AnalyzeOrder = Get-Content $AnalyzeFile -Encoding Ascii + $SourceFiles = @() + foreach ($line in $AnalyzeOrder) + { if (-not $line.StartsWith("#")) + { $SourceFiles += "$SourceDirectory\XilinxCoreLib\$line" } + } + + $ErrorCount += 0 + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) +} + Write-Host "--------------------------------------------------------------------------------" Write-Host "Compiling Xilinx ISE libraries " -NoNewline if ($ErrorCount -gt 0) diff --git a/libraries/vendors/compile-xilinx-ise.sh b/libraries/vendors/compile-xilinx-ise.sh index 67fb51074..25716aaf7 100755 --- a/libraries/vendors/compile-xilinx-ise.sh +++ b/libraries/vendors/compile-xilinx-ise.sh @@ -16,7 +16,7 @@ # - compiles all Xilinx ISE simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -80,6 +80,10 @@ while [[ $# > 0 ]]; do COMPILE_SIMPRIM=TRUE NO_COMMAND=0 ;; + --corelib) + COMPILE_CORELIB=TRUE + NO_COMMAND=0 + ;; --secureip) COMPILE_SECUREIP=TRUE ;; @@ -137,6 +141,8 @@ if [ "$HELP" == "TRUE" ]; then echo " One library folder 'lib/v??' per VHDL library will be created relative to the current" echo " working directory." echo "" + echo " Use the adv. options or edit 'config.sh' to supply paths and default params." + echo "" echo "Usage:" echo " compile-xilinx-ise.sh | [] []" echo "" @@ -149,6 +155,7 @@ if [ "$HELP" == "TRUE" ]; then echo " --unisim Compile the unisim library." echo " --unimacro Compile the unimacro library." echo " --simprim Compile the simprim library." + echo " --corelib Compile the corelib library." echo " --secureip Compile the secureip library." echo "" echo "Library compile options:" @@ -159,12 +166,12 @@ if [ "$HELP" == "TRUE" ]; then echo " -H --halt-on-error Halt on error(s)." echo "" echo "Advanced options:" - echo " --ghdl Path to GHDL's binary e.g. /usr/local/bin/ghdl." - echo " --out Name of the output directory." - echo " --src Path to the source directory." + echo " --ghdl Path to GHDL's binary directory, e.g. /usr/local/bin" + echo " --out Name of the output directory, e.g. xilinx-ise" + echo " --src Path to the sources, e.g. /opt/Xilinx/14.7/ISE_DS/ISE/vhdl/src" echo "" echo "Verbosity:" - echo " -n --no-warnings Suppress all warnings. Show only error messages." + echo " -n --no-warnings Suppress all warnings. Show only error messages." echo "" exit 0 fi @@ -173,6 +180,7 @@ if [ "$COMPILE_ALL" == "TRUE" ]; then COMPILE_UNISIM=TRUE COMPILE_UNIMACRO=TRUE COMPILE_SIMPRIM=TRUE + COMPILE_CORELIB=TRUE COMPILE_SECUREIP=TRUE fi @@ -339,6 +347,22 @@ if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_SIMPRIM" == "TRUE" ] && [ "$COMPILE_S GHDLCompileLibrary fi + +# Library corelib +# ============================================================================== +# compile corelib packages +if [ $STOPCOMPILING -eq 0 ] && [ "$COMPILE_CORELIB" == "TRUE" ]; then + Library="xilinxcorelib" + + # append absolute source path + SourceFiles=() + while IFS= read -r File; do + SourceFiles+=("$SourceDirectory/XilinxCoreLib/$File") + done < <(grep --no-filename -R '^[a-zA-Z]' "$SourceDirectory/XilinxCoreLib/vhdl_analyze_order") + + GHDLCompilePackages +fi + echo "--------------------------------------------------------------------------------" echo -n "Compiling Xilinx ISE libraries " diff --git a/libraries/vendors/compile-xilinx-vivado.ps1 b/libraries/vendors/compile-xilinx-vivado.ps1 index 63ab5be76..f65f7560c 100644 --- a/libraries/vendors/compile-xilinx-vivado.ps1 +++ b/libraries/vendors/compile-xilinx-vivado.ps1 @@ -15,7 +15,7 @@ # - compiles all Xilinx Vivado simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -152,7 +152,7 @@ $ErrorCount = 0 # Cleanup directories # ============================================================================== if ($Clean) -{ Write-Host "[ERROR]: '-Clean' is not implemented!" +{ Write-Host "[ERROR]: '-Clean' is not implemented!" -ForegroundColor Red Exit-CompileScript -1 Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow diff --git a/libraries/vendors/compile-xilinx-vivado.sh b/libraries/vendors/compile-xilinx-vivado.sh index 4ae2862fa..64e48c2b0 100755 --- a/libraries/vendors/compile-xilinx-vivado.sh +++ b/libraries/vendors/compile-xilinx-vivado.sh @@ -16,7 +16,7 @@ # - compiles all Xilinx Vivado simulation libraries and packages # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -126,13 +126,15 @@ if [ $NO_COMMAND -eq 1 ]; then fi if [ "$HELP" == "TRUE" ]; then - test $NO_COMMAND -eq 1 && echo 1>&2 -e "\n${COLORED_ERROR} No command selected." + test $NO_COMMAND -eq 1 && echo 1>&2 -e "/n${COLORED_ERROR} No command selected." echo "" echo "Synopsis:" echo " A script to compile the Xilinx Vivado simulation libraries for GHDL on Linux." echo " One library folder 'lib/v??' per VHDL library will be created relative to the current" echo " working directory." echo "" + echo " Use the adv. options or edit 'config.sh' to supply paths and default params." + echo "" echo "Usage:" echo " compile-xilinx-vivado.sh | [] []" echo "" @@ -154,9 +156,9 @@ if [ "$HELP" == "TRUE" ]; then echo " -H --halt-on-error Halt on error(s)." echo "" echo "Advanced options:" - echo " --ghdl Path to GHDL's binary e.g. /usr/local/bin/ghdl." - echo " --out Name of the output directory." - echo " --src Path to the source directory." + echo " --ghdl Path to GHDL's binary directory, e.g. /usr/local/bin" + echo " --out Name of the output directory, e.g. xilinx-vivado" + echo " --src Path to the sources, e.g. /opt/Xilinx/Vivado/2016.3/data/vhdl/src" echo "" echo "Verbosity:" echo " -n --no-warnings Suppress all warnings. Show only error messages." diff --git a/libraries/vendors/config.psm1 b/libraries/vendors/config.psm1 index 778687e96..0cd1511dd 100644 --- a/libraries/vendors/config.psm1 +++ b/libraries/vendors/config.psm1 @@ -13,7 +13,7 @@ # environment. # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -41,10 +41,10 @@ $Module_VendorToolName = $VendorToolName # Configure your tools here. Use absolute paths, without trailing directory # delimiter. Empty strings indicate not installed tools $InstallationDirectories = @{ - "AlteraQuartus" = "" # "C:\Altera\15.1\quartus"; - "LatticeDiamond" = "" # "C:\Lattice\Diamond\3.7_x64" + "AlteraQuartus" = "" # "C:\Altera\16.0\quartus"; + "LatticeDiamond" = "" # "C:\Lattice\Diamond\3.8_x64" "XilinxISE" = "" # "C:\Xilinx\14.7\ISE_DS"; - "XilinxVivado" = "" # "C:\Xilinx\Vivado\2016.1"; + "XilinxVivado" = "" # "C:\Xilinx\Vivado\2016.3"; "OSVVM" = "" # "C:\git\GitHub\osvvm"; "VUnit" = "" # "C:\git\GitHub\vunit" } diff --git a/libraries/vendors/config.sh b/libraries/vendors/config.sh index a1cafd662..357236f61 100644 --- a/libraries/vendors/config.sh +++ b/libraries/vendors/config.sh @@ -13,7 +13,7 @@ # This Bash file exports variables containing the users local tool environment. # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -67,4 +67,3 @@ SourceDirectories[VUnit]="vunit/vhdl" # input files greater than $LARGE_FILESIZE are skipped if '--skip-largefiles' is set LARGE_FILESIZE=125000 - diff --git a/libraries/vendors/shared.psm1 b/libraries/vendors/shared.psm1 index c15439fdf..1c693af73 100644 --- a/libraries/vendors/shared.psm1 +++ b/libraries/vendors/shared.psm1 @@ -14,7 +14,7 @@ # output streams (stdout and stderr). # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -66,7 +66,7 @@ function Exit-CompileScript if ($ExitCode -eq 0) { exit 0 } else - { Write-Host "[DEBUG]: HARD EXIT" -ForegroundColor Cyan + { Write-Host "[DEBUG]: HARD EXIT" -ForegroundColor Red exit $ExitCode } } @@ -159,11 +159,11 @@ function Get-GHDLBinary ) if ($GHDL -ne "") - { $GHDLBinary = $GHDL } + { $GHDLBinary = $GHDL.TrimEnd("\") + "\ghdl.exe" } elseif (Test-Path env:GHDL) - { $GHDLBinary = $env:GHDL } + { $GHDLBinary = $env:GHDL.TrimEnd("\") + "\ghdl.exe" } else - { $GHDLBinary = "ghdl.exe" } + { $GHDLBinary = "ghdl.exe" } if (-not (Test-Path $GHDLBinary -PathType Leaf)) { Write-Host "Use adv. options '-GHDL' to set the GHDL executable." -ForegroundColor Red diff --git a/libraries/vendors/shared.sh b/libraries/vendors/shared.sh index 689e78964..6b613ab17 100644 --- a/libraries/vendors/shared.sh +++ b/libraries/vendors/shared.sh @@ -12,7 +12,7 @@ # TODO # # ============================================================================== -# Copyright (C) 2015 Patrick Lehmann +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany # # 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 @@ -36,6 +36,7 @@ ANSI_YELLOW="\e[33m" ANSI_BLUE="\e[34m" ANSI_MAGENTA="\e[35m" ANSI_CYAN="\e[36;1m" +ANSI_DARKCYAN="\e[36m" ANSI_NOCOLOR="\e[0m" # red texts @@ -162,7 +163,7 @@ GHDLCompileLibrary() { elif [ $SKIP_LARGE_FILES -eq 1 ] && [ ${FileSize[0]} -gt $LARGE_FILESIZE ]; then echo -e "${ANSI_CYAN}Skipping large file '$File'${ANSI_NOCOLOR}" else - echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_NOCOLOR}" + echo -e "${ANSI_DARKCYAN}Analyzing file '$File'${ANSI_NOCOLOR}" $GHDLBinary -a ${GHDL_PARAMS[@]} --work=$Library "$File" 2>&1 | $GRC_COMMAND if [ $? -ne 0 ]; then let ERRORCOUNT++ @@ -185,7 +186,7 @@ GHDLCompilePackages() { if [ $SKIP_EXISTING_FILES -eq 1 ] && [ -e "${FileName%.*}.o" ]; then echo -e "${ANSI_CYAN}Skipping existing package '$File'${ANSI_NOCOLOR}" else - echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_NOCOLOR}" + echo -e "${ANSI_DARKCYAN}Analyzing package '$File'${ANSI_NOCOLOR}" $GHDLBinary -a ${GHDL_PARAMS[@]} --work=$Library "$File" 2>&1 | $GRC_COMMAND if [ $? -ne 0 ]; then let ERRORCOUNT++ -- cgit v1.2.3