add RAWCACHEFLUSH micro in multicore version code
authorjzhou <jzhou>
Thu, 1 Jan 2009 18:49:15 +0000 (18:49 +0000)
committerjzhou <jzhou>
Thu, 1 Jan 2009 18:49:15 +0000 (18:49 +0000)
Robust/src/IR/Flat/BuildCodeMultiCore.java
Robust/src/Runtime/multicoretask.c
Robust/src/buildscript

index ce7eb9a7a6a24ba5e9fa17cabccfa8139ee31783..4d27c7be0c8479297e9e07ea8f05df693221196b 100644 (file)
@@ -680,7 +680,7 @@ public class BuildCodeMultiCore extends BuildCode {
        super.generateFlatNode(fm, lb, current_node, output);
        if (current_node.kind()!=FKind.FlatReturnNode) {
          //output.println("   flushAll();");
-         output.println("#ifdef RAW");
+         output.println("#ifdef RAWCACHEFLUSH");
          output.println("raw_user_interrupts_off();");
          output.println("#ifdef RAWDEBUG");
          output.println("raw_test_pass(0xec00);");
@@ -1554,7 +1554,7 @@ public class BuildCodeMultiCore extends BuildCode {
        output.println("return "+generateTemp(fm, frn.getReturnTemp(), lb)+";");
     } else {
       if(fm.getTask() != null) {
-       output.println("#ifdef RAW");
+       output.println("#ifdef RAWCACHEFLUSH");
        output.println("raw_user_interrupts_off();");
        output.println("#ifdef RAWDEBUG");
        output.println("raw_test_pass(0xec00);");
index e5eb722e6c01b92bf493c52e00ce4f4da47d3876..c9c9c32bfff3ffa38b7e8ac0fa9b67ef3eaa9bbf 100644 (file)
@@ -498,14 +498,9 @@ void run(void* arg) {
       if(grount == 1) {
        int k = 0;
        // flush the object
+#ifdef RAWCACHEFLUSH
        raw_invalidate_cache_range((int)obj, classsize[((struct ___Object___ *)obj)->type]);
-       /*if(RuntimeHashcontainskey(objRedirectLockTbl, (int)obj)) {
-               int redirectlock = 0;
-               RuntimeHashget(objRedirectLockTbl, (int)obj, &redirectlock);
-               ((struct ___Object___ *)obj)->lock = redirectlock;
-               raw_flush_cache_range((int)obj, classsize[((struct ___Object___ *)obj)->type]);
-               RuntimeHashremovekey(objRedirectLockTbl, (int)obj);
-       }*/
+#endif
        // enqueue the object
        for(k = 0; k < objInfo->length; ++k) {
          int taskindex = objInfo->queues[2 * k];
@@ -856,7 +851,7 @@ void createstartupobject(int argc, char ** argv) {
   /* Set initialized flag for startup object */
   flagorandinit(startupobject,1,0xFFFFFFFF);
   enqueueObject(startupobject, NULL, 0);
-#ifdef RAW
+#ifdef RAWCACHEFLUSH
   raw_flush_entire_cache();
 #endif
 }
@@ -4731,6 +4726,7 @@ newtask:
 #endif
 
        // flush the object
+#ifdef RAWCACHEFLUSH
        {
          raw_invalidate_cache_range((int)parameter, classsize[((struct ___Object___ *)parameter)->type]);
        }
@@ -4746,6 +4742,7 @@ newtask:
 #ifdef INTERRUPT
                  raw_user_interrupts_on();
 #endif
+#endif
 #endif
        tmpparam = (struct ___Object___ *)parameter;
 #ifdef THREADSIMULATE
index 223b5072718be2571c4d512ddaf10825dcbcd6f2..05830c54b4525dd45fa7035ac282d774295925ce 100755 (executable)
@@ -19,6 +19,7 @@ echo -scheduling do task scheduling
 echo -multicore generate multi-core version binary
 echo "-numcore set the number of cores (should be used together with -multicore), defaultly set as 1"
 echo "-raw generate raw version binary (should be used together with -multicore)"
+echo "-rawcacheflush enable cache flush in raw version binary (should be used togethere with -raw)"
 echo "-interrupt generate raw version binary with interruption (should be used togethere with -raw)"
 echo "-rawconfig config raw simulator as 4xn (should be used together with -raw)"
 echo "-rawpath print out execute path information for raw version (should be used together with -raw)"
@@ -57,6 +58,7 @@ RECOVERFLAG=false
 MULTICOREFLAG=false
 TRANSSTATSFLAG=false
 RAWFLAG=false
+RAWCACHEFLUSHFLAG=false
 RAWCONFIG=''
 RAWDEBUGFLAG=false
 RAWPATHFLAG=false
@@ -157,6 +159,9 @@ elif [[ $1 = '-raw' ]]
 then
 RAWFLAG=true
 JAVAOPTS="$JAVAOPTS -raw"
+elif [[ $1 = '-rawcacheflush' ]]
+then
+RAWCACHEFLUSHFLAG=true
 elif [[ $1 = '-rawconfig' ]]
 then
 RAWCONFIG="$2"
@@ -317,6 +322,11 @@ rm ./*
 
 export RAWRGCCFLAGS="-DTASK -DMULTICORE -DRAW"
 
+if $RAWCACHEFLUSHFLAG
+then # print path
+RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWCACHEFLUSH"
+fi
+
 if $RAWPATHFLAG
 then # print path
 RAWRGCCFLAGS="${RAWRGCCFLAGS} -DRAWPATH"