]> rtime.felk.cvut.cz Git - fpga/quadcount.git/blob - tb/Makefile
Testbench Makefile improved
[fpga/quadcount.git] / tb / Makefile
1 # Be aware of required VHDL_ENTITIES sequence! All entities must be listed in
2 # bottom to up order (e.g. the top entity is the last in this list). Otherwise
3 # it won't compile.
4
5 # Target 'view' can be used to compile & run testbench and show the result
6 # in gtkwave. When lauching gtkwave, timing diagram settings (named after
7 # the testbench) is also loaded, so it's possible to store view settings
8 # by invoking 'File/Write Save File (Ctrl+S)' in gtkwave.
9
10
11 VHDL_MAIN     = tb_qcounter
12 VHDL_ENTITIES = dff.o \
13                 qcounter.o
14
15 STOP_TIME     = 8us
16
17 ##############################################################################
18
19 all: $(VHDL_MAIN)
20
21 run: $(VHDL_MAIN)
22         ghdl -r $< --stop-time=$(STOP_TIME) --vcd=$<.vcd
23
24 view: run
25         gtkwave $(VHDL_MAIN).vcd $(VHDL_MAIN).sav
26
27 $(VHDL_MAIN): $(VHDL_ENTITIES) $(VHDL_MAIN).o
28         ghdl -e -fexplicit --ieee=synopsys $@
29
30
31 %.o: %.vhd
32         ghdl -a -fexplicit --ieee=synopsys $<
33
34 %.o: ../%.vhd
35         ghdl -a -fexplicit --ieee=synopsys $<
36
37 clean:
38         rm -Rf *.o *.vcd $(VHDL_MAIN) results.txt work-obj93.cf
39