A new GitHub organization was created (2017-12-20) and the main repo was moved from github.com/tgingold/ghdl to github.com/ghdl/ghdl. Old refs will continue working, because permanent redirects are set up. However, we suggest every contributor to update the remote URLs in their local clones. See Changing a remote's URL.
This directory contains the sources of GHDL, the open-source compiler and simulator for VHDL, a Hardware Description Language (HDL). GHDL is not an interpreter: it allows you to analyse and elaborate sources to generate machine code from your design. Native program execution is the only way for high speed simulation.
Full support for the 1987, 1993, 2002 versions of the IEEE 1076 VHDL standard, and partial for the latest 2008 revision.
Partial support of PSL.
By using a code generator (LLVM, GCC or, x86_64/i386 only, a built-in one), it is much faster than any interpreted simulator. It can handle very large designs, such as leon3/grlib.
GHDL runs on GNU/Linux, Windows and macOS, both on x86
and on x86_64
. You can freely download a binary distribution for your OS, or try to build it on your own machine (see 'Getting GHDL' below).
Can write waveforms to a GHW, VCD or FST file. Combined with a GUI-based waveform viewer and a good text editor, GHDL is a very powerful tool for writing, testing and simulating your code.
Supported third party projects: VUnit, OSVVM, cocotb (through the VPI interface), ...
GHDL is free software:
- available at ghdl.readthedocs.io
- Some of the runtime libraries, are under different terms; see the individual source files for details.
Periodically (not regularly), several binary distributions are made available through the releases tab. If you can't find the one matching the platform and versions you need, you can build it yourself!
In order to follow the traditional way to configure
and make
, you need the GNU Ada compiler, GNAT GPL, 2014 (or later) for x86 (32 or 64 bits). GNAT GPL can be downloaded anonymously from libre.adacore.com. Then, untar and run the doinstall script.
Depending on the OS and distribution you are using, you will also need to install some toolchain dependencies, such as zlib
. See 'Building' for specific package names.
In the GHDL base directory, configure and build:
$ ./configure --prefix=/usr/local
$ make
At that place, you can already use the 'ghdl_mcode' built in the directory. You can also install GHDL:
$ make install
That's all!
The executable is installed as 'ghdl' in /usr/local
. To install it to a different path, change the --prefix
in the call to configure
. For example, on Windows, you may want to set it to --prefix=/c/Program Files (x86)/GHDL
.
Furthermore, each supported compiler has its pros and cons. Here is a short comparaison:
pros | cons | observations | |
---|---|---|---|
mcode | very easy to build | x86_64/i386 only | no executable created from your design |
very quick analysis time and can analyze very big designs | simulation is slower | ||
GCC | generated code is faster | analyze can take time (particularly for big units) | the output is an executable |
generated code can be debugged | build is more complex | ||
many platforms (x86, x86_64, powerpc, sparc) |
LLVM has the same pros/cons as GCC, but it is easier to build. However, coverage (gcov
) is unique to GCC.
You can find specific instructions for each of the options in 'Building'.