get rid of manually created table...
authorbdemsky <bdemsky>
Mon, 20 Jun 2011 06:52:47 +0000 (06:52 +0000)
committerbdemsky <bdemsky>
Mon, 20 Jun 2011 06:52:47 +0000 (06:52 +0000)
Robust/src/Runtime/bamboo/multicoremem_helper.c [new file with mode: 0644]

diff --git a/Robust/src/Runtime/bamboo/multicoremem_helper.c b/Robust/src/Runtime/bamboo/multicoremem_helper.c
new file mode 100644 (file)
index 0000000..611925f
--- /dev/null
@@ -0,0 +1,26 @@
+#include "multicoremem_helper.h"
+#include "runtime_arch.h"
+
+void buildCore2Test() {
+  for(int i=0;i<NUMCORES4GC;i++) {
+    int xcoord=BAMBOO_COORDS_X(i);
+    int ycoord=BAMBOO_COORDS_Y(i);
+    int index=0;
+    for(int x=xcoord-1;x<=(xcoord+1);x++) {
+      for(int y=ycoord-1;y<=(ycoord+1);y++) {
+       if ((x<0||x>7)||(y<0||y>7)) {
+         //bad coordinate
+         core2test[i][index]=-1;
+       } else {
+         int corenum=BAMBOO_CORE(x,y);
+         if (corenum<0||corenum>=NUMCORES4GC) {
+           core2test[i][index]=-1;
+         } else {
+           core2test[i][index]=corenum;
+         }
+       }
+       index++;
+      }
+    }
+  }
+}