eliminate standing bit
authoradam <adam@megacz.com>
Tue, 12 Feb 2008 09:12:45 +0000 (10:12 +0100)
committeradam <adam@megacz.com>
Tue, 12 Feb 2008 09:12:45 +0000 (10:12 +0100)
src/edu/berkeley/fleet/api/Instruction.java
src/edu/berkeley/fleet/assembler/Parser.java
src/edu/berkeley/fleet/ies44/InstructionEncoder.java

index 3521374..af9e9ce 100644 (file)
@@ -148,13 +148,11 @@ public abstract class Instruction {
         public final boolean     tokenOut;
         public final boolean     requeue;
         public final boolean     ignoreUntilLast;
-        public final boolean     standing;
 
         /** count=0 denotes a standing move */
         public Move(Pump        pump,
                     int         predicate,
                     Destination dest,
-                    int         count,
                     boolean     tokenIn,
                     boolean     dataIn,
                     boolean     latch,
@@ -173,7 +171,6 @@ public abstract class Instruction {
             this.tokenOut = tokenOut;
             this.requeue = requeue;
             this.ignoreUntilLast = ignoreUntilLast;
-            this.standing = count==0;
             if (pump.isInbox() && tokenIn && dataIn)
                 throw new RuntimeException("cannot have both \"wait\" and \"take\"/\"recieve\" on an inbox: " + this);
             if (pump.isOutbox() && tokenOut && dataOut)
@@ -208,7 +205,6 @@ public abstract class Instruction {
 
         public boolean isLooping() { return true; }
         public boolean isRepeating() { return true; }
-        public boolean isStanding() { return standing; }
     }
 
     /*
index 95a3ec7..c0635d9 100644 (file)
@@ -380,7 +380,7 @@ public class Parser {
                     if      ("wait".equals(ttt.head()))    { tokenIn = true; }
                     else if ("nop".equals(ttt.head()))     { }
                     else if ("kill".equals(ttt.head()))    {
-                        cb.add(new Instruction.Kill(pump, count));
+                        cb.add(new Instruction.Kill(pump, 1));
                         continue OUTER;
                     }
                     else if ("discard".equals(ttt.head())) { dataIn = true; latch = false; }
@@ -393,7 +393,7 @@ public class Parser {
                     else if ("notifyLast".equals(ttt.head()))     { tokenOut = true; ignoreUntilLast = true; dest = portReference(ttt.child(0)); }
                 }
                 cb.add(new Instruction.Move(pump, predicate,
-                                            dest, count, tokenIn, dataIn,
+                                            dest, tokenIn, dataIn,
                                             latch, dataOutDest, dataOut, tokenOut, requeue, ignoreUntilLast));
             }
         }
index 2efe2a6..bd6afe0 100644 (file)
@@ -36,7 +36,6 @@ public abstract class InstructionEncoder {
     public static final Mask P_Z                 = new Mask(".............01......................");
     public static final Mask P_ALWAYS            = new Mask(".............11......................");
     public static final Mask MOVE                = new Mask("...............001...................");
-    public static final Mask STAND               = new Mask("...................1.................");
     public static final Mask TI                  = new Mask("....................1................");
     public static final Mask DI                  = new Mask(".....................1...............");
     public static final Mask DC                  = new Mask("......................1..............");
@@ -116,12 +115,10 @@ public abstract class InstructionEncoder {
         boolean latch       = DC.get(inst);
         boolean dataOut     = DO.get(inst);
         boolean tokenOut    = TO.get(inst);
-        boolean standing    = STAND.get(inst);
         boolean dataOutDest = PATH_DATA.get(inst);
         return new Instruction.Move(name,
                                     predicate,
                                     dest,
-                                    standing?0:1,
                                     tokenIn,
                                     dataIn,
                                     latch,
@@ -215,7 +212,6 @@ public abstract class InstructionEncoder {
                 instr  = PATH_LITERAL.set(instr);
                 instr  = PATH_LITERAL.setval(instr, inst.dest==null?0:getDestAddr(inst.dest));
             }
-            if (inst.standing)                   instr = STAND.set(instr);
 
         } else {
             throw new RuntimeException("unrecognized instruction " + d);