diff options
Diffstat (limited to 'libraries/vendors/compile-altera.ps1')
-rw-r--r-- | libraries/vendors/compile-altera.ps1 | 377 |
1 files changed, 202 insertions, 175 deletions
diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1 index e3de6e6eb..e301038f5 100644 --- a/libraries/vendors/compile-altera.ps1 +++ b/libraries/vendors/compile-altera.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 Altera Quartus for GHDL on Windows. +# # .DESCRIPTION # This CmdLet: # (1) creates a subdirectory in the current working directory @@ -51,85 +37,88 @@ # - 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 -Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "AlteraQuartus" -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("Altera Quartus", "$WorkingDir") +$EnableVerbose -and (Write-Host "Loading modules..." -ForegroundColor Gray ) | Out-Null +$EnableDebug -and (Write-Host " Import-Module $PSScriptRoot\config.psm1 -Verbose:`$$false -Debug:`$$false -ArgumentList `"AlteraQuartus`"" -ForegroundColor DarkGray ) | Out-Null +Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -ArgumentList "AlteraQuartus" +$EnableDebug -and (Write-Host " Import-Module $PSScriptRoot\shared.psm1 -Verbose:`$$false -Debug:`$$false -ArgumentList @(`"Altera Quartus`", `"$WorkingDir`")" -ForegroundColor DarkGray ) | Out-Null +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$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 -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') @@ -148,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 @@ -161,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 } @@ -190,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) } @@ -204,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) } @@ -222,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) } @@ -236,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) } @@ -249,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) } @@ -265,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 @@ -279,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 @@ -293,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 @@ -309,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 @@ -323,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 @@ -338,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 @@ -354,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 @@ -370,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 @@ -384,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 @@ -400,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 @@ -414,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 @@ -428,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 @@ -444,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 @@ -460,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 @@ -474,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 @@ -490,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 @@ -504,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 @@ -518,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 @@ -536,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 |