From 253754dd9d55d3638f29664cc11b965142a3995d Mon Sep 17 00:00:00 2001 From: Vladimir Burian Date: Thu, 14 Apr 2011 14:17:40 +0200 Subject: [PATCH] Testbench Makefile improved --- tb/Makefile | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/tb/Makefile b/tb/Makefile index 18d0314..66b07d0 100644 --- a/tb/Makefile +++ b/tb/Makefile @@ -1,19 +1,39 @@ -VHDL_MAIN=tb_qcounter -VHDL_SUB=dff.o qcounter.o +# Be aware of required VHDL_ENTITIES sequence! All entities must be listed in +# bottom to up order (e.g. the top entity is the last in this list). Otherwise +# it won't compile. + +# Target 'view' can be used to compile & run testbench and show the result +# in gtkwave. When lauching gtkwave, timing diagram settings (named after +# the testbench) is also loaded, so it's possible to store view settings +# by invoking 'File/Write Save File (Ctrl+S)' in gtkwave. + + +VHDL_MAIN = tb_qcounter +VHDL_ENTITIES = dff.o \ + qcounter.o + +STOP_TIME = 8us + +############################################################################## all: $(VHDL_MAIN) run: $(VHDL_MAIN) - ghdl -r $< --stop-time=8us --vcd=$<.vcd + ghdl -r $< --stop-time=$(STOP_TIME) --vcd=$<.vcd + +view: run + gtkwave $(VHDL_MAIN).vcd $(VHDL_MAIN).sav + +$(VHDL_MAIN): $(VHDL_ENTITIES) $(VHDL_MAIN).o + ghdl -e -fexplicit --ieee=synopsys $@ -$(VHDL_MAIN): $(VHDL_MAIN).o $(VHDL_SUB) - ghdl -e --ieee=synopsys $@ %.o: %.vhd - ghdl -a --ieee=synopsys $< + ghdl -a -fexplicit --ieee=synopsys $< %.o: ../%.vhd - ghdl -a --ieee=synopsys $< + ghdl -a -fexplicit --ieee=synopsys $< clean: - rm -Rf *.o qctest + rm -Rf *.o *.vcd $(VHDL_MAIN) results.txt work-obj93.cf + -- 2.39.2