-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (50 loc) · 1.56 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
LIB_PATH = ../vhdl_userlib/ #### CHANGE ME
# library dependencies
LIB = userlib-obj93.cf
# VHDL compiler
GHDL = ghdl
# stimulus dependencies
vpath %.py $(STIM_FOLDER)
STIM_FOLDER = test/stimulus/
STIM_FILES = plru.stim
# option values
STD = 93c
# option flags
GHDL_OPTS = --std=$(STD) -P=$(LIB_PATH)
.PHONY : clean
FILES = cache_block.vhd \
valid_policy.vhd \
plru_policy.vhd \
cache_set.vhd \
test/cache_block_tb.vhd \
test/cache_set_tb.vhd \
test/plru_policy_tb.vhd \
test/valid_policy_tb.vhd
work-obj93.cf : $(FILES)
@echo "\nBuilding work-obj93.cf..."
@echo "Analyzing files...";
@for file in $(FILES); \
do \
declare SUCCESS=0; \
echo " > \033[0;36m$$file\033[0m"; \
if ! $(GHDL) -a $(GHDL_OPTS) $$file; \
then \
SUCCESS=1; \
if [ -f "work-obj93.cf" ]; then rm work-obj93.cf; fi; \
break; \
fi; \
done; \
if [[ $$SUCCESS -eq 0 ]]; \
then \
echo "Analysis finished : work-obj93.cf"; \
fi;
run :
ifeq ($(strip $(UNIT)), )
@echo "UNIT not found. Use UNIT=<value>."
@exit 1;
endif
$(GHDL) --elab-run -P=$(LIB_PATH) $(UNIT)_tb --fst=out.fst
clean :
@if [ -f out.fst ]; then rm out.fst; fi
@if [ -f out.fst.hier ]; then rm out.fst.hier; fi
@if [ -f *.cf ]; then rm *.cf; fi