update to new AM37 syntax
authoradam <adam@megacz.com>
Tue, 26 Aug 2008 10:04:10 +0000 (11:04 +0100)
committeradam <adam@megacz.com>
Tue, 26 Aug 2008 10:04:10 +0000 (11:04 +0100)
57 files changed:
ships/Alu2.ship
ships/Debug.ship
ships/Fifo.ship
ships/Lut3.ship
ships/Memory.ship
ships/Rotator.ship
src/edu/berkeley/fleet/assembler/Parser.java
src/edu/berkeley/fleet/assembler/fleet.g
tests/codebags/fun-with-codebags.fleet
tests/colliding-tokens.test
tests/dock/kill-only-standing-instructions.fleet [new file with mode: 0644]
tests/dock/literal-at-pump.fleet [new file with mode: 0644]
tests/dock/pump+ [new file with mode: 0644]
tests/dock/send-without-destination.fleet- [new file with mode: 0644]
tests/dock/shift.test [new file with mode: 0644]
tests/dock/test-count.fleet [moved from tests/pump/test-count.fleet with 93% similarity]
tests/dock/test-repeat-counter-from-data-latch.fleet [moved from tests/pump/test-repeat-counter-from-data-latch.fleet with 54% similarity]
tests/dock/test-repeat-counter.fleet [moved from tests/pump/test-repeat-counter.fleet with 51% similarity]
tests/dock/test-repeat-zero.fleet [moved from tests/pump/test-repeat-zero.fleet with 52% similarity]
tests/dock/test-use-loop-counter-dl-on-non-nop.fleet [new file with mode: 0644]
tests/dock/test-use-loop-counter.fleet [new file with mode: 0644]
tests/flags/basic.test
tests/flags/flags-ab-1.test
tests/flags/flags-ab-2.test
tests/flags/flags-ab-3.test
tests/flags/flags-ab-4.test
tests/flags/flags-ab-5.test
tests/flags/flags-ab-not-1.test
tests/flags/flags-ab-not-2.test
tests/flags/flags-ab-not-3.test
tests/flags/flags-ab-not-4.test
tests/flags/flags-ab-not-5.test
tests/flags/flags-reset.test
tests/flags/signal-0-from-inbox-to-inbox.test
tests/flags/signal-0-from-inbox-to-outbox.test.test
tests/flags/signal-0-from-outbox-to-inbox.test
tests/flags/signal-0-from-outbox-to-outbox.test.test
tests/flags/signal-1-from-inbox-to-inbox.test
tests/flags/signal-1-from-inbox-to-outbox.test.test
tests/flags/signal-1-from-outbox-to-inbox.test
tests/flags/signal-1-from-outbox-to-outbox.test.test
tests/literals/negative-absolute-literals.fleet
tests/memory/count.and.stride.fleet
tests/memory/memory-test.fleet
tests/multiply.test-
tests/ndp/p-plus.fleet-
tests/pump/kill-only-standing-instructions.fleet [deleted file]
tests/pump/literal-at-pump.fleet [deleted file]
tests/pump/send-without-destination.fleet- [deleted file]
tests/pump/test-use-loop-counter-dl-on-non-nop.fleet [deleted file]
tests/pump/test-use-loop-counter.fleet [deleted file]
tests/requeue/requeueing-literal.fleet
tests/requeue/test-for-common-requeue-timing-error.fleet
tests/requeue/test-requeue.fleet
tests/torpedo/basic-torpedo.test
tests/torpedo/epilogue-fifo.test
tests/torpedo/epilogue-fifo2.test

index 7f270b6..2394534 100644 (file)
@@ -165,60 +165,60 @@ public void service() {
 #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>
index 1e82d26..c8e102e 100644 (file)
@@ -56,7 +56,7 @@ endmodule
 #ship debug : Debug
 
 debug.in:
-  literal 25;
+  set word= 25;
   deliver;
 
 == Contributors =========================================================
index 8cbd38c..0a620b2 100644 (file)
@@ -51,21 +51,21 @@ at least 16 words.
 #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;
 
 
 
index 7781444..5a0460b 100644 (file)
@@ -357,45 +357,45 @@ is considered ``bit zero'').
 #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;
 
 
 
index c86e9ae..135102a 100644 (file)
@@ -229,17 +229,17 @@ sequence guarantee problem mentioned in the previous paragraph.
 // 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;
 }
 
 
index c6661c4..e12cddc 100644 (file)
@@ -77,10 +77,10 @@ public void service() {
 #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 =========================================================
index 91368ea..6eebcc2 100644 (file)
@@ -195,9 +195,6 @@ public class Parser {
                 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));
@@ -213,13 +210,6 @@ public class Parser {
             }
             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")) {
@@ -249,10 +239,8 @@ public class Parser {
 
     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;
@@ -263,10 +251,11 @@ public class Parser {
             }
         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);
     }
 
@@ -370,6 +359,12 @@ public class Parser {
             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;
@@ -382,36 +377,45 @@ public class Parser {
                     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;
@@ -431,11 +435,13 @@ public class Parser {
                         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)) {
@@ -455,23 +461,8 @@ public class Parser {
                 }
                 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;
@@ -484,18 +475,66 @@ public class Parser {
                 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,
index e560fa8..7b4ac5e 100644 (file)
@@ -1,4 +1,4 @@
-// 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
@@ -11,51 +11,44 @@ CodeBagBody::   = (Fiber | CodeBagDef) */ ws
 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 "]"
@@ -63,10 +56,7 @@ Literal         = int
                 | "{" 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=_\-]++
 
@@ -86,11 +76,6 @@ wsx!            = ()
 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"
index a116240..50d7b3d 100644 (file)
@@ -4,13 +4,13 @@
 #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;
index 3c83b54..31a976e 100644 (file)
@@ -9,11 +9,11 @@
 // 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;
 
diff --git a/tests/dock/kill-only-standing-instructions.fleet b/tests/dock/kill-only-standing-instructions.fleet
new file mode 100644 (file)
index 0000000..4f82177
--- /dev/null
@@ -0,0 +1,29 @@
+#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;
+
+
diff --git a/tests/dock/literal-at-pump.fleet b/tests/dock/literal-at-pump.fleet
new file mode 100644 (file)
index 0000000..b6cc4de
--- /dev/null
@@ -0,0 +1,3 @@
+#expect 21
+#ship debug : Debug
+debug.in: set word= 21; deliver;
diff --git a/tests/dock/pump+ b/tests/dock/pump+
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/dock/send-without-destination.fleet- b/tests/dock/send-without-destination.fleet-
new file mode 100644 (file)
index 0000000..d6478d8
--- /dev/null
@@ -0,0 +1,40 @@
+#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;
+
+
diff --git a/tests/dock/shift.test b/tests/dock/shift.test
new file mode 100644 (file)
index 0000000..180de2c
--- /dev/null
@@ -0,0 +1,7 @@
+#expect 524290
+#ship debug : Debug
+
+debug.in:
+   set word=1;
+   shift 2;
+   deliver;
similarity index 93%
rename from tests/pump/test-count.fleet
rename to tests/dock/test-count.fleet
index 7366f08..c6facee 100644 (file)
 #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;
 
@@ -9,16 +9,16 @@
 #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;
similarity index 51%
rename from tests/pump/test-repeat-counter.fleet
rename to tests/dock/test-repeat-counter.fleet
index af139b9..3587a34 100644 (file)
@@ -7,16 +7,16 @@
 #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;
 
similarity index 52%
rename from tests/pump/test-repeat-zero.fleet
rename to tests/dock/test-repeat-zero.fleet
index 150d3c8..69a68ca 100644 (file)
@@ -4,14 +4,14 @@
 #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;
diff --git a/tests/dock/test-use-loop-counter-dl-on-non-nop.fleet b/tests/dock/test-use-loop-counter-dl-on-non-nop.fleet
new file mode 100644 (file)
index 0000000..3b954ee
--- /dev/null
@@ -0,0 +1,40 @@
+#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;
diff --git a/tests/dock/test-use-loop-counter.fleet b/tests/dock/test-use-loop-counter.fleet
new file mode 100644 (file)
index 0000000..46e112e
--- /dev/null
@@ -0,0 +1,43 @@
+#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;
+
index 461ac1e..56649cc 100644 (file)
@@ -5,7 +5,7 @@
 #ship debug        : Debug
 
 debug.in:
-  literal 0;
-  setflags a=0, b=0;
+  set word= 0;
+  set flags a=0, b=0;
   deliver;
 
index 30a7c62..9d0fd1d 100644 (file)
@@ -5,7 +5,7 @@
 #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;
index f94b5a4..d022f21 100644 (file)
@@ -5,7 +5,7 @@
 #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;
index 97f0951..28b2d2c 100644 (file)
@@ -5,7 +5,7 @@
 #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;
index 538a372..a5a1046 100644 (file)
@@ -5,7 +5,7 @@
 #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;
index f9b0e0e..3c2a6b6 100644 (file)
@@ -5,8 +5,8 @@
 #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;
index 9dd4eac..44760fe 100644 (file)
@@ -5,7 +5,7 @@
 #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;
index 99fc68d..54652ed 100644 (file)
@@ -5,7 +5,7 @@
 #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;
index 3c46ce1..ed2f128 100644 (file)
@@ -5,8 +5,8 @@
 #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;
index 45d40f5..c8bac2f 100644 (file)
@@ -5,8 +5,8 @@
 #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;
index 020941d..99fddab 100644 (file)
@@ -5,8 +5,8 @@
 #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;
index db20a3d..6929934 100644 (file)
@@ -6,14 +6,14 @@
 #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;
 
index 264c364..b7179a6 100644 (file)
@@ -5,13 +5,13 @@
 #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;
index dc975a0..84f77b8 100644 (file)
@@ -6,16 +6,16 @@
 #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;
index b352fc9..7762c1b 100644 (file)
@@ -5,13 +5,13 @@
 #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;
index e28ecbb..e97049e 100644 (file)
@@ -6,16 +6,16 @@
 #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;
index acc7b30..b88cd01 100644 (file)
@@ -5,13 +5,13 @@
 #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;
index 1c91045..9e15062 100644 (file)
@@ -6,16 +6,16 @@
 #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;
index 4adf823..6993911 100644 (file)
@@ -5,13 +5,13 @@
 #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;
index 1ef3599..da7d1b9 100644 (file)
@@ -6,16 +6,16 @@
 #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;
index bfd4bb2..f097e14 100644 (file)
@@ -2,7 +2,7 @@
 #ship debug : Debug
 
 debug.in:
-  literal -1;
+  set word= -1;
   deliver;
 
 
index 2d44135..e145321 100644 (file)
 #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;
 
index 9e12103..c00d983 100644 (file)
 #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;
 
 
 
index a50cfdd..08c9df1 100644 (file)
 
 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;
 
index 39f0c1f..9e9921a 100644 (file)
@@ -9,76 +9,76 @@
 #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;
 
 }
diff --git a/tests/pump/kill-only-standing-instructions.fleet b/tests/pump/kill-only-standing-instructions.fleet
deleted file mode 100644 (file)
index 9073bb6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#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;
-
-
diff --git a/tests/pump/literal-at-pump.fleet b/tests/pump/literal-at-pump.fleet
deleted file mode 100644 (file)
index 10255e0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#expect 21
-#ship debug : Debug
-debug.in: literal 21; deliver;
diff --git a/tests/pump/send-without-destination.fleet- b/tests/pump/send-without-destination.fleet-
deleted file mode 100644 (file)
index 43fb949..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
-
-
diff --git a/tests/pump/test-use-loop-counter-dl-on-non-nop.fleet b/tests/pump/test-use-loop-counter-dl-on-non-nop.fleet
deleted file mode 100644 (file)
index 1ef3e80..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#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;
diff --git a/tests/pump/test-use-loop-counter.fleet b/tests/pump/test-use-loop-counter.fleet
deleted file mode 100644 (file)
index 9b5480d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#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;
-
index 5131b48..5fbbc3d 100644 (file)
@@ -9,19 +9,19 @@
 #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;
 
 
index dd265ca..ba97167 100644 (file)
 #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;
index 063a1cb..0752a24 100644 (file)
 #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;
 
index 38346da..6181121 100644 (file)
@@ -4,14 +4,15 @@
 #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;
 
index a438550..0042536 100644 (file)
@@ -5,17 +5,18 @@
 #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;
 
index a8955bc..d3806c9 100644 (file)
@@ -5,11 +5,11 @@
 #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;