| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- GHDL = ghdl
- VIEWER = gtkwave
- WAVEFILE = simulation/waves.vcd
- VIEWERTCL = simulation/gtkwave.tcl
- #TOP_DESIGN = top.vhd # Not used when not synthesizing..
- # Add design files to this row
- DESIGN_FILES = generic_counter.vhd ha.vhd generic_prescaler.vhd async_8n1_tx_v2.vhd async_8n1_tx.vhd
- DESIGN_FILES_DIR = hdl_design
- DESIGN_FILES_FULL_PATH = $(addprefix $(DESIGN_FILES_DIR)/,$(DESIGN_FILES))
- WORK_DIR = simulation
- WORK_LIBRARY = work
- GHDL_OPTIONS = --work=$(WORK_LIBRARY) --workdir=$(WORK_DIR)
- # Name of the testbench entity to simulate
- TOP_TESTBENCH = async_8n1_tx_tb
- # Add all testbench-related files on this row
- TEST_BENCHES = generic_prescaler_tb.vhd generic_counter_tb.vhd async_8n1_tx_tb.vhd
- TEST_BENCHES_DIR = testbench
- TEST_BENCHES_FULL_PATH = $(addprefix $(TEST_BENCHES_DIR)/,$(TEST_BENCHES))
- .PHONY: all clean analyze elaborate run view debug
- all: analyze elaborate run view
- analyze: $(DESIGN_FILES_FULL_PATH) $(TEST_BENCHES_FULL_PATH)
- $(GHDL) -a $(GHDL_OPTIONS) $(DESIGN_FILES_FULL_PATH) $(TEST_BENCHES_FULL_PATH)
- elaborate: analyze
- $(GHDL) -e $(GHDL_OPTIONS) $(TOP_TESTBENCH)
- run: elaborate
- $(GHDL) -r $(GHDL_OPTIONS) $(TOP_TESTBENCH) --vcd=$(WAVEFILE)
- view: run
- $(VIEWER) $(WAVEFILE) -S $(VIEWERTCL)
- clean:
- $(GHDL) --remove $(GHDL_OPTIONS)
- debug:
- echo $(DESIGN_FILES_FULL_PATH)
|