-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (72 loc) · 2.7 KB
/
Makefile
File metadata and controls
79 lines (72 loc) · 2.7 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.PHONY: all clean
TB_DEFINE := noHazard
CYCLE := 10
TB = Final_tb.v slow_memory.v
SRCLIST = src.f
SYN_SRC = ../Syn/CHIP_syn.v
TSMC13=/home/raid7_2/course/cvsd/CBDK_IC_Contest/CIC/Verilog/tsmc13.v
#TSMC13=/usr/cad/designkit/digital/T13/CBDK_IC_Contest_v2.5/Verilog/tsmc13_neg.v
export
COLOR_RED = \033[1;31m
COLOR_GREEN = \033[1;32m
COLOR_RESET = \033[0m
TESTCASES = noHazard hasHazard BrPred compression compression_uncompressed Mul QSort QSort_uncompressed Conv Conv_uncompressed
all: clean syn tb_rtl tb_syn
syn:
dc_shell-t -f syn.tcl
tb_rtl:
make -C Src/ rtl
tb_syn:
make -C Src/ syn
tb_rtl_all:
@summary=""; \
total_time=0; \
for testcase in $(TESTCASES); do \
echo -e "[-] running $$testcase"; \
TB_DEFINE=$$testcase; \
make -C Src/ rtl > Report/$$testcase.log; \
if grep -q CONGRATULATIONS!! Report/$$testcase.log; then \
time_ps=$$(grep -Eo 'Time: *[0-9]+' Report/$$testcase.log | head -n 1 | grep -Eo '[0-9]+'); \
total_time=$$(($$total_time + $$time_ps)); \
echo -e "$(COLOR_GREEN)$$testcase: pass$(COLOR_RESET)"; \
summary="$$summary\n$$testcase: $(COLOR_GREEN)$$time_ps ps$(COLOR_RESET)"; \
else \
echo -e "$(COLOR_RED)$$testcase: fail$(COLOR_RESET)"; \
exit 1; \
fi; \
done; \
echo -e "$$summary" | tee Report/rtl_all.report; \
echo -e "Total simulation time: $(COLOR_GREEN)$$total_time ps$(COLOR_RESET)"
tb_syn_all:
@summary=""; \
total_time=0; \
for testcase in $(TESTCASES); do \
echo -e "[-] running $$testcase"; \
TB_DEFINE=$$testcase; \
make -C Src/ syn > Report/$$testcase.syn.log; \
if grep -q CONGRATULATIONS!! Report/$$testcase.syn.log; then \
time_ps=$$(grep -Eo 'Time: *[0-9]+' Report/$$testcase.syn.log | head -n 1 | grep -Eo '[0-9]+'); \
total_time=$$(($$total_time + $$time_ps)); \
echo -e "$(COLOR_GREEN)$$testcase: pass$(COLOR_RESET)"; \
summary="$$summary\n$$testcase: $(COLOR_GREEN)$$time_ps ps$(COLOR_GREEN)"; \
else \
echo -e "$(COLOR_RED)$$testcase: fail$(COLOR_RESET)"; \
exit 1; \
fi; \
done; \
echo -e "$$summary" | tee Report/syn_all.report; \
echo -e "Total simulation time: $(COLOR_GREEN)$$total_time ps$(COLOR_RESET)"
tb_baseline:
@echo -e "[-] running baseline"
TB_DEFINE=noHazard
@make -C Src/ rtl > Report/noHazard.log
@if grep -q CONGRATULATIONS!! Report/noHazard.log; then echo -e "$(COLOR_GREEN)noHazard: pass$(COLOR_RESET)"; else echo -e "$(COLOR_RED)noHazard: fail$(COLOR_RESET)"; exit 1; fi
TB_DEFINE=hasHazard
@make -C Src/ rtl > Report/hasHazard.log
@if grep -q CONGRATULATIONS!! Report/hasHazard.log; then echo -e "$(COLOR_GREEN)hasHazard: pass$(COLOR_RESET)"; else echo -e "$(COLOR_RED)hasHazard: fail$(COLOR_RESET)"; fi
tb_mul:
make -C Src/ mul
tb_mul_syn:
make -C Src/ mul_syn
clean:
rm -rf Syn/