-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 796 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
COMPILER = ghdl
WORKDIR = debug
FLAGS = --ieee=synopsys
VHDL_SOURCES = $(wildcard rtl/*.vhd)
TBS = $(wildcard tb/tb_*.vhd)
UNIT_NAMES=$(basename $(notdir $(TBS)))
.PHONY: all
all: check analyze simulate clean
$(info "Completed.")
.PHONY: check
check: $(info "Checking...")
mkdir -p $(WORKDIR)
$(COMPILER) -s $(FLAGS) --workdir=$(WORKDIR) $(VHDL_SOURCES) $(TBS)
.PHONY: analyze
analyze: $(info "Analyzing...")
$(COMPILER) -a $(FLAGS) --workdir=$(WORKDIR) $(VHDL_SOURCES) $(TBS)
.PHONY: simulate
simulate: $(info "Simulating...")
for t in $(UNIT_NAMES); do\
$(COMPILER) --elab-run $(FLAGS) --workdir=$(WORKDIR) $$t;\
done;
.PHONY: clean
clean: $(info "Cleaning...")
$(COMPILER) --remove --workdir=$(WORKDIR)
rm -rf $(WORKDIR)
$(info "Done...")