aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2019-06-19 15:26:09 +0200
committerCyril SIX <cyril.six@kalray.eu>2019-06-19 15:26:09 +0200
commit3652fd819ce652bc97c47f95d88e400139931524 (patch)
tree9529f785d7379e49905d68253c00253aa5280c31
parent4b45c51d3d9a19abcc54273cc5cfa51b70352a49 (diff)
downloadcompcert-kvx-3652fd819ce652bc97c47f95d88e400139931524.tar.gz
compcert-kvx-3652fd819ce652bc97c47f95d88e400139931524.zip
Adding measures graph generation in the Makefile
-rw-r--r--test/monniaux/.gitignore9
-rw-r--r--test/monniaux/Makefile12
-rwxr-xr-xtest/monniaux/gengraphs.py10
-rwxr-xr-xtest/monniaux/run_benches.sh7
4 files changed, 26 insertions, 12 deletions
diff --git a/test/monniaux/.gitignore b/test/monniaux/.gitignore
index 12b3c9db..b051c860 100644
--- a/test/monniaux/.gitignore
+++ b/test/monniaux/.gitignore
@@ -1,5 +1,14 @@
**.host
**.k1c
+**measures.csv
+
+commands.txt
+oracle_times.txt
+verifier_times.txt
+compile_times.pdf
+measure_times.host.pdf
+measure_times.k1c.pdf
+
binary_search/Makefile
bitsliced-aes/Makefile
bitsliced-tea/Makefile
diff --git a/test/monniaux/Makefile b/test/monniaux/Makefile
index 0831a93c..b436c034 100644
--- a/test/monniaux/Makefile
+++ b/test/monniaux/Makefile
@@ -2,7 +2,7 @@
CCOMP?=ccomp
-all: compile_times.pdf
+all: compile_times.pdf measure_times.k1c.pdf
verifier_times.txt: Asmblockdeps.patch
patch ../../extraction/Asmblockdeps.ml < $<
@@ -16,9 +16,17 @@ oracle_times.txt: PostpassSchedulingOracle.patch
bash clean_benches.sh
bash build_benches.sh $@
+measures.csv:
+ (cd ../../ && make -j20 && make install)
+ bash build_benches.sh
+ bash run_benches.sh $@
+
compile_times.pdf: gencompile.py verifier_times.txt oracle_times.txt
python3.6 $^ $@
+measure_times.k1c.pdf: gengraphs.py measures.csv
+ python3.6 $^ $(basename $(basename $@))
+
.PHONY:
clean:
- rm -f verifier_times.txt oracle_times.txt compile_times.pdf
+ rm -f verifier_times.txt oracle_times.txt compile_times.pdf measure_times.k1c.pdf measures.csv
diff --git a/test/monniaux/gengraphs.py b/test/monniaux/gengraphs.py
index 3ffe6f3d..c7532efd 100755
--- a/test/monniaux/gengraphs.py
+++ b/test/monniaux/gengraphs.py
@@ -10,9 +10,9 @@ from typing import *
# Reading data
##
-if len(sys.argv) != 2:
- raise Exception("Only 1 argument should be given to this script: the make.proto file")
-csv_file = sys.argv[1]
+if len(sys.argv) != 3:
+ raise Exception("Arguments for this script: the csv file, the base name of the output PDF file")
+_, csv_file, output_basename = sys.argv
with open(csv_file, "r") as f:
df = pd.read_csv(csv_file)
@@ -90,5 +90,5 @@ def generate_file(f: str, cols: List[str]) -> None:
plt.savefig(f)
-generate_file("measures-host.pdf", host_measures_cols)
-generate_file("measures-k1c.pdf", k1c_measures_cols)
+generate_file(output_basename + ".host.pdf", host_measures_cols)
+generate_file(output_basename + ".k1c.pdf", k1c_measures_cols)
diff --git a/test/monniaux/run_benches.sh b/test/monniaux/run_benches.sh
index 479d09eb..5f9f22cb 100755
--- a/test/monniaux/run_benches.sh
+++ b/test/monniaux/run_benches.sh
@@ -19,8 +19,5 @@ for bench in $benches; do
fi
done
-nawk 'FNR==1 && NR!=1{next;}{print}' $benches_csv > measures.csv
-echo "measures.csv done"
-
-./gengraphs.py measures.csv
-echo "Graphs done"
+nawk 'FNR==1 && NR!=1{next;}{print}' $benches_csv > $1
+echo "$1 done"