#expect 1
#expect 1
-debug.in: [*] take, deliver;
+debug.in: set ilc=*; recv, deliver;
alu.in1:
- literal 9;
- load repeat counter with 7;
+ set word= 9;
+ set ilc=7;
deliver;
- literal 9;
+ set word= 9;
deliver;
alu.in2:
- literal 8;
- load repeat counter with 7;
+ set word= 8;
+ set ilc=7;
deliver;
- literal 9;
+ set word= 9;
deliver;
alu.out:
- load repeat counter with 4;
- take, sendto debug.in;
+ set ilc=4;
+ collect, send to debug.in;
alu.inOp:
- literal Alu2.inOp[ADD]; deliver;
- literal Alu2.inOp[SUB]; deliver;
- literal Alu2.inOp[IN1]; deliver;
- literal Alu2.inOp[IN2]; deliver;
+ set word= Alu2.inOp[ADD]; deliver;
+ set word= Alu2.inOp[SUB]; deliver;
+ set word= Alu2.inOp[IN1]; deliver;
+ set word= Alu2.inOp[IN2]; deliver;
alu.inOp:
- literal Alu2.inOp[MIN]; deliver;
- literal Alu2.inOp[MAX]; deliver;
- literal Alu2.inOp[CMP]; deliver;
- literal Alu2.inOp[CMP]; deliver;
+ set word= Alu2.inOp[MIN]; deliver;
+ set word= Alu2.inOp[MAX]; deliver;
+ set word= Alu2.inOp[CMP]; deliver;
+ set word= Alu2.inOp[CMP]; deliver;
alu.out:
- take, sendto debug.in; // MIN
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
-
- take, sendto debug.in; // MAX
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
-
- take, sendto debug.in; // CMP
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
-
- take, sendto debug.in; // CMP
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
+ collect, send to debug.in; // MIN
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
+
+ collect, send to debug.in; // MAX
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
+
+ collect, send to debug.in; // CMP
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
+
+ collect, send to debug.in; // CMP
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
== Contributors =========================================================
Adam Megacz <megacz@cs.berkeley.edu>
#ship debug : Debug
debug.in:
- literal 25;
+ set word= 25;
deliver;
== Contributors =========================================================
#ship debug : Debug
#ship fifo : Fifo
-debug.in: [*] take, deliver;
+debug.in: set ilc=*; recv, deliver;
fifo.in:
- literal 9;
+ set word= 9;
deliver;
- load repeat counter with 63;
- take, deliver;
- load repeat counter with 37;
- take, deliver;
+ set ilc=63;
+ recv, deliver;
+ set ilc=37;
+ recv, deliver;
fifo.out:
- load repeat counter with 63;
- take, sendto fifo.in;
- load repeat counter with 36;
- take, sendto fifo.in;
- take, sendto debug.in;
+ set ilc=63;
+ collect, send to fifo.in;
+ set ilc=36;
+ collect, send to fifo.in;
+ collect, send to debug.in;
#ship lut : Lut3
#ship alu : Alu2
-lut.in1: literal 85; [*] deliver;
-lut.in2: literal 51; [*] deliver;
-lut.in3: literal 15; [*] deliver;
-lut.out: [*] take, sendto debug.in;
+lut.in1: set word= 85; set ilc=*; deliver;
+lut.in2: set word= 51; set ilc=*; deliver;
+lut.in3: set word= 15; set ilc=*; deliver;
+lut.out: set ilc=*; collect, send to debug.in;
// cycle through truth tables using alu as INC
alu.in2:
- literal 1;
- [*] deliver;
+ set word= 1;
+ set ilc=*; deliver;
alu.inOp:
- literal Alu2.inOp[ADD];
- [*] deliver;
+ set word= Alu2.inOp[ADD];
+ set ilc=*; deliver;
alu.in1:
- literal 0;
+ set word= 0;
deliver;
- [*] take, deliver;
+ set ilc=*; recv, deliver;
alu.out:
- load loop counter with 2;
- [L] wait, take, sendto lut.inLut;
- [L] sendto alu.in1;
+ set olc=2;
+ [Rq] recv token, collect, send to lut.inLut;
+ [Rq] send to alu.in1;
tail;
lut.inLut:
- literal 0;
+ set word= 0;
deliver;
- [*] take, deliver;
+ set ilc=*; recv, deliver;
// acks from debug ship trigger new truth tables
debug.in:
- load repeat counter with 63;
- take, deliver, notify alu.out;
- load repeat counter with 63;
- take, deliver, notify alu.out;
- load repeat counter with 63;
- take, deliver, notify alu.out;
- load repeat counter with 63;
- take, deliver, notify alu.out;
- load repeat counter with 4;
- take, deliver, notify alu.out;
+ set ilc=63;
+ recv, deliver, send token to alu.out;
+ set ilc=63;
+ recv, deliver, send token to alu.out;
+ set ilc=63;
+ recv, deliver, send token to alu.out;
+ set ilc=63;
+ recv, deliver, send token to alu.out;
+ set ilc=4;
+ recv, deliver, send token to alu.out;
// which is dispatched when the code is loaded
memory.out:
- [*] take, send;
+ set ilc=*; collect packet, send;
memory.inCBD:
- literal BOB;
+ set word= BOB;
deliver;
BOB: {
debug.in:
- literal 12; deliver;
- literal 13; deliver;
- literal 14; deliver;
+ set word= 12; deliver;
+ set word= 13; deliver;
+ set word= 14; deliver;
}
#ship debug : Debug
#ship rotator : Rotator
-rotator.in: literal 1; deliver; literal 21615257152; deliver;
-rotator.inAmount: literal 1; deliver; literal 20; deliver;
-rotator.out: [*] take, sendto debug.in;
-debug.in: [*] take, deliver;
+rotator.in: set word= 1; deliver; set word= 21615257152; deliver;
+rotator.inAmount: set word= 1; deliver; set word= 20; deliver;
+rotator.out: set ilc=*; collect, send to debug.in;
+debug.in: set ilc=*; recv, deliver;
== Contributors =========================================================
for(Tree<String> statement : t.child(1))
fillCodeBag(statement, cb);
- } else if (head.equals("#import")) {
- // ignored
-
} else if (head.equals("#ship")) {
String name = name(t.child(0));
String type = string(t.child(1));
}
shipMap.put(name, ship);
- } else if (head.equals("#include")) {
- try {
- walk(parseIt(new InputStreamReader(new FileInputStream(string(t.child(0))))), cb);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
} else if (head.equals("#expect")) {
expect.add(number(t.child(0)));
} else if (head.equals("#skip")) {
Path path(Dock dock, Tree<String> t) {
if (!"Dock".equals(t.head()) && !"Destination".equals(t.head()) && !"ShipSpecificLiteral".equals(t.head())) return null;
- t = t.child(0);
String shipName = name(t.child(0));
String portName = name(t.child(1));
- String subPort = t.size()<3 ? null : name(t.child(2));
Ship ship = shipMap.get(shipName);
if (ship==null) throw new RuntimeException("no such ship \""+shipName+"\"");
Destination ret = null;
}
if (bb==null)
throw new RuntimeException("no such pump \""+portName+"\"");
- if (subPort==null) subPort="";
- if (":i".equals(t.head())) return dock.getPath(bb.getInstructionDestination(),SIGNAL_ZERO);
- if (":1".equals(t.head())) return dock.getPath(bb.getDataDestination(),SIGNAL_ONE);
- if (":0".equals(t.head())) return dock.getPath(bb.getDataDestination(),SIGNAL_ZERO);
+ if (t.size() >= 3) {
+ if (":i".equals(t.child(2).head())) return dock.getPath(bb.getInstructionDestination(),SIGNAL_ZERO);
+ if (":1".equals(t.child(2).head())) return dock.getPath(bb.getDataDestination(),SIGNAL_ONE);
+ if (":0".equals(t.child(2).head())) return dock.getPath(bb.getDataDestination(),SIGNAL_ZERO);
+ }
return dock.getPath(bb.getDataDestination(),SIGNAL_ZERO);
}
Dock dock = (Dock)dock(t.child(0));
OUTER: for(Tree tt : t.child(1)) {
+
+ if ("tail".equals(tt.head())) {
+ cb.add(new Tail(dock));
+ continue;
+ }
+
int count = 1;
Predicate predicate = Default;
boolean looping = false;
if ("[!a]".equals(ttt.head())) predicate = NotFlagA;
if ("[!b]".equals(ttt.head())) predicate = NotFlagB;
if ("[!c]".equals(ttt.head())) predicate = NotFlagC;
- if ("[+]".equals(ttt.head())) predicate = IgnoreOLC;
- if ("[I]".equals(ttt.head())) interruptible = true;
- if ("[L]".equals(ttt.head())) looping = true;
+ // FIXME: test case for this
+ if ("[*]".equals(ttt.head())) predicate = IgnoreOLC;
+ // FIXME: test case for this
+ if ("[olc=0]".equals(ttt.head())) predicate = OLCZero;
+ if ("[Rq]".equals(ttt.head())) looping = true;
}
tt = tt.child(1);
if ("tail".equals(tt.head())) {
cb.add(new Tail(dock));
continue;
- } else if ("setflags".equals(tt.head())) {
+ } else if ("flags".equals(tt.head())) {
cb.add(new Set(dock, looping, predicate, parseFlags(tt.child(0)), parseFlags(tt.child(1))));
continue;
- } else if ("load".equals(tt.head()) && "loop".equals(tt.child(0).head())) {
+ } else if ("olc=word".equals(tt.head())) {
cb.add(new Set(dock, looping, predicate, SetDest.OuterLoopCounter, SetSource.DataLatch));
continue;
- } else if ("load".equals(tt.head()) && "repeat".equals(tt.child(0).head())) {
+ } else if ("ilc=word".equals(tt.head())) {
cb.add(new Set(dock, looping, predicate, SetDest.InnerLoopCounter, SetSource.DataLatch));
continue;
} else if ("*".equals(tt.head())) {
cb.add(new Set(dock, looping, predicate, SetDest.InnerLoopCounter, SetSource.Infinity));
continue;
- } else if ("with".equals(tt.head()) && "loop".equals(tt.child(0).head())) {
- cb.add(new Set(dock, looping, predicate, SetDest.OuterLoopCounter, (number(tt.child(1)))));
+ } else if ("olc=int".equals(tt.head())) {
+ cb.add(new Set(dock, looping, predicate, SetDest.OuterLoopCounter, (number(tt.child(0)))));
continue;
- } else if ("with".equals(tt.head()) && "repeat".equals(tt.child(0).head())) {
- cb.add(new Set(dock, looping, predicate, SetDest.InnerLoopCounter, (number(tt.child(1)))));
+ } else if ("ilc=int".equals(tt.head())) {
+ cb.add(new Set(dock, looping, predicate, SetDest.InnerLoopCounter, (number(tt.child(0)))));
continue;
- } else if ("decrement".equals(tt.head())) {
+ } else if ("--".equals(tt.head())) {
cb.add(new Set(dock, looping, predicate, SetDest.OuterLoopCounter, SetSource.Decrement));
continue;
- } else if ("literal".equals(tt.head())) {
+ } else if ("nop".equals(tt.head())) {
+ // FIXME: test case for "torpedoable nop"
+ if (tt.child(0).size() > 0 && "[T]".equals(tt.child(0).head())) interruptible = true;
+ cb.add(new Move(dock, looping, predicate, interruptible, null, false, false, false, false, false, false));
+ } else if ("shift".equals(tt.head())) {
+ cb.add(new Shift(dock, looping, predicate,
+ new BitVector(dock.getShip().getFleet().getWordWidth()).set(number(tt.child(0)))));
+ } else if ("word".equals(tt.head())) {
long literal = 0;
if (tt.child(0).head().equals("CodeBagBody")) {
Tree<String> tq = tt;
literal = number(tt.child(0));
}
count = 1;
+ /*
if ("int".equals(tt.child(1).head())) {
count = (int)number(tt.child(1));
} else if ("forever".equals(tt.child(1).head())) {
count = 0;
}
+ */
if (FleetTwoFleet.isSmallEnoughToFit(literal)) {
}
Tree ttx = null;
boolean requeue = false;
- ttx = tt.child(1).head().equals("Commands") ? tt.child(1) : tt;
- if ("int".equals(tt.child(2).head())) {
- count = (int)number(tt.child(2));
- requeue = true;
- } else if ("forever".equals(tt.child(2).head())) {
- count = 0;
- requeue = true;
- }
- tt = tt.child(0);
- if (tt.head().equals("[*]")) {
- cb.add(new Set(dock, looping, predicate, SetDest.InnerLoopCounter, SetSource.Infinity));
- //count = 0;
- requeue = false;
- } else if (tt.head().equals("int")) {
- count = (int)number(tt);
- requeue = false;
- }
+ if ("[T]".equals(tt.child(0).head())) interruptible = true;
+ ttx = tt.child(tt.size()-1);
boolean tokenIn = false;
boolean dataIn = false;
boolean latch = false;
Path path = null;
for(int i=0; i<ttx.size(); i++) {
Tree ttt = ttx.child(i);
- if ("wait".equals(ttt.head())) { tokenIn = true; }
- else if ("nop".equals(ttt.head())) { }
+ if ("recv token".equals(ttt.head())) { tokenIn = true; }
else if ("discard".equals(ttt.head())) { dataIn = true; latch = false; }
else if ("take".equals(ttt.head())) { dataIn = true; latch = true; }
- else if ("recv".equals(ttt.head())) { dataIn = true; latch = true; }
- else if ("collect".equals(ttt.head())) { dataIn = true; latch = true; }
- else if ("recieve".equals(ttt.head())) { dataIn = true; latch = true; }
- else if ("send".equals(ttt.head())) { dispatch = true; dataOut = true; }
- else if ("sendto".equals(ttt.head())) { dataOut = true; path = path(dock, ttt.child(0)); }
+ else if ("collect".equals(ttt.head())) {
+ if (dock.isInputDock())
+ throw new RuntimeException("you can't use \"collect\" at input docks; try \"recv\" instead");
+ dataIn = true;
+ latch = true;
+ }
+ else if ("collect path".equals(ttt.head())) {
+ if (dock.isInputDock())
+ throw new RuntimeException("you can't use \"collect\" at input docks; try \"recv\" instead");
+ dataIn = true;
+ latch = false;
+ dispatch = true;
+ }
+ else if ("collect packet".equals(ttt.head())) {
+ if (dock.isInputDock())
+ throw new RuntimeException("you can't use \"collect\" at input docks; try \"recv\" instead");
+ dataIn = true;
+ latch = true;
+ dispatch = true;
+ }
+ else if ("collect nothing".equals(ttt.head())) {
+ if (dock.isInputDock())
+ throw new RuntimeException("you can't use \"collect\" at input docks; try \"recv\" instead");
+ dataIn = true;
+ }
+ else if ("recv".equals(ttt.head())) {
+ if (dock.isOutputDock())
+ throw new RuntimeException("you can't use \"recv\" at input docks; try \"collect\" instead");
+ dataIn = true;
+ latch = true;
+ }
+ else if ("recv path".equals(ttt.head())) {
+ if (dock.isOutputDock())
+ throw new RuntimeException("you can't use \"recv\" at input docks; try \"collect\" instead");
+ dataIn = true;
+ latch = false;
+ dispatch = true;
+ }
+ else if ("recv packet".equals(ttt.head())) {
+ if (dock.isOutputDock())
+ throw new RuntimeException("you can't use \"recv\" at input docks; try \"collect\" instead");
+ dataIn = true;
+ latch = true;
+ dispatch = true;
+ }
+ else if ("recv nothing".equals(ttt.head())) {
+ if (dock.isOutputDock())
+ throw new RuntimeException("you can't use \"recv\" at input docks; try \"collect\" instead");
+ dataIn = true;
+ }
+ else if ("send".equals(ttt.head())) {
+ dataOut = true;
+ }
+ else if ("send to".equals(ttt.head())) { dataOut = true; path = path(dock, ttt.child(0)); }
else if ("deliver".equals(ttt.head())) { dataOut = true; }
- else if ("notify".equals(ttt.head())) { tokenOut = true; path = path(dock, ttt.child(0)); }
- else if ("notifyLast".equals(ttt.head())) { tokenOut = true; ignoreUntilLast = true; path = path(dock, ttt.child(0)); }
+ else if ("send token".equals(ttt.head())) { tokenOut = true; }
+ else if ("send token to".equals(ttt.head())) { tokenOut = true; path = path(dock, ttt.child(0)); }
}
cb.add(new Move(dock, looping, predicate,
interruptible, path, tokenIn, dataIn,
-// The FLEET Assembly Language Grammar [26-Aug-2007]
+// The FLEET Assembly Language Grammar [22-Aug-2008]
// Note that this is the *entire, complete* formal specification of
// the grammar. An equivalent lex+yacc grammar and support code would
CodeBagDef:: = CodeBagName ":" "{" CodeBagBody "}" /ws
Fiber:: = Dock ":" Instructions /ws
-// FIXME: should not have predicates on tail/untail/kill/massacre
Instructions:: = Instruction +/ ws
-Instruction:: = (Tags:: Tag*) InstructionX
-Tag = ^"[a]" ws | ^"[b]" ws | ^"[c]" ws
- | ^"[!a]" ws | ^"[!b]" ws | ^"[!c]" ws
- | ^"[+]" ws
- | ^"[I]" ws
- | ^"[L]" ws
-InstructionX = ^"tail" ";" /ws
- | "take" ^"loop" "counter" ";" /ws
- | ^"load" (^"loop"|^"repeat") ws "counter" ";" /ws
- | "load" (^"loop"|^"repeat") ws "counter" ^"with" int ";" /ws
- | "load" (^"loop"|^"repeat") ws "counter" "with" ^"*" ";" /ws
- | "load" ^"tapl" "with" Destination ";" /ws
- | ^"decrement" "loop" "counter" ";" /ws
- | ^"setflags" "a" "=" Flags "," "b" "=" Flags ";" /ws
- | ^"literal" Literal RequeueCount ";" /ws
- | RepeatCount Commands RequeueCount ^";" /ws
-RepeatCount = "" | ^"[*]" | "[" int "]"
-RequeueCount = ""
- | "," "requeue" (^"forever" | int ws "times") /ws
+Instruction = Instruction:: (Tags:: Tag*) InstructionX
+ | ^"tail" ";" /ws
+Tag = ^"[a]" ws | ^"[b]" ws
+ | ^"[!a]" ws | ^"[!b]" ws
+ | ^"[olc=0]" ws
+ | ^"[*]" ws
+ | ^"[Rq]" ws
+InstructionX = (() | ^"[T]" ws) ^"nop" ";" /ws
+ | (() | ^"[T]" ws) (Commands:: Command +/ (ws "," ws)) ^";" /ws
+ | "olc=word":: "set" "olc" "=" "word" ";" /ws
+ | "ilc=word":: "set" "ilc" "=" "word" ";" /ws
+ | "olc=int":: "set" "olc" "=" int ";" /ws
+ | "ilc=int":: "set" "ilc" "=" int ";" /ws
+ | "set" "ilc" "=" ^"*" ";" /ws
+ | "set" "olc" ^"--" ";" /ws
+ | "set" ^"flags" "a" "=" Flags "," "b" "=" Flags ";" /ws
+ | "set" ^"word" "=" Literal ";" /ws
+ | ^"shift" Literal ";" /ws
-Flags:: = Flag +/ (ws "|" ws)
-Flag = ^"0"
- | ^"1"
- | ^"a"
- | ^"b"
- | ^"c"
- | ^"!a"
- | ^"!b"
- | ^"!c"
+Flags:: = (^"0") | (^"1") | (^"a" | ^"b" | ^"c" | ^"!a" | ^"!b" | ^"!c") +/ (ws "|" ws)
-Commands:: = Command +/ (ws "," ws)
-Command = ^"wait"
- | ^"nop"
- | ^"discard"
- | ^"recieve"
- | ^"recv"
- | ^"take"
- | ^"collect"
- | ^"deliver"
- | ^"send"
- | ^"sendto" Destination /ws
- | ^"notify" Destination /ws
- | ^"notifyLast" Destination /ws
+Command = "recv token":: "recv" ws "token"
+ | ^"recv"
+ | "recv":: "recv" ws "word"
+ | "recv nothing":: "recv" ws "nothing"
+ | "recv path":: "recv" ws "path"
+ | "recv packet":: "recv" ws "packet"
+ | ^"collect"
+ | "collect":: "collect" ws "word"
+ | "collect nothing":: "collect" ws "nothing"
+ | "collect path":: "collect" ws "path"
+ | "collect packet":: "collect" ws "packet"
+ | ^"deliver"
+ | ^"send"
+ | "send to":: "send" "to" Destination /ws
+ | "send token":: "send" "token" Destination /ws
+ | "send token to":: "send" "token" "to" Destination /ws
Literal = int
| ShipType "." DockName ^"[" Constants "]"
| "{" CodeBagBody "}" /ws
Dock:: = ShipName "." DockName
-Destination:: = (ShipName ^"." DockName)
- | (ShipName "." DockName ^":i")
- | (ShipName "." DockName ^":0")
- | (ShipName "." DockName ^":1")
+Destination:: = ShipName "." DockName ( ^"" | ^":i" | ^":0" | ^":1" )
Constants:: = Constant +/ ","
Constant:: = [a-zA-Z0-9=_\-]++
Comment! = "//" ~[\n\r]* [\r\n]
| "/*" ~[\n\r]* "*/"
-// the following extensions are not part of the official FLEET syntax
-
-Directive = ^"#memory" "{" (Memory:: int +/ (ws! "," ws!)) "}" /ws
- | ^"#import" [A-Za-z_.]++ /ws
- | ^"#include" ws! "\"" ~[\"]+ "\""
- | ^"#ship" ShipName ":" ("":: [0-9A-Za-z_.]++) /ws
+Directive = ^"#ship" ShipName ":" ("":: [0-9A-Za-z_.]++) /ws
| ^"#expect" int /ws
| ^"#skip"
#ship memory : Memory
memory.out:
- [*] take, send;
+ set ilc=*; collect packet, send;
-memory.inCBD: literal {
- memory.inCBD: literal {
- memory.inCBD: literal {
+memory.inCBD: set word= {
+ memory.inCBD: set word= {
+ memory.inCBD: set word= {
debug.in:
- literal 3;
+ set word= 3;
deliver;
}; deliver;
}; deliver;
// attempts to get tokens to "collide" in the switch fabric
debug.in:
- literal 2;
- [*] wait, deliver;
+ set word= 2;
+ set ilc=*; recv token, deliver;
-alu.inOp: deliver; notify debug.in;
-alu.in1: deliver; notify debug.in;
-alu.in2: deliver; notify debug.in;
-alu.out: collect; notify debug.in;
+alu.inOp: deliver; send token to debug.in;
+alu.in1: deliver; send token to debug.in;
+alu.in2: deliver; send token to debug.in;
+alu.out: collect; send token to debug.in;
--- /dev/null
+#skip
+#expect 1
+#expect 2
+
+#ship debug : Debug
+#ship fifo : Fifo
+#ship fifo2 : Fifo
+
+debug.in: set ilc=*; recv, deliver;
+fifo.in:
+ set word= 1;
+ deliver;
+ set ilc=*; recv, deliver;
+
+fifo2.in:
+ set word= 2;
+ deliver;
+ set ilc=*; recv, deliver;
+
+fifo2.out: recv token, collect, send to fifo.in;
+
+fifo.out:
+ [Rq] send token to fifo2.out;
+ [Rq] collect, send to debug.in;
+ [Rq] collect, send to debug.in;
+ tail;
+ tail;
+
+
--- /dev/null
+#expect 21
+#ship debug : Debug
+debug.in: set word= 21; deliver;
--- /dev/null
+#skip
+// output ///////////////////////////////////////////////////////////////////
+#expect 5263
+
+// program //////////////////////////////////////////////////////////////////
+#ship debug : Debug
+#ship memory : Memory
+#ship bitfifo : BitFifo
+#ship fifo : Fifo
+
+// dumb configurations
+debug.in: set ilc=*; take, deliver;
+memory.inAddrRead: set ilc=*; take, deliver;
+memory.inAddrWrite: set ilc=*; take, deliver;
+memory.inDataWrite: set ilc=*; take, deliver;
+
+FRED: {
+ fifo.in: deliver, send token to fifo.out;
+}
+
+fifo.in: set word= 5263;
+fifo.out: recv token, take, send to debug.in;
+
+bitfifo.in:
+ set word= 0; deliver; // six bits of leading zero (to wash out the codebag size)
+ set word= FRED; deliver; // FRED = { address_of_fred[31], size_of_fred[6] }
+
+// strip off bottom 6 bits
+bitfifo.inOp:
+ set word= BitFifo.inOp[take=6]; deliver;
+ set word= BitFifo.inOp[take=37]; deliver;
+bitfifo.outOp:
+ set word= BitFifo.outOp[take=37]; deliver;
+
+bitfifo.out: take, send to memory.inAddrRead;
+
+// value read out will be the instruction at FRED
+memory.out: take, send;
+
+
--- /dev/null
+#expect 524290
+#ship debug : Debug
+
+debug.in:
+ set word=1;
+ shift 2;
+ deliver;
#ship debug : Debug
debug.in:
- literal 9;
- load repeat counter with 63;
+ set word= 9;
+ set ilc=63;
deliver;
- load repeat counter with 37;
+ set ilc=37;
deliver;
#ship memory : Memory
#ship fifo : Fifo
-debug.in: [*] take, deliver;
+debug.in: set ilc=*; recv, deliver;
fifo.in:
- literal 5;
+ set word= 5;
deliver;
fifo.out:
- take;
- load repeat counter;
- literal 0;
- sendto debug.in;
- literal 1;
- sendto debug.in;
+ collect;
+ set ilc=word;
+ set word=0;
+ send to debug.in;
+ set word=1;
+ send to debug.in;
#ship debug : Debug
#ship fifo : Fifo
-debug.in: [*] take, deliver;
+debug.in: set ilc=*; recv, deliver;
-fifo.out: [*] take, sendto debug.in;
+fifo.out: set ilc=*; collect, send to debug.in;
fifo.in:
- literal 5;
- load repeat counter with 3;
+ set word= 5;
+ set ilc=3;
deliver;
- literal 1;
+ set word= 1;
deliver;
- literal 2;
+ set word= 2;
deliver;
#ship memory : Memory
#ship fifo : Fifo
-debug.in: [*] take, deliver;
+debug.in: set ilc=*; recv, deliver;
fifo.out:
- [*] take, sendto debug.in;
+ set ilc=*; collect, send to debug.in;
fifo.in:
- load repeat counter with 0;
- literal 0;
+ set ilc=0;
+ set word= 0;
deliver;
- literal 1;
+ set word= 1;
deliver;
--- /dev/null
+#skip
+#expect 5
+#expect 7
+#expect 5
+#expect 7
+#expect 5
+#expect 7
+#expect 9
+
+#ship memory : Memory
+#ship debug : Debug
+#ship fifo : Fifo
+#ship fifo2 : Fifo
+
+debug.in: set ilc=*; recv, deliver;
+
+fifo.out: set ilc=*; collect, send to debug.in;
+
+fifo.in:
+ [Rq] set olc=2;
+ [Rq] set word= 5;
+ [Rq] deliver;
+ [Rq] recv, deliver;
+ [Rq] send token to memory.inCBD;
+ [Rq] set olc--;
+ tail;
+
+fifo2.out:
+ set word= 7;
+ set ilc=4;
+ send to fifo.in;
+
+memory.inCBD: set word= {
+ fifo.in:
+ set word= 9;
+ deliver;
+ };
+ set ilc=3;
+ recv nothing;
+ deliver;
--- /dev/null
+#skip
+#expect 5
+#expect 7
+#expect 5
+#expect 7
+#expect 5
+#expect 7
+#expect 9
+
+#ship memory : Memory
+#ship debug : Debug
+#ship fifo : Fifo
+#ship fifo2 : Fifo
+
+debug.in: set ilc=*; recv, deliver;
+
+fifo.out: set ilc=*; collect, send to debug.in;
+
+fifo.in:
+ set olc=2;
+ [Rq] nop;
+ [Rq] set word= 5;
+ [Rq] deliver;
+ [Rq] send token to memory.inCBD;
+ [Rq] recv, deliver;
+ [Rq] set olc--;
+ tail;
+
+fifo2.out:
+ set word= 7;
+ set ilc=4;
+ send to fifo.in;
+
+memory.inCBD: set word= {
+ fifo.in:
+ set word= 9;
+ deliver;
+ };
+ recv nothing;
+ recv nothing;
+ recv nothing;
+ deliver;
+
#ship debug : Debug
debug.in:
- literal 0;
- setflags a=0, b=0;
+ set word= 0;
+ set flags a=0, b=0;
deliver;
#ship debug : Debug
debug.in:
- setflags a=1, b=0;
- [a] literal 1;
- [b] literal 2;
+ set flags a=1, b=0;
+ [a] set word= 1;
+ [b] set word= 2;
deliver;
#ship debug : Debug
debug.in:
- setflags a=0, b=1;
- [a] literal 3;
- [b] literal 4;
+ set flags a=0, b=1;
+ [a] set word= 3;
+ [b] set word= 4;
deliver;
#ship debug : Debug
debug.in:
- setflags a=1, b=1;
- [a] literal 5;
- [b] literal 6;
+ set flags a=1, b=1;
+ [a] set word= 5;
+ [b] set word= 6;
deliver;
#ship debug : Debug
debug.in:
- setflags a=1, b=1;
- [b] literal 7;
- [a] literal 8;
+ set flags a=1, b=1;
+ [b] set word= 7;
+ [a] set word= 8;
deliver;
#ship debug : Debug
debug.in:
- setflags a=0, b=0;
- literal 9;
- [b] literal 10;
- [a] literal 11;
+ set flags a=0, b=0;
+ set word= 9;
+ [b] set word= 10;
+ [a] set word= 11;
deliver;
#ship debug : Debug
debug.in:
- setflags a=1, b=0;
- [!a] literal 1;
- [!b] literal 2;
+ set flags a=1, b=0;
+ [!a] set word= 1;
+ [!b] set word= 2;
deliver;
#ship debug : Debug
debug.in:
- setflags a=0, b=1;
- [!a] literal 3;
- [!b] literal 4;
+ set flags a=0, b=1;
+ [!a] set word= 3;
+ [!b] set word= 4;
deliver;
#ship debug : Debug
debug.in:
- setflags a=1, b=1;
- literal 4;
- [!a] literal 5;
- [!b] literal 6;
+ set flags a=1, b=1;
+ set word= 4;
+ [!a] set word= 5;
+ [!b] set word= 6;
deliver;
#ship debug : Debug
debug.in:
- setflags a=1, b=1;
- literal 6;
- [!b] literal 7;
- [!a] literal 8;
+ set flags a=1, b=1;
+ set word= 6;
+ [!b] set word= 7;
+ [!a] set word= 8;
deliver;
#ship debug : Debug
debug.in:
- setflags a=0, b=0;
- literal 9;
- [!b] literal 10;
- [!a] literal 11;
+ set flags a=0, b=0;
+ set word= 9;
+ [!b] set word= 10;
+ [!a] set word= 11;
deliver;
#ship fifo : Fifo
debug.in:
- setflags a=1, b=b;
- [a] literal 1;
- [!a] literal 0;
+ set flags a=1, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
deliver;
- literal 0;
- literal 1;
- setflags a=0, b=b;
+ set word= 0;
+ set word= 1;
+ set flags a=0, b=b;
nop;
- [!a] literal 20;
+ [!a] set word= 20;
deliver;
#ship fifo : Fifo
debug.in:
- literal 2;
- load repeat counter with 1;
+ set word= 2;
+ set ilc=1;
recv;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
deliver;
fifo.in:
- notify debug.in:0;
+ send token to debug.in:0;
#ship fifo2 : Fifo
debug.in:
- [*] take, deliver;
+ set ilc=*; recv, deliver;
fifo2.out:
- literal 2;
- load repeat counter with 1;
- wait;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
+ set word= 2;
+ set ilc=1;
+ recv token;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
fifo.in:
- notify fifo2.out:0;
+ send token to fifo2.out:0;
#ship fifo : Fifo
debug.in:
- literal 2;
- load repeat counter with 1;
+ set word= 2;
+ set ilc=1;
recv;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
deliver;
fifo.out:
- notify debug.in:0;
+ send token to debug.in:0;
#ship fifo2 : Fifo
debug.in:
- [*] take, deliver;
+ set ilc=*; recv, deliver;
fifo2.out:
- literal 2;
- load repeat counter with 1;
- wait;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
+ set word= 2;
+ set ilc=1;
+ recv token;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
fifo.out:
- notify fifo2.out:0;
+ send token to fifo2.out:0;
#ship fifo : Fifo
debug.in:
- literal 2;
- load repeat counter with 1;
+ set word= 2;
+ set ilc=1;
recv;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
deliver;
fifo.in:
- notify debug.in:1;
+ send token to debug.in:1;
#ship fifo2 : Fifo
debug.in:
- [*] take, deliver;
+ set ilc=*; recv, deliver;
fifo2.out:
- literal 2;
- load repeat counter with 1;
- wait;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
+ set word= 2;
+ set ilc=1;
+ recv token;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
fifo.in:
- notify fifo2.out:1;
+ send token to fifo2.out:1;
#ship fifo : Fifo
debug.in:
- literal 2;
- load repeat counter with 1;
+ set word= 2;
+ set ilc=1;
recv;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
deliver;
fifo.out:
- notify debug.in:1;
+ send token to debug.in:1;
#ship fifo2 : Fifo
debug.in:
- [*] take, deliver;
+ set ilc=*; recv, deliver;
fifo2.out:
- literal 2;
- load repeat counter with 1;
- wait;
- setflags a=c, b=b;
- [a] literal 1;
- [!a] literal 0;
- sendto debug.in;
+ set word= 2;
+ set ilc=1;
+ recv token;
+ set flags a=c, b=b;
+ [a] set word= 1;
+ [!a] set word= 0;
+ send to debug.in;
fifo.out:
- notify fifo2.out:1;
+ send token to fifo2.out:1;
#ship debug : Debug
debug.in:
- literal -1;
+ set word= -1;
deliver;
#ship fifo : Fifo
// dumb configurations
-debug.in: [*] take, deliver;
-memory.inAddrRead: [*] take, deliver;
-memory.inAddrWrite: [*] take, deliver;
-memory.inDataWrite: [*] take, deliver;
-//memory.inCount: [*] take, deliver;
-//memory.inStride: [*] take, deliver;
-fifo.in: [*] take, deliver;
+debug.in: set ilc=*; recv, deliver;
+memory.inAddrRead: set ilc=*; recv, deliver;
+memory.inAddrWrite: set ilc=*; recv, deliver;
+memory.inDataWrite: set ilc=*; recv, deliver;
+//memory.inCount: set ilc=*; recv, deliver;
+//memory.inStride: set ilc=*; recv, deliver;
+fifo.in: set ilc=*; recv, deliver;
// addresses and values to initialize the memory with
-//1: sendto memory.inAddrWrite;
-//4: sendto memory.inCount;
-//1: sendto memory.inStride;
-//11: sendto memory.inDataWrite;
-//12: sendto memory.inDataWrite;
-//13: sendto memory.inDataWrite;
-//14: sendto memory.inDataWrite;
+//1: send to memory.inAddrWrite;
+//4: send to memory.inCount;
+//1: send to memory.inStride;
+//11: send to memory.inDataWrite;
+//12: send to memory.inDataWrite;
+//13: send to memory.inDataWrite;
+//14: send to memory.inDataWrite;
// send write-completion tokens to the fifo output
memory.out:
- load repeat counter with 4; take, notify fifo.out;
- [*] take, sendto debug.in;
+ set ilc=4; collect, send token to fifo.out;
+ set ilc=*; collect, send to debug.in;
// when the write-completion tokens accumulate, unleash
// the read addresses
fifo.out:
- load repeat counter with 4; wait;
- take, sendto memory.inAddrRead;
+ set ilc=4; recv token;
+ collect, send to memory.inAddrRead;
// read addresses
-//4: sendto fifo.in;
-//4: sendto memory.inCount;
-//-1: sendto memory.inStride;
+//4: send to fifo.in;
+//4: send to memory.inCount;
+//-1: send to memory.inStride;
#ship fifo : Fifo
// dumb configurations
-debug.in: [*] take, deliver;
-memory.inAddrRead: [*] take, deliver;
+debug.in: set ilc=*; recv, deliver;
+memory.inAddrRead: set ilc=*; recv, deliver;
// send write-completion tokens to the fifo output
memory.out:
- load repeat counter with 4; take, notify fifo.out;
- [*] take, sendto debug.in;
+ set ilc=4; collect, send token to fifo.out;
+ set ilc=*; collect, send to debug.in;
-memory.inAddrWrite: literal 1; deliver;
-memory.inDataWrite: literal 11; deliver;
+memory.inAddrWrite: set word= 1; deliver;
+memory.inDataWrite: set word= 11; deliver;
-memory.inAddrWrite: literal 2; deliver;
-memory.inDataWrite: literal 12; deliver;
+memory.inAddrWrite: set word= 2; deliver;
+memory.inDataWrite: set word= 12; deliver;
-memory.inAddrWrite: literal 3; deliver;
-memory.inDataWrite: literal 13; deliver;
+memory.inAddrWrite: set word= 3; deliver;
+memory.inDataWrite: set word= 13; deliver;
-memory.inAddrWrite: literal 4; deliver;
-memory.inDataWrite: literal 14; deliver;
+memory.inAddrWrite: set word= 4; deliver;
+memory.inDataWrite: set word= 14; deliver;
// when the write-completion tokens accumulate, unleash
// the read addresses
fifo.out:
- load repeat counter with 4; wait;
- load repeat counter with 4; take, sendto memory.inAddrRead;
+ set ilc=4; recv token;
+ set ilc=4; collect, send to memory.inAddrRead;
fifo.in:
- literal 4; deliver;
- literal 3; deliver;
- literal 2; deliver;
- literal 1; deliver;
+ set word= 4; deliver;
+ set word= 3; deliver;
+ set word= 2; deliver;
+ set word= 1; deliver;
bitfifo.in:
deliver; // deliver a junk word
- literal 10000;
- load repeat counter with 37; deliver; // deliver it 37 times (once per bit)
- literal 0;
- load repeat counter with 38; deliver; // deliver it 37 times
+ set word= 10000;
+ set ilc=37; deliver; // deliver it 37 times (once per bit)
+ set word= 0;
+ set ilc=38; deliver; // deliver it 37 times
// insert bits in lsb order
bitfifo.inOp:
- literal BitFifo.inOp[lsbFirst,take=37];
- [*] deliver;
+ set word= BitFifo.inOp[lsbFirst,take=37];
+ set ilc=*; deliver;
// toss out 37 bits, take one, repeat. sign extend the result
bitfifo.outOp:
- literal BitFifo.outOp[drop=37,take=1,signExtend];
- [*] deliver;
+ set word= BitFifo.outOp[drop=37,take=1,signExtend];
+ set ilc=*; deliver;
-bitfifo.out: [*] wait, take, sendto lut3.in2;
-lut3.in2: load repeat counter with 4; notify bitfifo.out;
- load repeat counter with 63;
- take, deliver, notify bitfifo.out;
- load repeat counter with 11;
- take, deliver, notify bitfifo.out;
+bitfifo.out: set ilc=*; recv token, take, send to lut3.in2;
+lut3.in2: set ilc=4; send token to bitfifo.out;
+ set ilc=63;
+ take, deliver, send token to bitfifo.out;
+ set ilc=11;
+ take, deliver, send token to bitfifo.out;
// mux on second input
-lut3.inLut: literal 226;
- [*] deliver;
+lut3.inLut: set word= 226;
+ set ilc=*; deliver;
-lut3.in1: literal 18683;
- load repeat counter with 37; deliver;
- literal 0;
- load repeat counter with 37; deliver;
+lut3.in1: set word= 18683;
+ set ilc=37; deliver;
+ set word= 0;
+ set ilc=37; deliver;
-lut3.in3: literal 12000;
- load repeat counter with 37; deliver;
- literal 0;
- load repeat counter with 37; deliver;
+lut3.in3: set word= 12000;
+ set ilc=37; deliver;
+ set word= 0;
+ set ilc=37; deliver;
-lut3.out: [*] wait, take, sendto alu3.in2;
+lut3.out: set ilc=*; recv token, take, send to alu3.in2;
-alu3.in1: literal 0; deliver; [*] take, deliver;
-alu3.in2: notify lut3.out; [*] take, deliver, notify lut3.out;
-alu3.in3: literal 0; deliver; [*] take, deliver;
-alu3.outBits: [*] take, sendto debug.in;
+alu3.in1: set word= 0; deliver; set ilc=*; take, deliver;
+alu3.in2: send token to lut3.out; set ilc=*; take, deliver, send token to lut3.out;
+alu3.in3: set word= 0; deliver; set ilc=*; take, deliver;
+alu3.outBits: set ilc=*; take, send to debug.in;
-alu3.out1: [*] take, sendto alu3.in1;
-alu3.out2: [*] take, sendto alu3.in3;
+alu3.out1: set ilc=*; take, send to alu3.in1;
+alu3.out2: set ilc=*; take, send to alu3.in3;
-debug.in: [*] take, deliver;
+debug.in: set ilc=*; take, deliver;
#ship counter2 : Alu2
#ship debug : Debug
-debug.in: [*] recv, deliver;
+debug.in: set ilc=*; recv, deliver;
mem1.inCBD:
- literal SETUP; deliver;
+ set word= SETUP; deliver;
recv;
recv;
- literal GO; deliver;
+ set word= GO; deliver;
SETUP: {
-mem1.inAddrWrite: literal 1000; [11] deliver;
+mem1.inAddrWrite: set word= 1000; [11] deliver;
mem1.inDataWrite:
- literal 10; deliver;
- literal 1; deliver;
- literal 2; deliver;
- literal 3; deliver;
- literal 4; deliver;
- literal 5; deliver;
- literal 6; deliver;
- literal 7; deliver;
- literal 8; deliver;
- literal 9; deliver;
+ set word= 10; deliver;
+ set word= 1; deliver;
+ set word= 2; deliver;
+ set word= 3; deliver;
+ set word= 4; deliver;
+ set word= 5; deliver;
+ set word= 6; deliver;
+ set word= 7; deliver;
+ set word= 8; deliver;
+ set word= 9; deliver;
mem1.out:
[11] collect;
- notify mem1.inCBD;
-mem2.inAddrWrite: literal 1000; [11] deliver;
+ send token to mem1.inCBD;
+mem2.inAddrWrite: set word= 1000; [11] deliver;
mem2.inDataWrite:
- literal 10; deliver;
- literal 1; deliver;
- literal 2; deliver;
- literal 3; deliver;
- literal 4; deliver;
- literal 5; deliver;
- literal 6; deliver;
- literal 7; deliver;
- literal 8; deliver;
- literal 9; deliver;
+ set word= 10; deliver;
+ set word= 1; deliver;
+ set word= 2; deliver;
+ set word= 3; deliver;
+ set word= 4; deliver;
+ set word= 5; deliver;
+ set word= 6; deliver;
+ set word= 7; deliver;
+ set word= 8; deliver;
+ set word= 9; deliver;
mem2.out:
[11] collect;
- notify mem1.inCBD;
+ send token to mem1.inCBD;
}
GO: {
-mem1.inAddrRead: literal 1000; deliver;
-mem2.inAddrRead: literal 1000; deliver;
+mem1.inAddrRead: set word= 1000; deliver;
+mem2.inAddrRead: set word= 1000; deliver;
// normally we would write to memory, but here we send to debug
-//mem3.inAddrWrite: literal 0; deliver;
-//mem3.out: [*] collect, sendto debug.in;
+//mem3.inAddrWrite: set word= 0; deliver;
+//mem3.out: set ilc=*; collect, send to debug.in;
-alu.in1: [*] recv, deliver;
-alu.in2: [*] recv, deliver;
-alu.inOp: literal Alu2.inOp[MAX]; deliver; literal Alu2.inOp[ADD]; [*] deliver;
-//alu.out: [*] collect, sendto debug.in;
+alu.in1: set ilc=*; recv, deliver;
+alu.in2: set ilc=*; recv, deliver;
+alu.inOp: set word= Alu2.inOp[MAX]; deliver; set word= Alu2.inOp[ADD]; set ilc=*; deliver;
+//alu.out: set ilc=*; collect, send to debug.in;
mem1.out:
collect;
- sendto counter1.in1;
- sendto alu.in1;
- load repeat counter;
- collect, sendto alu.in1;
+ send to counter1.in1;
+ send to alu.in1;
+ set ilc=data;
+ collect, send to alu.in1;
mem2.out:
collect;
- sendto counter2.in1;
- sendto alu.in2;
- load repeat counter;
- collect, sendto alu.in2;
+ send to counter2.in1;
+ send to alu.in2;
+ set ilc=data;
+ collect, send to alu.in2;
-counter1.in1: literal 10; load repeat counter; literal 1; deliver;
-counter1.in2: literal 0; deliver; [*] recv, deliver;
-counter1.inOp: literal Alu2.inOp[ADD]; [*] deliver;
-counter1.out: load loop counter with 1; collect; sendto debug.in; unclog;
+counter1.in1: set word= 10; set ilc=data; set word= 1; deliver;
+counter1.in2: set word= 0; deliver; set ilc=*; recv, deliver;
+counter1.inOp: set word= Alu2.inOp[ADD]; set ilc=*; deliver;
+counter1.out: set olc=1; collect; send to debug.in; unclog;
}
+++ /dev/null
-#skip
-#expect 1
-#expect 2
-
-#ship debug : Debug
-#ship fifo : Fifo
-#ship fifo2 : Fifo
-
-debug.in: [*] take, deliver;
-fifo.in:
- literal 1;
- deliver;
- [*] take, deliver;
-
-fifo2.in:
- literal 2;
- deliver;
- [*] take, deliver;
-
-fifo2.out: wait, take, sendto fifo.in;
-
-fifo.out:
- [L] notify fifo2.out;
- [L] take, sendto debug.in;
- [L] take, sendto debug.in;
- tail;
- tail;
-
-
+++ /dev/null
-#expect 21
-#ship debug : Debug
-debug.in: literal 21; deliver;
+++ /dev/null
-#skip
-// output ///////////////////////////////////////////////////////////////////
-#expect 5263
-
-// program //////////////////////////////////////////////////////////////////
-#ship debug : Debug
-#ship memory : Memory
-#ship bitfifo : BitFifo
-#ship fifo : Fifo
-
-// dumb configurations
-debug.in: [*] take, deliver;
-memory.inAddrRead: [*] take, deliver;
-memory.inAddrWrite: [*] take, deliver;
-memory.inDataWrite: [*] take, deliver;
-
-FRED: {
- fifo.in: deliver, notify fifo.out;
-}
-
-fifo.in: literal 5263;
-fifo.out: wait, take, sendto debug.in;
-
-bitfifo.in:
- literal 0; deliver; // six bits of leading zero (to wash out the codebag size)
- literal FRED; deliver; // FRED = { address_of_fred[31], size_of_fred[6] }
-
-// strip off bottom 6 bits
-bitfifo.inOp:
- literal BitFifo.inOp[take=6]; deliver;
- literal BitFifo.inOp[take=37]; deliver;
-bitfifo.outOp:
- literal BitFifo.outOp[take=37]; deliver;
-
-bitfifo.out: take, sendto memory.inAddrRead;
-
-// value read out will be the instruction at FRED
-memory.out: take, send;
-
-
+++ /dev/null
-#skip
-#expect 5
-#expect 7
-#expect 5
-#expect 7
-#expect 5
-#expect 7
-#expect 9
-
-#ship memory : Memory
-#ship debug : Debug
-#ship fifo : Fifo
-#ship fifo2 : Fifo
-
-debug.in: [*] take, deliver;
-
-fifo.out: [*] take, sendto debug.in;
-
-fifo.in:
- [L] load loop counter with 2;
- [L] literal 5;
- [L] deliver;
- [L] take, deliver;
- [L] notify memory.inCBD;
- [L] decrement loop counter;
- tail;
-
-fifo2.out:
- literal 7;
- load repeat counter with 4;
- sendto fifo.in;
-
-memory.inCBD: literal {
- fifo.in:
- literal 9;
- deliver;
- };
- load repeat counter with 3;
- discard;
- deliver;
+++ /dev/null
-#skip
-#expect 5
-#expect 7
-#expect 5
-#expect 7
-#expect 5
-#expect 7
-#expect 9
-
-#ship memory : Memory
-#ship debug : Debug
-#ship fifo : Fifo
-#ship fifo2 : Fifo
-
-debug.in: [*] take, deliver;
-
-fifo.out: [*] take, sendto debug.in;
-
-fifo.in:
- load loop counter with 2;
- [L] nop;
- [L] literal 5;
- [L] deliver;
- [L] notify memory.inCBD;
- [L] take, deliver;
- [L] decrement loop counter;
- tail;
-
-fifo2.out:
- literal 7;
- load repeat counter with 4;
- sendto fifo.in;
-
-memory.inCBD: literal {
- fifo.in:
- literal 9;
- deliver;
- };
- discard;
- discard;
- discard;
- deliver;
-
#ship debug : Debug
fifo.in:
- literal 9;
- load repeat counter with 6;
+ set word= 9;
+ set ilc=6;
deliver;
debug.in:
- [*] take, deliver;
+ set ilc=*; recv, deliver;
fifo.out:
- load loop counter with 3;
- [L] literal 5;
- [L] sendto debug.in;
- [L] take;
- [L] sendto debug.in;
+ set olc=3;
+ [Rq] set word= 5;
+ [Rq] send to debug.in;
+ [Rq] collect;
+ [Rq] send to debug.in;
tail;
#ship alu21 : Alu2
-fifo0.out: load loop counter with 1;
-fifo0.out: [L] collect;
+fifo0.out: set olc=1;
+fifo0.out: [Rq] collect;
-debug0.in: load repeat counter with *;
-debug0.in: recv, deliver, notify alu21.out;
+debug0.in: set ilc=*;
+debug0.in: recv, deliver, send token to alu21.out;
-fifo0.in: literal 12;
-fifo0.in: load repeat counter with *;
+fifo0.in: set word= 12;
+fifo0.in: set ilc=*;
fifo0.in: deliver;
-alu21.inOp: literal 2;
-alu21.inOp: load repeat counter with 6;
+alu21.inOp: set word= 2;
+alu21.inOp: set ilc=6;
alu21.inOp: deliver;
-alu21.in1: load repeat counter with *;
-alu21.in1: recv, deliver, notify fifo0.out;
+alu21.in1: set ilc=*;
+alu21.in1: recv, deliver, send token to fifo0.out;
-fifo0.out: [L] sendto alu21.in1;
-fifo0.out: [L] wait;
+fifo0.out: [Rq] send to alu21.in1;
+fifo0.out: [Rq] recv token;
-alu21.in2: literal 2;
-alu21.in2: load repeat counter with *;
+alu21.in2: set word= 2;
+alu21.in2: set ilc=*;
alu21.in2: deliver;
-fifo0.out: [+] tail;
+fifo0.out: tail;
-alu21.out: notify alu21.out;
-alu21.out: load loop counter with 1;
-alu21.out: [L] collect;
-//alu21.out: [L] setflags a=a, b=b; // uncommenting this line will mask the bug
-alu21.out: [L] sendto debug0.in;
-alu21.out: [L] wait;
-alu21.out: [+] tail;
+alu21.out: send token to alu21.out;
+alu21.out: set olc=1;
+alu21.out: [Rq] collect;
+//alu21.out: [Rq] set flags a=a, b=b; // uncommenting this line will mask the bug
+alu21.out: [Rq] send to debug0.in;
+alu21.out: [Rq] recv token;
+alu21.out: tail;
#ship alu : Alu2
#ship debug : Debug
-alu.inOp: literal Alu2.inOp[ADD];
- [*] deliver;
+alu.inOp: set word= Alu2.inOp[ADD];
+ set ilc=*; deliver;
-debug.in: [*] take, deliver, notify alu.out;
+debug.in: set ilc=*; recv, deliver, send token to alu.out;
-alu.in2: literal 4;
- [*] deliver;
+alu.in2: set word= 4;
+ set ilc=*; deliver;
-alu.out: load loop counter with 40;
- [L] take, sendto alu.in1;
- [L] sendto debug.in;
- [L] wait;
+alu.out: set olc=40;
+ [Rq] collect, send to alu.in1;
+ [Rq] send to debug.in;
+ [Rq] recv token;
tail;
-alu.in1: literal 2;
- load repeat counter with 4;
+alu.in1: set word= 2;
+ set ilc=4;
deliver;
- load loop counter with 2;
- [L] take, deliver;
- [L] discard, deliver;
+ set olc=2;
+ [Rq] recv, deliver;
+ [Rq] recv nothing, deliver;
tail;
#ship fifo : Fifo
debug.in:
- [L] nop;
- notify fifo.out;
- [I] [*] wait;
- [+] literal 20;
- [+] deliver;
+ [Rq] nop;
+ send token to fifo.out;
+ set ilc=*;
+ [T] recv token;
+ [*] set word= 20;
+ [*] deliver;
tail;
fifo.out:
- wait;
- notify debug.in:i;
+ recv token;
+ send token to debug.in:i;
#ship fifo : Fifo
debug.in:
- [L] nop;
- notify fifo.out;
- [I] [*] wait;
- [+] literal 20;
- [+] deliver;
+ [Rq] nop;
+ send token to fifo.out;
+ set ilc=*;
+ [T] recv token;
+ [*] set word= 20;
+ [*] deliver;
deliver;
tail;
- [+] literal 40;
- [+] deliver;
+ [*] set word= 40;
+ [*] deliver;
fifo.out:
- wait;
- notify debug.in:i;
+ recv token;
+ send token to debug.in:i;
#ship fifo : Fifo
debug.in:
- literal 0;
- [L] nop;
+ set word= 0;
+ [Rq] nop;
deliver;
- load loop counter with 0;
+ set olc=0;
tail;
- [+] deliver;
+ [*] deliver;