Skip to content
Snippets Groups Projects
Commit 880e6d66 authored by Daniel Maier's avatar Daniel Maier
Browse files

perforate.sh: integrate pluto

parent dd3db4d3
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
CLAN=/home/daniel/polyhedral_perforation/clan-0.8.0/clan CLAN=/home/daniel/polyhedral_perforation/clan-0.8.0/clan
PERF=./build/perf2 PERF=./build/perf2
CLOOG=/home/daniel/polyhedral_perforation/pluto/cloog-isl/cloog CLOOG=/home/daniel/polyhedral_perforation/pluto/cloog-isl/cloog
PLUTO=/home/daniel/polyhedral_perforation/pluto/polycc
usage() { usage() {
printf -- "%s: <OPTIONS> <INPUT>\n" "$0" printf -- "%s: <OPTIONS> <INPUT>\n" "$0"
...@@ -14,7 +15,7 @@ usage() { ...@@ -14,7 +15,7 @@ usage() {
printf -- "-g, --generate generate perforated program\n" printf -- "-g, --generate generate perforated program\n"
printf -- "-s, --statement statement to perforate\n" printf -- "-s, --statement statement to perforate\n"
printf -- "-l, --level level to perforate\n" printf -- "-l, --level level to perforate\n"
printf -- "-P, --pluto run pluto\n"
} }
extract_scop() { extract_scop() {
...@@ -26,7 +27,8 @@ perforate() { ...@@ -26,7 +27,8 @@ perforate() {
} }
run_pluto() { run_pluto() {
$PL # FIXME: what pluto options should be used?
$PLUTO -o "$2" "$1"
} }
generate() { generate() {
...@@ -48,6 +50,7 @@ while true; do ...@@ -48,6 +50,7 @@ while true; do
cmd_extract=yes cmd_extract=yes
cmd_perforate=yes cmd_perforate=yes
cmd_generate=yes cmd_generate=yes
cmd_pluto=yes
;; ;;
-e|--extract) -e|--extract)
cmd_extract=yes cmd_extract=yes
...@@ -70,6 +73,9 @@ while true; do ...@@ -70,6 +73,9 @@ while true; do
shift shift
level="$1" level="$1"
;; ;;
-P|--pluto)
cmd_pluto=yes
;;
*) *)
break break
esac esac
...@@ -80,6 +86,7 @@ input_src=$1 ...@@ -80,6 +86,7 @@ input_src=$1
scop="$input_src.openscop" scop="$input_src.openscop"
perforated="$input_src.perf.openscop" perforated="$input_src.perf.openscop"
pluto_input="${input_src}_pluto_input.c"
if [ "$input_src" = "" ]; then if [ "$input_src" = "" ]; then
...@@ -107,7 +114,12 @@ if [ "$cmd_perforate" = "yes" ]; then ...@@ -107,7 +114,12 @@ if [ "$cmd_perforate" = "yes" ]; then
fi fi
if [ "$cmd_generate" = "yes" ]; then if [ "$cmd_generate" = "yes" ]; then
generate "$perforated" "$output_src" generate "$perforated" "$pluto_input"
fi
if [ "$cmd_pluto" = "yes" ]; then
printf "running pluto on %s output %s\n" "$pluto_input" "$output_src"
run_pluto "$pluto_input" "$output_src"
fi fi
printf "input is \"%s\" output is \"%s\"\n" "$input_src" "$output_src" printf "input is \"%s\" output is \"%s\"\n" "$input_src" "$output_src"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment