Skip to content

Simple VHDL examples using ghdl as compiler and wave generating

Notifications You must be signed in to change notification settings

JulyWitch/vhdl_ghdl_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple VHDL + GHDL examples

This repository contains VHDL codes with their tests.

It also includes a simple Makefile to compile and run the test bench.

Requirements

Install ghdl to compile codes and gtkwave to show signals visually.

  • Linux
sudo apt-get install ghdl gtkwave
  • Mac

You can also install scansion instead of gtkwave.

brew install ghdl gtkwave
  • Windows

Install make, ghdl and gtkwave using msys2

make

ghdl

gtkwave

Usage

Clone this repo

git clone https://github.com/JulyWitch/vhdl_ghdl_examples.git

navigate to repo directory

cd vhdl_ghdl_examples

Create your vhdl file and it's test bench,

then run the following command.

make I=<input_file> T=<test_bench_file> E=<test_bench_entity_name>

example

make I=test/counter.vhdl T=test/counter.test.vhdl E=counter_tb

This will generate wave and vcd files to the waves directory.

Then open generated .ghw or .vcd file with gtkwave.

Options

To change simulation time pass S_TIME = <time> to make command. Time can be in ns, us, and ms.

example:

make I=test/counter.vhdl T=test/counter.test.vhdl E=counter_tb S_TIME=1ms

About

Simple VHDL examples using ghdl as compiler and wave generating

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published