diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-01-15 07:31:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 07:31:59 +0100 |
commit | d890f27e480cdb37428f1b7c4bb37475ed38348d (patch) | |
tree | ef94e9ac91446f661ede0db86cb295e9ec903477 /libraries/vendors/compile-intel.ps1 | |
parent | 4868294436574660552ccef50a5b0849559393de (diff) | |
download | ghdl-d890f27e480cdb37428f1b7c4bb37475ed38348d.tar.gz ghdl-d890f27e480cdb37428f1b7c4bb37475ed38348d.tar.bz2 ghdl-d890f27e480cdb37428f1b7c4bb37475ed38348d.zip |
Reworking pre-compile scripts for Windows (#1594)
* Updated pre-compile scripts for OSVVM.
* Reworked script for Vivado.
* Reworked script for ISE.
* Reworked UVVM compile script. Cannot be tested due to missing feature in GHDL see #1593.
* Reworked scripts for Altera, Intel and Lattice.
* Updated module imports.
* Adjusted warnings.
* Read OSVVM package files from compile-order file 'osvvm.pro'.
* Support OSVVM and OSVVMLibraries as source directory.
* Added support for OSVVM models to precompile script.
* First update to the pre-compile scripts documentation.
* Minimized file headers and redundant documentation. Using PowerShell's feature to document files, functions and modules.
* Updated README in precompile scripts directory.
* license: update headers of pyGHDL, scripts/windows, libraries/vendors
* Fixed ForegroundColor and InvocationName.
Co-authored-by: umarcor <unai.martinezcorral@ehu.eus>
Diffstat (limited to 'libraries/vendors/compile-intel.ps1')
-rw-r--r-- | libraries/vendors/compile-intel.ps1 | 380 |
1 files changed, 202 insertions, 178 deletions
diff --git a/libraries/vendors/compile-intel.ps1 b/libraries/vendors/compile-intel.ps1 index 8c1bfbf08..77d69a940 100644 --- a/libraries/vendors/compile-intel.ps1 +++ b/libraries/vendors/compile-intel.ps1 @@ -1,42 +1,28 @@ -# 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 Altera -# Quartus for GHDL on Windows -# -# Description: -# ------------------------------------ -# This is a PowerShell script (executable) which: -# - creates a subdirectory in the current working directory -# - compiles all Altera Quartus simulation libraries and packages +# Authors: +# Patrick Lehmann # # ============================================================================== -# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany -# Copyright (C) 2017 Patrick Lehmann - Freiburg, 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 -# 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. +# Copyright (C) 2017-2021 Patrick Lehmann - Boetzingen, Germany +# Copyright (C) 2015-2016 Patrick Lehmann - Dresden, Germany +# +# This program 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 of the License, or +# (at your option) any later version. +# +# This program 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 this program. If not, see <gnu.org/licenses>. # ============================================================================== # .SYNOPSIS -# This CmdLet compiles the simulation libraries from Altera. -# +# Script to compile the simulation libraries from Intel Quartus for GHDL on Windows. +# # .DESCRIPTION # This CmdLet: # (1) creates a subdirectory in the current working directory @@ -51,95 +37,95 @@ # - stratixiv, stratixiv_pcie_hip # - stratixv, stratixv_pcie_hip # - fiftyfivenm, twentynm -# +# [CmdletBinding()] param( # Show the embedded help page(s) - [switch]$Help = $false, - + [switch]$Help = $false, + # Compile all libraries and packages. - [switch]$All = $false, - + [switch]$All = $false, + # Compile the Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim - [switch]$Altera = $false, - + [switch]$Altera = $false, + # Compile the Altera Max device libraries - [switch]$Max = $false, - + [switch]$Max = $false, + # Compile the Altera Cyclone device libraries - [switch]$Cyclone = $false, - + [switch]$Cyclone = $false, + # Compile the Altera Arria device libraries - [switch]$Arria = $false, - + [switch]$Arria = $false, + # Compile the Altera Stratix device libraries - [switch]$Stratix = $false, - + [switch]$Stratix = $false, + # Unknown device library - [switch]$Nanometer = $false, - + [switch]$Nanometer = $false, + # Clean up directory before analyzing. - [switch]$Clean = $false, - + [switch]$Clean = $false, + # Set VHDL Standard to '93. - [switch]$VHDL93 = $false, + [switch]$VHDL93 = $false, # Set VHDL Standard to '08. - [switch]$VHDL2008 = $false, - + [switch]$VHDL2008 = $false, + # Skip warning messages. (Show errors only.) [switch]$SuppressWarnings = $false, # Halt on errors. - [switch]$HaltOnError = $false, - + [switch]$HaltOnError = $false, + # Set vendor library source directory. - [string]$Source = "", + [string]$Source = "", # Set output directory name. - [string]$Output = "", + [string]$Output = "", # Set GHDL binary directory. - [string]$GHDL = "" + [string]$GHDL = "" ) # --------------------------------------------- # save working directory -$WorkingDir = Get-Location +$WorkingDir = Get-Location # set default values -$EnableDebug = [bool]$PSCmdlet.MyInvocation.BoundParameters["Debug"] -$EnableVerbose = [bool]$PSCmdlet.MyInvocation.BoundParameters["Verbose"] -or $EnableDebug +$EnableDebug = [bool]$PSCmdlet.MyInvocation.BoundParameters["Debug"] +$EnableVerbose = [bool]$PSCmdlet.MyInvocation.BoundParameters["Verbose"] -or $EnableDebug # load modules from GHDL's 'vendors' library directory -$EnableVerbose -and (Write-Host "Loading modules..." -ForegroundColor Gray ) | Out-Null -$EnableDebug -and (Write-Host " Import-Module $PSScriptRoot\config.psm1 -Verbose:`$$false -Debug:`$$false -ArgumentList `"IntelQuartus`"" -ForegroundColor DarkGray ) | Out-Null +$EnableVerbose -and (Write-Host "Loading modules..." -ForegroundColor Gray ) | Out-Null +$EnableDebug -and (Write-Host " Import-Module $PSScriptRoot\config.psm1 -Verbose:`$$false -Debug:`$$false -ArgumentList `"IntelQuartus`"" -ForegroundColor DarkGray ) | Out-Null Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "IntelQuartus" -$EnableDebug -and (Write-Host " Import-Module $PSScriptRoot\shared.psm1 -Verbose:`$$false -Debug:`$$false -ArgumentList @(`"Intel Quartus Prime`", `"$WorkingDir`")" -ForegroundColor DarkGray ) | Out-Null +$EnableDebug -and (Write-Host " Import-Module $PSScriptRoot\shared.psm1 -Verbose:`$$false -Debug:`$$false -ArgumentList @(`"Intel Quartus Prime`", `"$WorkingDir`")" -ForegroundColor DarkGray ) | Out-Null Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("Intel Quartus Prime", "$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 -or $Clean)) if ($Help) -{ Get-Help $MYINVOCATION.InvocationName -Detailed +{ Get-Help $MYINVOCATION.MyCommand.Path -Detailed Exit-CompileScript } if ($All) -{ $Altera = $true - $Max = $true - $Cyclone = $true - $Arria = $true - $Stratix = $true - $Nanometer = $true +{ $Altera = $true + $Max = $true + $Cyclone = $true + $Arria = $true + $Stratix = $true + $Nanometer = $true } function Get-AlteraQuartusDirectory { if (Test-Path env:QUARTUS_ROOTDIR) - { return $QUARTUS_ROOTDIR + "\" + (Get-VendorToolSourceDirectory) } + { return $QUARTUS_ROOTDIR + "\" + (Get-VendorToolSourceDirectory) } else { $EnvSourceDir = "" foreach ($Drive in Get-PSDrive -PSProvider 'FileSystem') { $Path = $Drive.Name + ":\" + "Altera" if (Test-Path $Path -PathType Container) - { foreach ($Major in 16..13) - { foreach ($Minor in 3..0) + { foreach ($Major in 21..13) + { foreach ($Minor in 5..0) { $Dir = $Path + "\" + $Major + "." + $Minor + "\quartus" if (Test-Path $Dir -PathType Container) { $EnvSourceDir = $Dir + "\" + (Get-VendorToolSourceDirectory) @@ -151,10 +137,10 @@ function Get-AlteraQuartusDirectory } } } - -$SourceDirectory = Get-SourceDirectory $Source (Get-AlteraQuartusDirectory) -$DestinationDirectory = Get-DestinationDirectory $Output -$GHDLBinary = Get-GHDLBinary $GHDL + +$SourceDirectory = Get-SourceDirectory $Source (Get-AlteraQuartusDirectory) +$DestinationDirectory = Get-DestinationDirectory $Output +$GHDLBinary = Get-GHDLBinary $GHDL # create "Altera" directory and change to it New-DestinationDirectory $DestinationDirectory @@ -164,20 +150,44 @@ cd $DestinationDirectory $VHDLVersion,$VHDLStandard,$VHDLFlavor = Get-VHDLVariables $VHDL93 $VHDL2008 # define global GHDL Options -$GHDLOptions = @("-a", "--std=$VHDLStandard", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--ieee=$VHDLFlavor", "--no-vital-checks", "-P$DestinationDirectory") +$GHDLOptions = @( + "-a", + "-fexplicit", + "-frelaxed-rules", + "--mb-comments", + "-Wbinding" +) +if (-not $EnableDebug) +{ $GHDLOptions += @( + "-Wno-hide" + ) +} +if (-not ($EnableVerbose -or $EnableDebug)) +{ $GHDLOptions += @( + "-Wno-library", + "-Wno-others", + "-Wno-static" + ) +} +$GHDLOptions += @( + "--ieee=$VHDLFlavor", + "--no-vital-checks", + "--std=$VHDLStandard", + "-P$DestinationDirectory" +) # extract data from configuration -# $SourceDir = $InstallationDirectory["AlteraQuartus"] + "\quartus\eda\sim_lib" +# $SourceDir = $InstallationDirectory["AlteraQuartus"] + "\quartus\eda\sim_lib" -$StopCompiling = $false -$ErrorCount = 0 +$StopCompiling = $false +$ErrorCount = 0 # Cleanup directories # ============================================================================== if ($Clean) { Write-Host "[ERROR]: '-Clean' is not implemented!" -ForegroundColor Red Exit-CompileScript -1 - + Write-Host "Cleaning up vendor directory ..." -ForegroundColor Yellow rm *.cf } @@ -193,9 +203,8 @@ if ((-not $StopCompiling) -and $Altera) "220model.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + + $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -207,9 +216,8 @@ if ((-not $StopCompiling) -and $Altera) "sgate.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + + $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -225,9 +233,8 @@ if ((-not $StopCompiling) -and $Altera) "alt_dspbuilder_package.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + + $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -239,9 +246,8 @@ if ((-not $StopCompiling) -and $Altera) "altera_mf.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + + $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -252,9 +258,8 @@ if ((-not $StopCompiling) -and $Altera) "altera_lnsim_components.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + + $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -268,10 +273,11 @@ if ((-not $StopCompiling) -and $Max) "max_components.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile maxii library @@ -282,10 +288,11 @@ if ((-not $StopCompiling) -and $Max) "maxii_components.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile maxv library @@ -296,10 +303,11 @@ if ((-not $StopCompiling) -and $Max) "maxv_components.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile arriaii library @@ -312,10 +320,11 @@ if ((-not $StopCompiling) -and $Arria) "arriaii_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile arriaii_pcie_hip library @@ -326,10 +335,11 @@ if ((-not $StopCompiling) -and $Arria) "arriaii_pcie_hip_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile arriaiigz library @@ -341,10 +351,11 @@ if ((-not $StopCompiling) -and $Arria) "arriaiigz_hssi_components.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile arriav library @@ -357,10 +368,11 @@ if ((-not $StopCompiling) -and $Arria) "arriav_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile arriavgz library @@ -373,10 +385,11 @@ if ((-not $StopCompiling) -and $Arria) "arriavgz_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile arriavgz_pcie_hip library @@ -387,10 +400,11 @@ if ((-not $StopCompiling) -and $Arria) "arriavgz_pcie_hip_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile cycloneiv library @@ -403,10 +417,11 @@ if ((-not $StopCompiling) -and $Cyclone) "cycloneiv_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile cycloneiv_pcie_hip library @@ -417,10 +432,11 @@ if ((-not $StopCompiling) -and $Cyclone) "cycloneiv_pcie_hip_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile cycloneive library @@ -431,10 +447,11 @@ if ((-not $StopCompiling) -and $Cyclone) "cycloneive_components.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile cyclonev library @@ -447,10 +464,11 @@ if ((-not $StopCompiling) -and $Cyclone) "cyclonev_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile stratixiv library @@ -463,10 +481,11 @@ if ((-not $StopCompiling) -and $Stratix) "stratixiv_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile stratixiv_pcie_hip library @@ -477,10 +496,11 @@ if ((-not $StopCompiling) -and $Stratix) "stratixiv_pcie_hip_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile stratixv library @@ -493,10 +513,11 @@ if ((-not $StopCompiling) -and $Stratix) "stratixv_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile stratixv_pcie_hip library @@ -507,10 +528,11 @@ if ((-not $StopCompiling) -and $Stratix) "stratixv_pcie_hip_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile fiftyfivenm library @@ -521,10 +543,11 @@ if ((-not $StopCompiling) -and $Nanometer) "fiftyfivenm_components.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } # compile twentynm library @@ -539,17 +562,18 @@ if ((-not $StopCompiling) -and $Nanometer) "twentynm_hssi_atoms.vhd" ) $SourceFiles = $Files | % { "$SourceDirectory\$_" } - - $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug - $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + + if (Test-Path $SourceFiles[0]) + { $ErrorCount += Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $SuppressWarnings $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug + $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) + } } Write-Host "--------------------------------------------------------------------------------" Write-Host "Compiling Altera libraries " -NoNewline if ($ErrorCount -gt 0) -{ Write-Host "[FAILED]" -ForegroundColor Red } +{ Write-Host "[FAILED]" -ForegroundColor Red } else -{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green } +{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green } Exit-CompileScript |