more updates to test 3007
authorAdam Megacz <adam.megacz@sun.com>
Mon, 17 Nov 2008 23:08:13 +0000 (23:08 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Mon, 17 Nov 2008 23:08:13 +0000 (23:08 +0000)
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index ce4a953..518a733 100644 (file)
@@ -691,6 +691,20 @@ public class MarinaTest {
         prln("Successfully inserted " + i + " instructions");
     }
 
+    private static final Instruction NOP =
+        new Instruction.Move(DOCK,
+                             false,                  /* requeueing  */
+                             Predicate.IgnoreOLC,   /* predicate   */
+                             false,                 /* torpedoable */
+                             null,                  /* path        */
+                             false,                 /* tokenIn     */
+                             false,                 /* dataIn      */
+                             false,                 /* latchData   */
+                             false,                 /* latchPath   */
+                             false,                 /* dataOut     */
+                             false                  /* tokenOut    */
+                             );
+
     private static final Instruction REQUEUEING_NOP =
         new Instruction.Move(DOCK,
                              true,                  /* requeueing  */
@@ -757,52 +771,80 @@ public class MarinaTest {
         prln("End testRequeueStage0to1");
     }
 
+    /**
+     *  This test brings the requeue stage through the 0->1->3 state
+     *  transition sequence.
+     *
+
+     *  According to the diagram in IES50, there are two transitions
+     *  (0->1, 1->3) to perform, and in each state there are two
+     *  behaviors to verify (the two notations in each oval of the
+     *  state diagram).  The "OD->drain" behavior of state 0 is
+     *  verified by testRequeueStage0().
+     */
     private void testRequeueStage0to1to3(Marina marina) {
         List<BitVector> dataItems;
 
+        int olc_value = 63;
+
         prln("Begin testRequeueStage0to1to3");
        adjustIndent(2);
 
-        prln("Executing Set OLC=63");
-        marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC,SetDest.OuterLoopCounter,63));
+        // State 0 //////////////////////////////////////////////////////////////////////////////
 
+        prln("Executing Set OLC="+olc_value);
+        marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC,SetDest.OuterLoopCounter,olc_value));
        prln("Executing Set ILC=1");
        marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC,SetDest.InnerLoopCounter, 1));
 
+        // verify state0 "EPI->ring" and 0->1 transition
        prln("Executing Send Data (requeueable); this will cause 0->1 transition and be discarded");
         marina.instrIn.fill(REQUEUEING_SEND_DATA);
 
-       prln("Executing Set ILC=1 (requeueable); this will be requeued once TAIL happens");
-        marina.instrIn.fill(new Instruction.Set(DOCK,true,Predicate.IgnoreOLC,SetDest.InnerLoopCounter, 1));
+        // State 1 //////////////////////////////////////////////////////////////////////////////
 
-       prln("Executing Send Data (requeueable); this will be recirculated");
-        marina.instrIn.fill(SEND_DATA);
+        // verify state1 "EPI->ring"
+       prln("Executing Set ILC=1; this will be recirculated");
+       marina.instrIn.fill(new Instruction.Set(DOCK,true,Predicate.IgnoreOLC,SetDest.InnerLoopCounter, 1));
+
+       prln("Executing Send Data; this will be recirculated");
+        marina.instrIn.fill(REQUEUEING_SEND_DATA);
 
-       prln("Executing Set ILC=1 (requeueable); this will be recirculated");
-        marina.instrIn.fill(new Instruction.Set(DOCK,true,Predicate.IgnoreOLC,SetDest.InnerLoopCounter, 1));
+        /*
+       prln("Executing Set OLC--; this will be recirculated");
+        marina.instrIn.fill(new Instruction.Set(DOCK,true,Predicate.IgnoreOLC,SetDest.OuterLoopCounter,SetSource.Decrement));
+        */
 
-        // at this point we have inserted two "move" instructions; we
-        // want to make sure that only the first one is executed
+        // verify state1 "OD waits"
         dataItems = marina.data.drainMany(2);
         fatal(dataItems.size()!=1, "Expected exactly one data item to emerge but got: "+dataItems.size()+" data items");
 
-        // by now we should be in state 1; we insert another
-        // REQUEUEING_SEND_DATA in order to be sure that the epi fifo
-        // is still accepting input
-       prln("Executing Send Data (requeueable); this will be recirculated");
-        marina.instrIn.fill(REQUEUEING_SEND_DATA);
-
-       prln("Executing Set ILC=1 (requeueable); this will be recirculated");
-        marina.instrIn.fill(new Instruction.Set(DOCK,true,Predicate.IgnoreOLC,SetDest.InnerLoopCounter, 1));
-
+        // verify 1->3 transition
        prln("Executing Tail; this will cause the 2->3 transition and be discarded");
         marina.instrIn.fill(new Instruction.Tail(DOCK));
 
-        // now we should be in state 3
+        // State 3 //////////////////////////////////////////////////////////////////////////////
+
+        // verify state3 "OD->ring"
         dataItems = marina.data.drainMany(MORE_THAN_DATA_OUT_SATURATION_AMOUNT);
-        fatal(dataItems.size()!=MORE_THAN_DATA_OUT_SATURATION_AMOUNT,
+        fatal(dataItems.size()<MORE_THAN_DATA_OUT_SATURATION_AMOUNT,
               "Expected an endless supply of data items, but only got: "+dataItems.size()+" of them");
 
+        // verify state3 "OD->ring"
+        saturateInstructionFifo(marina, NOP, MORE_THAN_INSTRUCTION_IN_SATURATION_AMOUNT, true);
+
+        /*
+        // verify state3->state0
+        dataItems = marina.data.drainMany(olc_value);
+        fatal(dataItems.size()>=olc_value,
+              "Expected less than " + olc_value + " items to emerge, but got at least : "+dataItems.size()+" of them");
+
+        // State 0 //////////////////////////////////////////////////////////////////////////////
+
+        // verify that we are back in state0
+        saturateInstructionFifo(marina, REQUEUEING_NOP, MORE_THAN_INSTRUCTION_IN_SATURATION_AMOUNT, false);
+        */
+
        adjustIndent(-2);
         prln("End testRequeueStage0to1to3");
     }