add test 3008
authorAdam Megacz <adam.megacz@sun.com>
Tue, 18 Nov 2008 19:05:44 +0000 (19:05 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Tue, 18 Nov 2008 19:05:44 +0000 (19:05 +0000)
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index 518a733..52f0222 100644 (file)
@@ -782,12 +782,12 @@ public class MarinaTest {
      *  state diagram).  The "OD->drain" behavior of state 0 is
      *  verified by testRequeueStage0().
      */
-    private void testRequeueStage0to1to3(Marina marina) {
+    private void testRequeueStage0to1to3to0(Marina marina) {
         List<BitVector> dataItems;
 
         int olc_value = 63;
 
-        prln("Begin testRequeueStage0to1to3");
+        prln("Begin testRequeueStage0to1to3to0");
        adjustIndent(2);
 
         // State 0 //////////////////////////////////////////////////////////////////////////////
@@ -810,10 +810,8 @@ public class MarinaTest {
        prln("Executing Send Data; this will be recirculated");
         marina.instrIn.fill(REQUEUEING_SEND_DATA);
 
-        /*
        prln("Executing Set OLC--; this will be recirculated");
         marina.instrIn.fill(new Instruction.Set(DOCK,true,Predicate.IgnoreOLC,SetDest.OuterLoopCounter,SetSource.Decrement));
-        */
 
         // verify state1 "OD waits"
         dataItems = marina.data.drainMany(2);
@@ -833,7 +831,6 @@ public class MarinaTest {
         // 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,
@@ -843,12 +840,45 @@ public class MarinaTest {
 
         // verify that we are back in state0
         saturateInstructionFifo(marina, REQUEUEING_NOP, MORE_THAN_INSTRUCTION_IN_SATURATION_AMOUNT, false);
-        */
 
        adjustIndent(-2);
-        prln("End testRequeueStage0to1to3");
+        prln("End testRequeueStage0to1to3to0");
     }
 
+    private void testWaitForTail(Marina marina) {
+        List<BitVector> dataItems;
+
+        prln("Begin testWaitForTail");
+       adjustIndent(2);
+
+        prln("inserting instruction: Set OLC=5");
+        marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC,SetDest.OuterLoopCounter,1));
+
+       prln("inserting instruction: [Rq] Nop; this will cause 0->1 transition and possibly be discarded");
+        marina.instrIn.fill(REQUEUEING_NOP);
+
+        // just in case there is some capacity between the execution
+        // stage and the requeue stage, we stick in a whole bunch of
+        // NOPs.
+        for(int i=0; i<4; i++) {
+            prln("inserting instruction: [Rq] Nop; this (and subsequent instructions) should not execute until Tail is inserted");
+            marina.instrIn.fill(REQUEUEING_NOP);
+        }
+
+       prln("inserting instruction: [Rq] Set ILC=1");
+       marina.instrIn.fill(new Instruction.Set(DOCK,true,Predicate.IgnoreOLC,SetDest.InnerLoopCounter,1));
+
+       prln("inserting instruction: [Rq] Send Data");
+        marina.instrIn.fill(REQUEUEING_SEND_DATA);
+
+        dataItems = marina.data.drainMany(1);
+        fatal(dataItems.size()!=0, "Expected exactly no data items to emerge but got at least: "+dataItems.size());
+
+       adjustIndent(-2);
+        prln("End testWaitForTail");
+    }
+
+
     private void testFlagAB(Marina marina) {
        prln("Begin testFlagAB");
        adjustIndent(2);
@@ -985,7 +1015,8 @@ public class MarinaTest {
                case 3004: testFlagZ(marina); break;
                case 3005: testPredicationOnAB(marina); break;
                 case 3006: sendData(marina); break;
-               case 3007: testRequeueStage0to1to3(marina); break;
+               case 3007: testRequeueStage0to1to3to0(marina); break;
+               case 3008: testWaitForTail(marina); break;
 
                default:
                        fatal(true, "Test number: "+testNum+" doesn't exist.");