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,
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)
public boolean isLooping() { return true; }
public boolean isRepeating() { return true; }
- public boolean isStanding() { return standing; }
}
/*
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; }
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));
}
}
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..............");
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,
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);