diff options
author | 1138-4EB <1138-4EB@users.noreply.github.com> | 2017-02-21 00:50:09 +0100 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2017-12-10 12:02:05 +0100 |
commit | 669fd99724492f9c8983f414b43e7dfb7bec0dd0 (patch) | |
tree | dbc354c2be1f969763cfa369413109381b5508e3 /doc/building | |
parent | bfb47bd712511b42c66094c649fee89cd621fe32 (diff) | |
download | ghdl-669fd99724492f9c8983f414b43e7dfb7bec0dd0.tar.gz ghdl-669fd99724492f9c8983f414b43e7dfb7bec0dd0.tar.bz2 ghdl-669fd99724492f9c8983f414b43e7dfb7bec0dd0.zip |
Add theme_overrrides.css
Move WhatIs* to About. Move About, Contributing and Copying to doc. Rename Copying to License. Append CC-BY-SA-4.0 legalcode to COPYING.md
Chapter Introduction ready for review.
Starting to rewrite Building
Diffstat (limited to 'doc/building')
-rw-r--r-- | doc/building/VendorPrimitives.md | 329 | ||||
-rw-r--r-- | doc/building/index.rst | 178 |
2 files changed, 0 insertions, 507 deletions
diff --git a/doc/building/VendorPrimitives.md b/doc/building/VendorPrimitives.md deleted file mode 100644 index b608c0825..000000000 --- a/doc/building/VendorPrimitives.md +++ /dev/null @@ -1,329 +0,0 @@ -.. _VENDOR: - -Vendor Primitives -############# - -## Compile Scripts for Vendor VHDL Libraries - -Vendors like Altera, Lattice and Xilinx have their own simulation libraries, -especially for FPGA primitives, soft and hard macros. These libraries can not be -shipped with GHDL, but we offer prepared compile scripts to pre-compile the -vendor libraries, if the vendor tool is present on the computer. - -There are also popular simulation and verification libraries like [OSVVM][osvvm] -and [VUnit][vunit], which can be pre-compile, too. - -The compilation scripts are writen in the shell languages: PowerShell for Windows -and Bash for Linux. The compile scripts can colorize the GHDL warning and error -lines with the help of grc/grcat ([generic colourizer][grc]). - - [osvvm]: http://osvvm.org/ - [vunit]: https://github.com/LarsAsplund/vunit - [grc]: http://kassiopeia.juls.savba.sk/~garabik/software/grc.html - -##### Supported Vendors Libraries - - - Altera Quartus (≥13.0): - - lpm, sgate - - altera, altera_mf, altera_lnsim - - arriaii, arriaii_pcie_hip, arriaiigz - - arriav, arriavgz, arriavgz_pcie_hip - - cycloneiv, cycloneiv_pcie_hip, cycloneive - - cyclonev - - max, maxii, maxv - - stratixiv, stratixiv_pcie_hip - - stratixv, stratixv_pcie_hip - - fiftyfivenm, twentynm - - Lattice (≥3.6): - - ec - - ecp, ecp2, ecp3, ecp5u - - lptm, lptm2 - - machxo, machxo2, machxo3l - - sc, scm - - xp, xp2 - - Xilinx ISE (≥14.0): - - unisim (incl. secureip) - - unimacro - - simprim (incl. secureip) - - xilinxcorelib - - Xilinx Vivado (≥2014.1): - - unisim (incl. secureip) - - unimacro - -##### Supported Simulation and Verification Libraries - - - OSVVM (for VHDL-2008) - - osvvm - - VUnit (for VHDL-2008) - - vunit_lib - ---------------------------------------------------------------------- -### Script Configuration - -The vendor library compile scripts need to know where the used / latest vendor -tool chain is installed. Therefore, the script implement a default installation -directory search as well as environment variable checks. If a vendor tool could -not be detected or the script choses the wrong vendor library source directory, -then it's possible to provide the path via `--source` or `-Source`. - -The generated output is stored relative to the current working directory. The -scripts create a sub-directory for each vendor. The default output directory can -be overwritten by the parameter `--output` or `-Output`. - -To compile all source files with GHDL, the simulator executable is searched in -`PATH`. The found default GHDL executable can be overwritten by setting the -environment variable `GHDL` or by passing the parameter `--ghdl` or `-GHDL` to -the scripts. - -If the vendor library compilation is used very often, we recommend to configure -these parameters in `config.sh` or `config.psm1`, so the command line can be -shortened to the essential parts. - ---------------------------------------------------------------------- -### Compiling on Linux - - - **Step 0 - Configure the scripts (optional)** - See next section for how to configure `config.sh`. - - - **Step 1 - Browse to your simulation working directory** - ```Bash - $ cd <MySimulationFolder> - ``` - - - **Step 2 - Start the compilation script(s)** - ```Bash - $ /usr/local/lib/ghdl/vendors/compile-altera.sh --all - $ /usr/local/lib/ghdl/vendors/compile-lattice.sh --all - $ /usr/local/lib/ghdl/vendors/compile-xilinx-ise.sh --all - $ /usr/local/lib/ghdl/vendors/compile-xilinx-vivado.sh --all - $ /usr/local/lib/ghdl/vendors/compile-osvvm.sh --all - $ /usr/local/lib/ghdl/vendors/compile-vunit.sh --all - ``` - - In most cases GHDL is installed into `/usr/local/`. The scripts are - installed into the `lib` directory. - - - **Step 3 - Viewing the result** - This creates vendor directories in your current working directory and - compiles the vendor files into them. - - ```Bash - $ ls -ahl - ... - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:41 altera - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:42 lattice - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 osvvm - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 vunit - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:58 xilinx-ise - drwxr-xr-x 2 <user> <group> 56K Nov 30 17:48 xilinx-vivado - ``` - - ---------------------------------------------------------------------- -### Compiling on Windows - - - **Step 0 - Configure the scripts (optional)** - See next section for how to configure `config.psm1`. - - - **Step 1 - Browse to your simulation working directory** - ```PowerShell - PS> cd <MySimulationFolder> - ``` - - - **Step 2 - Start the compilation script(s)** - ```PowerShell - PS> <GHDL>\libraries\vendors\compile-altera.ps1 -All - PS> <GHDL>\libraries\vendors\compile-lattice.ps1 -All - PS> <GHDL>\libraries\vendors\compile-xilinx-ise.ps1 -All - PS> <GHDL>\libraries\vendors\compile-xilinx-vivado.ps1 -All - PS> <GHDL>\libraries\vendors\compile-osvvm.ps1 -All - PS> <GHDL>\libraries\vendors\compile-vunit.ps1 -All - ``` - - - **Step 3 - Viewing the result** - This creates vendor directories in your current working directory and - compiles the vendor files into them. - - ```PowerShell - PS> dir - Directory: D:\temp\ghdl - - Mode LastWriteTime Length Name - ---- ------------- ------ ---- - d---- 20.11.2015 19:33 <DIR> altera - d---- 20.11.2015 19:38 <DIR> lattice - d---- 20.11.2015 19:38 <DIR> osvvm - d---- 20.11.2015 19:45 <DIR> vunit_lib - d---- 20.11.2015 19:06 <DIR> xilinx-ise - d---- 20.11.2015 19:40 <DIR> xilinx-vivado - ``` - ---------------------------------------------------------------------- -### Configuration Files - -#### For Linux: `config.sh` - -Please open the `config.sh` file and set the dictionary entries for the -installed vendor tools to the appropriate directory to your tool's installation -directories. Use an empty string `""` for not installed tools. - -`config.sh`: -```Bash -declare -A InstallationDirectory -InstallationDirectory[AlteraQuartus]="/opt/Altera/16.0" -InstallationDirectory[LatticeDiamond]="/opt/Diamond/3.8_x64" -InstallationDirectory[OSVVM]="/home/<user>/git/GitHub/osvvm" -InstallationDirectory[VUnit]="/home/<user>/git/GitHub/vunit" -InstallationDirectory[XilinxISE]="/opt/Xilinx/14.7" -InstallationDirectory[XilinxVivado]="/opt/Xilinx/Vivado/2016.3" -``` - -#### For Windows: `config.psm1` - -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. Use an empty string `""` for not installed tools. - -`config.psm1`: -```PowerShell -$InstallationDirectory = @{ - "AlteraQuartus" = "C:\Altera\16.0"; - "LatticeDiamond" = "C:\Lattice\Diamond\3.8_x64"; - "XilinxISE" = "C:\Xilinx\14.7\ISE_DS"; - "XilinxVivado" = "C:\Xilinx\Vivado\2016.3"; - "OSVVM" = "D:\git\GitHub\osvvm"; - "VUnit" = "D:\git\GitHub\vunit" -} -``` - -### Selectable Options for the Bash Scripts: - -*First I should translate the scripts before writing the docu...* - - - Common parameters to most scripts: - - -h --help Print the embedded help page(s). - -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: - - -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: - - -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 - --corelib Compile the xilinxcorelib macros - --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: - - -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. - --osvvm Compile the OSVVM library. - - `compile-vunit.sh` - Selectable libraries: - - -a --all Compile all. - --osvvm Compile the VUnit library. - -### Selectable Options for the PowerShell Scripts: - - - Common parameters to all scripts: - - -Help Print the embedded help page(s). - -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 - -CoreLib Compile the xilinxcorelib macros - -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. - -OSVVM Compile the OSVVM library. - - `compile-vunit.ps1` - Selectable libraries: - - -All Compile all. - -VUnit Compile the VUnit library. - ------------------------- -Author: Patrick Lehmann -Last update: 28.10.2016 - ------------------------- - -.. TODO:: - - - Convert Markdown to RST - - Vendor Primitives - - Alters / Intel - - Lattice - - OSVVM - - UVVM - - Xilinx ISE - - Xilinx Vivado diff --git a/doc/building/index.rst b/doc/building/index.rst deleted file mode 100644 index 9cdc812f9..000000000 --- a/doc/building/index.rst +++ /dev/null @@ -1,178 +0,0 @@ -.. _BUILD: - -Building GHDL -############# - -GHDL currently supports three supported different backends (code generators): mcode, GCC and LLVM. Here is a short comparison, so that you can choose the one you want to use: - -* mcode (an internal code generator) -+ very easy to build -- but x86_64/i386 only -+ very quick analysis time -+ can analyze very big designs -- simulation is slower -- no executable created - -* GCC -+ generated code is faster (particularly with -O or -O2) -+ generated code can be debugged (with -g) -+ the output is an executable -+ ported to many platforms (x86, x86_64, powerpc, sparc) -- analyze can takes time (particularly for big units) -- build is more complex - -* LLVM -+ same advantages of gcc (good generated code, debuggable) -+ easier to build than gcc - -As GHDL is written in Ada, you need to use the GNU Ada compiler (GNAT). I recommend to use GNAT GPL from http://libre.adacore.com (free). GHDL was tested with GNAT GPL 2014. Any later version should work. -The only other dependency is zlib (On ubuntu/debian, install zlib1g-dev). - -.. TODO:: - - - `./doc/oldmds/BUILD.txt <https://github.com/tgingold/ghdl/blob/master/doc/oldmds/BUILD.txt>`_ - - Directory structure of the main branch [1138: #279] - - Coverage, `gcov`, is unique to gcc. That specific difference is not explained anywhere. Should be added. - - @1138 Backtraces optional -patchable- - - Very briefly, why is mode faster for analysis and GCC/LLVM for simulation? - -Mcode backend -================= - -- Linux - -This is as simple as: - -$ ./configure --prefix=PREFIX - - where PREFIX is the directory for installation - -$ make - - This builds the ghdl_mcode executable, which can be used as is. - -$ make install - - To install within PREFIX - -- Windows MinGW 32/64 -- Windows GNAT GPL (32 only) - -.. TODO:: - - Note: this was tested with Windows XP SP2 familly edition. - - Note: If you want to create the installer, GHDL should be built on a FAT partition. NSIS rounds files date to be FAT compliant (seconds are always even) and because GHDL stores dates, the files date must not be modified. - - The Ada95 GNAT compiler (GNAT GPL 2005 is known to work), along with NSIS to create the installer. Then unzip, edit winbuild to use correct path for makensis, and run winbuild. The installer is in the windows directory. - -LLVM backend -================= - -- Linux - -You need to build and install llvm. The supported versions are 3.5 -till 3.9, but only debugging is only supported with llvm 3.5 -(Usually llvm also depends on libedit). - -First configure ghdl with '--with-llvm-config' -$ ./configure --with-llvm-config - -If llvm-config is not in your path, you can specify it: -$ ./configure --with-llvm-config=LLVM_INSTALL/bin/llvm-config - -If you want to have stack backtraces on errors (like assert failure or -index of out bounds), you need to configure and build libbacktrace from gcc -(you don't need to configure gcc), and add to configure: - --with-backtrace-lib=/path-to-gcc-build/libbacktrace/.libs/libbacktrace.a - -Then build with 'make' and install with 'make install'. - -- Mac OS? -- Windows MinGW 32/64 - -GCC backend -================= - -- Linux - -You need to download and untar the sources of -gcc version 4.9 [do not modify this line as this is read by scripts]. - -First configure ghdl, specify gcc source dir and prefix. -(replace /usr/local by your prefix directory): -$ ./configure --with-gcc=/path/to/gcc/source/dir --prefix=/usr/local - -Then invoke make to copy ghdl sources in the source dir: -$ make copy-sources - -There are some dependencies for building gcc (gmp, mpfr and mpc). If you have -not them installed on your system, you can either build them manually or use -the 'download_prerequisite' script provided in gcc source tree (recommended). - -$ cd /path/to/gcc/source/dir -$ ./contrib/download_prerequisites - -Then configure gcc. The list of --disable configure options could be -adjusted for your needs. GHDL don't require all these optional -libraries and disabling them speed-up the build. Note the prefix -directory must be the same as the one used to configure ghdl. -If you have manually built gmp/mpfr/mpc (without using the script -in contrib) and if you have installed them in a non-standard -directory, you may need to add --with-gmp=GMP_INSTALL_DIR. - -$ mkdir gcc-objs; cd gcc-objs -$ ../gcc-4.9.3/configure --prefix=/usr/local --enable-languages=c,vhdl \ - --disable-bootstrap --disable-lto --disable-multilib \ - --disable-libssp --disable-libgomp --disable-libquadmath -$ make -j2 - -Install gcc: -$ make install -or if you don't want to install makeinfo: -$ make install MAKEINFO=true - -Build and install vhdl libraries: -$ cd /path/to/ghdl/source/dir -$ make ghdllib -$ make install - -- Windows? - -.. TODO: - - Since the content of BUILD.txt is moved to the docs, what shall we do with this line? +gcc version 6.3 [do not modify this line as this is read by scripts]. - - Note for ppc64 (and AIX ?) platform: the object file format contains an identifier for the source language. Because gcc doesn't know about the VHDL, gcc crashes very early. This could be fixed with a very simple change in gcc/config/rs6000/rs6000.c, function rs6000_output_function_epilogue (as of gcc 4.8): - else if (! strcmp (language_string, "GNU Objective-C")) - i = 14; - else -- gcc_unreachable (); -+ i = 0; - fprintf (file, "%d,", i); - - /* 8 single bit fields: global linkage (not set for C extern linkage, - - Install file for the binary distribution of GHDL. The binary are installed in /usr/local directory. You cannot change this default location, unless you set links. You must be root to install this distribution. To install ghdl: `tar -C / -jxvf @TARFILE@.tar.bz2`. Note: you must also have a C compiler and zlib installed. - -- Notes for developpers - -Developping with the gcc backend: -Once gcc (with ghdl) has been built once, it is possible to work on ghdl -sources tree without copying them in gcc tree. Commands are: -$ make ghdl1-gcc # To build the compiler -$ make ghdl_gcc # To build the driver -$ make libs.vhdl.local_gcc # To compile the vhdl libraries -$ make grt-all # To build the ghdl runtime -$ make grt.links # To locally install the ghdl runtime - -.. TODO:: - - gcc object dir - -Test suites -================= - -.. TODO:: - - @1138 explain that there are two (maybe three with vhdl08 tests)
\ No newline at end of file |