printflat option
authorbdemsky <bdemsky>
Mon, 24 Mar 2008 00:26:44 +0000 (00:26 +0000)
committerbdemsky <bdemsky>
Mon, 24 Mar 2008 00:26:44 +0000 (00:26 +0000)
Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/FlatPrefetchNode.java
Robust/src/IR/State.java
Robust/src/Main/Main.java
Robust/src/buildscript

index 76bb6ac3e3950b158d0fbb4c142feac535391250..2767c1ee51e6690b911b08aced11822c0ecc78c2 100644 (file)
@@ -1,6 +1,6 @@
 MAINCLASS=MatrixMultiply
 SRC=${MAINCLASS}.java
-FLAGS=-dsm -prefetch -nooptimize -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS}
+FLAGS=-dsm -prefetch -nooptimize -printflat -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS}
 default:
        ../../../buildscript ${FLAGS} ${SRC}
 clean:
index c7c7e61c7e7f7f848cf2ed5690ee2cf1cec339ed..6f82f3184cefcc5d3a3b44e12ef0b69143518a1c 100644 (file)
@@ -1200,6 +1200,8 @@ public class BuildCode {
     /***** Generate code for FlatMethod fm. *****/
 
     private void generateFlatMethod(FlatMethod fm, LocalityBinding lb, PrintWriter output) {
+       if (State.PRINTFLAT)
+           System.out.println(fm.printMethod());
        MethodDescriptor md=fm.getMethod();
        
        TaskDescriptor task=fm.getTask();
index c89bb90b189b8f487d56320844e6a1344008df67..1623fb890df8c2b21fc6315dad9b868f4532851a 100644 (file)
@@ -10,7 +10,16 @@ public class FlatPrefetchNode extends FlatNode {
        }
 
        public String toString() {
-               return "prefetchnode";
+           String st="prefetch(";
+           boolean first=true;
+           for(Iterator<PrefetchPair> it=hspp.iterator();it.hasNext();) {
+               PrefetchPair pp=it.next();
+               if (!first)
+                   st+=", ";
+               first=false;
+               st+=pp;
+           }
+           return st+")";
        }
 
        public int kind() {
index 679d93f8ece5e58b1d272edd61918f313af6d420..eab812821d0f1d2f99e93b054ed382e0a88af2fb 100644 (file)
@@ -58,6 +58,7 @@ public class State {
     public boolean THREAD=false;
     public boolean CONSCHECK=false;
     public boolean INSTRUCTIONFAILURE=false;
+    public static boolean PRINTFLAT=false;
     public String structfile;
     public String main;
 
index b8f2b039e8454e7647e6d621655f7d6ae3d03aa3..d9130458097fdd2e0635e625719edffed302b024 100644 (file)
@@ -65,6 +65,8 @@ public class Main {
              ClassLibraryPrefix=args[++i]+"/";
          else if (option.equals("-mainclass"))
              state.main=args[++i];
+         else if (option.equals("-printflat"))
+             State.PRINTFLAT=true;
          else if (option.equals("-struct"))
              state.structfile=args[++i];
          else if (option.equals("-conscheck"))
@@ -112,6 +114,7 @@ public class Main {
              System.out.println("-conscheck -- turn on consistency checking");
              System.out.println("-task -- compiler for tasks");
              System.out.println("-thread -- threads");
+             System.out.println("-printflat -- print out flat representation");
              System.out.println("-instructionfailures -- insert code for instruction level failures");
              System.out.println("-taskstate -- do task state analysis");
              System.out.println("-flatirtasks -- create dot files for flat IR graphs of tasks");
index 16087770ef485b39c97d9b1d4fcbcde97f028db0..1cb060150ecdb6e2f36d4171cfe55c13877cafb4 100755 (executable)
@@ -7,6 +7,7 @@ echo -check generate check code
 echo -dmalloc link in dmalloc
 echo -recover compile task code
 echo -specdir directory
+echo -printflat print out flat representation
 echo -selfloop task - this task cannot self loop forever
 echo "-excprefetch methoddescriptor - exclude prefetches for this method (specified as class.method)"
 echo -taskstate do task state analysis
@@ -81,6 +82,9 @@ DSMFLAG=true
 elif [[ $1 = '-prefetch' ]]
 then
 JAVAOPTS="$JAVAOPTS -prefetch"
+elif [[ $1 = '-printflat' ]]
+then
+JAVAOPTS="$JAVAOPTS -printflat"
 elif [[ $1 = '-mac' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"