false /* tokenOut */
);
+ private static final Instruction SEND_TOKEN =
+ new Instruction.Move(DOCK,
+ false, /* requeueing */
+ Predicate.IgnoreOLC, /* predicate */
+ false, /* torpedoable */
+ null, /* path */
+ false, /* tokenIn */
+ false, /* dataIn */
+ false, /* latchData */
+ false, /* latchPath */
+ false, /* dataOut */
+ true /* tokenOut */
+ );
+
+ private static final Instruction RECV_TOKEN =
+ new Instruction.Move(DOCK,
+ false, /* requeueing */
+ Predicate.IgnoreOLC, /* predicate */
+ false, /* torpedoable */
+ null, /* path */
+ true, /* tokenIn */
+ false, /* dataIn */
+ false, /* latchData */
+ false, /* latchPath */
+ false, /* dataOut */
+ false /* tokenOut */
+ );
+
private static final Instruction REQUEUEING_SEND_DATA =
new Instruction.Move(DOCK,
true, /* requeueing */
* This test brings the requeue stage through the 0->2->3->0 state
* transition sequence.
*
-
* According to the diagram in IES50, there are two transitions
* (0->2, 2->3, 3->0) to perform, and in each state there are two
* behaviors to verify (the two notations in each oval of the
prln("End recvData");
}
+ private void testSendAndRecvToken(Marina marina) {
+ prln("Begin testSendAndRecvToken");
+ adjustIndent(2);
+
+ prln("sending token");
+ marina.instrIn.fill(SEND_TOKEN);
+
+ prln("receiving token");
+ marina.instrIn.fill(RECV_TOKEN);
+
+ prln("sending data item");
+ marina.instrIn.fill(SEND_DATA);
+
+ prln("checking to confirm that data item arrived");
+ List<BitVector> dataItems = marina.data.drainMany(3);
+ fatal(dataItems.size()!=1,
+ "expected exactly one data item, got " + dataItems.size());
+
+ adjustIndent(-2);
+ prln("End testSendAndRecvToken");
+ }
+
private void testSignExtendedLiteral(Marina marina) {
prln("Begin testSignExtendedLiteral");
adjustIndent(2);
case 3012: testFlagC(marina); break;
case 3013: testSignExtendedLiteral(marina); break;
case 3014: testShiftedLiteral(marina); break;
+ case 3015: testSendAndRecvToken(marina); break;
default:
fatal(true, "Test number: "+testNum+" doesn't exist.");