GHDL is a very well established free and open source simulator for VHDL. For more information, visit the GHDL home page.
The easiest way for Windows users to get GHDL running is to install it as a binary package in MSYS2:
-
Install MSYS2 if required by following these steps.
-
Open an MSYS2 MINGW32 shell.
-
Enter the following command to install GHDL:
pacman -S --needed mingw-w64-i686-ghdl-mcode
-
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.
To build the Vivado libraries:
-
Open an MSYS2 MINGW32 shell.
-
Navigate to the GHDL vendor library directory:
cd /mingw32/lib/ghdl/vendors
-
Edit the
Xilinx_Vivado_Settings
section ofconfig.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" )
-
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
To build the Quartus libraries:
-
Open an MSYS2 MINGW32 shell.
-
Navigate to the GHDL vendor library directory:
cd /mingw32/lib/ghdl/vendors
-
Edit the
Intel_Quartus_Settings
section ofconfig.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" )
-
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
To build and install the latest version of GHDL from source:
-
Open an MSYS2 MINGW64 shell.
-
Ensure that the required build tools are installed:
pacman -S --needed base-devel mingw-w64-x86_64-{gcc,gnatcoll,llvm}
-
Navigate to an appropriate working directory, and clone the GHDL repository there:
cd ~ git clone https://github.com/ghdl/ghdl.git
-
Navigate into the cloned repository, create a build subdirectory and navigate into that:
cd ghdl mkdir build cd build
-
Configure the build, specifying where to install it:
../configure --prefix=/mingw32
-
Build and install GHDL:
make make install