Skip to content

Latest commit

 

History

History
120 lines (73 loc) · 3.41 KB

ghdl.adoc

File metadata and controls

120 lines (73 loc) · 3.41 KB

GHDL

GHDL is a very well established free and open source simulator for VHDL. For more information, visit the GHDL home page.

Installation on Windows

The easiest way for Windows users to get GHDL running is to install it as a binary package in MSYS2:

  1. Install MSYS2 if required by following these steps.

  2. Open an MSYS2 MINGW32 shell.

  3. Enter the following command to install GHDL:

    pacman -S --needed mingw-w64-i686-ghdl-mcode
  4. To check the GHDL version, enter the following command:

    ghdl --version

    You should see something like this:

    GHDL 3.0.0-dev (2.0.0.r670.ga259712cc) [Dunoon edition]
     Compiled with GNAT Version: 12.2.0
     mcode code generator
    Written by Tristan Gingold.
    
    Copyright (C) 2003 - 2022 Tristan Gingold.
    GHDL is free software, covered by the GNU General Public License.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

AMD/Xilinx Vivado Libraries

To build the Vivado libraries:

  1. Open an MSYS2 MINGW32 shell.

  2. Navigate to the GHDL vendor library directory:

    cd /mingw32/lib/ghdl/vendors
  3. Edit the Xilinx_Vivado_Settings section of config.sh there to match your Vivado installation path, for example:

    declare -A Xilinx_Vivado_Settings=(
    	["InstallationDirectory"]="/c/Xilinx/Vivado/2022.1"
    	["SourceDirectory"]="data/vhdl/src"
    	["DestinationDirectory"]="xilinx-vivado"
    )
  4. Run the build script, specifying all libraries, for VHDL 1993 and 2008:

    ./compile-xilinx-vivado.sh -a --vhdl93
    ./compile-xilinx-vivado.sh -a --vhdl2008

Note: the process takes many minutes to complete. Some script warnings may be produced (the script was written to run on Linux systems).

When running GHDL analysis or elaboration, specify the path to these libraries with the following command line option:

-P/mingw32/lib/ghdl/vendors/xilinx-vivado

Intel/Altera Quartus Libraries

To build the Quartus libraries:

  1. Open an MSYS2 MINGW32 shell.

  2. Navigate to the GHDL vendor library directory:

    cd /mingw32/lib/ghdl/vendors
  3. Edit the Intel_Quartus_Settings section of config.sh there to match your Quartus installation path, for example:

    declare -A Intel_Quartus_Settings=(
    	["InstallationDirectory"]="/c/intelFPGA_lite/21.1/quartus"
    	["SourceDirectory"]="eda/sim_lib"
    	["DestinationDirectory"]="intel"
    )
  4. Run the build script, specifying all libraries, for VHDL 1993 and 2008:

    ./compile-intel.sh -a --vhdl93
    ./compile-intel.sh -a --vhdl2008

Note: the process takes many minutes to complete. Some script warnings may be produced (the script was written to run on Linux systems).

When running GHDL analysis or elaboration, specify the path to these libraries with the following command line option:

-P/mingw32/lib/ghdl/vendors/intel

Building GHDL from source

To build and install the latest version of GHDL from source:

  1. Open an MSYS2 MINGW64 shell.

  2. Ensure that the required build tools are installed:

    pacman -S --needed base-devel mingw-w64-x86_64-{gcc,gnatcoll,llvm}
  3. Navigate to an appropriate working directory, and clone the GHDL repository there:

    cd ~
    git clone https://github.com/ghdl/ghdl.git
  4. Navigate into the cloned repository, create a build subdirectory and navigate into that:

    cd ghdl
    mkdir build
    cd build
  5. Configure the build, specifying where to install it:

    ../configure --prefix=/mingw32
  6. Build and install GHDL:

    make
    make install