How to install ghdl on Windows and Linux - tomas-fryza/vhdl-labs GitHub Wiki
Installation on Windows
-
Download and install GtkWave waveform viewer to
C:\APPZ\VHDL\. Do NOT use accented symbols and spaces in the path to install folder! -
Download and install ghdl-0.29.1 compiler to
C:\APPZ\VHDL\. Note that, actual version can be found here.
Installation on Linux
-
Start Terminal (typically
Ctrl+Alt+T) and install ghdl compiler and GtkWave waveform viewer.sudo apt-get install ghdl gtkwave
Create a new project and simulate it
Note: Description and example of
ghdlusage is also here.
-
Create a new project folder
gateson your local disk. Do NOT use accented symbols and spaces in the path to project folder! -
Create a design VHDL file
gates/gates.vhd. Open the Example of basic gates and copy/paste thedesign.vhdcode to your localgates/gates.vhdfile. -
Create a simulation VHDL file
gates/tb_gates.vhdand copy/paste thetestbench.vhdto this file. -
Create a script file
gates/RUN.shand copy/paste this content to it. In this file:-
set the
TOP_ENTITYaccording to your testbench -
set path to your
gtkwaveinstallation on Windows or LinuxTOP_ENTITY=tb_gates # For Windows GTK=C:/APPZ/VHDL/gtkwave/bin # For Linux # GTK=/usr/bin
-
-
Run Git Bash, Command Prompt (Windows) of Terminal (Linux), navigate to your project folder, and run the script.
# Windows Git Bash or Linux: sh RUN.sh
Tested on
| Version | Result (yyyy-mm-dd) | Note |
|---|---|---|
| Windows 10 | OK (2023-04-01) | HomeOffice |
| Linux Mint 20.3 (Una) | OK (2022-02-24) | Laptop |
# FYI: How to check OS version in Linux
$ cat /etc/os-release
# Or by Neofetch
$ neofetch