public int getCount() {
return value & 0x3f;
}
+ public String toString() {
+ return "[ilc, count="+getCount()+", infinity="+getInfinity()+", done="+getDone()+"]";
+ }
}
private final Indenter indenter;
public void enableInstructionCounter(Boolean b) {
instrIn.setGeneralPurposeOutput(b);
}
+
+ public void dispatch(Instruction[] instructions) {
+ enableInstructionSend(false);
+ enableInstructionRecirculate(true);
+ for(Instruction i : instructions)
+ instrIn.fill(i);
+ enableInstructionRecirculate(false);
+ enableInstructionSend(true);
+ instrIn.run();
+ }
+
}
List<BitVector> dItems;
+ prln("Setting OLC=1");
+ marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 1));
prln("Setting ILC=1");
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 1));
int expected = torpedoable?1:0;
dataItems = marina.data.drainMany(2);
fatal(dataItems.size()!=expected, "Expected "+expected+" item to emerge but got: "+dataItems.size()+" data items");
+
+ fatal(!marina.getILC().getDone(), "Expected ilc=done, but got "+marina.getILC());
}
adjustIndent(-2);
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1));
// commenting the following four lines causes this test to pass
- prln("disabling instruction send");
- marina.enableInstructionSend(false);
- prln("enabling instruction recirculate");
- marina.enableInstructionRecirculate(true);
prln("inserting: "+decr_amount+" olc-- instructions");
- for(int i=0; i<decr_amount; i++)
- marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,
- SetDest.OuterLoopCounter,SetSource.Decrement));
-
prln("inserting: [!d] send data");
- marina.instrIn.fill(new Instruction.Move(dock,
- Predicate.Default, /* predicate */
- false, /* torpedoable */
- null, /* path */
- false, /* tokenIn */
- false, /* dataIn */
- false, /* latchData */
- false, /* latchPath */
- true, /* dataOut */
- false /* tokenOut */
- ));
-
- prln("disabling instruction recirculate");
- marina.enableInstructionRecirculate(false);
- prln("enabling instruction send");
- marina.enableInstructionSend(true);
-
- prln("calling marina.instrIn.run()");
- marina.instrIn.run();
-
+ Instruction[] instructions = new Instruction[decr_amount+1];
+ for(int i=0; i<decr_amount; i++)
+ instructions[i] =
+ new Instruction.Set(dock,
+ Predicate.IgnoreFlagD,
+ SetDest.OuterLoopCounter,
+ SetSource.Decrement);
+ instructions[instructions.length-1] =
+ new Instruction.Move(dock,
+ Predicate.Default, // predicate
+ false, // torpedoable
+ null, // path
+ false, // tokenIn
+ false, // dataIn
+ false, // latchData
+ false, // latchPath
+ true, // dataOut
+ false // tokenOut
+ );
+ marina.dispatch(instructions);
model.waitNS(64 * CYCLE_TIME_NS);
int expected = decr_amount>=olc ? 0 : 1;