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.
Partial support of PSL.
GHDL is free software:
- available at
- 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
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
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:
|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'.