“ghdl” is an open-source simulator for the VHDL (VHSIC Hardware Description Language) programming language. It provides a convenient and powerful toolset for designing, testing, and simulating digital circuits described in VHDL.
Here are the key features and functionalities of ghdl:
- VHDL Simulation: ghdl allows you to simulate and test VHDL designs without the need for actual hardware. It supports various VHDL constructs, including entity/architecture declarations, process statements, signals, components, and libraries. You can write VHDL code to describe the behavior and structure of digital circuits and use ghdl to simulate their functionality.
- Language Compliance: ghdl is compliant with the IEEE standard VHDL language specifications. It supports VHDL-87, VHDL-93, VHDL-2002, and most of the VHDL-2008 features. This ensures compatibility with a wide range of VHDL designs and enables you to write code that adheres to the standard.
- Simulation Modes: ghdl offers different simulation modes to suit your needs. It supports both interpreted and compiled modes. In interpreted mode, VHDL code is interpreted directly, providing a quick and interactive simulation environment. In compiled mode, VHDL code is compiled to native machine code, resulting in faster simulation speeds for larger designs.
- Waveform Viewing: ghdl provides support for viewing waveforms, which allows you to visualize the behavior of signals and variables during simulation. You can generate waveform files in VCD (Value Change Dump) format and use waveform viewers to analyze and debug the simulated circuits. This feature is essential for understanding the dynamic behavior of your VHDL designs.
- Testbench Generation: ghdl supports the generation of testbenches, which are modules used to stimulate and verify the functionality of VHDL designs. Testbenches can be written in VHDL itself and integrated with the design code. ghdl provides tools to automate the testbench generation process, making it easier to develop comprehensive test suites for your VHDL designs.
- Cross-Platform Support: ghdl is designed to work on multiple platforms, including Linux, macOS, and Windows. It leverages the GNU Compiler Collection (GCC) infrastructure and can be compiled to run on different operating systems. This cross-platform support ensures that you can use ghdl on your preferred development environment.
- Open-Source and Community Driven: ghdl is an open-source project, which means that its source code is freely available for inspection, modification, and distribution. It benefits from a vibrant community of VHDL enthusiasts and developers who contribute to its development and provide support through forums, mailing lists, and online resources.
By using ghdl, VHDL designers can effectively verify the correctness and performance of their digital circuit designs before actual implementation. It offers a comprehensive set of features for VHDL simulation, waveform viewing, testbench generation, and compatibility with VHDL language standards. Whether you are a student, hobbyist, or professional engineer working with VHDL, ghdl provides a reliable and powerful tool for designing and simulating digital circuits.
ghdl Command Examples
1. Analyze a VHDL source file and produce an object file:
# ghdl -a filename.vhdl
2. Elaborate a design (where design is the name of a configuration unit, entity unit or architecture unit):
# ghdl -e design
3. Run an elaborated design:
# ghdl -r design
4. Run an elaborated design and dump output to a waveform file:
# ghdl -r design --wave=output.ghw
5. Check the syntax of a VHDL source file:
# ghdl -s filename.vhdl
6. Display the help page:
# ghdl --help