basic simulations of digital electronics using vhdl
Install ghdl - open source vhdl simulation tool (works both on Linux and Windows) using link below
or try fetching it via your system installer :
http://ghdl.free.fr/
and gtkwave to view simulation runs:
http://gtkwave.sourceforge.net/
- Your main design declaration
- Your testbench for design (i.e. the testing setup, allows to view how signals are processed by main design)
component.vhdl - main design
component_tb.vhdl - testbench
- Write your design e.g. in component.vhdl
- Let ghdl check for syntax:
use : ~ghdl -a component.vhdl - Build .o by typing
~ghdl -e component - Write your testbench
e.g. component_tb.vhdl - Check testbench for syntax
~ghdl -a component_tb.vhdl - Create .o file
~ghdl -e component_tb - Run your testbench for a limited time!, and save simulation output (wavefile .vcd)
e.g. ~ghdl -r component_tb --stop-time=120ns --vcd=component.vcd - View the results
gtkwave component.vcd
Remeber to drag signals into viewing pane and adjust the time scale
Just add the new .vhdl files and objects to corresponding fields using "" and run analysis with:
~make anal
to clean the .o, .cf, work and other redundant files (except testbench and design file) run:
~make clean
#### Have fun!