Permalink
Browse files

Tweaks to remote memory access (still not quite right).

  • Loading branch information...
jameshanlon committed Feb 6, 2012
1 parent bee84f7 commit 73a2821324f38ba7c125267e9882401438f4fb78
Showing with 15 additions and 16 deletions.
  1. +2 −2 system/xs1/builtins_remotemem.xc
  2. +13 −14 test/features/builtin_remotemem.sire
@@ -1,7 +1,7 @@
#define _RWRITE(destID, address, value) \
do { \
unsigned c; \
- GETR_CHANEND(c) \
+ GETR_CHANEND(c); \
SETD(c, destID << 16 | XS1_RES_TYPE_CHANEND); \
OUTCT(c, XS1_CT_WRITE4); \
OUT(c, address); \
@@ -13,7 +13,7 @@ do { \
#define _RREAD(destID, address, value) \
do { \
unsigned c; \
- GETR_CHANEND(c) \
+ GETR_CHANEND(c); \
SETD(c, destID << 16 | XS1_RES_TYPE_CHANEND); \
OUTCT(c, XS1_CT_READ4); \
OUT(c, address); \
@@ -1,30 +1,29 @@
-val location := NUM_CORES-1;
+val N is NUM_CORES-1;
-proc foo(chanend c) is
-{ var v;
+proc foo(val origin) is
+{ chanend c;
+ var v;
var address[];
+ connect c:0 to master origin;
v := memalloc(address, 1);
c ! address;
c ? v;
v := memfree(address)
}
-proc baz(chanend c) is
-{ var v;
+proc bar(val dest) is
+{ chanend c;
+ var v;
var address;
+ connect c:0 to slave dest;
c ? address;
- rwrite(location, 0x20000, 0xDEADBEEF);
- rread(location, 0x20000, v);
+ %rwrite(location, 0x20000, 0xDEADBEEF);
+ rread(dest, 0x20000, v);
%printhexln(v);
%assert v = 0xDEADBEEF;
- c ! 0;
+ c ! 0
}
-proc bar(chanend c) is
- on location do baz(c)
-
proc main() is
-{ chan x;
- foo(x) || bar(x)
-}
+{ on N do bar(0) || foo(N) }

0 comments on commit 73a2821

Please sign in to comment.