Files
vhdl/projects/cpu/Makefile
T
jens ea60299d26 - added
git-svn-id: http://moon:8086/svn/vhdl/trunk@1414 cc03376c-175c-47c8-b038-4cd826a8556b
2021-03-21 10:47:01 +00:00

69 lines
1.6 KiB
Makefile

# -------------------------------------------------
# Global options
# -------------------------------------------------
LANG_STD := 93c
IEEE_STD := standard
WORK_PATH := work
SOURCE_PATH := src
LIB_PATH := ../lib
# -------------------------------------------------
# Target options
# -------------------------------------------------
TARGET := tb_cpu
SOURCES := $(SOURCE_PATH)/cpu_pkg.vhd \
$(SOURCE_PATH)/stack.vhd \
$(SOURCE_PATH)/pc.vhd \
$(SOURCE_PATH)/reg_dual.vhd \
$(SOURCE_PATH)/dpath_ctrl.vhd \
$(SOURCE_PATH)/cpu.vhd \
$(SOURCE_PATH)/alu.vhd \
$(SOURCE_PATH)/$(TARGET).vhd
# -------------------------------------------------
GHDL_OPT := --workdir=$(WORK_PATH) --std=$(LANG_STD) --ieee=$(IEEE_STD)
# -------------------------------------------------
all: elaborate
.PHONY: syntax
syntax:
ghdl -s $(GHDL_OPT) $(SOURCES)
import:
ghdl -i $(GHDL_OPT) $(LIB_PATH)/*.vhd $(SOURCES)
analyze:
ghdl -a $(GHDL_OPT) $(LIB_PATH)/*.vhd $(SOURCES)
anaborate:
ghdl -c $(GHDL_OPT) $(LIB_PATH)/*.vhd $(SOURCES) -e $(TARGET)
makeunit: analyze
ghdl -m $(GHDL_OPT) $(TARGET)
elaborate: analyze
ghdl -e $(GHDL_OPT) $(TARGET)
run: elaborate
ghdl -r $(GHDL_OPT) $(TARGET) --vcd=$(TARGET).vcd --wave=$(TARGET).ghw --assert-level=error
show: $(TARGET).vcd
gtkwave $(TARGET).ghw $(TARGET).sav
xref: import
mkdir -p html
ghdl --xref-html $(SOURCES)
tree: elaborate
./$(TARGET) --no-run --disp-tree=inst
# -------------------------------------------------
.PHONY: clean
clean:
rm -rf $(TARGET)
cd $(WORK_PATH); rm -rf *.o *.cf
# -------------------------------------------------