From 76abb605749d1b8ddcc842cecb258fa755d63ccf Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 14 May 2019 18:01:28 +0200 Subject: Avancement sur la génération de Makefile des benchmarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/monniaux/benches.sh | 4 ++ test/monniaux/binary_search/make.proto | 2 +- test/monniaux/bitsliced-aes/make.proto | 1 + test/monniaux/bitsliced-tea/Makefile | 27 ------------ test/monniaux/bitsliced-tea/make.proto | 2 + test/monniaux/clean_benches.sh | 7 ++++ test/monniaux/complex/Makefile | 29 ------------- test/monniaux/complex/make.proto | 1 + test/monniaux/float_mat/Makefile | 24 ----------- test/monniaux/float_mat/make.proto | 2 + test/monniaux/generate_makefiles.sh | 6 ++- test/monniaux/genmake.py | 37 +++++++++++++---- test/monniaux/glibc_qsort/Makefile | 27 ------------ test/monniaux/glibc_qsort/make.proto | 2 + test/monniaux/heapsort/Makefile | 30 -------------- test/monniaux/heapsort/make.proto | 2 + test/monniaux/idea/Makefile | 27 ------------ test/monniaux/idea/make.proto | 1 + test/monniaux/number_theoretic_transform/Makefile | 25 ----------- .../monniaux/number_theoretic_transform/make.proto | 1 + test/monniaux/quicksort/Makefile | 36 ---------------- test/monniaux/quicksort/make.proto | 2 + test/monniaux/rules.mk | 2 +- test/monniaux/run_makefiles.sh | 9 ++++ test/monniaux/sha-2/Makefile | 24 ----------- test/monniaux/sha-2/make.proto | 2 + test/monniaux/tacle-bench-lift/Makefile | 42 ------------------- test/monniaux/tacle-bench-lift/make.proto | 3 ++ test/monniaux/tacle-bench-powerwindow/Makefile | 48 ---------------------- test/monniaux/tacle-bench-powerwindow/make.proto | 7 ++++ test/monniaux/ternary/Makefile | 29 ------------- test/monniaux/ternary/make.proto | 1 + test/monniaux/too_slow/Makefile | 30 -------------- test/monniaux/too_slow/make.proto | 1 + 34 files changed, 84 insertions(+), 409 deletions(-) create mode 100644 test/monniaux/benches.sh create mode 100644 test/monniaux/bitsliced-aes/make.proto delete mode 100644 test/monniaux/bitsliced-tea/Makefile create mode 100644 test/monniaux/bitsliced-tea/make.proto create mode 100755 test/monniaux/clean_benches.sh delete mode 100644 test/monniaux/complex/Makefile create mode 100644 test/monniaux/complex/make.proto delete mode 100644 test/monniaux/float_mat/Makefile create mode 100644 test/monniaux/float_mat/make.proto delete mode 100644 test/monniaux/glibc_qsort/Makefile create mode 100644 test/monniaux/glibc_qsort/make.proto delete mode 100644 test/monniaux/heapsort/Makefile create mode 100644 test/monniaux/heapsort/make.proto delete mode 100644 test/monniaux/idea/Makefile create mode 100644 test/monniaux/idea/make.proto delete mode 100644 test/monniaux/number_theoretic_transform/Makefile create mode 100644 test/monniaux/number_theoretic_transform/make.proto delete mode 100644 test/monniaux/quicksort/Makefile create mode 100644 test/monniaux/quicksort/make.proto create mode 100755 test/monniaux/run_makefiles.sh delete mode 100644 test/monniaux/sha-2/Makefile create mode 100644 test/monniaux/sha-2/make.proto delete mode 100644 test/monniaux/tacle-bench-lift/Makefile create mode 100644 test/monniaux/tacle-bench-lift/make.proto delete mode 100644 test/monniaux/tacle-bench-powerwindow/Makefile create mode 100644 test/monniaux/tacle-bench-powerwindow/make.proto delete mode 100644 test/monniaux/ternary/Makefile create mode 100644 test/monniaux/ternary/make.proto delete mode 100644 test/monniaux/too_slow/Makefile create mode 100644 test/monniaux/too_slow/make.proto (limited to 'test') diff --git a/test/monniaux/benches.sh b/test/monniaux/benches.sh new file mode 100644 index 00000000..f6552370 --- /dev/null +++ b/test/monniaux/benches.sh @@ -0,0 +1,4 @@ +#benches="binary_search bitsliced-aes bitsliced-tea complex float_mat glibc_qsort heapsort idea number_theoretic_transform quicksort sha-2 tacle-bench-lift tacle-bench-powerwindow ternary too_slow" +benches="binary_search bitsliced-tea complex float_mat glibc_qsort heapsort idea number_theoretic_transform quicksort sha-2 tacle-bench-lift tacle-bench-powerwindow ternary too_slow" + +# TODO - put back bitslices-aes once i get it working again diff --git a/test/monniaux/binary_search/make.proto b/test/monniaux/binary_search/make.proto index 19501e78..69f04092 100644 --- a/test/monniaux/binary_search/make.proto +++ b/test/monniaux/binary_search/make.proto @@ -1 +1 @@ -binary_search +target: binary_search diff --git a/test/monniaux/bitsliced-aes/make.proto b/test/monniaux/bitsliced-aes/make.proto new file mode 100644 index 00000000..6f3139c7 --- /dev/null +++ b/test/monniaux/bitsliced-aes/make.proto @@ -0,0 +1 @@ +target: test diff --git a/test/monniaux/bitsliced-tea/Makefile b/test/monniaux/bitsliced-tea/Makefile deleted file mode 100644 index 3d5fd540..00000000 --- a/test/monniaux/bitsliced-tea/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -include ../rules.mk - -PRODUCTS=bstea.gcc.host.out bstea.ccomp.host.out bstea.gcc.o1.k1c.out bstea.gcc.k1c.out bstea.ccomp.k1c.out bstea.ccomp.k1c.s bstea.gcc.k1c.s bstea.gcc.k1c bstea.ccomp.k1c bstea.gcc.host bstea.ccomp.host - -all: $(PRODUCTS) - -bstea.gcc.host: bstea.c bstea_run.c bstea.h ../clock.o - $(CC) $(CFLAGS) bstea.c bstea_run.c ../clock.o -o $@ - -bstea.ccomp.host: bstea.c bstea_run.c bstea.h ../clock.o - $(CCOMP) $(CCOMPFLAGS) bstea.c bstea_run.c ../clock.o -o $@ - -bstea.gcc.k1c.s bstea.ccomp.k1c.s bstea_run.gcc.k1c.s: bstea.h - -bstea.gcc.k1c: bstea.gcc.k1c.o bstea_run.gcc.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -bstea.gcc.o1.k1c: bstea.gcc.o1.k1c.o bstea_run.gcc.o1.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -bstea.ccomp.k1c: bstea.ccomp.k1c.o bstea_run.gcc.k1c.o ../clock.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - $(RM) -f *.k1c *.host *.out *.o *.s - -.PHONY: clean diff --git a/test/monniaux/bitsliced-tea/make.proto b/test/monniaux/bitsliced-tea/make.proto new file mode 100644 index 00000000..7ddc95d2 --- /dev/null +++ b/test/monniaux/bitsliced-tea/make.proto @@ -0,0 +1,2 @@ +objdeps: [{name: bstea_run, compiler: gcc}] +target: bstea diff --git a/test/monniaux/clean_benches.sh b/test/monniaux/clean_benches.sh new file mode 100755 index 00000000..d246e110 --- /dev/null +++ b/test/monniaux/clean_benches.sh @@ -0,0 +1,7 @@ + +source benches.sh + +rm -f commands.txt +for bench in $benches; do + (cd $bench && make clean) +done diff --git a/test/monniaux/complex/Makefile b/test/monniaux/complex/Makefile deleted file mode 100644 index ca3d441b..00000000 --- a/test/monniaux/complex/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -include ../rules.mk - -PRODUCTS=complex_mat.gcc.host.out complex_mat.ccomp.host.out \ - complex_mat.gcc.k1c.out complex_mat.gcc.o1.k1c.out complex_mat.ccomp.k1c.out \ - complex_mat.gcc.k1c.s complex_mat.ccomp.k1c.s - -all: $(PRODUCTS) - -complex_mat.gcc.host.s complex_mat.ccomp.host.s complex_mat.gcc.k1c.s complex_mat.ccomp.k1c.s : ../clock.h - -complex_mat.ccomp.host: complex_mat.ccomp.host.o ../clock.gcc.host.o - $(CCOMP) $(CCOMPFLAGS) $+ -o $@ - -complex_mat.gcc.host: complex_mat.gcc.host.o ../clock.gcc.host.o - $(CC) $(CFLAGS) $+ -o $@ - -complex_mat.gcc.k1c: complex_mat.gcc.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -complex_mat.gcc.o1.k1c: complex_mat.gcc.o1.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -complex_mat.ccomp.k1c: complex_mat.ccomp.k1c.o ../clock.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - -rm -f *.o *.s *.k1c - -.PHONY: clean diff --git a/test/monniaux/complex/make.proto b/test/monniaux/complex/make.proto new file mode 100644 index 00000000..b4d1222f --- /dev/null +++ b/test/monniaux/complex/make.proto @@ -0,0 +1 @@ +target: complex_mat diff --git a/test/monniaux/float_mat/Makefile b/test/monniaux/float_mat/Makefile deleted file mode 100644 index 0d3d68d6..00000000 --- a/test/monniaux/float_mat/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -include ../rules.mk - -PRODUCTS=float_mat.host float_mat.gcc.o1.k1c.out float_mat.gcc.k1c.out float_mat.ccomp.k1c.out float_mat.ccomp.k1c.s float_mat.gcc.k1c.s float_mat.gcc.k1c float_mat.ccomp.k1c - -all: $(PRODUCTS) - -float_mat.host: float_mat.c float_mat_run.c float_mat.h - $(CC) $(CFLAGS) float_mat.c float_mat_run.c -o $@ - -float_mat.gcc.k1c.s float_mat.ccomp.k1c.s float_mat_run.gcc.k1c.s: float_mat.h - -float_mat.gcc.k1c: float_mat.gcc.k1c.o float_mat_run.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -float_mat.gcc.o1.k1c: float_mat.gcc.o1.k1c.o float_mat_run.gcc.o1.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -float_mat.ccomp.k1c: float_mat.ccomp.k1c.o float_mat_run.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - $(RM) -f *.k1c *.host *.o *.s - -.PHONY: clean diff --git a/test/monniaux/float_mat/make.proto b/test/monniaux/float_mat/make.proto new file mode 100644 index 00000000..3628afbb --- /dev/null +++ b/test/monniaux/float_mat/make.proto @@ -0,0 +1,2 @@ +objdeps: [{name: float_mat_run, compiler: gcc}] +target: float_mat diff --git a/test/monniaux/generate_makefiles.sh b/test/monniaux/generate_makefiles.sh index ed8270b5..14a6bd92 100755 --- a/test/monniaux/generate_makefiles.sh +++ b/test/monniaux/generate_makefiles.sh @@ -1,5 +1,7 @@ #!/usr/bin/bash -for bench in binary_search; do - ./genmake.py $(cat $bench/make.proto) > $bench/Makefile +source benches.sh + +for bench in $benches; do + ./genmake.py $bench/make.proto > $bench/Makefile done diff --git a/test/monniaux/genmake.py b/test/monniaux/genmake.py index 8503b1ee..7e25c181 100755 --- a/test/monniaux/genmake.py +++ b/test/monniaux/genmake.py @@ -9,6 +9,7 @@ See the source for more info. from collections import namedtuple import sys +import yaml Optim = namedtuple("Optim", ["short", "full"]) Env = namedtuple("Env", ["compiler", "optimizations", "target"]) @@ -31,8 +32,19 @@ environments = [gcc_x86, gcc_k1c, ccomp_x86, ccomp_k1c] # Argument parsing ## if len(sys.argv) != 2: - raise Exception("Only 1 argument should be given to this script") -basename = sys.argv[1] + raise Exception("Only 1 argument should be given to this script: the make.proto file") +yaml_file = sys.argv[1] + +with open(yaml_file, "r") as f: + settings = yaml.load(f.read()) + +basename = settings["target"] +objdeps = settings["objdeps"] if "objdeps" in settings else [] +intro = settings["intro"] if "intro" in settings else "" + +for objdep in objdeps: + if objdep["compiler"] not in ("gcc", "ccomp", "both"): + raise Exception('Invalid compiler specified in make.proto:objdeps, should be either "gcc" or "ccomp" or "both"') ## # Printing the rules @@ -41,27 +53,38 @@ basename = sys.argv[1] def make_product(env, optim): return basename + "." + env.compiler.short + (("." + optim.short) if optim.short != "" else "") + "." + env.target +def make_obj(name, env, compiler_short): + return name + "." + compiler_short + "." + env.target + ".o" + def make_clock(env, optim): return "clock.gcc." + env.target def print_rule(env, optim): - print("{product}: {product}.o ../{clock}.o" - .format(product = make_product(env, optim), clock = make_clock(env, optim))) + print("{product}: {product}.o ../{clock}.o " + .format(product = make_product(env, optim), clock = make_clock(env, optim)) + + " ".join([make_obj(objdep["name"], env, (objdep["compiler"] if objdep["compiler"] != "both" else env.compiler.short)) for objdep in objdeps])) print(" {compiler} {flags} $+ -o $@" .format(compiler = env.compiler.full, flags = optim.full)) products = [] for env in environments: for optim in env.optimizations: - products.append(make_product(env, optim) + ".out") + products.append(make_product(env, optim)) print(""" include ../rules.mk -PRODUCTS?={} +{intro} + +PRODUCTS?={prod} +PRODUCTS_OUT=$(addsuffix .out,$(PRODUCTS)) all: $(PRODUCTS) -""".format(" ".join(products))) + +.PHONY: +exec: $(PRODUCTS_OUT) + +""".format(intro=intro, prod=" ".join(products))) for env in environments: for optim in env.optimizations: diff --git a/test/monniaux/glibc_qsort/Makefile b/test/monniaux/glibc_qsort/Makefile deleted file mode 100644 index 62902903..00000000 --- a/test/monniaux/glibc_qsort/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -include ../rules.mk - -PRODUCTS=glibc_qsort.gcc.host.out glibc_qsort.ccomp.host.out glibc_qsort.gcc.k1c.out glibc_qsort.gcc.o1.k1c.out glibc_qsort.ccomp.k1c.out glibc_qsort.ccomp.k1c.s glibc_qsort.gcc.k1c.s glibc_qsort.gcc.k1c glibc_qsort.ccomp.k1c - -all: $(PRODUCTS) - -glibc_qsort.gcc.host: glibc_qsort.c glibc_qsort_run.gcc.host.o glibc_qsort.h - $(CC) $(CFLAGS) glibc_qsort.c glibc_qsort_run.gcc.host.o -o $@ - -glibc_qsort.ccomp.host: glibc_qsort.c glibc_qsort_run.gcc.host.o glibc_qsort.h - $(CCOMP) $(CCOMPFLAGS) glibc_qsort.c glibc_qsort_run.gcc.host.o -o $@ - -glibc_qsort.gcc.k1c.s glibc_qsort.ccomp.k1c.s glibc_qsort_run.gcc.k1c.s: glibc_qsort.h - -glibc_qsort.gcc.k1c: glibc_qsort.gcc.k1c.o glibc_qsort_run.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -glibc_qsort.gcc.o1.k1c: glibc_qsort.gcc.o1.k1c.o glibc_qsort_run.gcc.o1.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -glibc_qsort.ccomp.k1c: glibc_qsort.ccomp.k1c.o glibc_qsort_run.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - $(RM) -f $(PRODUCTS) glibc_qsort.gcc.k1c.o glibc_qsort.ccomp.k1c.o glibc_qsort_run.gcc.k1c.o glibc_qsort_run.gcc.k1c.s - -.PHONY: clean diff --git a/test/monniaux/glibc_qsort/make.proto b/test/monniaux/glibc_qsort/make.proto new file mode 100644 index 00000000..d89f9ea4 --- /dev/null +++ b/test/monniaux/glibc_qsort/make.proto @@ -0,0 +1,2 @@ +objdeps: [{name: glibc_qsort_run, compiler: gcc}] +target: glibc_qsort diff --git a/test/monniaux/heapsort/Makefile b/test/monniaux/heapsort/Makefile deleted file mode 100644 index 74eb1dea..00000000 --- a/test/monniaux/heapsort/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -include ../rules.mk - -PRODUCTS=heapsort.gcc.host.out heapsort.ccomp.host.out heapsort.gcc.o1.k1c.out heapsort.gcc.k1c.out heapsort.ccomp.k1c.out heapsort.ccomp.k1c.s heapsort.gcc.k1c.s heapsort.gcc.k1c heapsort.ccomp.k1c - -all: $(PRODUCTS) - -heapsort.gcc.host: heapsort.c heapsort_run.gcc.host.o heapsort.h - $(CC) $(CFLAGS) heapsort.c heapsort_run.gcc.host.o -o $@ - -heapsort.ccomp.host: heapsort.c heapsort_run.gcc.host.o heapsort.h - $(CCOMP) $(CCOMPFLAGS) heapsort.c heapsort_run.gcc.host.o -o $@ - -heapsort.gcc.k1c.s heapsort.ccomp.k1c.s heapsort_run.gcc.k1c.s: heapsort.h - -heapsort.gcc.o1.k1c: heapsort.gcc.o1.k1c.o heapsort_run.gcc.o1.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -heapsort.gcc.k1c: heapsort.gcc.k1c.o heapsort_run.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -heapsort.ccomp.k1c: heapsort.ccomp.k1c.o heapsort_run.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -%.k1c.out: %.k1c - k1-cluster --cycle-based -- $< | tee $@ - -clean: - $(RM) -f $(PRODUCTS) heapsort.gcc.k1c.o heapsort.ccomp.k1c.o heapsort_run.gcc.k1c.o heapsort_run.gcc.k1c.s - -.PHONY: clean diff --git a/test/monniaux/heapsort/make.proto b/test/monniaux/heapsort/make.proto new file mode 100644 index 00000000..edbf0efd --- /dev/null +++ b/test/monniaux/heapsort/make.proto @@ -0,0 +1,2 @@ +objdeps: [{name: heapsort_run, compiler: gcc}] +target: heapsort diff --git a/test/monniaux/idea/Makefile b/test/monniaux/idea/Makefile deleted file mode 100644 index c638f22f..00000000 --- a/test/monniaux/idea/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -include ../rules.mk - -PRODUCTS=idea.gcc.host.out idea.ccomp.host.out idea.gcc.o1.k1c.out idea.gcc.k1c.out idea.ccomp.k1c.out idea.ccomp.k1c.s idea.gcc.k1c.s idea.gcc.k1c idea.ccomp.k1c - -all: $(PRODUCTS) - -idea.gcc.host: idea.c idea.h ../clock.gcc.host.o - $(CC) $(CFLAGS) idea.c ../clock.gcc.host.o -o $@ - -idea.ccomp.host: idea.c idea.h ../clock.gcc.host.o - $(CCOMP) $(CCOMPFLAGS) idea.c ../clock.gcc.host.o -o $@ - -idea.gcc.k1c.s idea.ccomp.k1c.s idea_run.gcc.k1c.s: idea.h - -idea.gcc.k1c: idea.gcc.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -idea.gcc.o1.k1c: idea.gcc.o1.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -idea.ccomp.k1c: idea.ccomp.k1c.o ../clock.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - $(RM) -f $(PRODUCTS) idea.gcc.k1c.o idea.ccomp.k1c.o - -.PHONY: clean diff --git a/test/monniaux/idea/make.proto b/test/monniaux/idea/make.proto new file mode 100644 index 00000000..b633a3be --- /dev/null +++ b/test/monniaux/idea/make.proto @@ -0,0 +1 @@ +target: idea diff --git a/test/monniaux/number_theoretic_transform/Makefile b/test/monniaux/number_theoretic_transform/Makefile deleted file mode 100644 index 701703e1..00000000 --- a/test/monniaux/number_theoretic_transform/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -include ../rules.mk - -PRODUCTS=ntt.gcc.host.out ntt.ccomp.host.out ntt.gcc.o1.k1c.out ntt.gcc.k1c.out ntt.ccomp.k1c.out ntt.ccomp.k1c.s ntt.gcc.k1c.s ntt.gcc.k1c ntt.ccomp.k1c ntt.gcc.host ntt.ccomp.host - -all: $(PRODUCTS) - -ntt.gcc.host: ntt.c ../clock.o - $(CC) $(CFLAGS) ntt.c ../clock.o -o $@ - -ntt.ccomp.host: ntt.c ../clock.o - $(CCOMP) $(CCOMPFLAGS) ntt.c ../clock.o -o $@ - -ntt.gcc.k1c: ntt.gcc.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -ntt.gcc.o1.k1c: ntt.gcc.o1.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -ntt.ccomp.k1c: ntt.ccomp.k1c.o ../clock.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - $(RM) -f *.k1c *.host *.out *.o *.s - -.PHONY: clean diff --git a/test/monniaux/number_theoretic_transform/make.proto b/test/monniaux/number_theoretic_transform/make.proto new file mode 100644 index 00000000..2d3c7144 --- /dev/null +++ b/test/monniaux/number_theoretic_transform/make.proto @@ -0,0 +1 @@ +target: ntt diff --git a/test/monniaux/quicksort/Makefile b/test/monniaux/quicksort/Makefile deleted file mode 100644 index f753d916..00000000 --- a/test/monniaux/quicksort/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -include ../rules.mk - -PRODUCTS=quicksort.host quicksort.gcc.o1.k1c.out quicksort.gcc.k1c.out quicksort.ccomp.k1c.out quicksort.ccomp.k1c.s quicksort.gcc.k1c.s quicksort.gcc.k1c quicksort.ccomp.k1c - -all: $(PRODUCTS) - -%.gcc.k1c.s: %.c - $(K1C_CC) $(K1C_CFLAGS) -S $< -o $@ - -%.gcc.k1c.o: %.gcc.k1c.s - $(K1C_CC) $(K1C_CFLAGS) -c $< -o $@ - -%.ccomp.k1c.s: %.c - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -S $< -o $@ - -%.ccomp.k1c.o: %.ccomp.k1c.s - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -c $< -o $@ - -quicksort.host: quicksort.c quicksort_run.c quicksort.h - $(CC) $(CFLAGS) quicksort.c quicksort_run.c -o $@ - -quicksort.gcc.k1c.s quicksort.ccomp.k1c.s quicksort_run.gcc.k1c.s: quicksort.h - -quicksort.gcc.k1c: quicksort.gcc.k1c.o quicksort_run.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -quicksort.gcc.o1.k1c: quicksort.gcc.o1.k1c.o quicksort_run.gcc.o1.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -quicksort.ccomp.k1c: quicksort.ccomp.k1c.o quicksort_run.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - $(RM) -f $(PRODUCTS) quicksort.gcc.k1c.o quicksort.ccomp.k1c.o quicksort_run.gcc.k1c.o quicksort_run.gcc.k1c.s - -.PHONY: clean diff --git a/test/monniaux/quicksort/make.proto b/test/monniaux/quicksort/make.proto new file mode 100644 index 00000000..4af771e5 --- /dev/null +++ b/test/monniaux/quicksort/make.proto @@ -0,0 +1,2 @@ +objdeps: [{name: quicksort_run, compiler: gcc}] +target: quicksort diff --git a/test/monniaux/rules.mk b/test/monniaux/rules.mk index ffbdac96..d098d1b2 100644 --- a/test/monniaux/rules.mk +++ b/test/monniaux/rules.mk @@ -1,5 +1,5 @@ ALL_CCOMPFLAGS=-fno-unprototyped -CCOMP=ccomp +CCOMP=ccomp-x86 CCOMPFLAGS=-g -O3 -Wall $(ALL_CCOMPFLAGS) $(ALL_CFLAGS) CFLAGS=-g -std=c99 -O3 -Wall -Wextra -Werror=implicit $(ALL_CFLAGS) diff --git a/test/monniaux/run_makefiles.sh b/test/monniaux/run_makefiles.sh new file mode 100755 index 00000000..02123665 --- /dev/null +++ b/test/monniaux/run_makefiles.sh @@ -0,0 +1,9 @@ + +source benches.sh + +rm -f commands.txt +for bench in $benches; do + echo "(cd $bench && make -j5 $1)" >> commands.txt +done + +cat commands.txt | xargs -n1 -I{} -P4 bash -c '{}' diff --git a/test/monniaux/sha-2/Makefile b/test/monniaux/sha-2/Makefile deleted file mode 100644 index 8fba819b..00000000 --- a/test/monniaux/sha-2/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -include ../rules.mk - -PRODUCTS=sha-256.host sha-256.gcc.o1.k1c.out sha-256.gcc.k1c.out sha-256.ccomp.k1c.out sha-256.ccomp.k1c.s sha-256.gcc.k1c.s sha-256.gcc.k1c sha-256.ccomp.k1c - -all: $(PRODUCTS) - -sha-256.host: sha-256.c sha-256_run.c sha-256.h - $(CC) $(CFLAGS) sha-256.c sha-256_run.c -o $@ - -sha-256.gcc.k1c.s sha-256.ccomp.k1c.s sha-256_run.gcc.k1c.s: sha-256.h - -sha-256.gcc.k1c: sha-256.gcc.k1c.o sha-256_run.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -sha-256.gcc.o1.k1c: sha-256.gcc.o1.k1c.o sha-256_run.gcc.o1.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -sha-256.ccomp.k1c: sha-256.ccomp.k1c.o sha-256_run.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - $(RM) -f $(PRODUCTS) sha-256.gcc.k1c.o sha-256.ccomp.k1c.o sha-256_run.gcc.k1c.o sha-256_run.gcc.k1c.s - -.PHONY: clean diff --git a/test/monniaux/sha-2/make.proto b/test/monniaux/sha-2/make.proto new file mode 100644 index 00000000..e96fee7d --- /dev/null +++ b/test/monniaux/sha-2/make.proto @@ -0,0 +1,2 @@ +objdeps: [{name: sha-256_run, compiler: gcc}] +target: sha-256 diff --git a/test/monniaux/tacle-bench-lift/Makefile b/test/monniaux/tacle-bench-lift/Makefile deleted file mode 100644 index ab930adb..00000000 --- a/test/monniaux/tacle-bench-lift/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -ALL_CFLAGS = -include kill_pragma.h - -CFILES=lift.c liftlibcontrol.c liftlibio.c - -HFILES=liftlibcontrol.h liftlibio.h - -K1C_GCC_OFILES=$(CFILES:.c=.gcc.k1c.o) -K1C_GCC_OFILES_O1=$(CFILES:.c=.gcc.o1.k1c.o) -K1C_CCOMP_OFILES=$(CFILES:.c=.ccomp.k1c.o) -K1C_GCC_SFILES=$(CFILES:.c=.gcc.k1c.s) -K1C_CCOMP_SFILES=$(CFILES:.c=.ccomp.k1c.s) - -HOST_GCC_OFILES=$(CFILES:.c=.gcc.host.o) -HOST_CCOMP_OFILES=$(CFILES:.c=.ccomp.host.o) -HOST_GCC_SFILES=$(CFILES:.c=.gcc.host.s) -HOST_CCOMP_SFILES=$(CFILES:.c=.ccomp.host.s) - -all: lift.gcc.o1.k1c.out lift.gcc.k1c.out lift.ccomp.k1c.out $(K1C_GCC_SFILES) $(K1C_CCOMP_SFILES) - -include ../rules.mk - -$(K1C_GCC_SFILES) $(K1C_CCOMP_SFILES) $(HOST_GCC_SFILES) $(HOST_CCOMP_SFILES) : $(HFILES) - -lift.gcc.k1c: $(K1C_GCC_OFILES) - $(K1C_CC) $(K1C_CFLAGS) -o $@ $+ ../clock.gcc.k1c.o - -lift.gcc.o1.k1c: $(K1C_GCC_OFILES_O1) - $(K1C_CC) $(K1C_CFLAGS_O1) -o $@ $+ ../clock.gcc.k1c.o - -lift.ccomp.k1c: $(K1C_CCOMP_OFILES) - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -o $@ $+ ../clock.gcc.k1c.o - -lift.gcc.host: $(HOST_GCC_OFILES) - $(CC) $(CFLAGS) -o $@ $+ ../clock.gcc.host.o - -lift.ccomp.host: $(HOST_CCOMP_OFILES) - $(CCOMP) $(CCOMPFLAGS) -o $@ $+ ../clock.gcc.host.o - -.PHONY: clean - -clean: - rm -f *.s *.o *.k1c diff --git a/test/monniaux/tacle-bench-lift/make.proto b/test/monniaux/tacle-bench-lift/make.proto new file mode 100644 index 00000000..58dd5c39 --- /dev/null +++ b/test/monniaux/tacle-bench-lift/make.proto @@ -0,0 +1,3 @@ +intro: "ALL_CFLAGS = -include kill_pragma.h" +objdeps: [{name: liftlibcontrol, compiler: both}, {name: liftlibio, compiler: both}] +target: lift diff --git a/test/monniaux/tacle-bench-powerwindow/Makefile b/test/monniaux/tacle-bench-powerwindow/Makefile deleted file mode 100644 index 560a0cf9..00000000 --- a/test/monniaux/tacle-bench-powerwindow/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -ALL_CFLAGS = -include kill_pragma.h - -CFILES= powerwindow.c powerwindow_PW_Control_DRV.c \ - powerwindow_const_params.c powerwindow_PW_Control_PSG_BackL.c \ - powerwindow_controlexclusion.c powerwindow_PW_Control_PSG_BackR.c \ - powerwindow_debounce.c powerwindow_PW_Control_PSG_Front.c \ - powerwindow_inputs.c wcclib.c \ - powerwindow_powerwindow_control.c - -HFILES= kill_pragma.h wcclib.h \ - $(wildcard powerwindow_HeaderFiles/*.h) - -K1C_GCC_OFILES=$(CFILES:.c=.gcc.k1c.o) -K1C_GCC_OFILES_O1=$(CFILES:.c=.gcc.o1.k1c.o) -K1C_CCOMP_OFILES=$(CFILES:.c=.ccomp.k1c.o) -K1C_GCC_SFILES=$(CFILES:.c=.gcc.k1c.s) -K1C_CCOMP_SFILES=$(CFILES:.c=.ccomp.k1c.s) - -HOST_GCC_OFILES=$(CFILES:.c=.gcc.host.o) -HOST_CCOMP_OFILES=$(CFILES:.c=.ccomp.host.o) -HOST_GCC_SFILES=$(CFILES:.c=.gcc.host.s) -HOST_CCOMP_SFILES=$(CFILES:.c=.ccomp.host.s) - -all: powerwindow.gcc.o1.k1c.out powerwindow.gcc.k1c.out powerwindow.ccomp.k1c.out $(K1C_GCC_SFILES) $(K1C_CCOMP_SFILES) - -include ../rules.mk - -$(K1C_GCC_SFILES) $(K1C_CCOMP_SFILES) $(HOST_GCC_SFILES) $(HOST_CCOMP_SFILES) : $(HFILES) - -powerwindow.gcc.k1c: $(K1C_GCC_OFILES) - $(K1C_CC) $(K1C_CFLAGS) -o $@ $+ ../clock.gcc.k1c.o - -powerwindow.gcc.o1.k1c: $(K1C_GCC_OFILES_O1) - $(K1C_CC) $(K1C_CFLAGS_O1) -o $@ $+ ../clock.gcc.k1c.o - -powerwindow.ccomp.k1c: $(K1C_CCOMP_OFILES) - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) -o $@ $+ ../clock.gcc.k1c.o - -powerwindow.gcc.host: $(HOST_GCC_OFILES) - $(CC) $(CFLAGS) -o $@ $+ ../clock.gcc.host.o - -powerwindow.ccomp.host: $(HOST_CCOMP_OFILES) - $(CCOMP) $(CCOMPFLAGS) -o $@ $+ ../clock.gcc.host.o - -.PHONY: clean - -clean: - rm -f *.s *.o *.k1c diff --git a/test/monniaux/tacle-bench-powerwindow/make.proto b/test/monniaux/tacle-bench-powerwindow/make.proto new file mode 100644 index 00000000..3d1ad1e5 --- /dev/null +++ b/test/monniaux/tacle-bench-powerwindow/make.proto @@ -0,0 +1,7 @@ +intro: "ALL_CFLAGS = -include kill_pragma.h" +objdeps: [{name: powerwindow_const_params, compiler: both}, {name: powerwindow_controlexclusion, compiler: both}, + {name: powerwindow_debounce, compiler: both}, {name: powerwindow_inputs, compiler: both}, + {name: powerwindow_powerwindow_control, compiler: both}, {name: powerwindow_PW_Control_DRV, compiler: both}, + {name: powerwindow_PW_Control_PSG_BackL, compiler: both}, {name: powerwindow_PW_Control_PSG_BackR, compiler: both}, + {name: powerwindow_PW_Control_PSG_Front, compiler: both}] +target: powerwindow diff --git a/test/monniaux/ternary/Makefile b/test/monniaux/ternary/Makefile deleted file mode 100644 index 7b1fe155..00000000 --- a/test/monniaux/ternary/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -include ../rules.mk - -PRODUCTS=ternary.gcc.host.out ternary.ccomp.host.out \ - ternary.gcc.o1.k1c.out ternary.gcc.k1c.out ternary.ccomp.k1c.out \ - ternary.gcc.k1c.s ternary.ccomp.k1c.s - -all: $(PRODUCTS) - -ternary.gcc.host.s ternary.ccomp.host.s ternary.gcc.k1c.s ternary.ccomp.k1c.s : ../clock.h - -ternary.ccomp.host: ternary.ccomp.host.o ../clock.gcc.host.o - $(CCOMP) $(CCOMPFLAGS) $+ -o $@ - -ternary.gcc.host: ternary.gcc.host.o ../clock.gcc.host.o - $(CC) $(CFLAGS) $+ -o $@ - -ternary.gcc.k1c: ternary.gcc.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -ternary.gcc.o1.k1c: ternary.gcc.o1.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -ternary.ccomp.k1c: ternary.ccomp.k1c.o ../clock.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - -rm -f *.o *.s *.k1c - -.PHONY: clean diff --git a/test/monniaux/ternary/make.proto b/test/monniaux/ternary/make.proto new file mode 100644 index 00000000..c5219f1c --- /dev/null +++ b/test/monniaux/ternary/make.proto @@ -0,0 +1 @@ +target: ternary diff --git a/test/monniaux/too_slow/Makefile b/test/monniaux/too_slow/Makefile deleted file mode 100644 index fc612e2e..00000000 --- a/test/monniaux/too_slow/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -include ../rules.mk - -PRODUCTS=memset_from_bitsliced-aes.gcc.host.out memset_from_bitsliced-aes.ccomp.host.out \ - memset_from_bitsliced-aes.gcc.o1.k1c.out memset_from_bitsliced-aes.gcc.k1c.out memset_from_bitsliced-aes.ccomp.k1c.out \ - memset_from_bitsliced-aes.gcc.k1c.s memset_from_bitsliced-aes.ccomp.k1c.s - -all: $(PRODUCTS) - -memset_from_bitsliced-aes.gcc.host.s memset_from_bitsliced-aes.ccomp.host.s memset_from_bitsliced-aes.gcc.k1c.s memset_from_bitsliced-aes.ccomp.k1c.s : ../clock.h - -memset_from_bitsliced-aes.ccomp.host: memset_from_bitsliced-aes.ccomp.host.o ../clock.gcc.host.o - $(CCOMP) $(CCOMPFLAGS) $+ -o $@ - -memset_from_bitsliced-aes.gcc.host: memset_from_bitsliced-aes.gcc.host.o ../clock.gcc.host.o - $(CC) $(CFLAGS) $+ -o $@ - -memset_from_bitsliced-aes.gcc.k1c: memset_from_bitsliced-aes.gcc.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS) $+ -o $@ - -memset_from_bitsliced-aes.gcc.o1.k1c: memset_from_bitsliced-aes.gcc.o1.k1c.o ../clock.gcc.k1c.o - $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@ - -memset_from_bitsliced-aes.ccomp.k1c: memset_from_bitsliced-aes.ccomp.k1c.o ../clock.gcc.k1c.o - $(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@ - -clean: - -rm -f *.o *.s *.k1c - -.PHONY: clean - diff --git a/test/monniaux/too_slow/make.proto b/test/monniaux/too_slow/make.proto new file mode 100644 index 00000000..a7b0b37d --- /dev/null +++ b/test/monniaux/too_slow/make.proto @@ -0,0 +1 @@ +target: memset_from_bitsliced-aes -- cgit