Skip to content

How to install ghdl on Windows and Linux

Tomas Fryza edited this page Mar 31, 2023 · 15 revisions

Installation on Windows

  1. Download and install GtkWave waveform viewer.

  2. Download and install ghdl-0.29.1 compiler. Note that, actual version can be found here.

Installation on Linux

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

  1. Create a new project folder gates on your local disk. Do NOT use accented symbols and spaces in the path to project folder!

  2. Create a design VHDL file gates/gates.vhd. Open the Example of basic gates and copy/paste the design.vhd code to your local gates/gates.vhd file.

  3. Create a testbench VHDL file gates/tb_gates.vhd. Open the Example of basic gates and copy/paste the testbench.vhd code to your local gates/tb_gates.vhd file.

  4. Create a new file gates/RUN.sh and copy/paste the content to it. In this file:

    • set the TOP_ENTITY according to your testbench
    • set path to your gtkwave installation on Windows or Linux
    TOP_ENTITY=tb_gates
    
    # For Windows
    GTK=c:/APPZ/gtkwave/bin
    
    # For Linux
    # GTK=/usr/bin
  5. 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

    gtkwave gates

Tested on operating systems

Version Date (YYYY-MM-DD) Note
Linux Mint 20.3 (Una) 2022-02-24 Laptop
# FYI: How to check OS version in Linux
$ cat /etc/os-release

# Or by Neofetch
$ neofetch