add test 3015 (testSendAndRecvToken)
authorAdam Megacz <adam.megacz@sun.com>
Sat, 22 Nov 2008 19:19:37 +0000 (19:19 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Sat, 22 Nov 2008 19:19:37 +0000 (19:19 +0000)
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index d5b704c..7c85173 100644 (file)
@@ -752,6 +752,34 @@ public class MarinaTest {
                              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  */
@@ -868,7 +896,6 @@ public class MarinaTest {
      *  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
@@ -1100,6 +1127,28 @@ public class MarinaTest {
        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);
@@ -1436,6 +1485,7 @@ public class MarinaTest {
                 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.");