VHDL examples simulated using GHDL.
sudo apt update
sudo apt install ghdl gtkwaveIf you get the following error:
error: unit "numeric_std" not found in library "ieee"then you can build ghdl from source
sudo apt update
sudo apt install gnat
git clone https://github.com/ghdl/ghdl
cd ghdl
./configure
make
sudo make installThere are two steos to compile a VHDL program with GHDL. The first step is to analyze the VHDL source files and the second step is to elaborate, producing the compiled executable.
ghdl -a --std=08 blinky.vhd blinky_tb.vhd
ghdl -e --std=08 tbThe simulation is run with the -r option and the signal waveform is output
with the --vcd option. A VCD file is an ASCII text Value Change Dump file
captures signal transitions from the simulator.
ghdl -r --std=08 tb --vcd=test.vcdgtkwave test.vcd