Giter VIP home page Giter VIP logo

ghdl's Introduction

2017-12-20: the main repo was moved from github.com/tgingold/ghdl to github.com/ghdl/ghdl. Old refs still work, because permanent redirects were set up. However, it is suggested to update the remote URLs in the local clones of every contributor. See Changing a remote's URL.

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.

Main features

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; on x86, x86_64, armv6/armv7/aarch32 and 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).

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, UVVM, OSVVM, cocotb (through the VPI interface), ...

GHDL is free software:

  • GNU General Public License 2
  • Creative Commons Attribution-ShareAlike available at ghdl.readthedocs.io.
  • Some of the runtime libraries, are under different terms; see the individual source files for details.

Getting GHDL

Pre-built releases

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!

Building GHDL

GHDL currently supports three different back-ends (code generators). Each has its pros and cons. Here is a short comparison:

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'.

TL;DR

In order to follow the traditional way to configure and make, you need the an Ada compiler. Most GNU/Linux package managers provide a package named gcc-ada or gcc-gnat. Alternatively, GNAT GPL can be downloaded anonymously from libre.adacore.com (2014, or later; 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

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.

Project structure

Regular users

  • 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_mcode, ghdl_gcc and 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.

  • vscode-client is an extension for Visual Studio Code (VSC) to provide language support for VHDL by interfacing ghdl-ls.

Advanced users

  • libghdl is 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.

  • [experimental] ghdlsynth-beta is the integration of GHDL as a frontend plugin module for Yosys Open SYnthesis Suite, which uses the libghdl library (built with --enable-synth).

  • [deprecated] libghdlsynth is a shared library that includes the analysis and synthesis features of the core GHDL, but not the pieces for compilation/simulation.

  • [deprecated] 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.

ghdl's People

Contributors

arcturus140 avatar ccorn avatar cirosantilli avatar dominiksalvet avatar emogenet avatar endofexclusive avatar flip111 avatar forrestv avatar gasparka avatar gingold-adacore avatar gritbub avatar jonsba avatar kraigher avatar lavovalampa avatar lvoudour avatar maehne avatar marph91 avatar obijuan avatar paebbels avatar pepijndevos avatar preusser avatar sharkcz avatar tgingold avatar thomashk0 avatar tmeissner avatar topileppanen avatar truls avatar umarcor avatar vicencb avatar vuokko avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.