Created
July 13, 2019 15:28
-
-
Save thetooth/155ce302ad1f30383ce7cbebb8e8854f to your computer and use it in GitHub Desktop.
VHDL simulation template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nfacs [ gtkwave::getNumFacs ] | |
set dmt [ gtkwave::getDumpType ] | |
set list [list] | |
for {set i 0} {$i < $nfacs } {incr i} { | |
set facname [ gtkwave::getFacName $i ] | |
# set indx [ string first "fsm_tb.u_fsm" $facname ] | |
# if {$indx != -1} { | |
lappend list "$facname" | |
# } | |
} | |
set num_added [ gtkwave::addSignalsFromList $list ] | |
puts "Added $num_added/$nfacs signals from $dmt input." | |
gtkwave::/Time/Zoom/Zoom_Full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stop time for eleboration and simulation | |
timeout = 1ms | |
# Assertion level to deem eleboration a failure | |
assertion-level = warning | |
# Test bench entity to use | |
entity ?= idklol | |
# I/O | |
sources := $(wildcard *.vhd) | |
objects := $(sources:%.vhd=%.o) | |
# Try to find helper script for gtkwave preconfiguration | |
ifneq (,$(wildcard ../allsignals.tcl)) | |
wavescript = --script ../allsignals.tcl | |
endif | |
.PHONY: all | |
all: analysis simulation | |
$(objects): $(sources) | |
ghdl -a --ieee=synopsys $? | |
analysis: $(objects) | |
elaboration: analysis | |
ghdl --elab-run --ieee=synopsys $(entity) --assert-level=$(assertion-level) --stop-time=$(timeout) | |
simulation: analysis | |
ghdl --elab-run --ieee=synopsys $(entity) --assert-level=note --stop-time=$(timeout) --vcd=- \ | |
| gtkwave --vcd $(wavescript) | |
interactive: analysis | |
ghdl --elab-run --ieee=synopsys $(entity) --stop-time=$(timeout) --vcd=- \ | |
| shmidcat \ | |
| gtkwave --interactive --vcd $(wavescript) | |
clean: | |
rm *.o *.cf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment