From f8a445ef12a8bcdc50a98da5b4909bf61f4628d8 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 2 Nov 2016 00:09:35 +0100 Subject: Added verbosity control for vendor compile scripts. --- libraries/vendors/compile-altera.ps1 | 55 ++++++++++++++++------------- libraries/vendors/compile-lattice.ps1 | 35 ++++++++++-------- libraries/vendors/compile-osvvm.ps1 | 9 ++++- libraries/vendors/compile-vunit.ps1 | 9 ++++- libraries/vendors/compile-xilinx-ise.ps1 | 25 ++++++++----- libraries/vendors/compile-xilinx-vivado.ps1 | 19 ++++++---- libraries/vendors/shared.psm1 | 34 +++++++++++++----- 7 files changed, 122 insertions(+), 64 deletions(-) (limited to 'libraries') diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1 index 80f36637e..bcbbcba0d 100644 --- a/libraries/vendors/compile-altera.ps1 +++ b/libraries/vendors/compile-altera.ps1 @@ -102,6 +102,13 @@ param( # save working directory $WorkingDir = Get-Location +# set default values +$EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] +$EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] +if ($EnableVerbose -eq $null) { $EnableVerbose = $false } +if ($EnableDebug -eq $null) { $EnableDebug = $false } +if ($EnableDebug -eq $true) { $EnableVerbose = $true } + # 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") @@ -187,7 +194,7 @@ if ((-not $StopCompiling) -and $Altera) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -201,7 +208,7 @@ if ((-not $StopCompiling) -and $Altera) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -219,7 +226,7 @@ if ((-not $StopCompiling) -and $Altera) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -233,7 +240,7 @@ if ((-not $StopCompiling) -and $Altera) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -246,7 +253,7 @@ if ((-not $StopCompiling) -and $Altera) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -262,7 +269,7 @@ if ((-not $StopCompiling) -and $Max) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -276,7 +283,7 @@ if ((-not $StopCompiling) -and $Max) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -290,7 +297,7 @@ if ((-not $StopCompiling) -and $Max) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -306,7 +313,7 @@ if ((-not $StopCompiling) -and $Arria) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -320,7 +327,7 @@ if ((-not $StopCompiling) -and $Arria) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -335,7 +342,7 @@ if ((-not $StopCompiling) -and $Arria) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -351,7 +358,7 @@ if ((-not $StopCompiling) -and $Arria) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -367,7 +374,7 @@ if ((-not $StopCompiling) -and $Arria) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -381,7 +388,7 @@ if ((-not $StopCompiling) -and $Arria) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -397,7 +404,7 @@ if ((-not $StopCompiling) -and $Cyclone) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -411,7 +418,7 @@ if ((-not $StopCompiling) -and $Cyclone) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -425,7 +432,7 @@ if ((-not $StopCompiling) -and $Cyclone) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -441,7 +448,7 @@ if ((-not $StopCompiling) -and $Cyclone) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -457,7 +464,7 @@ if ((-not $StopCompiling) -and $Stratix) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -471,7 +478,7 @@ if ((-not $StopCompiling) -and $Stratix) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -487,7 +494,7 @@ if ((-not $StopCompiling) -and $Stratix) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -501,7 +508,7 @@ if ((-not $StopCompiling) -and $Stratix) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -515,7 +522,7 @@ if ((-not $StopCompiling) -and $Nanometer) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -533,7 +540,7 @@ if ((-not $StopCompiling) -and $Nanometer) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } diff --git a/libraries/vendors/compile-lattice.ps1 b/libraries/vendors/compile-lattice.ps1 index 991cb7012..b73787032 100644 --- a/libraries/vendors/compile-lattice.ps1 +++ b/libraries/vendors/compile-lattice.ps1 @@ -113,6 +113,13 @@ param( # save working directory $WorkingDir = Get-Location +# set default values +$EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] +$EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] +if ($EnableVerbose -eq $null) { $EnableVerbose = $false } +if ($EnableDebug -eq $null) { $EnableDebug = $false } +if ($EnableDebug -eq $true) { $EnableVerbose = $true } + # load modules from GHDL's 'vendors' library directory Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "LatticeDiamond" Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("Lattice Diamond", "$WorkingDir") @@ -220,7 +227,7 @@ if ((-not $StopCompiling) -and $ec) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -231,7 +238,7 @@ if ((-not $StopCompiling) -and $ecp) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -242,7 +249,7 @@ if ((-not $StopCompiling) -and $ecp2) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -253,7 +260,7 @@ if ((-not $StopCompiling) -and $ecp3) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -264,7 +271,7 @@ if ((-not $StopCompiling) -and $ecp5u) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -275,7 +282,7 @@ if ((-not $StopCompiling) -and $lptm) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -286,7 +293,7 @@ if ((-not $StopCompiling) -and $lptm2) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -297,7 +304,7 @@ if ((-not $StopCompiling) -and $MachXO) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -308,7 +315,7 @@ if ((-not $StopCompiling) -and $MachXO2) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -319,7 +326,7 @@ if ((-not $StopCompiling) -and $machxo3l) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -330,7 +337,7 @@ if ((-not $StopCompiling) -and $sc) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -341,7 +348,7 @@ if ((-not $StopCompiling) -and $scm) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -352,7 +359,7 @@ if ((-not $StopCompiling) -and $xp) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -363,7 +370,7 @@ if ((-not $StopCompiling) -and $xp2) $SourceFiles = $FileLists[$Library] | % { "$SourceDirectory\$Library\src\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } diff --git a/libraries/vendors/compile-osvvm.ps1 b/libraries/vendors/compile-osvvm.ps1 index 3d4a1b28d..b10b9f7aa 100644 --- a/libraries/vendors/compile-osvvm.ps1 +++ b/libraries/vendors/compile-osvvm.ps1 @@ -71,6 +71,13 @@ param( # save working directory $WorkingDir = Get-Location +# set default values +$EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] +$EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] +if ($EnableVerbose -eq $null) { $EnableVerbose = $false } +if ($EnableDebug -eq $null) { $EnableDebug = $false } +if ($EnableDebug -eq $true) { $EnableVerbose = $true } + # load modules from GHDL's 'vendors' library directory Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "OSVVM" Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("OSVVM", "$WorkingDir") @@ -139,7 +146,7 @@ if ((-not $StopCompiling) -and $OSVVM) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } diff --git a/libraries/vendors/compile-vunit.ps1 b/libraries/vendors/compile-vunit.ps1 index 2f2732f31..0948dc5d0 100644 --- a/libraries/vendors/compile-vunit.ps1 +++ b/libraries/vendors/compile-vunit.ps1 @@ -71,6 +71,13 @@ param( # save working directory $WorkingDir = Get-Location +# set default values +$EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] +$EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] +if ($EnableVerbose -eq $null) { $EnableVerbose = $false } +if ($EnableDebug -eq $null) { $EnableDebug = $false } +if ($EnableDebug -eq $true) { $EnableVerbose = $true } + # load modules from GHDL's 'vendors' library directory Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "VUnit" Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("VUnit", "$WorkingDir") @@ -165,7 +172,7 @@ if ((-not $StopCompiling) -and $VUnit) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } diff --git a/libraries/vendors/compile-xilinx-ise.ps1 b/libraries/vendors/compile-xilinx-ise.ps1 index 51680def9..39d680128 100644 --- a/libraries/vendors/compile-xilinx-ise.ps1 +++ b/libraries/vendors/compile-xilinx-ise.ps1 @@ -98,6 +98,13 @@ if ($Help) # save working directory $WorkingDir = Get-Location +# set default values +$EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] +$EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] +if ($EnableVerbose -eq $null) { $EnableVerbose = $false } +if ($EnableDebug -eq $null) { $EnableDebug = $false } +if ($EnableDebug -eq $true) { $EnableVerbose = $true } + # load modules from GHDL's 'vendors' library directory Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -Debug:$false -ArgumentList "XilinxISE" Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -Debug:$false -ArgumentList @("Xilinx ISE", "$WorkingDir") @@ -186,7 +193,7 @@ if ((-not $StopCompiling) -and $Unisim) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -196,7 +203,7 @@ if ((-not $StopCompiling) -and $Unisim) $SourceFiles = dir "$SourceDirectory\unisims\primitive\*.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -206,7 +213,7 @@ if ((-not $StopCompiling) -and $Unisim -and $SecureIP) $SourceFiles = dir "$SourceDirectory\unisims\secureip\*.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -221,7 +228,7 @@ if ((-not $StopCompiling) -and $Unimacro) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -231,7 +238,7 @@ if ((-not $StopCompiling) -and $Unimacro) $SourceFiles = dir "$SourceDirectory\unimacro\*_MACRO.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -247,7 +254,7 @@ if ((-not $StopCompiling) -and $Simprim) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -257,7 +264,7 @@ if ((-not $StopCompiling) -and $Simprim) $SourceFiles = dir "$SourceDirectory\simprims\primitive\other\*.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -267,7 +274,7 @@ if ((-not $StopCompiling) -and $Simprim -and $SecureIP) $SourceFiles = dir "$SourceDirectory\simprims\secureip\other\*.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -291,7 +298,7 @@ if ((-not $StopCompiling) -and $CoreLib) } $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } diff --git a/libraries/vendors/compile-xilinx-vivado.ps1 b/libraries/vendors/compile-xilinx-vivado.ps1 index f65f7560c..2627298db 100644 --- a/libraries/vendors/compile-xilinx-vivado.ps1 +++ b/libraries/vendors/compile-xilinx-vivado.ps1 @@ -85,6 +85,13 @@ param( # save working directory $WorkingDir = Get-Location +# set default values +$EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] +$EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] +if ($EnableVerbose -eq $null) { $EnableVerbose = $false } +if ($EnableDebug -eq $null) { $EnableDebug = $false } +if ($EnableDebug -eq $true) { $EnableVerbose = $true } + # load modules from GHDL's 'vendors' library directory Import-Module $PSScriptRoot\config.psm1 -Verbose:$false -ArgumentList "XilinxVivado" Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList @("Xilinx Vivado", "$WorkingDir") @@ -174,7 +181,7 @@ if ((-not $StopCompiling) -and $Unisim) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -184,7 +191,7 @@ if ((-not $StopCompiling) -and $Unisim) $SourceFiles = dir "$SourceDirectory\unisims\primitive\*.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -194,7 +201,7 @@ if ((-not $StopCompiling) -and $Unisim) $SourceFiles = dir "$SourceDirectory\unisims\retarget\*.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -204,7 +211,7 @@ if ((-not $StopCompiling) -and $Unisim -and $SecureIP) $SourceFiles = dir "$SourceDirectory\unisims\secureip\*.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -219,7 +226,7 @@ if ((-not $StopCompiling) -and $Unimacro) $SourceFiles = $Files | % { "$SourceDirectory\$_" } $ErrorCount += 0 - Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PackageCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } @@ -229,7 +236,7 @@ if ((-not $StopCompiling) -and $Unimacro) $SourceFiles = dir "$SourceDirectory\unimacro\*_MACRO.vhd*" $ErrorCount += 0 - Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError + Start-PrimitiveCompilation $GHDLBinary $GHDLOptions $DestinationDirectory $Library $VHDLVersion $SourceFiles $HaltOnError -Verbose:$EnableVerbose -Debug:$EnableDebug $StopCompiling = $HaltOnError -and ($ErrorCount -ne 0) } diff --git a/libraries/vendors/shared.psm1 b/libraries/vendors/shared.psm1 index 1c693af73..9cc31b375 100644 --- a/libraries/vendors/shared.psm1 +++ b/libraries/vendors/shared.psm1 @@ -91,9 +91,9 @@ function Get-SourceDirectory ) if ($Source -ne "") - { $SourceDirectory = $Source } # TODO: remove trailing backslashes + { $SourceDirectory = $Source.TrimEnd("\") } elseif ($EnvSource -ne "") - { $SourceDirectory = $EnvSource } + { $SourceDirectory = $EnvSource } else { $SourceDirectory = (Get-VendorToolInstallationDirectory) + "\" + (Get-VendorToolSourceDirectory) } @@ -126,7 +126,7 @@ function Get-DestinationDirectory [string]$Output ) if ($Output -ne "") - { $DestinationDirectory = $Output } # TODO: remove trailing backslashes + { $DestinationDirectory = $Output.TrimEnd("\") } else { $DestinationDirectory = Get-VendorToolDestinationDirectory } @@ -268,17 +268,25 @@ function Start-PackageCompilation [Parameter(Mandatory=$true)][string[]]$SourceFiles, [Parameter(Mandatory=$true)][bool]$HaltOnError ) + # set default values + $EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] + $EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] + if ($EnableVerbose -eq $null) { $EnableVerbose = $false } + if ($EnableDebug -eq $null) { $EnableDebug = $false } + if ($EnableDebug -eq $true) { $EnableVerbose = $true } + $LibraryDirectory="$DestinationDirectory/$Library/$VHDLVersion" + $EnableDebug -and (Write-Host " mkdir $LibraryDirectory" -ForegroundColor DarkGray ) | Out-Null mkdir $LibraryDirectory -ErrorAction SilentlyContinue | Out-Null - echo $LibraryDirectory + $EnableDebug -and (Write-Host " cd $LibraryDirectory" -ForegroundColor DarkGray ) | Out-Null cd $LibraryDirectory Write-Host "Compiling library '$Library' ..." -ForegroundColor Yellow $ErrorCount = 0 foreach ($File in $SourceFiles) { Write-Host "Analyzing package file '$File'" -ForegroundColor DarkCyan $InvokeExpr = "$GHDLBinary " + ($GHDLOptions -join " ") + " --work=$Library " + $File + " 2>&1" - # Write-Host " $InvokeExpr" -ForegroundColor DarkGray - $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings + $EnableDebug -and (Write-Host " $InvokeExpr" -ForegroundColor DarkGray ) | Out-Null + $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings " " if ($LastExitCode -ne 0) { $ErrorCount += 1 if ($HaltOnError) @@ -319,17 +327,25 @@ function Start-PrimitiveCompilation [Parameter(Mandatory=$true)][string[]]$SourceFiles, [Parameter(Mandatory=$true)][bool]$HaltOnError ) + # set default values + $EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"] + $EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"] + if ($EnableVerbose -eq $null) { $EnableVerbose = $false } + if ($EnableDebug -eq $null) { $EnableDebug = $false } + if ($EnableDebug -eq $true) { $EnableVerbose = $true } + $LibraryDirectory="$DestinationDirectory/$Library/$VHDLVersion" + $EnableDebug -and (Write-Host " mkdir $LibraryDirectory" -ForegroundColor DarkGray ) | Out-Null mkdir $LibraryDirectory -ErrorAction SilentlyContinue | Out-Null - echo $LibraryDirectory + $EnableDebug -and (Write-Host " cd $LibraryDirectory" -ForegroundColor DarkGray ) | Out-Null cd $LibraryDirectory Write-Host "Compiling library '$Library' ..." -ForegroundColor Yellow $ErrorCount = 0 foreach ($File in $SourceFiles) { Write-Host "Analyzing primitive file '$File'" -ForegroundColor DarkCyan $InvokeExpr = "$GHDLBinary " + ($GHDLOptions -join " ") + " --work=$Library " + $File + " 2>&1" - # Write-Host " $InvokeExpr" -ForegroundColor DarkGray - $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings + $EnableDebug -and (Write-Host " $InvokeExpr" -ForegroundColor DarkGray ) | Out-Null + $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings " " if ($LastExitCode -ne 0) { $ErrorCount += 1 if ($HaltOnError) -- cgit v1.2.3