-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
205 lines (162 loc) · 9.58 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
###
### Be aware of the timeout command in case of experiments !
### We also assume that ./tools/install_sdf3.sh has been already executed
###
SHELL = /bin/bash
SDF3_BENCHMARK := ./benchmarks/sdf3bench/
SDF3_MEM_BENCHMARK := ./benchmarks/sdf3mem/
SDF3_CS_BENCHMARK := ./benchmarks/sdf3cs/
SDF3_EXAMPLES := ./benchmarks/sdf3examples/
ASCENT_TESTBENCH := ./benchmarks/ascenttestbench/
SDF3_ROOT := $(shell pwd)/tools/sdf3/
SDF3_BINARY_ROOT := ${SDF3_ROOT}/sdf3_140724/sdf3/build/release/Linux/bin/
SDF3ANALYSIS_CSDF := timeout 180 ${SDF3_BINARY_ROOT}/sdf3analysis-csdf
SDF3ANALYSIS_SDF := timeout 180 ${SDF3_BINARY_ROOT}/sdf3analysis-sdf
KITER := timeout 180 ./Release/bin/kiter
SOURCES=$(shell find src tests)
WGET=sleep 20 && wget --tries=1
ifeq (,"${TRAVIS}")
ifeq (,$(shell find "${SDF3_BINARY_ROOT}/sdf3analysis-csdf" 2> /dev/null))
$(error Could not find SDF3 binary required for Travis.)
endif
endif
info :
@echo "-------------------------------------------"
@echo SDF3_ROOT is [${SDF3_ROOT}]
@echo SDF3_BINARY_ROOT is [${SDF3_BINARY_ROOT}]
@echo "-------------------------------------------"
@echo "make release: Compile Kiter in release mode"
@echo "make debug: Compile Kiter in debug mode (more verbose, slower)"
@echo "make unit_test: Run Kiter unit tests"
@echo "make ubuntu_test: Run kiter with Ubuntu Docker"
@echo "make test: Run Kiter user-level test"
@echo "make sdf3_benchmarks: Download SDF3 benchmarks."
@echo "make sdf3: Download and Compile SDF3 (required for comparative tests)."
@echo "-------------------------------------------"
all : release debug
@echo "###########"" ENTER IN $@ : $^ #####################"
sdf3: ${SDF3_BINARY_ROOT}
debug: ./Debug/Makefile
@echo "###########"" ENTER IN $@ : $^ #####################"
$(MAKE) -C Debug all
release: ./Release/Makefile
@echo "###########"" ENTER IN $@ : $^ #####################"
$(MAKE) -C Release all
clean:
@echo "###########"" ENTER IN $@ : $^ #####################"
rm -rf Release Debug *.lp *.mps *.png *.dot *.pdf *.xml *.lp ./tools/.ipynb_checkpoints
cleanall: clean
@echo "###########"" ENTER IN $@ : $^ #####################"
rm -rf ./logs/ tools/sdf3*/ sdf.log benchmarks/sdf3*/ benchmarks/ascenttestbench/
benchmark : sdf.log csdf.log csdf_sized.log
@echo "###########"" ENTER IN $@ : $^ #####################"
ubuntu_test:
@echo "###########"" ENTER IN $@ : $^ #####################"
docker build -f tools/docker/DockerFile.u18 -t bbodin/kiter-u18 ./
test: ./Release/bin/kiter
@echo "###########"" ENTER IN $@ : $^ #####################"
#Bodin2013 and Bodin2016
mkdir -p ./logs
rm -rf ./logs/*
for f in benchmarks/*.xml ; do echo === $$f ; ${KITER} -f $$f -a 1PeriodicThroughput -a KPeriodicThroughput >> ./logs/1KBenchmarks.log ; done
for f in benchmarks/IB5CSDF/*.xml ; do echo === $$f ; ${KITER} -f $$f -a 1PeriodicThroughput -a KPeriodicThroughput >> ./logs/1KBenchmarks.log ; done
${KITER} -f benchmarks/sample.xml -a KPeriodicThroughput -pA=1 -pB=1 -pC=1 | grep -q 23.000000
${KITER} -f benchmarks/sample.xml -a KPeriodicThroughput -pA=2 -pB=1 -pC=2 | grep -q 23.000000
# test: Verify Kperiodic
./tools/verify_kperiodic.sh benchmarks/21.xml benchmarks/expansion_paper_norm_sdf.xml benchmarks/expansion_paper_sdf.xml benchmarks/faustTest.xml benchmarks/multrate.xml benchmarks/new_benchmark.xml benchmarks/sample.xml benchmarks/simpler_benchmark.xml benchmarks/tiny_r.xml benchmarks/tiny.xml > ./logs/verifykperiodic.log
# test: Verify KDSE
./tools/verify_dse.sh benchmarks/21.xml benchmarks/expansion_paper_norm_sdf.xml benchmarks/expansion_paper_sdf.xml benchmarks/faustTest.xml benchmarks/new_benchmark.xml benchmarks/sample.xml benchmarks/simpler_benchmark.xml benchmarks/tiny_r.xml benchmarks/tiny.xml > ./logs/verifydse.log
# test: KDSE
./tools/kdse_run_benchmarks.sh ./logs/ 30 > ./logs/kdse_run_benchmarks.log # Limit to 30 sec for CI
csdf_benchmarks.log: ./Release/bin/kiter Makefile
@echo "###########"" ENTER IN $@ : $^ #####################"
rm -f $@
@echo "==============================================================================================="
@echo "==============================================================================================="
for f in benchmarks/*.xml ; do echo === $$f >> $@;echo === $$f ; ${KITER} -f $$f -a PeriodicThroughput -a 1PeriodicThroughput -a KPeriodicThroughput >> $@ ; if [ -d ${SDF3_BINARY_ROOT} ];then ${SDF3ANALYSIS_CSDF} --graph $$f --algo throughput >> $@ || true; fi ; done
csdf_IB5CSDF.log: ./Release/bin/kiter Makefile
@echo "###########"" ENTER IN $@ : $^ #####################"
rm -f $@
@echo "==============================================================================================="
@echo "==============================================================================================="
for f in benchmarks/IB5CSDF/*.xml ; do echo === $$f >> $@;echo === $$f ; ${KITER} -f $$f -a PeriodicThroughput -a 1PeriodicThroughput -a KPeriodicThroughput >> $@ ; if [ -d ${SDF3_BINARY_ROOT} ];then ${SDF3ANALYSIS_CSDF} --graph $$f --algo throughput >> $@ || true; fi ; done
${SDF3_ROOT}/sdfg_throughput.zip :
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p ${SDF3_ROOT}
${WGET} "http://www.es.ele.tue.nl/sdf3/download/files/benchmarks/sdfg_throughput.zip" -O $@
${SDF3_ROOT}/sdfg_buffersizing.zip :
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p ${SDF3_ROOT}
${WGET} "http://www.es.ele.tue.nl/sdf3/download/files/benchmarks/sdfg_buffersizing.zip" -O $@
${SDF3_ROOT}/sdfg_designflow_case_study.zip:
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p ${SDF3_ROOT}
${WGET} "http://www.es.ele.tue.nl/sdf3/download/files/benchmarks/sdfg_designflow_case_study.zip" -O $@
sdf3_benchmarks : ${SDF3_BENCHMARK} ${SDF3_MEM_BENCHMARK} ${SDF3_CS_BENCHMARK} ${SDF3_EXAMPLES}
@echo "###########"" ENTER IN $@ : $^ #####################"
${SDF3_BINARY_ROOT} : ./tools/install_sdf3.sh
@echo "###########"" ENTER IN $@ : $^ #####################"
@echo "Please run manually '$< ${SDF3_ROOT}' before running the Makefile"
exit 1
${SDF3_CS_BENCHMARK} : ${SDF3_ROOT}/sdfg_designflow_case_study.zip
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p $@
cp $< $@/
cd $@ && unzip $<
sed -i.bak "s/xsi:noNamespaceSchemaLocation=\"http:..www.es.ele.tue.nl.sdf3.xsd.sdf3-sdf.xsd\"//g" $@/designflow_case_study/*.xml
${SDF3_MEM_BENCHMARK} : ${SDF3_ROOT}/sdfg_buffersizing.zip
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p $@
cp $< $@/
cd $@ && unzip $<
sed -i.bak "s/xsi:noNamespaceSchemaLocation=\"http:..www.es.ele.tue.nl.sdf3.xsd.sdf3-sdf.xsd\"//g" $@/*.xml
${SDF3_EXAMPLES} :
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p $@
for example in h263decoder h263encoder mp3decoder_granule_parallelism mp3decoder_block_parallelism mp3playback satellite samplerate modem ; do \
${WGET} "http://www.es.ele.tue.nl/sdf3/download/files/examples/$$example.xml" -O ${SDF3_EXAMPLES}/$$example.xml ; done
sed -i.bak "s/xsi:noNamespaceSchemaLocation=\"http:..www.es.ele.tue.nl.sdf3.xsd.sdf3-sdf.xsd\"//g" $@/*.xml
${SDF3_BENCHMARK} : ${SDF3_ROOT}/sdfg_throughput.zip
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p $@
cp $< $@/
cd $@ && unzip $<
cd ${SDF3_BENCHMARK} && unzip graphs/graphs1/graphs.zip; for f in *.xml ; do mv $$f one_$$f ; done
cd ${SDF3_BENCHMARK} && unzip graphs/graphs2/graphs.zip; for f in graph*.xml ; do mv $$f two_$$f ; done
cd ${SDF3_BENCHMARK} && unzip graphs/graphs3/graphs.zip; for f in graph*.xml ; do mv $$f three_$$f ; done
cd ${SDF3_BENCHMARK} && unzip graphs/graphs4/graphs.zip; for f in graph*.xml ; do mv $$f four_$$f ; done
cd ${SDF3_BENCHMARK} && rm -rf graphs scripts sdfg_throughput.zip
${ASCENT_TESTBENCH} : ${SDF3_BENCHMARK}
@echo "###########"" ENTER IN $@ : $^ #####################"
mkdir -p $@
cp $</one_* $@/
for f in $@/*_buffer.xml; do mv -- "$$f" "$${f%_buffer.xml}.xml" ; done
sed -i.bak "s/.*=\"_.*//" $@/*.xml
rm $@/*.bak
sdf.log: ./Release/bin/kiter Makefile
@echo "###########"" ENTER IN $@ : $^ #####################"
rm -f $@
@echo "==============================================================================================="
@echo "==============================================================================================="
for f in ${SDF3_BENCHMARK}/*.xml ; do echo === $$f ;\
echo === $$f === 1PeriodicThroughput >> $@; ${KITER} -f $$f -a 1PeriodicThroughput >> $@ ; \
echo === $$f === KPeriodicThroughput >> $@; ${KITER} -f $$f -a KPeriodicThroughput >> $@ ; \
echo === $$f === deGrooteThroughput >> $@; ${KITER} -f $$f -a deGrooteThroughput >> $@ ; \
if [ -d ${SDF3_BINARY_ROOT} ];then echo === $$f === SDF3 >> $@; ${SDF3ANALYSIS_SDF} --graph $$f --algo throughput >> $@ || true ; fi ;\
done
%/bin/kiter: ${SOURCES} %/Makefile
@echo "###########"" ENTER IN $@ : $^ #####################"
@$(MAKE) -C $* all
%/Makefile: ${SOURCES} CMakeLists.txt
@echo "###########"" ENTER IN $@ : $^ #####################"
@mkdir -p $*
@pushd $* && cmake -D CMAKE_BUILD_TYPE=$* .. && popd
unit_test: ./Debug/Makefile ./Debug/bin/kiter
@echo "###########"" ENTER IN $@ : $^ #####################"
make -C Debug/ test
check: ./Debug/Makefile ./Debug/bin/kiter ./Release/Makefile ./Release/bin/kiter
timeout 5 ./Release/bin/kiter -f ./benchmarks/sample.xml -a SPeriodicScheduling
timeout 5 ./Release/bin/kiter -f ./benchmarks/sample.xml -a 1PeriodicScheduling
timeout 5 ./Release/bin/kiter -f ./benchmarks/sample.xml -a ASAPScheduling
.PHONY: sdf3 all infos debug release clean benchmark ubuntu_test test unit_test
.PRECIOUS: %/Makefile tools/sdf3/%.zip