public String toString() {
String ret = benkoBox.toString() + ": ";
if (count==0 || count>1 || recycle) {
- ret += "[";
+ ret += recycle ? "(" : "[";
if (count>1) ret += count;
if (count==0) ret += "*";
- if (recycle) ret += "r";
- ret += "] ";
+ ret += recycle ? ")" : "] ";
}
boolean needcomma = false;
if (tokenIn) { ret += (needcomma ? ", " : "") + "wait"; needcomma = true; }
- if (dataIn && latch) { ret += (needcomma ? ", " : "") + "take"; needcomma = true; }
- if (dataIn && !latch) { ret += (needcomma ? ", " : "") + "discard"; needcomma = true; }
+ if (dataIn && latch) {
+ if (benkoBox instanceof BenkoBox.Inbox)
+ ret += (needcomma ? ", " : "") + "receive";
+ else
+ ret += (needcomma ? ", " : "") + "take";
+ needcomma = true;
+ }
+ if (dataIn && !latch) { ret += (needcomma ? ", " : "") + "dismiss"; needcomma = true; }
if (dataOut) {
if (benkoBox instanceof BenkoBox.Inbox || dest==null)
ret += (needcomma ? ", " : "") + "deliver";
ret += (needcomma ? ", " : "") + "sendto "+dest;
needcomma = true;
}
- if (tokenOut) { ret += (needcomma ? ", " : "") + "ack "+dest; needcomma = true; }
+ if (tokenOut) { ret += (needcomma ? ", " : "") + "notify "+dest; needcomma = true; }
return ret;
}
Tree ttx = null;
boolean recycle = false;
ttx = tt.child(1);
- if (tt.size() > 1) {
- tt = tt.child(0);
- if (tt.size() > 0 && tt.child(0).size()>0) {
- tt = tt.child(0);
- if (tt.child(0).size() == 0) count=1;
- else if (tt.child(0).size() > 0 && "Star".equals(tt.child(0).child(0).head())) count=0;
- else count = Integer.parseInt(string(tt.child(0)));
- if (tt.size() > 1 && tt.child(1).size() > 0)
- recycle = true;
+ if (tt.size() > 1 && tt.child(0).size()>0) {
+ tt = tt.child(0).child(0);
+ if (tt.head().equals("BrackStar")) {
+ count = 0;
+ recycle = false;
+ } else if (tt.head().equals("ParenStar")) {
+ count = 0;
+ recycle = true;
+ } else if (tt.head().equals("Brack")) {
+ count = Integer.parseInt(string(tt.child(0)));
+ recycle = false;
+ } else if (tt.head().equals("Paren")) {
+ count = Integer.parseInt(string(tt.child(0)));
+ recycle = true;
}
}
boolean tokenIn = false;
| CodeBagDescriptor:: CodeBag ":" "sendto" Port ";" /ws
| NamedCodeBag:: name ":" "{" CodeBagBody "}" /ws
+CountField = Brack:: "[" int "]"
+ | Paren:: "(" int ")"
+ | BrackStar:: "[*]"
+ | ParenStar:: "(*)"
Instruction = Instruction::
- (Brack:: "[" (int|(Star::"*"))? ("r")? "]" ws!)?
+ (CountField ws!)?
(Command +/ (ws! "," ws!) ws! ";"!)
Command = Nop:: "nop"
| Kill:: "kill"
| KillStar:: "kill*"
| Wait:: "wait"
- | Discard:: "discard"
- | Take:: "take"
+ | Discard:: "dismiss"
+ | Take:: ("take"|"receive")
| SendTo:: "sendto" ws! Port
| Deliver:: "deliver"
- | Ack:: "ack" ws! Port
+ | Ack:: "notify" ws! Port
Source = Port
| ShipSpecific
private String bitfile;
- public Slipway() { this("superbowl2.bit"); }
+ public Slipway() { this("superbowl3.bit"); }
public Slipway(String bitfile) {
this.bitfile = bitfile;
createShip("Debug", "debug");
- createShip("Fifo", "fifo1");
createShip("Alu2", "alu2a");
createShip("Alu2", "alu2b");
createShip("Alu2", "alu2c");
fifo.out:
[*] nop;
- ack fifo2.out;
+ notify fifo2.out;
take, sendto debug.in;
take, sendto debug.in;
kill*;
take;
[100] deliver;
fifo.out:
- [99r] take, sendto fifo.in;
- [1r] take, sendto debug.in;
+ (99) take, sendto fifo.in;
+ (1) take, sendto debug.in;
0: sendto alu.in;
alu.out:
[*] nop;
- [*r] wait, take, sendto lut.inLut;
- [*r] sendto alu.in;
+ (*) wait, take, sendto lut.inLut;
+ (*) sendto alu.in;
kill;
// acks from debug ship trigger new truth tables
-debug.in: [*] take, deliver, ack alu.out;
+debug.in: [*] take, deliver, notify alu.out;
// kickoff
0: sendto lut.inLut;