This directory contains the sources of GHDL, the open-source analyzer, 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 runs on GNU/Linux, Windows and macOS; on
aarch64. You can freely download a binary distribution for your OS, use GHDL Docker images, or try to build it on your own machine (see 'Getting GHDL' below).
GHDL is free software:
- available at ghdl.rtfd.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. You may use GHDL Docker images in case your didn't find a suitable release, or build GHDL yourself!
GHDL currently supports three different back-ends (code generators). Each has its pros and cons. You can find specific instructions for each of the options in 'Building'.
In order to follow the traditional way to
make, you need the an Ada compiler. Most GNU/Linux package managers provide a package named
Alternatively, GNAT GPL can be downloaded anonymously from libre.adacore.com (later than 2017 is suggested; for x86, 32 or 64 bits). 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.
To use mcode backend (easiest to build), 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
--prefixin the call to
configure. For example, on Windows, you may want to set it to
--prefix=/c/Program Files (x86)/GHDL.
The 'regular' tool allows analysis, compilation, simulation and (very experimental) synthesis of EDIF netlists. It is written in Ada and C, and three different backends are supported, which are sometimes named
ghdl_llvm. This is the entrypoint for most users.
ghdl-ls implements Language Server Protocol (LSP) in Python. VHDL analysis features provided by GHDL are accessed through
libghdl-py. This can be integrated in text editors or IDES, such as, Vim, Emacs, Atom or Visual Studio Code.
libghdlis a shared library that includes a subset of the regular features plus some features to be used by extension tools (i.e.
libghdl-py). This is built along with the regular GHDL and it supports both non-synthesisable and synthesisable code. Nonetheless, this is not for users, but for tools built on top of the core. When configured along with
--enable-synth, this shared library includes [experimental] synthesis features too.
libghdl-py is a Python interface to
libghdl. Currently, it is only used by
ghdl-ls; however, it can be useful for advanced users which are willing to build Python utilities based on GHDL.
libghdlsynthis a shared library that includes the analysis and synthesis features of the core GHDL, but not the pieces for compilation/simulation.
ghdl_simul, which supports interpreted simulation, is available for historical reasons and for development/debugging only. It is very slow compared to the 'regular' compiled simulation and not all the features are supported.