aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@tu-dresden.de>2016-06-07 20:54:10 +0200
committertgingold <tgingold@users.noreply.github.com>2016-06-07 20:54:10 +0200
commita41a009f2ebec350f0ebbcbf8353223a15cfa557 (patch)
tree44e1d7374c4aa7bea4f8541296f18c70b087682d
parent20259a7f396e03c5bfce9237fd5732eb931e3d23 (diff)
downloadghdl-a41a009f2ebec350f0ebbcbf8353223a15cfa557.tar.gz
ghdl-a41a009f2ebec350f0ebbcbf8353223a15cfa557.tar.bz2
ghdl-a41a009f2ebec350f0ebbcbf8353223a15cfa557.zip
Paebbels/master (#75)
* Obviously, this is the initial commit on a .gitignore file. * Implemented vendor specific compile scripts for: Altera Quartus-II (tested with 15.0), Xilinx ISE (tested with 14.7) and OSVVM. * Minor fixes. * First version of a README file for the vendor specific library compile scripts. * Vendor specific simulation library compile scripts: Improved error handling by stream processing. Extracted configuration into a config.ps1 file. * Minor fixes. * Added Unisim SecureIP primitives. Added Unimacro library. * Fixed file encoding of compile-osvvm.ps1. Implemented a 'advanced functions' to restore ghdl warning/error messages as a one-liner. * Splitted Xilinx compile scripts into *-ise.ps1 and *-vivado.ps1. * Added compile script for VUnit. * Updated README.md for the vendor compile scripts. * Added file headers. Change config.ps1 and shared.ps1 to a PowerShell module (*.psm1). * Fixed embedded help pages in all compile scripts. * Fixed all errors in compile script for Vivado simulation libraries: *_retarget_VCOMP.vhd was missing. * First steps towards compile scripts for Linux. * Translated lines from Windows script to Linux script. * Step 3 - colors and basic control blocks. * Changed copyright line in file header. * Changed copyright line in file header. * Added colorizer rules. Added skip mode for existing object files. Added cleanup mode. * Disabled vital checks in Xilinx's simprim library. Fixed typo. * Added '-Clean' parameter to cleanup the directory before analyzing. * Added a new '-Help' switch to all compile scripts to show the embedded help page(s). * Generalized config.sh. Fixed some bugs in compile-xilinx-ise.sh. * Added command line argument parsing. * Fixed syntax errors on Linux. * Added --all option. Generalized GHDL parameters. * Added '--skip-largefile' option. * Added the 'stop compiling' feature (not working). * Updated README.md for vendor specific compile scripts. * Implemented a check if grcat is installed on the system. Added support to execute the script from an other directory. Changed file size test from 'du -b' to 'wc -b'. * Fixed exit code problem in pipes. Fixed word count problem. * Minor fixes. * Fixed possible syntax error. * Implemented vendor specific library compile script for OSVVM. * Implemented vendor specific library compile script for VUnit. * Enabled disabled messages. Fixed typos. * Implemented vendor specific library compile script for Xilinx Vivado. * Minor fixes. * Implemented vendor specific library compile script for Altera Quartus-II. * Applied chmod to all new compile scripts. * Minor fixes. * Fixed typos. * Implemented 'halt-on-error' feature. * Fixed relative path problem for grcat. * README updates. * Updated PoSh scripts for - IEEE library compilation (complib.ps1) - added VITAL2000 support for VHDL-2008 - minor fixes - vendor compile scripts - added VHDL93 and VHDL2008 switches to compile vendor libraries with VHDL-2008 - minor fixes * Updated vendor library compile scripts (Bash) for Linux, too. * Fixed error in vendor library compile scripts for osvvm and vunit. * Windows compile scripts for mcode backend: Reworked compile.ps1. * Changed default output directory to xilinx-ise and xilinx-vivado. * compile-altera.sh: Skip large files * Updated compile script for OSVVM. * Improved OSVVM compile script for Linux.
-rw-r--r--dist/mcode/winbuild.ps147
-rw-r--r--dist/mcode/windows/compile.ps1362
-rw-r--r--dist/mcode/windows/complib.ps115
-rw-r--r--dist/mcode/windows/shared.psm1147
-rw-r--r--dist/mcode/windows/targets.psm1465
-rw-r--r--libraries/vendors/README.md79
-rw-r--r--libraries/vendors/compile-altera.ps1248
-rwxr-xr-xlibraries/vendors/compile-altera.sh306
-rwxr-xr-xlibraries/vendors/compile-lattice.sh5
-rw-r--r--libraries/vendors/compile-osvvm.ps158
-rwxr-xr-xlibraries/vendors/compile-osvvm.sh176
-rw-r--r--libraries/vendors/compile-vunit.ps1110
-rwxr-xr-xlibraries/vendors/compile-vunit.sh124
-rw-r--r--libraries/vendors/compile-xilinx-ise.ps1146
-rwxr-xr-xlibraries/vendors/compile-xilinx-ise.sh117
-rw-r--r--libraries/vendors/compile-xilinx-vivado.ps1122
-rwxr-xr-xlibraries/vendors/compile-xilinx-vivado.sh95
-rw-r--r--libraries/vendors/config.psm18
-rw-r--r--libraries/vendors/config.sh37
19 files changed, 1923 insertions, 744 deletions
diff --git a/dist/mcode/winbuild.ps1 b/dist/mcode/winbuild.ps1
index 50ec438c1..19accd514 100644
--- a/dist/mcode/winbuild.ps1
+++ b/dist/mcode/winbuild.ps1
@@ -93,18 +93,20 @@ $Script_WorkingDir = Get-Location
$GHDLRootDir_AbsPath = Convert-Path (Resolve-Path ($PSScriptRoot + "\" + $Script_RelPathToRoot))
# configure some variables: paths, executables, directory names, ...
-$WindowsDirName = "dist\mcode\windows"
-$BuildDirName = "dist\mcode\build"
-$LibraryDirName = "dist\mcode\lib"
-$ZipPackageDirName = "dist\mcode\zip"
-$ZipPackageFileName = "dist\mcode\ghdl-install.zip"
+$WindowsDirName = "dist\mcode\windows"
+$BuildDirName = "dist\mcode\build"
+$CompiledLibraryDirName = "dist\mcode\lib"
+$ZipPackageDirName = "dist\mcode\zip"
+$ZipPackageFileName = "dist\mcode\ghdl-install.zip"
+$VendorLibraryDirName = "libraries\vendors"
# construct directories
-$GHDLWindowsDir = $GHDLRootDir_AbsPath + "\" + $WindowsDirName
-$GHDLBuildDir = $GHDLRootDir_AbsPath + "\" + $BuildDirName
-$GHDLLibraryDir = $GHDLRootDir_AbsPath + "\" + $LibraryDirName
-$GHDLZipPackageDir = $GHDLRootDir_AbsPath + "\" + $ZipPackageDirName
-$GHDLZipPackageFile = $GHDLRootDir_AbsPath + "\" + $ZipPackageFileName
+$GHDLWindowsDir = $GHDLRootDir_AbsPath + "\" + $WindowsDirName
+$GHDLBuildDir = $GHDLRootDir_AbsPath + "\" + $BuildDirName
+$GHDLCompiledLibraryDir = $GHDLRootDir_AbsPath + "\" + $CompiledLibraryDirName
+$GHDLZipPackageDir = $GHDLRootDir_AbsPath + "\" + $ZipPackageDirName
+$GHDLZipPackageFile = $GHDLRootDir_AbsPath + "\" + $ZipPackageFileName
+$GHDLVendorLibraryDirName = $GHDLRootDir_AbsPath + "\" + $VendorLibraryDirName
# set default values
$Script_ExitCode = 0
@@ -282,7 +284,7 @@ else
if ($Script_ExitCode -eq 0)
{ $Script_Path = $GHDLWindowsDir + "\compile.ps1"
$Script_Parameters = @()
- $Script_Parameters += '-Compile'
+ $Script_Parameters += '-All'
if ($Script_EnableVerbose -eq $true) { $Script_Parameters += '-Verbose' }
if ($Script_EnableDebug -eq $true) { $Script_Parameters += '-Debug' }
@@ -357,13 +359,15 @@ else
Remove-Item $GHDLZipPackageDir -Force -Recurse -ErrorAction SilentlyContinue
Write-Host " Creating directory '$GHDLZipPackageDir'."
- [void](New-Item -ItemType directory -Path $GHDLZipPackageDir -ErrorAction SilentlyContinue)
- [void](New-Item -ItemType directory -Path "$GHDLZipPackageDir\bin" -ErrorAction SilentlyContinue)
+ [void](New-Item -ItemType directory -Path "$GHDLZipPackageDir" -ErrorAction SilentlyContinue)
+ [void](New-Item -ItemType directory -Path "$GHDLZipPackageDir\bin" -ErrorAction SilentlyContinue)
+ [void](New-Item -ItemType directory -Path "$GHDLZipPackageDir\scripts" -ErrorAction SilentlyContinue)
Copy-Item "$GHDLBuildDir\ghdl.exe" "$GHDLZipPackageDir\bin\ghdl.exe" -ErrorAction SilentlyContinue
Copy-Item "$GHDLBuildDir\ghdlfilter.exe" "$GHDLZipPackageDir\bin\ghdlfilter.exe" -ErrorAction SilentlyContinue
- Copy-Item $GHDLLibraryDir -Recurse $GHDLZipPackageDir -ErrorAction SilentlyContinue
+ Copy-Item $GHDLCompiledLibraryDir -Recurse "$GHDLZipPackageDir" -ErrorAction SilentlyContinue
+ Copy-Item $GHDLVendorLibraryDirName -Recurse "$GHDLZipPackageDir\scripts" -ErrorAction SilentlyContinue
Write-Host " Compressing files into '$GHDLZipPackageFile'"
$file = Get-ChildItem $GHDLZipPackageDir -Recurse | Write-Zip -IncludeEmptyDirectories -EntryPathRoot $GHDLZipPackageDir -OutputPath $GHDLZipPackageFile
@@ -420,18 +424,21 @@ else
{ Write-Host " Install directory: $InstallPath"
Write-Host " Creating directory '$InstallPath'."
- [void](New-Item -ItemType directory -Path $InstallPath -ErrorAction SilentlyContinue)
- [void](New-Item -ItemType directory -Path "$InstallPath\bin" -ErrorAction SilentlyContinue)
-
+ [void](New-Item -ItemType directory -Path "$InstallPath" -ErrorAction SilentlyContinue)
+ [void](New-Item -ItemType directory -Path "$InstallPath\bin" -ErrorAction SilentlyContinue)
+ [void](New-Item -ItemType directory -Path "$InstallPath\scripts" -ErrorAction SilentlyContinue)
+
Copy-Item "$GHDLBuildDir\ghdl.exe" "$InstallPath\bin\ghdl.exe" -ErrorAction SilentlyContinue
Copy-Item "$GHDLBuildDir\ghdlfilter.exe" "$InstallPath\bin\ghdlfilter.exe" -ErrorAction SilentlyContinue
- Copy-Item $GHDLLibraryDir -Recurse $InstallPath -ErrorAction SilentlyContinue
+ Copy-Item $GHDLCompiledLibraryDir -Recurse "$InstallPath" -ErrorAction SilentlyContinue
+ Copy-Item "$GHDLVendorLibraryDirName\*.*" -Recurse "$InstallPath\scripts" -ErrorAction SilentlyContinue
}
if ($Script_ExitCode -eq 0)
- { Write-Host " Registering installation directory in system PATH"
- Add-Path "$InstallPath\bin"
+ { Write-Host " Registering installation directory in system PATH" -NoNewline
+ Write-Host " [DISABLED]" -ForegroundColor Red
+ #Add-Path "$InstallPath\bin"
}
if ($Script_ExitCode -eq 0)
diff --git a/dist/mcode/windows/compile.ps1 b/dist/mcode/windows/compile.ps1
index b75ffb6ac..5021d01fc 100644
--- a/dist/mcode/windows/compile.ps1
+++ b/dist/mcode/windows/compile.ps1
@@ -36,219 +36,211 @@
# ==============================================================================
<#
.SYNOPSIS
- GHDL for Windows - GHDL compile script
- Use 'compile.ps1 -Help' to see the integrated help page
+ GHDL for Windows - GHDL compile script
+ Use 'compile.ps1 -Help' to see the integrated help page
.EXAMPLE
- C:\PS> .\compile.ps1 -Verbose -Compile
+ C:\PS> .\compile.ps1 -Clean -Compile
#>
# define script parameters
[CmdletBinding()]
Param(
- # compile GHDL
- [switch]$Compile,
+ # compile ALL
+ [switch]$All = $false,
+
+ # compile main targets
+ [switch]$Compile = $false,
+ # compile GHDL (simulator)
+ [switch]$GHDL = $false,
+ [switch]$Test = $false,
+
+ # compile TOOLS
+ [switch]$Tools = $false,
+ # compile Filter (helper)
+ [switch]$Filter = $false,
+
+ # build options
+ [switch]$Release = $false,
# clean up all files and directories
- [switch]$Clean,
+ [switch]$Clean = $false,
# display this help"
- [switch]$Help
+ [switch]$Help = $false
)
# configure script here
$Script_RelPathToRoot = "..\..\.."
-$GHDLVersion = "0.33dev"
# save parameters and current working directory
-$Script_Parameters = $args
-$Script_ScriptDir = $PSScriptRoot
-$Script_WorkingDir = Get-Location
-$GHDLRootDir_AbsPath = Convert-Path (Resolve-Path ($PSScriptRoot + "\" + $Script_RelPathToRoot))
-
-# configure some variables: paths, executables, directory names, ...
-$SourceDirName = "src"
-$BuildDirName = "dist\mcode\build"
-
-# TODO:
-# check if:
-# - program are installed / auto find programs / auto find paths
-# - program version
-$GCCExecutable = "gcc.exe"
-$GNATExecutable = "gnatmake.exe"
-$StripExecutable = "strip.exe"
-$GHDLExecutable = "ghdl.exe"
-$GHDLFilterExecutable = "ghdlfilter.exe"
-
-# construct directories
-$SourceDir = $GHDLRootDir_AbsPath + "\" + $SourceDirName
-$BuildDir = $GHDLRootDir_AbsPath + "\" + $BuildDirName
+$Script_Parameters = $args
+$Script_WorkingDir = Get-Location
+$GHDLRootDir = Convert-Path (Resolve-Path ($PSScriptRoot + "\" + $Script_RelPathToRoot))
# set default values
-$Script_ExitCode = 0
-if ($PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent) { $Script_EnableDebug = $true }
-if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) { $Script_EnableVerbose = $true }
+$Script_ExitCode = 0
+$BuildRelease = "Development" # "Release"
+
+if ($All)
+{ $Compile = $true
+ $Tools = $true
+}
+if ($Compile)
+{ $GHDL = $true
+ $Test = $true
+}
+if ($Tools)
+{ $Filter = $true
+}
+
+if ($Release)
+{ $BuildRelease = "Release" }
+else
+{ $BuildRelease = "Development" }
-# Compiler flags
-$CFlags = @() # start with an empty array
-$CFlags += '-O' # optimize; level ?
-$CFlags += '-g' # enable debug symbols
+$NoCommand = -not ($Clean -or $All -or $Compile -or $Tools -or $GHDL -or $Test -or $Filter)
+if ($NoCommand)
+{ $Help = $true }
-Write-Host "GHDL for Windows - GHDL and tools compile script" -ForegroundColor Yellow
-Write-Host
+Write-Host "================================================================================" -ForegroundColor Magenta
+Write-Host "GHDL for Windows - GHDL and tools compile script" -ForegroundColor Magenta
+Write-Host "================================================================================" -ForegroundColor Magenta
+# if command is help or no command was given => display help page(s)
if ($Help)
- { Write-Host "Usage:"
- Write-Host " compile.ps1 [-Verbose] [-Debug] (-Help|-Compile|-Clean)" -ForegroundColor Gray
- Write-Host
- Write-Host "Options:"
- Write-Host " -Verbose enable detailed messages"
- Write-Host " -Debug enable debug messages"
- Write-Host
- Write-Host "Commands:"
- Write-Host " -Help display this help"
- Write-Host " -Compile compile all library files"
- Write-Host " -Clean clean up all files and directories"
- } # Help
-elseif ($Clean)
- { Write-Host "Removing all created files and directories..."
- Write-Host " rmdir $BuildDir"
-
- Remove-Item $BuildDir -Force -Recurse -ErrorAction SilentlyContinue
- } # Clean
-elseif ($Compile)
- { Write-Host "Compiling GHDL $GHDLVersion for Windows"
- Write-Host "Preparing..."
-
- # create build directory if it does not exist
- if (Test-Path -Path $BuildDir)
- { Write-Host " Directory '$BuildDir' already exists."}
- else
- { Write-Host " Creating directory '$BuildDir'."
- [void](New-Item -ItemType directory -Path $BuildDir -ErrorAction SilentlyContinue)
- }
-
- # change working directory to BuildDir
- Write-Host " cd $BuildDir"
- Set-Location $BuildDir
-
- Write-Host
- Write-Host "Start compilation..."
- # list all files to be compiled; add additional CFlags if needed
- $SourceFiles = @()
- $SourceFiles += New-Object PSObject -Property @{File="grt\grt-cbinding.c"; CFlags=@()}
- $SourceFiles += New-Object PSObject -Property @{File="grt\grt-cvpi.c"; CFlags=@()}
- $SourceFiles += New-Object PSObject -Property @{File="grt\config\clock.c"; CFlags=@()}
- $SourceFiles += New-Object PSObject -Property @{File="grt\config\win32.c"; CFlags=@('-DWITH_GNAT_RUN_TIME')}
- $SourceFiles += New-Object PSObject -Property @{File="ortho\mcode\memsegs_c.c"; CFlags=@()}
-
- # compile c files
- foreach ($SourceFile in $SourceFiles)
- { $Parameters = @()
- $Parameters += '-c'
- $Parameters += $CFlags
- $Parameters += $SourceFile.CFlags
- $Parameters += $SourceDir + "\" + $SourceFile.File
-
- Write-Host (" compiling: " + $SourceFile.File)
- if ($Script_EnableDebug)
- { Write-Host (" file: " + $SourceDir + "\" + $SourceFile.File)
- Write-Host (" call: " + $GCCExecutable + " " + ($Parameters -join ' '))
- }
-
- # call compiler
- & $GCCExecutable $Parameters
- if ($LastExitCode -ne 0)
- { $Script_ExitCode = 1
- Write-Host " ERROR while compiling" -ForegroundColor Red
- }
- }
-
- if ($Script_ExitCode -eq 0)
- { # compile with GNAT
- $Parameters = @()
- $Parameters += $CFlags
- $Parameters += '-gnatn'
-
- # add source include paths
- $Parameters += '-aI' + $GHDLRootDir_AbsPath + '\dist\mcode\windows'
- $Parameters += '-aI' + $SourceDir
- $Parameters += '-aI' + $SourceDir + '\ghdldrv'
- $Parameters += '-aI' + $SourceDir + '\psl'
- $Parameters += '-aI' + $SourceDir + '\grt'
- $Parameters += '-aI' + $SourceDir + '\ortho'
- $Parameters += '-aI' + $SourceDir + '\ortho\mcode'
- $Parameters += '-aI' + $SourceDir + '\vhdl'
- $Parameters += '-aI' + $SourceDir + '\vhdl\translate'
- $Parameters += 'ghdl_jit'
-
- # add output filename
- $Parameters += '-o'
- $Parameters += $GHDLExecutable
-
- # add linker parameters
- $Parameters += '-largs'
- $Parameters += 'grt-cbinding.o'
- $Parameters += 'clock.o'
- $Parameters += 'grt-cvpi.o'
- $Parameters += 'memsegs_c.o'
- $Parameters += 'win32.o'
- $Parameters += '-ldbghelp'
- $Parameters += '-largs'
- $Parameters += '-Wl,--stack,8404992'
-
- # call compiler (GNAT)
- Write-Host " compiling with GNAT"
- if ($Script_EnableDebug)
- { #Write-Host (" file: " + $SourceDir + "\" + $SourceFile.File)
- Write-Host (" call: " + $GNATExecutable + " " + ($Parameters -join ' '))
- }
-
- & $GNATExecutable $Parameters
- if ($LastExitCode -ne 0)
- { $Script_ExitCode = 1
- Write-Host " ERROR while compiling" -ForegroundColor Red }
- }
-
- if ($Script_ExitCode -eq 0)
- { #
- Write-Host " stripping executable..."
- & $StripExecutable $GHDLExecutable
- }
+{ Write-Host "Usage:"
+ Write-Host " compile.ps1 (-Help|-Clean|-All|-Compile|-Tools|-GHDL|-Test|-Filter)" -ForegroundColor Gray
+ Write-Host
+ Write-Host "Options:"
+ Write-Host " -Release build in release mode"
+ # Write-Host " -Debug enable debug messages"
+ # Write-Host
+ Write-Host "Commands:"
+ Write-Host " -Help display this help"
+ Write-Host " -All compile all targets"
+ Write-Host " -Compile compile all main targets"
+ Write-Host " -Tools compile all tool targets"
+ Write-Host " -GHDL compile ghdl.exe"
+ Write-Host " -Filter compile filter.exe"
+ Write-Host " -Clean clean up all files and directories"
+ Write-Host
+
+ exit 0
+} # Help
+
+# load modules
+Import-Module $PSScriptRoot\shared.psm1
+Import-Module $PSScriptRoot\targets.psm1
+
+# grep GHDL version string from Ada source file
+$GHDLVersion = Get-GHDLVersion $GHDLRootDir
+
+# gather git information
+$Git_IsGitRepo = Test-GitRepository
+if ($Git_IsGitRepo)
+{ $Git_Branch_Name = & git rev-parse --abbrev-ref HEAD
+ $Git_Commit_DataString = & git log -1 --format=%cd --date=short
+ $Git_Commit_ShortHash = & git rev-parse --short HEAD
+}
+
+Write-Host " Version: $GHDLVersion"
+Write-Host " Release: $BuildRelease"
+if ($Git_IsGitRepo)
+{ Write-Host " Git branch: $Git_Branch_Name"
+ Write-Host " Git commit: $Git_Commit_DataString ($Git_Commit_ShortHash)"
+}
+Write-Host
- if ($Script_ExitCode -eq 0)
- { # compile with GNAT
- $Parameters = @()
- $Parameters += $CFlags
+function Write-TargetResult($error)
+{ if ($error)
+ { Write-Host " [FAILED]" -ForegroundColor Red }
+ # else
+ # { Write-Host " [DONE]" -ForegroundColor Green }
+}
+
+if ($BuildRelease -eq "Release")
+{ $BuildDir = $GHDLRootDir + "\dist\mcode\build" }
+elseif ($BuildRelease -eq "Development")
+{ $BuildDir = $GHDLRootDir + "\dist\mcode\build" }
+else
+{ Write-Host "[ERROR]: Unknown build setting '$BuildRelease'." -ForegroundColor Red
+ exit 1
+}
- # add source include paths
- $Parameters += '-aI' + $GHDLRootDir_AbsPath + '\dist\mcode\windows'
- $Parameters += 'ghdlfilter'
+# ==============================================================================
+# Main Target: Clean
+# ==============================================================================
+if ($Clean)
+{ $error = Invoke-Clean $BuildDir
+ Write-TargetResult $error
+} # Clean
- # add output filename
- $Parameters += '-o'
- $Parameters += $GHDLFilterExecutable
- # call compiler (GNAT)
- Write-Host " compiling with GNAT"
- if ($Script_EnableDebug)
- { #Write-Host (" file: " + $SourceDir + "\" + $SourceFile.File)
- Write-Host (" call: " + $GNATExecutable + " " + ($Parameters -join ' '))
- }
+# ==============================================================================
+# Main Target: GHDL
+# ==============================================================================
+if ($GHDL)
+{ # create a build directory
+ $error = Invoke-CreateBuildDirectory $BuildDir
+ Write-TargetResult $error
+
+ # patch the version file if it's no release build
+ if ((-not $error) -and ($BuildRelease -eq "Development") -and $Git_IsGitRepo)
+ { $error = Invoke-PatchVersionFile $GHDLRootDir $Git_Branch_Name $Git_Commit_DataString $Git_Commit_ShortHash
+ Write-TargetResult $error
+ }
+
+ # build C source files
+ if (-not $error)
+ { $error = Invoke-CompileCFiles $GHDLRootDir $BuildDir
+ Write-TargetResult $error
+ }
+
+ # build Ada source files
+ if (-not $error)
+ { $error = Invoke-CompileGHDLAdaFiles $GHDLRootDir $BuildDir
+ Write-TargetResult $error
+ }
+
+ # strip result
+ if (-not $error)
+ { $error = Invoke-StripGHDLExecutable $BuildDir
+ Write-TargetResult $error
+ }
+
+ # restore the version file if it was patched
+ if ((-not $error) -and ($BuildRelease -eq "Development") -and $Git_IsGitRepo)
+ { $error = Restore-PatchedVersionFile $GHDLRootDir
+ Write-TargetResult $error
+ }
+} # Compile
+
+if ($Test)
+{ # running ghdl
+ $error = Test-GHDLVersion $BuildDir
+ Write-TargetResult $error
+} # Test
- & $GNATExecutable $Parameters
- if ($LastExitCode -ne 0)
- { $Script_ExitCode = 1
- Write-Host " ERROR while compiling" -ForegroundColor Red }
- }
- } # compile
-else
- { Write-Host "ERROR: missing argument(s)" -ForegroundColor Red
- Write-Host
- Write-Host "Usage:"
- Write-Host " compile.ps1 [-Verbose] [-Debug] (-Help|-Compile|-Clean)" -ForegroundColor Gray
- Write-Host
- } # unknown command
+# ==============================================================================
+# Tool Target: Filter
+# ==============================================================================
+if ($Filter)
+{ # create a build directory
+ $error = Invoke-CreateBuildDirectory $BuildDir
+ Write-TargetResult $error
+
+ # build Ada source files
+ if (-not $error)
+ { $error = Invoke-CompileFilterAdaFiles $GHDLRootDir $BuildDir
+ Write-TargetResult $error
+ }
+} # Tools
+
+
+# unload PowerShell modules
+Remove-Module shared
+Remove-Module targets
# restore working directory if changed
Set-Location $Script_WorkingDir
diff --git a/dist/mcode/windows/complib.ps1 b/dist/mcode/windows/complib.ps1
index 7a622da30..7bdcd00c3 100644
--- a/dist/mcode/windows/complib.ps1
+++ b/dist/mcode/windows/complib.ps1
@@ -78,7 +78,7 @@ $GHDLRootDir_AbsPath = Convert-Path (Resolve-Path ($PSScriptRoot + "\" + $Script
#$VHDLDestLibraryDirName = "lib"
$GHDLExecutable = $GHDLRootDir_AbsPath + "\dist\mcode\build\ghdl.exe"
-$GHDLFilterExecutable = $GHDLRootDir_AbsPath + "\dist\mcode\build\ghdlfilter.exe"
+$GHDLFilterExecutable = $GHDLRootDir_AbsPath + "\dist\mcode\build\filter.exe"
# construct directories
$VHDLSourceLibraryDir = $GHDLRootDir_AbsPath + "\libraries" # + $VHDLSourceLibraryDirName
@@ -603,7 +603,7 @@ elseif ($Compile)
$VHDLSrcLibrary = "vital2000"
foreach ($SourceFile in $SourceFiles[$VHDLSrcLibrary])
- { Write-Host " file: v93\$SourceFile.v93"
+ { Write-Host " file: v93\$SourceFile.vhd"
if ($Script_EnableVerbose) { Write-Host " copy: $SourceFile" }
Copy-Item "$VHDLSourceLibraryDir\$VHDLSrcLibrary\$SourceFile.vhdl" "$SourceFile.vhd"
@@ -710,6 +710,17 @@ elseif ($Compile)
if ($Script_EnableVerbose) { Write-Host (" ghdl analyse (" + ($GHDLParameters -join " ") + ")") }
& $GHDLExecutable $GHDLParameters
}
+
+ $VHDLSrcLibrary = "vital2000"
+ foreach ($SourceFile in $SourceFiles[$VHDLSrcLibrary])
+ { Write-Host " file: v08\$SourceFile.vhd"
+ if ($Script_EnableVerbose) { Write-Host " copy: $SourceFile" }
+ Copy-Item "$VHDLSourceLibraryDir\$VHDLSrcLibrary\$SourceFile.vhdl" "$SourceFile.vhd"
+
+ $GHDLParameters = @("-a", "-C", "-frelaxed-rules", "--std=08", "-P..\std", "--work=$VHDLDestLibrary", "$SourceFile.vhd")
+ if ($Script_EnableVerbose) { Write-Host (" ghdl analyse (" + ($GHDLParameters -join " ") + ")") }
+ & $GHDLExecutable $GHDLParameters
+ }
}
# ==============================================================================
# vXX
diff --git a/dist/mcode/windows/shared.psm1 b/dist/mcode/windows/shared.psm1
new file mode 100644
index 000000000..13ec46ada
--- /dev/null
+++ b/dist/mcode/windows/shared.psm1
@@ -0,0 +1,147 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Module: The module provides common CmdLets for ...
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This PowerShell module provides CommandLets (CmdLets) to ...
+#
+# ==============================================================================
+# Copyright (C) 2016 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+function Restore-NativeCommandStream
+{ <#
+ .SYNOPSIS
+ This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs
+ as a single line.
+
+ .DESCRIPTION
+ This CmdLet collects multiple ErrorRecord objects and emits one String
+ object per line.
+
+ .PARAMETER InputObject
+ A object stream is required as an input.
+ #>
+ [CmdletBinding()]
+ param(
+ [Parameter(ValueFromPipeline=$true)]
+ $InputObject
+ )
+
+ begin
+ { $LineRemainer = "" }
+
+ process
+ { if (-not $InputObject)
+ { Write-Host "Empty pipeline!" }
+ elseif ($InputObject -is [System.Management.Automation.ErrorRecord])
+ { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError")
+ { Write-Output $InputObject.ToString() }
+ elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage")
+ { $NewLine = $LineRemainer + $InputObject.ToString()
+ while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1)
+ { Write-Output $NewLine.Substring(0, $NewLinePos)
+ $NewLine = $NewLine.Substring($NewLinePos + 1)
+ }
+ $LineRemainer = $NewLine
+ }
+ }
+ elseif ($InputObject -is [String])
+ { Write-Output $InputObject }
+ else
+ { Write-Host "Unsupported object in pipeline stream" }
+ }
+
+ end
+ { if ($LineRemainer -ne "")
+ { Write-Output $LineRemainer }
+ }
+}
+
+function Write-ColoredGHDLLine
+{ <#
+ .SYNOPSIS
+ This CmdLet colors GHDL output lines.
+
+ .DESCRIPTION
+ This CmdLet colors GHDL output lines. Warnings are prefixed with 'WARNING: '
+ in yellow and errors are prefixed with 'ERROR: ' in red.
+
+ .PARAMETER InputObject
+ A object stream is required as an input.
+
+ .PARAMETER SuppressWarnings
+ Skip warning messages. (Show errors only.)
+ #>
+ [CmdletBinding()]
+ param(
+ [Parameter(ValueFromPipeline=$true)]
+ $InputObject,
+
+ [Parameter(Position=1)]
+ [switch]$SuppressWarnings = $false
+ )
+
+ begin
+ { $ErrorRecordFound = $false }
+
+ process
+ { if (-not $InputObject)
+ { Write-Host "Empty pipeline!" }
+ elseif ($InputObject -is [String])
+ { if ($InputObject -match ":\d+:\d+:\swarning:")
+ { if (-not $SuppressWarnings)
+ { Write-Host "WARNING: " -NoNewline -ForegroundColor Yellow
+ Write-Host $InputObject
+ }
+ }
+ elseif ($InputObject -match ":\d+:\d+:\s")
+ { $ErrorRecordFound = $true
+ Write-Host "ERROR: " -NoNewline -ForegroundColor Red
+ Write-Host $InputObject
+ }
+ else
+ { Write-Host $InputObject }
+ }
+ else
+ { Write-Host "Unsupported object in pipeline stream" }
+ }
+
+ end
+ { $ErrorRecordFound }
+}
+
+function Test-GitRepository
+{ <#
+ .SYNOPSIS
+ Returns true, if the current working directy is under git control.
+ #>
+
+ git rev-parse 2>&1 | Out-Null
+ return $LastExitCode -eq 0
+}
+
+# export functions
+Export-ModuleMember -Function 'Restore-NativeCommandStream'
+Export-ModuleMember -Function 'Write-ColoredGHDLLine'
+Export-ModuleMember -Function 'Test-GitRepository'
diff --git a/dist/mcode/windows/targets.psm1 b/dist/mcode/windows/targets.psm1
new file mode 100644
index 000000000..db6f970a8
--- /dev/null
+++ b/dist/mcode/windows/targets.psm1
@@ -0,0 +1,465 @@
+# 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;
+#
+# ==============================================================================
+# PowerShell Module: The module provides build targets for GHDL.
+#
+# Authors: Patrick Lehmann
+#
+# Description:
+# ------------------------------------
+# This PowerShell module provides build targets for GHDL.
+#
+# ==============================================================================
+# Copyright (C) 2016 Patrick Lehmann
+#
+# GHDL is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any later
+# version.
+#
+# GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GHDL; see the file COPYING. If not, write to the Free
+# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+# ==============================================================================
+
+# TODO:
+# check if:
+# - program are installed / auto find programs / auto find paths
+# - program version
+
+# configure compiler tools
+$GCCExecutable = "gcc.exe"
+$GNATMakeExecutable = "gnatmake.exe"
+$StripExecutable = "strip.exe"
+
+# configure output file
+$GHDLExecutableName = "ghdl.exe"
+$FilterExecutable = "filter.exe"
+
+# configure directory structure
+$CommonSourceDirName = "src"
+$WinMcodeSourceDirName = "dist\mcode\windows"
+# $WinLLVMSourceDirName = "dist\llvm\windows"
+$WinMcodeBuildDirName = "dist\mcode\build"
+# $WinLLVMBuildDirName = "dist\llvm\build"
+
+# construct file paths
+$VersionFileName = "version.ads"
+
+
+function Invoke-Clean
+{ <#
+ .SYNOPSIS
+ This CommandLet removes all generated files.
+ .PARAMETER BuildDirectory
+ The directory where all generated files are stored.
+ .PARAMETER Quiet
+ Disable outputs to the host console.
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $BuildDirectory,
+ [switch] $Quiet = $false
+ )
+
+ Write-Host "Executing build target 'Clean' ..." -ForegroundColor Yellow
+ if ($Quiet -eq $false)
+ { Write-Host " Removing all created files and directories..."
+ Write-Host " rmdir $BuildDirectory"
+ }
+ Remove-Item $BuildDirectory -Force -Recurse -ErrorAction SilentlyContinue
+
+ return $false
+} # Invoke-Clean
+
+function Invoke-CreateBuildDirectory
+{ <#
+ .SYNOPSIS
+ This CommandLet creates a build directory if not existent, yet.
+ .PARAMETER BuildDirectory
+ The directory where all generated files are stored.
+ .PARAMETER Quiet
+ Disable outputs to the host console.
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $BuildDirectory,
+ [switch] $Quiet = $false
+ )
+
+ Write-Host "Executing build target 'CreateBuildDirectory' ..." -ForegroundColor Yellow
+ if (Test-Path -Path $BuildDirectory)
+ { if ($Quiet -eq $false)
+ { Write-Host " Directory '$BuildDirectory' already exists." }
+ }
+ else
+ { if ($Quiet -eq $false)
+ { Write-Host " Creating new directory '$BuildDirectory'." }
+
+ [void](New-Item -ItemType directory -Path $BuildDirectory -ErrorAction SilentlyContinue)
+ }
+
+ return $false
+} # Invoke-CreateBuildDirectory
+
+function Get-GHDLVersion
+{ <#
+ .SYNOPSIS
+ Returns the GHDL version string.
+ .PARAMETER GHDLRootDir
+ The repository root directory.
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $GHDLRootDir
+ )
+ # construct DirectoryPaths
+ $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
+ # construct FilePaths
+ $VersionFilePath = $SourceDirectory + "\" + $VersionFileName
+
+ if (-not (Test-Path -Path $VersionFilePath))
+ { Write-Host " Version file '$VersionFilePath' does not exists." -ForegroundColor Red
+ return ""
+ }
+ $FileContent = Get-Content -Path $VersionFilePath
+ foreach ($Line in $FileContent)
+ { if ($Line -match 'Ghdl_Ver(.+?)\"(.+?)\";')
+ { return $Matches[2] }
+ }
+ return ""
+}
+
+function Invoke-PatchVersionFile
+{ <#
+ .SYNOPSIS
+ This CommandLet patches the version file to include the git patch state.
+ .PARAMETER GHDLRootDir
+ The repository root directory.
+ .PARAMETER GitBranchName
+ The branch's name, where HEAD is located.
+ .PARAMETER GitCommitDataString
+ The DateTime when HEAD was commited.
+ .PARAMETER GitCommitHash
+ The Hash of HEAD.
+ .PARAMETER Quiet
+ Disable outputs to the host console.
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $GHDLRootDir,
+ [string] $GitBranchName = "unknown",
+ [string] $GitCommitDataString = "unknown",
+ [string] $GitCommitHash = "........",
+ [switch] $Quiet = $false
+ )
+ # construct DirectoryPaths
+ $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
+ # construct FilePaths
+ $CurrentVersionFilePath = $SourceDirectory + "\" + $VersionFileName
+ $OriginalVersionFilePath = $SourceDirectory + "\" + $VersionFileName + ".bak"
+
+ Write-Host "Executing build target 'PatchVersionFile' ..." -ForegroundColor Yellow
+
+ if (-not (Test-Path -Path $CurrentVersionFilePath))
+ { Write-Host " Version file '$CurrentVersionFilePath' does not exists." -ForegroundColor Red
+ return $true
+ }
+ if ($Quiet -eq $false)
+ { Write-Host " Patching '$CurrentVersionFilePath'." }
+ $FileContent = Get-Content -Path $CurrentVersionFilePath -Encoding Ascii
+ $FileContent = $FileContent -Replace "\s\(\d+\)\s", " (commit: $GitCommitDataString; git branch: $GitBranchName'; hash: $GitCommitHash) "
+
+ Move-Item $CurrentVersionFilePath $OriginalVersionFilePath -Force
+ $FileContent | Out-File $CurrentVersionFilePath -Encoding Ascii
+
+ return $false
+} # Invoke-PatchVersionFile
+
+function Restore-PatchedVersionFile
+{ <#
+ .SYNOPSIS
+ This CommandLet restores the original version file.
+ .PARAMETER GHDLRootDir
+ The repository root directory.
+ .PARAMETER Quiet
+ Disable outputs to the host console.
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $GHDLRootDir,
+ [switch] $Quiet = $false
+ )
+ # construct DirectoryPaths
+ $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
+ # construct FilePaths
+ $CurrentVersionFilePath = $SourceDirectory + "\" + $VersionFileName
+ $OriginalVersionFilePath = $SourceDirectory + "\" + $VersionFileName + ".bak"
+
+ Write-Host "Executing build target 'PatchedVersionFile' ..." -ForegroundColor Yellow
+
+ if (-not (Test-Path -Path "$CurrentVersionFilePath"))
+ { Write-Host " Version file '$CurrentVersionFilePath' does not exists." -ForegroundColor Red
+ return $true
+ }
+ if ($Quiet -eq $false)
+ { Write-Host " Restoring '$CurrentVersionFilePath'." }
+ Move-Item $OriginalVersionFilePath $CurrentVersionFilePath -Force
+ return $false
+} # Restore-PatchedVersionFile
+
+function Get-CFlags
+{ <#
+ .SYNOPSIS
+ Returns common ANSI C compiler flags for GCC.
+ #>
+ return @(
+ "-O1", # optimize; level 1
+ "-g" # enable debug symbols
+ )
+}
+
+function Invoke-CompileCFiles
+{ <#
+ .SYNOPSIS
+ This CommandLet compiles all C files with GCC.
+ .PARAMETER GHDLRootDir
+ The repository root directory.
+ .PARAMETER BuildDirectory
+ The directory where all generated files are stored.
+ .PARAMETER Quiet
+ Disable outputs to the host console
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $GHDLRootDir,
+ [string] $BuildDirectory,
+ [switch] $Quiet = $false
+ )
+ # construct DirectoryPaths
+ $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
+
+ Set-Location $BuildDirectory
+ Write-Host "Executing build target 'CompileCFiles' ..." -ForegroundColor Yellow
+
+ # list all files to be compiled; add additional CFlags if needed
+ $SourceFiles = @()
+ $SourceFiles += New-Object PSObject -Property @{File="grt\grt-cbinding.c"; CFlags=@()}
+ $SourceFiles += New-Object PSObject -Property @{File="grt\grt-cvpi.c"; CFlags=@()}
+ $SourceFiles += New-Object PSObject -Property @{File="grt\config\clock.c"; CFlags=@()}
+ $SourceFiles += New-Object PSObject -Property @{File="grt\config\win32.c"; CFlags=@('-DWITH_GNAT_RUN_TIME')}
+ $SourceFiles += New-Object PSObject -Property @{File="ortho\mcode\memsegs_c.c"; CFlags=@()}
+
+ # compile C files
+ foreach ($SourceFile in $SourceFiles)
+ { $Parameters = @()
+ $Parameters += "-c" # compile only
+ $Parameters += Get-CFlags # append common CFlags
+ $Parameters += $SourceFile.CFlags
+ $Parameters += $SourceDirectory + "\" + $SourceFile.File
+
+ # call C compiler
+ $InvokeExpr = "$GCCExecutable " + ($Parameters -join " ") + " 2>&1"
+
+ Write-Host (" compiling: " + $SourceFile.File)
+ Write-Debug " call: $InvokeExpr"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine
+ if ($LastExitCode -ne 0)
+ { return $true }
+ }
+
+ return $false
+} # Invoke-CompileCFiles
+
+
+function Invoke-CompileGHDLAdaFiles
+{ <#
+ .SYNOPSIS
+ This CommandLet compiles all Ada files with GNAT.
+ .PARAMETER GHDLRootDir
+ The repository root directory.
+ .PARAMETER BuildDirectory
+ The directory where all generated files are stored.
+ .PARAMETER Quiet
+ Disable outputs to the host console
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $GHDLRootDir,
+ [string] $BuildDirectory,
+ [switch] $Quiet = $false
+ )
+ # construct DirectoryPaths
+ $CommonSourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
+ $WinMcodeSourceDirectory = $GHDLRootDir + "\" + $WinMcodeSourceDirName
+
+ Set-Location $BuildDirectory
+ Write-Host "Executing build target 'CompileGHDLAdaFiles' ..." -ForegroundColor Yellow
+
+ $Parameters = @()
+ $Parameters += Get-CFlags # append common CFlags
+ $Parameters += '-gnatn'
+
+ # append all source paths
+ $Parameters += '-aI' + $WinMcodeSourceDirectory
+ $Parameters += '-aI' + $CommonSourceDirectory
+ $Parameters += '-aI' + $CommonSourceDirectory + '\ghdldrv'
+ $Parameters += '-aI' + $CommonSourceDirectory + '\psl'
+ $Parameters += '-aI' + $CommonSourceDirectory + '\grt'
+ $Parameters += '-aI' + $CommonSourceDirectory + '\ortho'
+ $Parameters += '-aI' + $CommonSourceDirectory + '\ortho\mcode'
+ $Parameters += '-aI' + $CommonSourceDirectory + '\vhdl'
+ $Parameters += '-aI' + $CommonSourceDirectory + '\vhdl\translate'
+
+ # top level
+ $Parameters += 'ghdl_jit'
+
+ # add output filename
+ $Parameters += '-o'
+ $Parameters += $GHDLExecutableName
+
+ # append linker parameters
+ $Parameters += '-largs'
+ $Parameters += 'grt-cbinding.o'
+ $Parameters += 'clock.o'
+ $Parameters += 'grt-cvpi.o'
+ $Parameters += 'memsegs_c.o'
+ $Parameters += 'win32.o'
+ $Parameters += '-ldbghelp'
+ $Parameters += '-largs'
+ # $Parameters += '-Wl,--stack,8404992'
+
+ # call Ada compiler (GNAT)
+ $InvokeExpr = "$GNATMakeExecutable " + ($Parameters -join " ") + " 2>&1"
+
+ Write-Host " compiling with GNAT"
+ Write-Debug " call: $InvokeExpr"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine
+ return ($LastExitCode -ne 0)
+} # Invoke-CompileGHDLAdaFiles
+
+function Invoke-CompileFilterAdaFiles
+{ <#
+ .SYNOPSIS
+ This CommandLet compiles all Ada files with GNAT.
+ .PARAMETER SourceDirectory
+ The directory where all source files are located.
+ .PARAMETER BuildDirectory
+ The directory where all generated files are stored.
+ .PARAMETER Quiet
+ Disable outputs to the host console
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $GHDLRootDir,
+ [string] $BuildDirectory,
+ [switch] $Quiet = $false
+ )
+ # construct DirectoryPaths
+ $SourceDirectory = $GHDLRootDir + "\" + $CommonSourceDirName
+
+ Set-Location $BuildDirectory
+ Write-Host "Executing build target 'CompileFilterAdaFiles' ..." -ForegroundColor Yellow
+
+ $Parameters = @()
+ $Parameters += Get-CFlags # append common CFlags
+ $Parameters += '-gnatn'
+
+ # append all source paths
+ $Parameters += '-aI' + $SourceDirectory + '\..\dist\mcode\windows'
+
+ # top level
+ $Parameters += 'ghdlfilter'
+
+ # add output filename
+ $Parameters += '-o'
+ $Parameters += $FilterExecutable
+
+ # call Ada compiler (GNAT)
+ $InvokeExpr = "$GNATMakeExecutable " + ($Parameters -join " ") + " 2>&1"
+
+ Write-Host " compiling with GNAT"
+ Write-Debug " call: $InvokeExpr"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine
+ return ($LastExitCode -ne 0)
+} # Invoke-CompileFilterAdaFiles
+
+function Invoke-StripGHDLExecutable
+{ <#
+ .SYNOPSIS
+ This CommandLet strips the result files.
+ .PARAMETER BuildDirectory
+ The directory where all generated files are stored.
+ .PARAMETER Quiet
+ Disable outputs to the host console
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $BuildDirectory,
+ [switch] $Quiet = $false
+ )
+
+ Set-Location $BuildDirectory
+ Write-Host "Executing build target 'StripGHDLExecutable' ..." -ForegroundColor Yellow
+
+ # call striping tool (strip)
+ Write-Host " stripping '$GHDLExecutableName'"
+ Write-Debug " call: $StripExecutable $GHDLExecutableName"
+ & $StripExecutable $GHDLExecutableName
+ return ($LastExitCode -ne 0)
+} # Invoke-StripGHDLExecutable
+
+function Test-GHDLVersion
+{ <#
+ .SYNOPSIS
+ This CommandLet executes ghdl to read the version information
+ .PARAMETER BuildDirectory
+ The directory where all generated files are stored.
+ .PARAMETER Quiet
+ Disable outputs to the host console
+ #>
+ [CmdletBinding()]
+ param(
+ [string] $BuildDirectory,
+ [switch] $Quiet = $false
+ )
+
+ Set-Location $BuildDirectory
+ Write-Host "Executing build target 'GHDLVersion' ..." -ForegroundColor Yellow
+
+ if (-not (Test-Path -Path $GHDLExecutableName))
+ { Write-Host " GHDL executable '$GHDLExecutableName' does not exists." -ForegroundColor Red
+ return $true
+ }
+
+ # call ghdl
+ $InvokeExpr = "$GHDLExecutableName --version 2>&1"
+
+ Write-Host " executing '$GHDLExecutableName'"
+ Write-Host " call: $InvokeExpr"
+ Write-Host "----------------------------------------"
+ Invoke-Expression $InvokeExpr | Restore-NativeCommandStream
+ Write-Host "----------------------------------------"
+ return ($LastExitCode -ne 0)
+} # Test-GHDLVersion
+
+
+# export functions
+Export-ModuleMember -Function 'Get-GHDLVersion'
+Export-ModuleMember -Function 'Invoke-Clean'
+Export-ModuleMember -Function 'Invoke-CreateBuildDirectory'
+Export-ModuleMember -Function 'Invoke-PatchVersionFile'
+Export-ModuleMember -Function 'Restore-PatchedVersionFile'
+Export-ModuleMember -Function 'Invoke-CompileCFiles'
+Export-ModuleMember -Function 'Invoke-CompileGHDLAdaFiles'
+Export-ModuleMember -Function 'Invoke-CompileFilterAdaFiles'
+Export-ModuleMember -Function 'Invoke-StripGHDLExecutable'
+Export-ModuleMember -Function 'Test-GHDLVersion'
diff --git a/libraries/vendors/README.md b/libraries/vendors/README.md
index 81a3306bc..3486a1556 100644
--- a/libraries/vendors/README.md
+++ b/libraries/vendors/README.md
@@ -87,14 +87,15 @@ The compilation scripts are writen in shell languages: PowerShell for Windows an
- **Step 1 - Configure the scripts**
Please open the `config.psm1` file and set the dictionary entries for the installed
- vendor tools to the appropriate directory to your tool's installation folder.
+ vendor tools to the appropriate directory to your tool's installation folder. Use an
+ empty string `""` for not installed tools.
`config.psm1`:
```PowerShell
$InstallationDirectory = @{
"AlteraQuartusII" = "C:\Altera\15.0";
"XilinxISE" = "C:\Xilinx\14.7";
- "XilinxVivado" = "C:\Xilinx\Vivado\2015.3";
+ "XilinxVivado" = "C:\Xilinx\Vivado\2015.4";
"OSVVM" = "D:\git\GitHub\osvvm";
"VUnit" = "D:\git\GitHub\vunit"
}
@@ -137,61 +138,107 @@ The compilation scripts are writen in shell languages: PowerShell for Windows an
- Common parameters to all scripts:
-h --help Print the embedded help page(s).
- -a --all Compile all libraries, including common libraries, packages and device libraries.
-c --clean Cleanup directory before analyzing.
-n --no-warnings Don't show warnings. Report errors only.
-s --skip-existing Skip already compiled files (an *.o file exists).
-S --skip-largefiles Don't compile large entities like DSP and PCIe primitives.
-H --halt-on-error Stop compiling if an error occured.
- `compile-altera.sh`
+ Selectable libraries:
- --altera Compile base libraries like 'altera' and 'altera_mf'
- --max Compile device libraries for Max CPLDs
- --arria Compile device libraries for Arria FPGAs
- --cyclone Compile device libraries for Cyclone FPGAs
- --stratix Compile device libraries for Stratix FPGAs
+ -a --all Compile all libraries, including common libraries, packages and device libraries.
+ --altera Compile base libraries like 'altera' and 'altera_mf'
+ --max Compile device libraries for Max CPLDs
+ --arria Compile device libraries for Arria FPGAs
+ --cyclone Compile device libraries for Cyclone FPGAs
+ --stratix Compile device libraries for Stratix FPGAs
+ Compile options:
+
+ --vhdl93 Compile selected libraries with VHDL-93 (default).
+ --vhdl2008 Compile selected libraries with VHDL-2008.
- `compile-xilinx-ise.sh`
+ Selectable libraries:
- --unisim Compile the unisim primitives
- --unimacro Compile the unimacro macros
- --simprim Compile the simprim primitives
- --secureip Compile the secureip primitives
+ -a --all Compile all libraries, including common libraries, packages and device libraries.
+ --unisim Compile the unisim primitives
+ --unimacro Compile the unimacro macros
+ --simprim Compile the simprim primitives
+ --secureip Compile the secureip primitives
+ Compile options:
+
+ --vhdl93 Compile selected libraries with VHDL-93 (default).
+ --vhdl2008 Compile selected libraries with VHDL-2008.
- `compile-xilinx-vivado.sh`
+ Selectable libraries:
- --unisim Compile the unisim primitives
- --unimacro Compile the unimacro macros
- --secureip Compile the secureip primitives
+ -a --all Compile all libraries, including common libraries, packages and device libraries.
+ --unisim Compile the unisim primitives
+ --unimacro Compile the unimacro macros
+ --secureip Compile the secureip primitives
+ Compile options:
+
+ --vhdl93 Compile selected libraries with VHDL-93 (default).
+ --vhdl2008 Compile selected libraries with VHDL-2008.
- `compile-osvvm.sh`
+ Selectable libraries:
+
+ -a --all Compile all.
- `compile-vunit.sh`
+ Selectable libraries:
+
+ -a --all Compile all.
### Selectable Options for the PowerShell Scripts:
- Common parameters to all scripts:
-Help Print the embedded help page(s).
- -All Compile all libraries, including common libraries, packages and device libraries.
-Clean Cleanup directory before analyzing.
-SuppressWarnings Don't show warnings. Report errors only.
- `compile-altera.ps1`
+ Selectable libraries:
+ -All Compile all libraries, including common libraries, packages and device libraries.
-Altera Compile base libraries like 'altera' and 'altera_mf'
-Max Compile device libraries for Max CPLDs
-Arria Compile device libraries for Arria FPGAs
-Cyclone Compile device libraries for Cyclone FPGAs
-Stratix Compile device libraries for Stratix FPGAs
+ Compile options:
+
+ -VHDL93 Compile selected libraries with VHDL-93 (default).
+ -VHDL2008 Compile selected libraries with VHDL-2008.
- `compile-xilinx-ise.ps1`
+ Selectable libraries:
+ -All Compile all libraries, including common libraries, packages and device libraries.
-Unisim Compile the unisim primitives
-Unimacro Compile the unimacro macros
-Simprim Compile the simprim primitives
-Secureip Compile the secureip primitives
+ Compile options:
+
+ -VHDL93 Compile selected libraries with VHDL-93 (default).
+ -VHDL2008 Compile selected libraries with VHDL-2008.
- `compile-xilinx-vivado.ps1`
+ Selectable libraries:
+ -All Compile all libraries, including common libraries, packages and device libraries.
-Unisim Compile the unisim primitives
-Unimacro Compile the unimacro macros
-Secureip Compile the secureip primitives
+ Compile options:
+
+ -VHDL93 Compile selected libraries with VHDL-93 (default).
+ -VHDL2008 Compile selected libraries with VHDL-2008.
- `compile-osvvm.ps1`
+ Selectable libraries:
+
+ -All Compile all.
- `compile-vunit.ps1`
+ Selectable libraries:
+
+ -All Compile all.
------------------------
Author: Patrick Lehmann (30.11.2015)
diff --git a/libraries/vendors/compile-altera.ps1 b/libraries/vendors/compile-altera.ps1
index cfd4bd5fa..aaf9786a9 100644
--- a/libraries/vendors/compile-altera.ps1
+++ b/libraries/vendors/compile-altera.ps1
@@ -54,7 +54,7 @@
[CmdletBinding()]
param(
# Compile all libraries and packages.
- [switch]$All = $null,
+ [switch]$All = $false,
# Compile the Altera standard libraries: lpm, sgate, altera, altera_mf, altera_lnsim
[switch]$Altera = $false,
@@ -74,11 +74,18 @@ param(
# Unknown device library
[switch]$Nanometer = $false,
+ # Set VHDL Standard to '93
+ [switch]$VHDL93 = $false,
+ # Set VHDL Standard to '08
+ [switch]$VHDL2008 = $false,
+
# Clean up directory before analyzing.
[switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
[switch]$SuppressWarnings = $false,
+ # Halt on errors
+ [switch]$HaltOnError = $false,
# Show the embedded help page(s)
[switch]$Help = $false
@@ -101,9 +108,7 @@ Import-Module $PSScriptRoot\shared.psm1
$SourceDir = $InstallationDirectory["AlteraQuartusII"] + "\quartus\eda\sim_lib"
$DestinationDir = $DestinationDirectory["Altera"]
-if (-not $All)
-{ $All = $false }
-elseif ($All -eq $true)
+if ($All -eq $true)
{ $Altera = $true
$Max = $true
$Cyclone = $true
@@ -112,11 +117,24 @@ elseif ($All -eq $true)
$Nanometer = $true
}
-$StopCompiling = $false
+if ($VHDL93 -eq $true)
+{ $VHDLStandard = "93c"
+ $VHDLFlavor = "synopsys"
+}
+elseif ($VHDL2008 -eq $true)
+{ $VHDLStandard = "08"
+ $VHDLFlavor = "standard"
+}
+else
+{ $VHDLStandard = "93c"
+ $VHDLFlavor = "synopsys"
+}
+$StopCompiling = $false
+$ErrorCount = 0
# define global GHDL Options
-$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--ieee=synopsys", "--no-vital-checks", "--std=93c")
+$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--ieee=$VHDLFlavor", "--no-vital-checks", "--std=$VHDLStandard")
# create "Altera" directory and change to it
Write-Host "Creating vendor directory: '$DestinationDir'" -ForegroundColor Yellow
@@ -143,8 +161,13 @@ if ((-not $StopCompiling) -and $Altera)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=lpm " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -159,8 +182,13 @@ if ((-not $StopCompiling) -and $Altera)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=sgate " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -179,8 +207,13 @@ if ((-not $StopCompiling) -and $Altera)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=altera " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -195,8 +228,13 @@ if ((-not $StopCompiling) -and $Altera)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=altera_mf " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -209,8 +247,13 @@ if ((-not $StopCompiling) -and $Altera)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=altera_lnsim " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -227,8 +270,13 @@ if ((-not $StopCompiling) -and $Max)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=max " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -243,8 +291,13 @@ if ((-not $StopCompiling) -and $Max)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=maxii " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -259,8 +312,13 @@ if ((-not $StopCompiling) -and $Max)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=maxv " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -277,8 +335,13 @@ if ((-not $StopCompiling) -and $Arria)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriaii " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -293,8 +356,13 @@ if ((-not $StopCompiling) -and $Arria)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriaii_pcie_hip " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -310,8 +378,13 @@ if ((-not $StopCompiling) -and $Arria)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriaiigz " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -328,8 +401,13 @@ if ((-not $StopCompiling) -and $Arria)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriav " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -346,8 +424,13 @@ if ((-not $StopCompiling) -and $Arria)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriavgz " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -362,8 +445,13 @@ if ((-not $StopCompiling) -and $Arria)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=arriavgz_pcie_hip " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -380,8 +468,13 @@ if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cycloneiv " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -396,8 +489,13 @@ if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cycloneiv_pcie_hip " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -412,8 +510,13 @@ if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cycloneive " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -430,8 +533,13 @@ if ((-not $StopCompiling) -and $Cyclone)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=cyclonev " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -448,8 +556,13 @@ if ((-not $StopCompiling) -and $Stratix)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixiv " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -464,8 +577,13 @@ if ((-not $StopCompiling) -and $Stratix)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixiv_pcie_hip " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -482,8 +600,13 @@ if ((-not $StopCompiling) -and $Stratix)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixv " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -498,8 +621,13 @@ if ((-not $StopCompiling) -and $Stratix)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=stratixv_pcie_hip " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -514,8 +642,13 @@ if ((-not $StopCompiling) -and $Nanometer)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=fiftyfivenm " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -534,14 +667,19 @@ if ((-not $StopCompiling) -and $Nanometer)
{ Write-Host "Analyzing file '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=twentynm " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
Write-Host "--------------------------------------------------------------------------------"
Write-Host "Compiling Altera libraries " -NoNewline
-if ($StopCompiling)
+if ($ErrorCount -gt 0)
{ Write-Host "[FAILED]" -ForegroundColor Red }
else
{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
diff --git a/libraries/vendors/compile-altera.sh b/libraries/vendors/compile-altera.sh
index fdffc99b2..d73a5fabd 100755
--- a/libraries/vendors/compile-altera.sh
+++ b/libraries/vendors/compile-altera.sh
@@ -101,6 +101,12 @@ while [[ $# > 0 ]]; do
NANOMETER=TRUE
NO_COMMAND=FALSE
;;
+ --vhdl93)
+ VHDL93=TRUE
+ ;;
+ --vhdl2008)
+ VHDL2008=TRUE
+ ;;
*) # unknown option
UNKNOWN_OPTION=TRUE
;;
@@ -141,6 +147,8 @@ elif [ "$HELP" == "TRUE" ]; then
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 entities like DSP and PCIe primitives."
echo " -H --halt-on-error Halt on error(s)."
@@ -161,13 +169,23 @@ if [ "$ALL" == "TRUE" ]; then
NANOMETER=TRUE
fi
+if [ "$VHDL93" == "TRUE" ]; then
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+elif [ "$VHDL2008" == "TRUE" ]; then
+ VHDLStandard="08"
+ VHDLFlavor="standard"
+else
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+fi
+
# extract data from configuration
-InstallDir=${InstallationDirectory[AlteraQuartusII]}
-SourceDir="$InstallDir/quartus/eda/sim_lib"
-DestinationDir=${DestinationDirectory[AlteraQuartusII]}
+SourceDir=${SourceDirectory[AlteraQuartus]}
+DestinationDir=${DestinationDirectory[AlteraQuartus]}
-if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
- echo -e "${COLORED_ERROR} Altera Quartus-II is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
+if [ -z $DestinationDir ]; then
+ echo -e "${COLORED_ERROR} Altera Quartus is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
exit -1
elif [ ! -d $SourceDir ]; then
echo -e "${COLORED_ERROR} Path '$SourceDir' does not exist.${ANSI_RESET}"
@@ -201,6 +219,7 @@ else
fi
STOPCOMPILING=FALSE
+ERRORCOUNT=0
# Cleanup directory
# ==============================================================================
@@ -215,7 +234,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'lpm' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/220pack.vhd
$SourceDir/220model.vhd
@@ -227,9 +246,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=lpm "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -239,7 +261,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'sgate' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/sgate_pack.vhd
$SourceDir/sgate.vhd
@@ -251,9 +273,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=sgate "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -263,7 +288,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'altera' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/altera_europa_support_lib.vhd
$SourceDir/altera_primitives_components.vhd
@@ -279,9 +304,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=altera "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -291,7 +319,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'altera_mf' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/altera_mf_components.vhd
$SourceDir/altera_mf.vhd
@@ -303,9 +331,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=altera_mf "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -315,7 +346,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ALTERA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'altera_lnsim' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/altera_lnsim_components.vhd
)
@@ -340,7 +371,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'max' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/max_atoms.vhd
$SourceDir/max_components.vhd
@@ -352,9 +383,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=max "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -364,7 +398,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'maxii' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/maxii_atoms.vhd
$SourceDir/maxii_components.vhd
@@ -376,9 +410,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=maxii "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -388,7 +425,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'maxv' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/maxv_atoms.vhd
$SourceDir/maxv_components.vhd
@@ -400,9 +437,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$MAX" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=maxv "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -412,7 +452,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'arriaii' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/arriaii_atoms.vhd
$SourceDir/arriaii_components.vhd
@@ -426,9 +466,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=arriaii "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -437,21 +480,26 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'arriaii_pcie_hip' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/arriaii_pcie_hip_components.vhd
$SourceDir/arriaii_pcie_hip_atoms.vhd
)
for File in ${Files[@]}; do
FileName=$(basename "$File")
- if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ if [ "$SKIP_LARGE_FILES" == "TRUE" ]; then
+ echo -e "${ANSI_CYAN}Skipping large file '$File'${ANSI_RESET}"
+ elif [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=arriaii_pcie_hip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -461,7 +509,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'arriaiigz' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/arriaiigz_atoms.vhd
$SourceDir/arriaiigz_components.vhd
@@ -474,9 +522,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=arriaiigz "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -486,7 +537,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'arriav' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/arriav_atoms.vhd
$SourceDir/arriav_components.vhd
@@ -500,9 +551,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=arriav "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -512,7 +566,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'arriavgz' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/arriavgz_atoms.vhd
$SourceDir/arriavgz_components.vhd
@@ -526,9 +580,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=arriavgz "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -537,21 +594,26 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$ARRIA" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'arriavgz_pcie_hip' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/arriavgz_pcie_hip_components.vhd
$SourceDir/arriavgz_pcie_hip_atoms.vhd
)
for File in ${Files[@]}; do
FileName=$(basename "$File")
- if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ if [ "$SKIP_LARGE_FILES" == "TRUE" ]; then
+ echo -e "${ANSI_CYAN}Skipping large file '$File'${ANSI_RESET}"
+ elif [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=arriavgz_pcie_hip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -561,7 +623,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'cycloneiv' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/cycloneiv_atoms.vhd
$SourceDir/cycloneiv_components.vhd
@@ -575,9 +637,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=cycloneiv "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -586,21 +651,26 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'cycloneiv_pcie_hip' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/cycloneiv_pcie_hip_components.vhd
$SourceDir/cycloneiv_pcie_hip_atoms.vhd
)
for File in ${Files[@]}; do
FileName=$(basename "$File")
- if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ if [ "$SKIP_LARGE_FILES" == "TRUE" ]; then
+ echo -e "${ANSI_CYAN}Skipping large file '$File'${ANSI_RESET}"
+ elif [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=cycloneiv_pcie_hip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -610,7 +680,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'cycloneive' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/cycloneive_atoms.vhd
$SourceDir/cycloneive_components.vhd
@@ -622,9 +692,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=cycloneive "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -634,7 +707,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'cyclonev' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/cyclonev_atoms.vhd
$SourceDir/cyclonev_components.vhd
@@ -648,9 +721,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$CYCLONE" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=cyclonev "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -660,7 +736,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'stratixiv' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/stratixiv_atoms.vhd
$SourceDir/stratixiv_components.vhd
@@ -674,9 +750,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=stratixiv "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -685,21 +764,26 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'stratixiv_pcie_hip' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/stratixiv_pcie_hip_components.vhd
$SourceDir/stratixiv_pcie_hip_atoms.vhd
)
for File in ${Files[@]}; do
FileName=$(basename "$File")
- if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ if [ "$SKIP_LARGE_FILES" == "TRUE" ]; then
+ echo -e "${ANSI_CYAN}Skipping large file '$File'${ANSI_RESET}"
+ elif [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=stratixiv_pcie_hip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -709,7 +793,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'stratixv' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/stratixv_atoms.vhd
$SourceDir/stratixv_components.vhd
@@ -723,9 +807,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=stratixv "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -734,21 +821,26 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$STRATIX" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'stratixv_pcie_hip' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/stratixv_pcie_hip_components.vhd
$SourceDir/stratixv_pcie_hip_atoms.vhd
)
for File in ${Files[@]}; do
FileName=$(basename "$File")
- if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ if [ "$SKIP_LARGE_FILES" == "TRUE" ]; then
+ echo -e "${ANSI_CYAN}Skipping large file '$File'${ANSI_RESET}"
+ elif [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
echo -e "${ANSI_CYAN}Skipping file '$File'${ANSI_RESET}"
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=stratixv_pcie_hip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -758,7 +850,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$NANOMETER" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'fiftyfivenm' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/fiftyfivenm_atoms.vhd
$SourceDir/fiftyfivenm_components.vhd
@@ -770,9 +862,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$NANOMETER" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=fiftyfivenm "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -782,7 +877,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$NANOMETER" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'twentynm' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/twentynm_atoms.vhd
$SourceDir/twentynm_components.vhd
@@ -798,9 +893,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$NANOMETER" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing file '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=twentynm "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -808,7 +906,7 @@ fi
echo "--------------------------------------------------------------------------------"
echo -n "Compiling Altera Quartus-II libraries "
-if [ "$STOPCOMPILING" == "TRUE" ]; then
+if [ $ERRORCOUNT -gt 0 ]; then
echo -e $COLORED_FAILED
else
echo -e $COLORED_SUCCESSFUL
diff --git a/libraries/vendors/compile-lattice.sh b/libraries/vendors/compile-lattice.sh
index 4a982799f..8155aaf68 100755
--- a/libraries/vendors/compile-lattice.sh
+++ b/libraries/vendors/compile-lattice.sh
@@ -132,11 +132,10 @@ elif [ "$HELP" == "TRUE" ]; then
fi
# extract data from configuration
-InstallDir=${InstallationDirectory[LatticeDiamond]}
-SourceDir="$InstallDir/cae_library/simulation/vhdl"
+SourceDir=${SourceDirectory[LatticeDiamond]}
DestinationDir=${DestinationDirectory[LatticeDiamond]}
-if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+if [ -z $DestinationDir ]; then
echo -e "${COLORED_ERROR} Lattice Diamond is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
exit -1
elif [ ! -d $SourceDir ]; then
diff --git a/libraries/vendors/compile-osvvm.ps1 b/libraries/vendors/compile-osvvm.ps1
index 7f271c252..c8c643db9 100644
--- a/libraries/vendors/compile-osvvm.ps1
+++ b/libraries/vendors/compile-osvvm.ps1
@@ -46,10 +46,12 @@ param(
[switch]$All = $true,
# Clean up directory before analyzing.
- [switch]$Clean = $false,
+ [switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
[switch]$SuppressWarnings = $false,
+ # Halt on errors
+ [switch]$HaltOnError = $false,
# Show the embedded help page(s)
[switch]$Help = $false
@@ -72,14 +74,11 @@ Import-Module $PSScriptRoot\shared.psm1
$SourceDir = $InstallationDirectory["OSVVM"]
$DestinationDir = $DestinationDirectory["OSVVM"]
-if (-not $All)
-{ $All = $false }
-elseif ($All -eq $true)
+if ($All -eq $true)
{ # nothing to configure
}
-$StopCompiling = $false
-
+$ErrorCount = 0
# define global GHDL Options
$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--no-vital-checks", "--std=08")
@@ -97,34 +96,35 @@ if ($Clean)
}
# compile osvvm library
-if (-not $StopCompiling)
-{ Write-Host "Compiling library 'osvvm' ..." -ForegroundColor Yellow
- $Options = $GlobalOptions
- $Files = (
- "$SourceDir\NamePkg.vhd",
- "$SourceDir\OsvvmGlobalPkg.vhd",
- "$SourceDir\TextUtilPkg.vhd",
- "$SourceDir\TranscriptPkg.vhd",
- "$SourceDir\AlertLogPkg.vhd",
- "$SourceDir\MemoryPkg.vhd",
- "$SourceDir\MessagePkg.vhd",
- "$SourceDir\SortListPkg_int.vhd",
- "$SourceDir\RandomBasePkg.vhd",
- "$SourceDir\RandomPkg.vhd",
- "$SourceDir\CoveragePkg.vhd",
- "$SourceDir\OsvvmContext.vhd")
- foreach ($File in $Files)
- { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
- $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=osvvm " + $File + " 2>&1"
- $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+Write-Host "Compiling library 'osvvm' ..." -ForegroundColor Yellow
+$Options = $GlobalOptions
+$Files = (
+ "$SourceDir\NamePkg.vhd",
+ "$SourceDir\OsvvmGlobalPkg.vhd",
+ "$SourceDir\TextUtilPkg.vhd",
+ "$SourceDir\TranscriptPkg.vhd",
+ "$SourceDir\AlertLogPkg.vhd",
+ "$SourceDir\MemoryPkg.vhd",
+ "$SourceDir\MessagePkg.vhd",
+ "$SourceDir\SortListPkg_int.vhd",
+ "$SourceDir\RandomBasePkg.vhd",
+ "$SourceDir\RandomPkg.vhd",
+ "$SourceDir\CoveragePkg.vhd",
+ "$SourceDir\OsvvmContext.vhd")
+foreach ($File in $Files)
+{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=osvvm " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { break }
}
}
Write-Host "--------------------------------------------------------------------------------"
Write-Host "Compiling OSVVM library " -NoNewline
-if ($StopCompiling)
+if ($ErrorCount -gt 0)
{ Write-Host "[FAILED]" -ForegroundColor Red }
else
{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
diff --git a/libraries/vendors/compile-osvvm.sh b/libraries/vendors/compile-osvvm.sh
index fe20e3872..d7430434f 100755
--- a/libraries/vendors/compile-osvvm.sh
+++ b/libraries/vendors/compile-osvvm.sh
@@ -4,10 +4,10 @@
# kate: tab-width 2; replace-tabs off; indent-width 2;
#
# ==============================================================================
-# Bash Script: Script to compile the OSVVM library for GHDL on Linux
-#
# Authors: Patrick Lehmann
#
+# Bash Script: Script to compile the OSVVM library for GHDL on Linux
+#
# Description:
# ------------------------------------
# This is a Bash script (executable) which:
@@ -15,7 +15,7 @@
# - compiles all OSVVM packages
#
# ==============================================================================
-# Copyright (C) 2015 Patrick Lehmann
+# Copyright (C) 2015-2016 Patrick Lehmann
#
# GHDL is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -37,15 +37,17 @@
# save working directory
WorkingDir=$(pwd)
ScriptDir="$(dirname $0)"
-ScriptDir="$(realpath $ScriptDir)"
+ScriptDir="$(readlink -f $ScriptDir)"
# source configuration file from GHDL's 'vendors' library directory
source $ScriptDir/config.sh
source $ScriptDir/shared.sh
-NO_COMMAND=TRUE
-
# command line argument processing
+NO_COMMAND=TRUE
+GHDLBinDir=""
+DestDir=""
+SrcDir=""
while [[ $# > 0 ]]; do
key="$1"
case $key in
@@ -54,7 +56,11 @@ while [[ $# > 0 ]]; do
NO_COMMAND=FALSE
;;
-a|--all)
- ALL=TRUE
+ COMPILE_ALL=TRUE
+ NO_COMMAND=FALSE
+ ;;
+ -o|--osvvm)
+ COMPILE_OSVVM=TRUE
NO_COMMAND=FALSE
;;
-s|--skip-existing)
@@ -66,13 +72,22 @@ while [[ $# > 0 ]]; do
-H|--halt-on-error)
HALT_ON_ERROR=TRUE
;;
-# -v|--verbose)
-# VERBOSE=TRUE
-# ;;
-h|--help)
HELP=TRUE
NO_COMMAND=FALSE
;;
+ --ghdl)
+ GHDLBinDir="$2"
+ shift # past argument
+ ;;
+ --src)
+ SrcDir="$2"
+ shift # past argument
+ ;;
+ --out)
+ DestDir="$2"
+ shift # past argument
+ ;;
*) # unknown option
UNKNOWN_OPTION=TRUE
;;
@@ -93,50 +108,88 @@ elif [ "$HELP" == "TRUE" ]; then
fi
echo ""
echo "Synopsis:"
- echo " Script to compile the simulation library OSVVM for GHDL on Linux"
+ echo " A script to compile the simulation library 'OSVVM' for GHDL on Linux."
+ echo " A library folder 'osvvm/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-osvvm.sh <common command>|<library> [<options>]"
-# [-v] [-c] [--all] [-s|--skip-existing] [-n|--no-warnings]
+ echo " compile-osvvm.sh <common command>|<library> [<options>] [<adv. options>]"
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 packages."
+ echo " -a --all Compile all packages (default)."
+ echo " -o --osvvm Compile package osvvm."
echo ""
echo "Library compile options:"
- echo " -s --skip-existing Skip already compiled files (an *.o file exists)."
- echo " -H --halt-on-error Halt on error(s)."
+ 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 <GHDL BinDir> Path to GHDL binary directory e.g. /usr/bin."
+ echo " --out <dir name> Name of the output directory."
+ echo " --src <Path to OSVVM> Name of the output directory."
echo ""
echo "Verbosity:"
-# echo " -v --verbose Print more messages"
echo " -n --no-warnings Suppress all warnings. Show only error messages."
echo ""
exit 0
fi
-if [ "$ALL" == "TRUE" ]; then
- UNISIM=TRUE
- UNIMACRO=TRUE
- SIMPRIM=TRUE
- SECUREIP=TRUE
+if [ "$COMPILE_ALL" == "TRUE" ]; then
+ COMPILE_OSVVM=TRUE
fi
-# extract data from configuration
-InstallDir=${InstallationDirectory[OSVVM]}
-SourceDir="$InstallDir"
+SourceDirectory=${SourceDirectory[OSVVM]}
DestinationDir=${DestinationDirectory[OSVVM]}
-if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+# OSVVM source directory
+# ----------------------
+# If a command line argument ('--src') was passed in, use it, else use the default value
+# from config.sh
+if [ ! -z "$SrcDir" ]; then
+ SourceDirectory=$SrcDir
+fi
+# OSVVM output directory
+# ----------------------
+# If a command line argument ('--out') was passed in, use it, else use the default value
+# from config.sh
+if [ ! -z "$DestDir" ]; then
+ DestinationDir=$DestDir
+fi
+
+# Use GHDL binary directory from command line argument, if set
+if [ ! -z "$GHDLBinDir" ]; then
+ GHDLBinary=$GHDLBinDir/ghdl
+ if [[ ! -x "$GHDLBinary" ]]; then
+ echo -e "${COLORED_ERROR} GHDL not found or is not executable.${ANSI_RESET}"
+ exit -1
+ fi
+else # fall back to GHDL found via PATH
+ GHDLBinary=$(which ghdl)
+ if [ $? -ne 0 ]; then
+ echo -e "${COLORED_ERROR} GHDL not found in PATH.${ANSI_RESET}"
+ echo -e " Use adv. options '--ghdl' to set the GHDL binary directory."
+ exit -1
+ fi
+fi
+
+if [ -z $SourceDirectory ] || [ -z $DestinationDir ]; then
echo -e "${COLORED_ERROR} OSVVM is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
+ echo -e " Use adv. options '--src' and '--out' or configure 'config.sh'."
exit -1
-elif [ ! -d $SourceDir ]; then
+elif [ ! -d $SourceDirectory ]; then
echo -e "${COLORED_ERROR} Path '$SourceDir' does not exist.${ANSI_RESET}"
exit -1
fi
+# append VHDL version folder
+DestinationDir=$DestinationDir/v08
+
# set bash options
set -o pipefail
@@ -148,7 +201,7 @@ if [[ -d "$DestinationDir" ]]; then
echo -e "${ANSI_YELLOW}Vendor directory '$DestinationDir' already exists.${ANSI_RESET}"
else
echo -e "${ANSI_YELLOW}Creating vendor directory: '$DestinationDir'${ANSI_RESET}"
- mkdir "$DestinationDir"
+ mkdir -p "$DestinationDir"
fi
cd $DestinationDir
@@ -163,57 +216,60 @@ else
fi
fi
-STOPCOMPILING=FALSE
-
# Cleanup directory
# ==============================================================================
if [ "$CLEAN" == "TRUE" ]; then
- echo -e "${ANSI_YELLOW}Cleaning up vendor directory ...${ANSI_RESET}"
+ echo -e "${ANSI_YELLOW}Cleaning up directory ...${ANSI_RESET}"
rm *.o 2> /dev/null
+ rm *.cf 2> /dev/null
fi
# Library osvvm
# ==============================================================================
# compile osvvm packages
-if [ "$STOPCOMPILING" == "FALSE" ]; then
+if [ "$COMPILE_OSVVM" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'osvvm' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
GHDL_PARAMS+=(--std=08)
Files=(
- $SourceDir/NamePkg.vhd
- $SourceDir/OsvvmGlobalPkg.vhd
- $SourceDir/TextUtilPkg.vhd
- $SourceDir/TranscriptPkg.vhd
- $SourceDir/AlertLogPkg.vhd
- $SourceDir/MemoryPkg.vhd
- $SourceDir/MessagePkg.vhd
- $SourceDir/SortListPkg_int.vhd
- $SourceDir/RandomBasePkg.vhd
- $SourceDir/RandomPkg.vhd
- $SourceDir/CoveragePkg.vhd
- $SourceDir/OsvvmContext.vhd
+ NamePkg.vhd
+ OsvvmGlobalPkg.vhd
+ TextUtilPkg.vhd
+ TranscriptPkg.vhd
+ AlertLogPkg.vhd
+ MemoryPkg.vhd
+ MessagePkg.vhd
+ SortListPkg_int.vhd
+ RandomBasePkg.vhd
+ RandomPkg.vhd
+ CoveragePkg.vhd
+ OsvvmContext.vhd
)
+
+ echo $GHDLBinary
+
+ ERRORCOUNT=0
for File in ${Files[@]}; do
FileName=$(basename "$File")
if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
- ghdl -a ${GHDL_PARAMS[@]} --work=osvvm "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ $GHDLBinary -a ${GHDL_PARAMS[@]} --work=osvvm "$SourceDirectory/$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ break
+ fi
fi
fi
done
+
+ echo "--------------------------------------------------------------------------------"
+ echo -n "Compiling OSVVM library "
+ if [ $ERRORCOUNT -gt 0 ]; then
+ echo -e $COLORED_FAILED
+ else
+ echo -e $COLORED_SUCCESSFUL
+ fi
fi
-
-echo "--------------------------------------------------------------------------------"
-echo -n "Compiling OSVVM library "
-if [ "$STOPCOMPILING" == "TRUE" ]; then
- echo -e $COLORED_FAILED
-else
- echo -e $COLORED_SUCCESSFUL
-fi
-
-cd $WorkingDir
diff --git a/libraries/vendors/compile-vunit.ps1 b/libraries/vendors/compile-vunit.ps1
index 53c104bc5..e2230fded 100644
--- a/libraries/vendors/compile-vunit.ps1
+++ b/libraries/vendors/compile-vunit.ps1
@@ -46,10 +46,12 @@ param(
[switch]$All = $true,
# Clean up directory before analyzing.
- [switch]$Clean = $false,
+ [switch]$Clean = $false,
#Skip warning messages. (Show errors only.)
[switch]$SuppressWarnings = $false,
+ # Halt on errors
+ [switch]$HaltOnError = $false,
# Show the embedded help page(s)
[switch]$Help = $false
@@ -72,14 +74,11 @@ Import-Module $PSScriptRoot\shared.psm1
$SourceDir = $InstallationDirectory["VUnit"]
$DestinationDir = $DestinationDirectory["VUnit"]
-if (-not $All)
-{ $All = $false }
-elseif ($All -eq $true)
+if ($All -eq $true)
{ # nothing to configure
}
-$StopCompiling = $false
-
+$ErrorCount = 0
# define global GHDL Options
$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--mb-comments", "--warn-binding", "--no-vital-checks", "--std=08")
@@ -97,60 +96,61 @@ if ($Clean)
}
# compile vunit_lib library
-if (-not $StopCompiling)
-{ Write-Host "Compiling library 'vunit_lib' ..." -ForegroundColor Yellow
- $Options = $GlobalOptions
- $Files = (
- "$SourceDir\vhdl\run\src\stop_api.vhd",
- "$SourceDir\vhdl\vhdl\src\lib\std\textio.vhd",
- "$SourceDir\vhdl\vhdl\src\lang\lang.vhd",
- "$SourceDir\vhdl\com\src\com_types.vhd",
- "$SourceDir\vhdl\run\src\stop_body_2008.vhd",
- "$SourceDir\vhdl\com\src\com_api.vhd",
- "$SourceDir\vhdl\string_ops\src\string_ops.vhd",
- "$SourceDir\vhdl\path\src\path.vhd",
- "$SourceDir\vhdl\logging\src\log_types.vhd",
- "$SourceDir\vhdl\logging\src\log_formatting.vhd",
- "$SourceDir\vhdl\logging\src\log_special_types200x.vhd",
- "$SourceDir\vhdl\array\src\array_pkg.vhd",
- "$SourceDir\vhdl\logging\src\log_base_api.vhd",
- "$SourceDir\vhdl\logging\src\log_base.vhd",
- "$SourceDir\vhdl\logging\src\log_api.vhd",
- "$SourceDir\vhdl\logging\src\log.vhd",
- "$SourceDir\vhdl\check\src\check_types.vhd",
- "$SourceDir\vhdl\check\src\check_special_types200x.vhd",
- "$SourceDir\vhdl\check\src\check_base_api.vhd",
- "$SourceDir\vhdl\check\src\check_base.vhd",
- "$SourceDir\vhdl\check\src\check_api.vhd",
- "$SourceDir\vhdl\check\src\check.vhd",
- "$SourceDir\vhdl\dictionary\src\dictionary.vhd",
- "$SourceDir\vhdl\run\src\run_types.vhd",
- "$SourceDir\vhdl\run\src\run_special_types200x.vhd",
- "$SourceDir\vhdl\run\src\run_base_api.vhd",
- "$SourceDir\vhdl\run\src\run_base.vhd",
- "$SourceDir\vhdl\run\src\run_api.vhd",
- "$SourceDir\vhdl\run\src\run.vhd",
- "$SourceDir\vhdl\vunit_run_context.vhd",
- "$SourceDir\vhdl\vunit_context.vhd",
- "$SourceDir\vhdl\com\src\com_std_codec_builder.vhd",
- "$SourceDir\vhdl\com\src\com_debug_codec_builder.vhd",
- "$SourceDir\vhdl\com\src\com_string.vhd",
- "$SourceDir\vhdl\com\src\com_codec_api.vhd",
- "$SourceDir\vhdl\com\src\com_codec.vhd",
- "$SourceDir\vhdl\com\src\com.vhd",
- "$SourceDir\vhdl\com\src\com_context.vhd")
- foreach ($File in $Files)
- { Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
- $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=vunit_lib " + $File + " 2>&1"
- $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+Write-Host "Compiling library 'vunit_lib' ..." -ForegroundColor Yellow
+$Options = $GlobalOptions
+$Files = (
+ "$SourceDir\vunit\vhdl\run\src\stop_api.vhd",
+ "$SourceDir\vunit\vhdl\vhdl\src\lib\std\textio.vhd",
+ "$SourceDir\vunit\vhdl\vhdl\src\lang\lang.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_types.vhd",
+ "$SourceDir\vunit\vhdl\run\src\stop_body_2008.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_api.vhd",
+ "$SourceDir\vunit\vhdl\string_ops\src\string_ops.vhd",
+ "$SourceDir\vunit\vhdl\path\src\path.vhd",
+ "$SourceDir\vunit\vhdl\logging\src\log_types.vhd",
+ "$SourceDir\vunit\vhdl\logging\src\log_formatting.vhd",
+ "$SourceDir\vunit\vhdl\logging\src\log_special_types200x.vhd",
+ "$SourceDir\vunit\vhdl\array\src\array_pkg.vhd",
+ "$SourceDir\vunit\vhdl\logging\src\log_base_api.vhd",
+ "$SourceDir\vunit\vhdl\logging\src\log_base.vhd",
+ "$SourceDir\vunit\vhdl\logging\src\log_api.vhd",
+ "$SourceDir\vunit\vhdl\logging\src\log.vhd",
+ "$SourceDir\vunit\vhdl\check\src\check_types.vhd",
+ "$SourceDir\vunit\vhdl\check\src\check_special_types200x.vhd",
+ "$SourceDir\vunit\vhdl\check\src\check_base_api.vhd",
+ "$SourceDir\vunit\vhdl\check\src\check_base.vhd",
+ "$SourceDir\vunit\vhdl\check\src\check_api.vhd",
+ "$SourceDir\vunit\vhdl\check\src\check.vhd",
+ "$SourceDir\vunit\vhdl\dictionary\src\dictionary.vhd",
+ "$SourceDir\vunit\vhdl\run\src\run_types.vhd",
+ "$SourceDir\vunit\vhdl\run\src\run_special_types200x.vhd",
+ "$SourceDir\vunit\vhdl\run\src\run_base_api.vhd",
+ "$SourceDir\vunit\vhdl\run\src\run_base.vhd",
+ "$SourceDir\vunit\vhdl\run\src\run_api.vhd",
+ "$SourceDir\vunit\vhdl\run\src\run.vhd",
+ "$SourceDir\vunit\vhdl\vunit_run_context.vhd",
+ "$SourceDir\vunit\vhdl\vunit_context.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_std_codec_builder.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_debug_codec_builder.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_string.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_codec_api.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_codec.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com.vhd",
+ "$SourceDir\vunit\vhdl\com\src\com_context.vhd")
+foreach ($File in $Files)
+{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
+ $InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=vunit_lib " + $File + " 2>&1"
+ $ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { break }
}
}
Write-Host "--------------------------------------------------------------------------------"
Write-Host "Compiling VUnit library " -NoNewline
-if ($StopCompiling)
+if ($ErrorCount -gt 0)
{ Write-Host "[FAILED]" -ForegroundColor Red }
else
{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
diff --git a/libraries/vendors/compile-vunit.sh b/libraries/vendors/compile-vunit.sh
index f77961be2..0cecf3685 100755
--- a/libraries/vendors/compile-vunit.sh
+++ b/libraries/vendors/compile-vunit.sh
@@ -118,18 +118,14 @@ elif [ "$HELP" == "TRUE" ]; then
fi
if [ "$ALL" == "TRUE" ]; then
- UNISIM=TRUE
- UNIMACRO=TRUE
- SIMPRIM=TRUE
- SECUREIP=TRUE
+ COMPILE_VUNIT=TRUE
fi
# extract data from configuration
-InstallDir=${InstallationDirectory[VUnit]}
-SourceDir="$InstallDir"
+SourceDir=${SourceDirectory[VUnit]}
DestinationDir=${DestinationDirectory[VUnit]}
-if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+if [ -z $DestinationDir ]; then
echo -e "${COLORED_ERROR} VUnit is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
exit -1
elif [ ! -d $SourceDir ]; then
@@ -163,7 +159,7 @@ else
fi
fi
-STOPCOMPILING=FALSE
+ERRORCOUNT=0
# Cleanup directory
# ==============================================================================
@@ -175,68 +171,68 @@ fi
# Library vunit_lib
# ==============================================================================
# compile vunit packages
-if [ "$STOPCOMPILING" == "FALSE" ]; then
- echo -e "${ANSI_YELLOW}Compiling library 'vunit_lib' ...${ANSI_RESET}"
- GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--std=08)
- Files=(
- $SourceDir/vhdl/run/src/stop_api.vhd
- $SourceDir/vhdl/vhdl/src/lib/std/textio.vhd
- $SourceDir/vhdl/vhdl/src/lang/lang.vhd
- $SourceDir/vhdl/com/src/com_types.vhd
- $SourceDir/vhdl/run/src/stop_body_2008.vhd
- $SourceDir/vhdl/com/src/com_api.vhd
- $SourceDir/vhdl/string_ops/src/string_ops.vhd
- $SourceDir/vhdl/path/src/path.vhd
- $SourceDir/vhdl/logging/src/log_types.vhd
- $SourceDir/vhdl/logging/src/log_formatting.vhd
- $SourceDir/vhdl/logging/src/log_special_types200x.vhd
- $SourceDir/vhdl/array/src/array_pkg.vhd
- $SourceDir/vhdl/logging/src/log_base_api.vhd
- $SourceDir/vhdl/logging/src/log_base.vhd
- $SourceDir/vhdl/logging/src/log_api.vhd
- $SourceDir/vhdl/logging/src/log.vhd
- $SourceDir/vhdl/check/src/check_types.vhd
- $SourceDir/vhdl/check/src/check_special_types200x.vhd
- $SourceDir/vhdl/check/src/check_base_api.vhd
- $SourceDir/vhdl/check/src/check_base.vhd
- $SourceDir/vhdl/check/src/check_api.vhd
- $SourceDir/vhdl/check/src/check.vhd
- $SourceDir/vhdl/dictionary/src/dictionary.vhd
- $SourceDir/vhdl/run/src/run_types.vhd
- $SourceDir/vhdl/run/src/run_special_types200x.vhd
- $SourceDir/vhdl/run/src/run_base_api.vhd
- $SourceDir/vhdl/run/src/run_base.vhd
- $SourceDir/vhdl/run/src/run_api.vhd
- $SourceDir/vhdl/run/src/run.vhd
- $SourceDir/vhdl/vunit_run_context.vhd
- $SourceDir/vhdl/vunit_context.vhd
- $SourceDir/vhdl/com/src/com_std_codec_builder.vhd
- $SourceDir/vhdl/com/src/com_debug_codec_builder.vhd
- $SourceDir/vhdl/com/src/com_string.vhd
- $SourceDir/vhdl/com/src/com_codec_api.vhd
- $SourceDir/vhdl/com/src/com_codec.vhd
- $SourceDir/vhdl/com/src/com.vhd
- $SourceDir/vhdl/com/src/com_context.vhd
- )
- for File in ${Files[@]}; do
- FileName=$(basename "$File")
- if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
- echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
- else
- echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
- ghdl -a ${GHDL_PARAMS[@]} --work=vunit_lib "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
+echo -e "${ANSI_YELLOW}Compiling library 'vunit_lib' ...${ANSI_RESET}"
+GHDL_PARAMS=(${GHDL_OPTIONS[@]})
+GHDL_PARAMS+=(--std=08)
+Files=(
+ $SourceDir/run/src/stop_api.vhd
+ $SourceDir/vhdl/src/lib/std/textio.vhd
+ $SourceDir/vhdl/src/lang/lang.vhd
+ $SourceDir/com/src/com_types.vhd
+ $SourceDir/run/src/stop_body_2008.vhd
+ $SourceDir/com/src/com_api.vhd
+ $SourceDir/string_ops/src/string_ops.vhd
+ $SourceDir/path/src/path.vhd
+ $SourceDir/logging/src/log_types.vhd
+ $SourceDir/logging/src/log_formatting.vhd
+ $SourceDir/logging/src/log_special_types200x.vhd
+ $SourceDir/array/src/array_pkg.vhd
+ $SourceDir/logging/src/log_base_api.vhd
+ $SourceDir/logging/src/log_base.vhd
+ $SourceDir/logging/src/log_api.vhd
+ $SourceDir/logging/src/log.vhd
+ $SourceDir/check/src/check_types.vhd
+ $SourceDir/check/src/check_special_types200x.vhd
+ $SourceDir/check/src/check_base_api.vhd
+ $SourceDir/check/src/check_base.vhd
+ $SourceDir/check/src/check_api.vhd
+ $SourceDir/check/src/check.vhd
+ $SourceDir/dictionary/src/dictionary.vhd
+ $SourceDir/run/src/run_types.vhd
+ $SourceDir/run/src/run_special_types200x.vhd
+ $SourceDir/run/src/run_base_api.vhd
+ $SourceDir/run/src/run_base.vhd
+ $SourceDir/run/src/run_api.vhd
+ $SourceDir/run/src/run.vhd
+ $SourceDir/vunit_run_context.vhd
+ $SourceDir/vunit_context.vhd
+ $SourceDir/com/src/com_std_codec_builder.vhd
+ $SourceDir/com/src/com_debug_codec_builder.vhd
+ $SourceDir/com/src/com_string.vhd
+ $SourceDir/com/src/com_codec_api.vhd
+ $SourceDir/com/src/com_codec.vhd
+ $SourceDir/com/src/com.vhd
+ $SourceDir/com/src/com_context.vhd
+)
+for File in ${Files[@]}; do
+ FileName=$(basename "$File")
+ if [ "$SKIP_EXISTING_FILES" == "TRUE" ] && [ -e "${FileName%.*}.o" ]; then
+ echo -e "${ANSI_CYAN}Skipping package '$File'${ANSI_RESET}"
+ else
+ echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
+ ghdl -a ${GHDL_PARAMS[@]} --work=vunit_lib "$File" 2>&1 | $GRC_COMMAND
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
break
fi
fi
- done
-fi
+ fi
+done
echo "--------------------------------------------------------------------------------"
echo -n "Compiling VUnit library "
-if [ "$STOPCOMPILING" == "TRUE" ]; then
+if [ $ERRORCOUNT -gt 0 ]; then
echo -e $COLORED_FAILED
else
echo -e $COLORED_SUCCESSFUL
diff --git a/libraries/vendors/compile-xilinx-ise.ps1 b/libraries/vendors/compile-xilinx-ise.ps1
index 7557a5129..610210f6c 100644
--- a/libraries/vendors/compile-xilinx-ise.ps1
+++ b/libraries/vendors/compile-xilinx-ise.ps1
@@ -47,25 +47,32 @@
[CmdletBinding()]
param(
# Compile all libraries and packages.
- [switch]$All = $null,
+ [switch]$All = $false,
# Compile the Xilinx simulation library.
- [switch]$Unisim = $false,
+ [switch]$Unisim = $false,
# Compile the Xilinx macro library.
- [switch]$Unimacro = $false,
+ [switch]$Unimacro = $false,
# Compile the Xilinx post-map simulation library.
- [switch]$Simprim = $false,
+ [switch]$Simprim = $false,
# Compile the Xilinx secureip library.
- [switch]$SecureIP = $false,
+ [switch]$SecureIP = $false,
+
+ # Set VHDL Standard to '93
+ [switch]$VHDL93 = $false,
+ # Set VHDL Standard to '08
+ [switch]$VHDL2008 = $false,
# Clean up directory before analyzing.
- [switch]$Clean = $false,
+ [switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
[switch]$SuppressWarnings = $false,
+ # Halt on errors
+ [switch]$HaltOnError = $false,
# Show the embedded help page(s)
[switch]$Help = $false
@@ -96,8 +103,27 @@ elseif ($All -eq $true)
$Unimacro = $true
$SecureIP = $true
}
-$StopCompiling = $false
+if ($VHDL93 -eq $true)
+{ $VHDLStandard = "93c"
+ $VHDLFlavor = "synopsys"
+ $DestinationDir += ".v93"
+}
+elseif ($VHDL2008 -eq $true)
+{ $VHDLStandard = "08"
+ $VHDLFlavor = "standard"
+ $DestinationDir += ".v08"
+ Write-Host "Not all Xilinx primitives are VHDL-2008 compatible! Setting HaltOnError to FALSE." -ForegroundColor Red
+ $HaltOnError = $false
+}
+else
+{ $VHDLStandard = "93c"
+ $VHDLFlavor = "synopsys"
+ $DestinationDir += ".v93"
+}
+
+$StopCompiling = $false
+$ErrorCount = 0
# define global GHDL Options
$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--no-vital-checks", "--warn-binding", "--mb-comments")
@@ -120,8 +146,8 @@ if ($Clean)
if ((-not $StopCompiling) -and $Unisim)
{ Write-Host "Compiling library 'unisim' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = (
"$SourceDir\unisims\unisim_VPKG.vhd",
"$SourceDir\unisims\unisim_VCOMP.vhd")
@@ -129,23 +155,33 @@ if ((-not $StopCompiling) -and $Unisim)
{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
# compile unisim primitives
if ((-not $StopCompiling) -and $Unisim)
{ $Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\unisims\primitive\*.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -153,15 +189,20 @@ if ((-not $StopCompiling) -and $Unisim)
if ((-not $StopCompiling) -and $Unisim -and $SecureIP)
{ Write-Host "Compiling library secureip primitives ..." -ForegroundColor Yellow
$Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\unisims\secureip\*.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=secureip " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- #if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ # break
+ }
+ }
}
}
@@ -171,31 +212,41 @@ if ((-not $StopCompiling) -and $Unisim -and $SecureIP)
if ((-not $StopCompiling) -and $Unimacro)
{ Write-Host "Compiling library 'unimacro' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = @(
"$SourceDir\unimacro\unimacro_VCOMP.vhd")
foreach ($File in $Files)
{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
# compile unimacro macros
if ((-not $StopCompiling) -and $Unimacro)
{ $Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\unimacro\*_MACRO.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -205,8 +256,8 @@ if ((-not $StopCompiling) -and $Unimacro)
if ((-not $StopCompiling) -and $Simprim)
{ Write-Host "Compiling library 'simprim' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = (
"$SourceDir\simprims\simprim_Vpackage.vhd",
"$SourceDir\simprims\simprim_Vcomponents.vhd")
@@ -214,8 +265,13 @@ if ((-not $StopCompiling) -and $Simprim)
{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -223,15 +279,20 @@ if ((-not $StopCompiling) -and $Simprim)
if ((-not $StopCompiling) -and $Simprim)
{ Write-Host "Compiling library 'simprim' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\simprims\primitive\other\*.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- #if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ # break
+ }
+ }
}
}
@@ -239,21 +300,26 @@ if ((-not $StopCompiling) -and $Simprim)
if ((-not $StopCompiling) -and $Simprim -and $SecureIP)
{ Write-Host "Compiling secureip primitives ..." -ForegroundColor Yellow
$Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\simprims\secureip\other\*.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=simprim " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- #if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ # break
+ }
+ }
}
}
Write-Host "--------------------------------------------------------------------------------"
Write-Host "Compiling Xilinx ISE libraries " -NoNewline
-if ($StopCompiling)
+if ($ErrorCount -gt 0)
{ Write-Host "[FAILED]" -ForegroundColor Red }
else
{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
diff --git a/libraries/vendors/compile-xilinx-ise.sh b/libraries/vendors/compile-xilinx-ise.sh
index b3675289c..ffbfd96d2 100755
--- a/libraries/vendors/compile-xilinx-ise.sh
+++ b/libraries/vendors/compile-xilinx-ise.sh
@@ -92,6 +92,12 @@ while [[ $# > 0 ]]; do
--secureip)
SECUREIP=TRUE
;;
+ --vhdl93)
+ VHDL93=TRUE
+ ;;
+ --vhdl2008)
+ VHDL2008=TRUE
+ ;;
*) # unknown option
UNKNOWN_OPTION=TRUE
;;
@@ -130,6 +136,8 @@ elif [ "$HELP" == "TRUE" ]; then
echo " --secureip Compile the secureip 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 entities like DSP and PCIe primitives."
echo " -H --halt-on-error Halt on error(s)."
@@ -148,12 +156,24 @@ if [ "$ALL" == "TRUE" ]; then
SECUREIP=TRUE
fi
+if [ "$VHDL93" == "TRUE" ]; then
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+elif [ "$VHDL2008" == "TRUE" ]; then
+ VHDLStandard="08"
+ VHDLFlavor="standard"
+ echo -e "${ANSI_RED}Not all Xilinx primitives are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_RESET}"
+ HALT_ON_ERROR=FALSE
+else
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+fi
+
# extract data from configuration
-InstallDir=${InstallationDirectory[XilinxISE]}
-SourceDir="$InstallDir/ISE_DS/ISE/vhdl/src"
+SourceDir=${SourceDirectory[XilinxISE]}
DestinationDir=${DestinationDirectory[XilinxISE]}
-if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+if [ -z $DestinationDir ]; then
echo -e "${COLORED_ERROR} Xilinx ISE is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
exit -1
elif [ ! -d $SourceDir ]; then
@@ -188,6 +208,7 @@ else
fi
STOPCOMPILING=FALSE
+ERRORCOUNT=0
# Cleanup directory
# ==============================================================================
@@ -202,7 +223,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'unisim' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/unisims/unisim_VPKG.vhd
$SourceDir/unisims/unisim_VCOMP.vhd
@@ -214,9 +235,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unisim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -225,7 +249,7 @@ fi
# compile unisim primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unisims/primitive/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -238,9 +262,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unisim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -250,7 +277,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ] && [ "$SECUREIP" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library secureip primitives${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unisims/secureip/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -263,9 +290,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ] && [ "$SECUREIP" =
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=secureip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -277,7 +307,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'unimacro' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/unimacro/unimacro_VCOMP.vhd
)
@@ -288,9 +318,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unimacro "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -299,7 +332,7 @@ fi
# compile unimacro macros
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unimacro/*_MACRO.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -308,9 +341,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unimacro "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -322,7 +358,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'simprim' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/simprims/simprim_Vpackage.vhd
$SourceDir/simprims/simprim_Vcomponents.vhd
@@ -334,9 +370,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=simprim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -345,7 +384,7 @@ fi
# compile simprim primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/simprims/primitive/other/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -358,9 +397,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=simprim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -369,7 +411,7 @@ fi
# compile simprim secureip primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ] && [ "$SECUREIP" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/simprims/secureip/other/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -382,9 +424,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$SIMPRIM" == "TRUE" ] && [ "$SECUREIP"
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=simprim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -392,7 +437,7 @@ fi
echo "--------------------------------------------------------------------------------"
echo -n "Compiling Xilinx ISE libraries "
-if [ "$STOPCOMPILING" == "TRUE" ]; then
+if [ $ERRORCOUNT -gt 0 ]; then
echo -e $COLORED_FAILED
else
echo -e $COLORED_SUCCESSFUL
diff --git a/libraries/vendors/compile-xilinx-vivado.ps1 b/libraries/vendors/compile-xilinx-vivado.ps1
index 8e46825a8..8628b278f 100644
--- a/libraries/vendors/compile-xilinx-vivado.ps1
+++ b/libraries/vendors/compile-xilinx-vivado.ps1
@@ -46,22 +46,29 @@
[CmdletBinding()]
param(
# Compile all libraries and packages.
- [switch]$All = $null,
+ [switch]$All = $false,
# Compile the Xilinx simulation library.
- [switch]$Unisim = $false,
+ [switch]$Unisim = $false,
# Compile the Xilinx macro library.
- [switch]$Unimacro = $false,
+ [switch]$Unimacro = $false,
# Compile the Xilinx secureip library.
- [switch]$SecureIP = $false,
+ [switch]$SecureIP = $false,
+
+ # Set VHDL Standard to '93
+ [switch]$VHDL93 = $false,
+ # Set VHDL Standard to '08
+ [switch]$VHDL2008 = $false,
# Clean up directory before analyzing.
- [switch]$Clean = $false,
+ [switch]$Clean = $false,
# Skip warning messages. (Show errors only.)
[switch]$SuppressWarnings = $false,
+ # Halt on errors
+ [switch]$HaltOnError = $false,
# Show the embedded help page(s)
[switch]$Help = $false
@@ -84,16 +91,33 @@ Import-Module $PSScriptRoot\shared.psm1
$SourceDir = $InstallationDirectory["XilinxVivado"] + "\data\vhdl\src"
$DestinationDir = $DestinationDirectory["XilinxVivado"]
-if (-not $All)
-{ $All = $false }
-elseif ($All -eq $true)
+if ($All -eq $true)
{ $Unisim = $true
$Simprim = $true
$Unimacro = $true
$SecureIP = $true
}
-$StopCompiling = $false
+if ($VHDL93 -eq $true)
+{ $VHDLStandard = "93c"
+ $VHDLFlavor = "synopsys"
+ $DestinationDir += ".v93"
+}
+elseif ($VHDL2008 -eq $true)
+{ $VHDLStandard = "08"
+ $VHDLFlavor = "standard"
+ $DestinationDir += ".v08"
+ Write-Host "Not all Xilinx primitives are VHDL-2008 compatible! Setting HaltOnError to FALSE." -ForegroundColor Red
+ $HaltOnError = $false
+}
+else
+{ $VHDLStandard = "93c"
+ $VHDLFlavor = "synopsys"
+ $DestinationDir += ".v93"
+}
+
+$StopCompiling = $false
+$ErrorCount = 0
# define global GHDL Options
$GlobalOptions = ("-a", "-fexplicit", "-frelaxed-rules", "--warn-binding", "--mb-comments")
@@ -117,8 +141,8 @@ if ((-not $StopCompiling) -and $Unisim)
{ Write-Host "Compiling library 'unisim' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
$Options += "--no-vital-checks"
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = (
"$SourceDir\unisims\unisim_VPKG.vhd",
"$SourceDir\unisims\unisim_VCOMP.vhd",
@@ -128,8 +152,13 @@ if ((-not $StopCompiling) -and $Unisim)
{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -137,15 +166,20 @@ if ((-not $StopCompiling) -and $Unisim)
if ((-not $StopCompiling) -and $Unisim)
{ $Options = $GlobalOptions
$Options += "--no-vital-checks"
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\unisims\primitive\*.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -153,15 +187,20 @@ if ((-not $StopCompiling) -and $Unisim)
if ((-not $StopCompiling) -and $Unisim)
{ $Options = $GlobalOptions
$Options += "--no-vital-checks"
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\unisims\retarget\*.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing retarget primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unisim " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- #if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ # break
+ }
+ }
}
}
@@ -169,15 +208,20 @@ if ((-not $StopCompiling) -and $Unisim)
if ((-not $StopCompiling) -and $Unisim -and $SecureIP)
{ Write-Host "Compiling library secureip primitives ..." -ForegroundColor Yellow
$Options = $GlobalOptions
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\unisims\secureip\*.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=secureip " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -188,16 +232,21 @@ if ((-not $StopCompiling) -and $Unimacro)
{ Write-Host "Compiling library 'unimacro' ..." -ForegroundColor Yellow
$Options = $GlobalOptions
$Options += "--no-vital-checks"
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = @(
"$SourceDir\unimacro\unimacro_VCOMP.vhd")
foreach ($File in $Files)
{ Write-Host "Analyzing package '$File'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ break
+ }
+ }
}
}
@@ -205,15 +254,20 @@ if ((-not $StopCompiling) -and $Unimacro)
if ((-not $StopCompiling) -and $Unimacro)
{ $Options = $GlobalOptions
$Options += "--no-vital-checks"
- $Options += "--ieee=synopsys"
- $Options += "--std=93c"
+ $Options += "--ieee=$VHDLFlavor"
+ $Options += "--std=$VHDLStandard"
$Files = dir "$SourceDir\unimacro\*_MACRO.vhd*"
foreach ($File in $Files)
{ Write-Host "Analyzing primitive '$($File.FullName)'" -ForegroundColor Cyan
$InvokeExpr = "ghdl.exe " + ($Options -join " ") + " --work=unimacro " + $File.FullName + " 2>&1"
$ErrorRecordFound = Invoke-Expression $InvokeExpr | Restore-NativeCommandStream | Write-ColoredGHDLLine $SuppressWarnings
- $StopCompiling = ($LastExitCode -ne 0)
- #if ($StopCompiling) { break }
+ if ($LastExitCode -ne 0)
+ { $ErrorCount += 1
+ if ($HaltOnError)
+ { $StopCompiling = $true
+ # break
+ }
+ }
}
}
@@ -223,7 +277,7 @@ if ((-not $StopCompiling) -and $Unimacro)
Write-Host "--------------------------------------------------------------------------------"
Write-Host "Compiling Xilinx Vivado libraries " -NoNewline
-if ($StopCompiling)
+if ($ErrorCount -gt 0)
{ Write-Host "[FAILED]" -ForegroundColor Red }
else
{ Write-Host "[SUCCESSFUL]" -ForegroundColor Green }
diff --git a/libraries/vendors/compile-xilinx-vivado.sh b/libraries/vendors/compile-xilinx-vivado.sh
index b47a66a08..3bc06b037 100755
--- a/libraries/vendors/compile-xilinx-vivado.sh
+++ b/libraries/vendors/compile-xilinx-vivado.sh
@@ -88,6 +88,12 @@ while [[ $# > 0 ]]; do
--secureip)
SECUREIP=TRUE
;;
+ --vhdl93)
+ VHDL93=TRUE
+ ;;
+ --vhdl2008)
+ VHDL2008=TRUE
+ ;;
*) # unknown option
UNKNOWN_OPTION=TRUE
;;
@@ -125,6 +131,8 @@ elif [ "$HELP" == "TRUE" ]; then
echo " --secureip Compile the secureip 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 entities like DSP and PCIe primitives."
echo " -H --halt-on-error Halt on error(s)."
@@ -142,12 +150,24 @@ if [ "$ALL" == "TRUE" ]; then
SECUREIP=TRUE
fi
+if [ "$VHDL93" == "TRUE" ]; then
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+elif [ "$VHDL2008" == "TRUE" ]; then
+ VHDLStandard="08"
+ VHDLFlavor="standard"
+ echo -e "${ANSI_RED}Not all Xilinx primitives are VHDL-2008 compatible! Setting HALT_ON_ERROR to FALSE.${ANSI_RESET}"
+ HALT_ON_ERROR=FALSE
+else
+ VHDLStandard="93c"
+ VHDLFlavor="synopsys"
+fi
+
# extract data from configuration
-InstallDir=${InstallationDirectory[XilinxVivado]}
-SourceDir="$InstallDir/data/vhdl/src"
+SourceDir=${SourceDirectory[XilinxVivado]}
DestinationDir=${DestinationDirectory[XilinxVivado]}
-if [ -z $InstallDir ] || [ -z $DestinationDir ]; then
+if [ -z $DestinationDir ]; then
echo -e "${COLORED_ERROR} Xilinx Vivado is not configured in '$ScriptDir/config.sh'${ANSI_RESET}"
exit -1
elif [ ! -d $SourceDir ]; then
@@ -182,6 +202,7 @@ else
fi
STOPCOMPILING=FALSE
+ERRORCOUNT=0
# Cleanup directory
# ==============================================================================
@@ -196,7 +217,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'unisim' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/unisims/unisim_VPKG.vhd
$SourceDir/unisims/unisim_VCOMP.vhd
@@ -211,9 +232,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unisim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -222,7 +246,7 @@ fi
# compile unisim primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unisims/primitive/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -235,9 +259,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unisim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -246,7 +273,7 @@ fi
# compile unisim retarget primitives
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unisims/retarget/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -259,9 +286,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unisim "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -271,7 +301,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ] && [ "$SECUREIP" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library secureip primitives${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unisims/secureip/*.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -284,9 +314,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNISIM" == "TRUE" ] && [ "$SECUREIP" =
else
echo -e "${ANSI_CYAN}Analyzing primitive '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=secureip "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -298,7 +331,7 @@ fi
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
echo -e "${ANSI_YELLOW}Compiling library 'unimacro' ...${ANSI_RESET}"
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files=(
$SourceDir/unimacro/unimacro_VCOMP.vhd
)
@@ -309,9 +342,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing package '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unimacro "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -320,7 +356,7 @@ fi
# compile unimacro macros
if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
GHDL_PARAMS=(${GHDL_OPTIONS[@]})
- GHDL_PARAMS+=(--ieee=synopsys --std=93c)
+ GHDL_PARAMS+=(--ieee=$VHDLFlavor --std=$VHDLStandard)
Files="$(LC_COLLATE=C ls $SourceDir/unimacro/*_MACRO.vhd)"
for File in $Files; do
FileName=$(basename "$File")
@@ -329,9 +365,12 @@ if [ "$STOPCOMPILING" == "FALSE" ] && [ "$UNIMACRO" == "TRUE" ]; then
else
echo -e "${ANSI_CYAN}Analyzing macro '$File'${ANSI_RESET}"
ghdl -a ${GHDL_PARAMS[@]} --work=unimacro "$File" 2>&1 | $GRC_COMMAND
- if [ $? -ne 0 ] && [ "$HALT_ON_ERROR" == "TRUE" ]; then
- STOPCOMPILING=TRUE
- break
+ if [ $? -ne 0 ]; then
+ let ERRORCOUNT++
+ if [ "$HALT_ON_ERROR" == "TRUE" ]; then
+ STOPCOMPILING=TRUE
+ break
+ fi
fi
fi
done
@@ -343,7 +382,7 @@ fi
echo "--------------------------------------------------------------------------------"
echo -n "Compiling Xilinx Vivado libraries "
-if [ "$STOPCOMPILING" == "TRUE" ]; then
+if [ $ERRORCOUNT -gt 0 ]; then
echo -e $COLORED_FAILED
else
echo -e $COLORED_SUCCESSFUL
diff --git a/libraries/vendors/config.psm1 b/libraries/vendors/config.psm1
index 85fd100fa..3c228f3b1 100644
--- a/libraries/vendors/config.psm1
+++ b/libraries/vendors/config.psm1
@@ -34,17 +34,17 @@
# Configure your tools here. Use absolute paths, without trailing directory
# delimiter. Empty strings indicate not installed tools
$InstallationDirectory = @{
- "AlteraQuartusII" = "C:\Altera\15.0";
+ "AlteraQuartusII" = "C:\Altera\15.1";
"XilinxISE" = "C:\Xilinx\14.7";
- "XilinxVivado" = "C:\Xilinx\Vivado\2015.3";
+ "XilinxVivado" = "C:\Xilinx\Vivado\2016.1";
"OSVVM" = "D:\git\PoC\lib\osvvm";
"VUnit" = "D:\git\PoC\lib\vunit"
}
$DestinationDirectory = @{
"Altera" = "altera";
- "XilinxISE" = "xilinx";
- "XilinxVivado" = "vivado";
+ "XilinxISE" = "xilinx-ise";
+ "XilinxVivado" = "xilinx-vivado";
"OSVVM" = "osvvm";
"VUnit" = "vunit"
}
diff --git a/libraries/vendors/config.sh b/libraries/vendors/config.sh
index 6640b4c5b..9395269b4 100644
--- a/libraries/vendors/config.sh
+++ b/libraries/vendors/config.sh
@@ -4,16 +4,16 @@
# kate: tab-width 2; replace-tabs off; indent-width 2;
#
# ==============================================================================
-# Bash Script: Configurable directories to local installed tools
-#
# Authors: Patrick Lehmann
#
+# Bash Script: Configurable directories to local installed tools
+#
# Description:
# ------------------------------------
# This Bash file exports variables containing the users local tool environment.
#
# ==============================================================================
-# Copyright (C) 2015 Patrick Lehmann
+# Copyright (C) 2015-2016 Patrick Lehmann
#
# GHDL is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
@@ -31,21 +31,40 @@
# 02111-1307, USA.
# ==============================================================================
+
+# Configure
+# - vendor tool chain installation paths or
+# - library root directories
+# in the following dictionary.
+#
+# These values are used if no command line argument (--src) is passed to a
+# compile script. Empty strings means not configured.
declare -A InstallationDirectory
-InstallationDirectory[AlteraQuartusII]="/opt/Altera/15.0"
+InstallationDirectory[AlteraQuartus]="/opt/Altera/15.1"
InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7"
-InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2014.4"
-InstallationDirectory[LatticeDiamond]="/usr/local/diamond/3.6_x64"
+InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2016.1"
+InstallationDirectory[LatticeDiamond]="/usr/local/diamond/3.7_x64"
InstallationDirectory[OSVVM]="/home/paebbels/git/PoC/lib/osvvm"
InstallationDirectory[VUnit]="/home/paebbels/git/PoC/lib/vunit"
+# Configure preferred output directories for each library set:
declare -A DestinationDirectory
-DestinationDirectory[AlteraQuartusII]="altera"
-DestinationDirectory[XilinxISE]="xilinx"
-DestinationDirectory[XilinxVivado]="vivado"
+DestinationDirectory[AlteraQuartus]="altera"
+DestinationDirectory[XilinxISE]="xilinx-ise"
+DestinationDirectory[XilinxVivado]="xilinx-vivado"
DestinationDirectory[LatticeDiamond]="lattice"
DestinationDirectory[OSVVM]="osvvm"
DestinationDirectory[VUnit]="vuint"
+# Declare source directories depending on the installation paths:
+declare -A SourceDirectory
+SourceDirectory[AlteraQuartus]="${InstallationDirectory[AlteraQuartus]}/quartus/eda/sim_lib"
+SourceDirectory[XilinxISE]="${InstallationDirectory[XilinxISE]}/ISE_DS/ISE/vhdl/src"
+SourceDirectory[XilinxVivado]="${InstallationDirectory[XilinxVivado]}/data/vhdl/src"
+SourceDirectory[LatticeDiamond]="${InstallationDirectory[LatticeDiamond]}/cae_library/simulation/vhdl"
+SourceDirectory[OSVVM]="${InstallationDirectory[OSVVM]}"
+SourceDirectory[VUnit]="${InstallationDirectory[VUnit]}/vunit/vhdl"
+
# input files greater than $LARGE_FILESIZE are skipped if '--skip-largefiles' is set
LARGE_FILESIZE=125000
+