]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-dad.git/blob - hw/tb/Makefile
Include testbed for simulation in GHDL.
[fpga/lx-cpu1/lx-dad.git] / hw / tb / Makefile
1 GHDL=ghdl
2 tumbl_SRC=mbl_pkg.vhd mem.vhd fetch.vhd exeq.vhd decode.vhd core_ctrl.vhd
3 tumbl_DIR=../tumbl
4 lx_util_SRC=util_pkg.vhd lx_dad_pkg.vhd xilinx_dualport_bram.vhd
5 lx_util_DIR=..
6 lx_dad_SRC=dff3.vhd dff2.vhd cnt_div.vhd measurement_register.vhd \
7         lx_crosdom_ser_fifo.vhd \
8         bus_example.vhd lx_example_mem.vhd bus_measurement.vhd lx_dad_top.vhd
9 lx_dad_DIR=..
10
11 MODULES=lx_util lx_dad
12
13 SRC=$(foreach m, $(MODULES), $($(m)_SRC:%=$($(m)_DIR)/%))
14
15 $(warning SRC=$(SRC))
16
17 SRC+=lx_dad_top_tb.vhd
18
19 CFLAGS += -Wall
20
21 GHDLFLAGS+=
22 ANALYZEFLAGS+=--std=93c --ieee=synopsys -fexplicit -ggdb
23
24 #SIM_FLAGS=--stop-time=1000ns #--ieee-asserts=disable
25
26 all:    test-lx-dad
27
28 #convert_bin2bits : convert_bin2bits.o
29
30 #imem.bits : imem.bin convert_bin2bits
31 #       ./convert_bin2bits $< >$@
32
33 test-lx-dad: analyze-all #imem.bits
34         $(GHDL) $(GHDLFLAGS) -m $(ANALYZEFLAGS) lx_dad_top_tb
35         $(GHDL) $(GHDLFLAGS) -r lx_dad_top_tb --stop-time=10000ns --vcd=$@.vcd --wave=$@.ghw
36
37 analyze-all: $(SRC)
38         $(GHDL) $(GHDLFLAGS) -a $(ANALYZEFLAGS) $(SRC)
39
40
41 clean:
42         rm -f convert_bin2bits
43         rm -f *.o
44         $(GHDL) --clean
45         $(RM) work-obj93.cf