# NAME # BUILD_DIR # SRCS # ENTITY_RUN GHDL := ghdl GHDL_GCC := ghdl-gcc RUN_OPTS := --vcd=$(BUILD_DIR)/$(NAME).vcd --wave=$(BUILD_DIR)/$(NAME).ghw --assert-level=error TS := ps all: analyze $(BUILD_DIR): mkdir -p $@ analyze: $(BUILD_DIR) $(SRCS) $(GHDL) -a --work=$(NAME) --workdir=$(BUILD_DIR) --time-resolution=$(TS) $(SRCS) anaborate: $(BUILD_DIR) $(SRCS) $(GHDL_GCC) -c -o $(BUILD_DIR)/$(NAME) --work=$(NAME) --workdir=$(BUILD_DIR) $(SRCS) -e $(ENTITY_RUN) -$(BUILD_DIR)/$(NAME) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log run: analyze -$(GHDL) -r --work=$(NAME) --workdir=$(BUILD_DIR) --time-resolution=$(TS) $(ENTITY_RUN) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log sim: run exec gtkwave -f $(BUILD_DIR)/$(NAME).vcd & synth: analyze $(GHDL) --synth --work=$(NAME) --workdir=$(BUILD_DIR) $(ENTITY_SYN) clean: rm -f $(BUILD_DIR)/$(NAME)*.cf mrproper: rm -rf $(BUILD_DIR)