test updates for kessels counter
authorAdam Megacz <adam.megacz@sun.com>
Fri, 29 May 2009 06:32:06 +0000 (06:32 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Fri, 29 May 2009 06:32:06 +0000 (06:32 +0000)
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index 0a58ba3..9e14e73 100644 (file)
@@ -683,10 +683,21 @@ public class MarinaTest {
     private void walkOneOLC(Marina marina) {
         prln("Begin walkOneOLC");
         adjustIndent(2);
-        for (int i=5; i>=0; i--) {
-            int inOlc = 1<<i;
+        for (int i=-1; i<=5; i++) {
+
+            if (marina.kesselsCounter) {
+                // master clear on each iteration; otherwise we'd need to "run down" the olc
+                marina.masterClear();
+                marina.enableInstructionSend(true);
+            }
+
+            int inOlc = i==-1 ? 0 : (1<<i);
             marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, inOlc));
+
+            model.waitNS(128 * CYCLE_TIME_NS);
+
             int outOlc = marina.getOLC();
+
             fatal(outOlc!=inOlc, "walkOneOLC: got="+outOlc+" expected="+inOlc);
             prln("walkOneOLC: "+inOlc+" checks out");
         }
@@ -1364,13 +1375,20 @@ public class MarinaTest {
 
             marina.fillSouthProperStopper(new Instruction[] {
                     RECV_DATA,
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch)
+                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch),
+                    // FIXME: try a load literal right here to be evil
                 });
 
             model.waitNS(CYCLE_TIME_NS * 64);
 
             int olc = marina.getOLC();
             fatal(olc != (1<<bit), "expected olc to be " + (1<<bit) + ", but got " + olc); 
+
+            if (marina.kesselsCounter) {
+                // master clear on each iteration; otherwise we'd need to "run down" the olc
+                marina.masterClear();
+                marina.enableInstructionSend(true);
+            }
         }
 
         adjustIndent(-2);
@@ -1713,8 +1731,9 @@ public class MarinaTest {
         marina.instrIn.fill(setOlc(63));
 
         int olc;
+        model.waitNS(128 * CYCLE_TIME_NS);
         olc = marina.getOLC();
-        fatal(olc!=63, "bad OLC: "+olc+" expected: 1");
+        fatal(olc!=63, "bad OLC: "+olc+" expected: 63");
 
         marina.instrIn.fill(new 
                             Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG));
@@ -1724,6 +1743,10 @@ public class MarinaTest {
         prln("execute a move instruction that does nothing but loops until torpedo arrives"); 
         prln("A=1, B=B This instruction should not execute because D-flag is set");
         prln("Set A=A, B=1 This instruction should execute because D-flag is set");
+
+        model.waitNS(128 * CYCLE_TIME_NS);
+        prln("infoz: olc="+marina.getOLC());
+
         marina.fillSouthProperStopper(new Instruction[] {
                 new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity),
                 new Instruction.Move(dock,
@@ -1747,19 +1770,28 @@ public class MarinaTest {
                                     ),
             });
 
+        model.waitNS(128 * CYCLE_TIME_NS);
+        prln("infoz: olc="+marina.getOLC());
+
         prln("send torpedo. This should clear the OLC");
         marina.instrIn.fillTorpedo();
         model.waitNS(128 * CYCLE_TIME_NS);
+
+        model.waitNS(128 * CYCLE_TIME_NS);
+        prln("infoz: olc="+marina.getOLC());
                 
         prln("A should remain false, B should be true");
         fatal(marina.getFlagA(), "bad A flag: true");
         fatal(!marina.getFlagB(), "bad B flag: false");
         
-        prln("OLC = 63. Reload OLC after torpedo, clears D-flag");
-        marina.instrIn.fill(new 
-                            Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
+        model.waitNS(128 * CYCLE_TIME_NS);
+        prln("infoz: olc="+marina.getOLC());
+
+        prln("Reload OLC after torpedo, clears D-flag");
+        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
 
         // FIXME: find another way to test this
+        model.waitNS(128 * CYCLE_TIME_NS);
         olc = marina.getOLC();
         fatal(olc!=63, "bad OLC: "+olc+" expected: 63");
                 
@@ -1886,11 +1918,12 @@ public class MarinaTest {
             int expected = decr_amount>=olc ? 0 : 1;
             dataItems = marina.data.drainMany(2);
             fatal(dataItems.size()!=expected, "Expected "+expected+" item to emerge but got: "+dataItems.size()+" data items");
-            for(int i=0; i<Math.max(0, olc-decr_amount); i++)
-                marina.instrIn.fill(new Instruction.Set(dock,
-                                                        Predicate.Default,
-                                                        SetDest.OuterLoopCounter,
-                                                        SetSource.Decrement));
+
+            if (marina.kesselsCounter) {
+                // master clear on each iteration; otherwise we'd need to "run down" the olc
+                marina.masterClear();
+                marina.enableInstructionSend(true);
+            }
         }
 
         adjustIndent(-2);
@@ -1947,6 +1980,14 @@ public class MarinaTest {
 
         for (int i=0; i<6; i++) {
             int notZero = 32 >> i;
+
+            if (marina.kesselsCounter) {
+                // master clear on each iteration; otherwise we'd need to "run down" the olc
+                marina.masterClear();
+                marina.enableInstructionSend(true);
+            }
+
+            int outOlc;
             prln("Set OLC=0");
             prln("Then immediately set OLC="+notZero);
             marina.fillSouthProperStopper(new Instruction[] {
@@ -1956,20 +1997,22 @@ public class MarinaTest {
 
             model.waitNS(64 * CYCLE_TIME_NS);
             prln("Verify OLC count using scan chain");
-            int outOlc = marina.getOLC();
+            outOlc = marina.getOLC();
             fatal(outOlc!=notZero, "bad OLC count: "+outOlc+" expected: "+notZero);
 
-            prln("Set OLC="+notZero);
-            prln("Then immediately set OLC=0");
-            marina.fillSouthProperStopper(new Instruction[] {
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
-                });
-                        
-            model.waitNS(64 * CYCLE_TIME_NS);
-            prln("Verify OLC count using scan chain");
-            outOlc = marina.getOLC();
-            fatal(outOlc!=0, "bad OLC count: "+outOlc+" expected: 0");
+            if (!marina.kesselsCounter) {
+                prln("Set OLC="+notZero);
+                prln("Then immediately set OLC=0");
+                marina.fillSouthProperStopper(new Instruction[] {
+                        new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
+                        new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
+                    });
+                
+                model.waitNS(64 * CYCLE_TIME_NS);
+                prln("Verify OLC count using scan chain");
+                outOlc = marina.getOLC();
+                fatal(outOlc!=0, "bad OLC count: "+outOlc+" expected: 0");
+            }
         }
         
         adjustIndent(-2);
@@ -2032,6 +2075,7 @@ public class MarinaTest {
                 case 0: {
 
                     // these tests run fairly quickly
+
                     doOneTest(1);       // passes extracted parasitics
                     doOneTest(2);       // passes extracted parasitics
                     doOneTest(3);       // passes extracted parasitics
@@ -2049,14 +2093,14 @@ public class MarinaTest {
                     doOneTest(3006);    // passes extracted parasitics
                     doOneTest(3007);    // passes extracted parasitics
                     doOneTest(3008);    // passes extracted parasitics
-                    doOneTest(3009);    // fails extracted parasitics
+                    doOneTest(3009);    // passes extracted parasitics
                     doOneTest(3010);    // passes extracted parasitics
                     doOneTest(3011);    // passes extracted parasitics
                     doOneTest(3012);    // passes extracted parasitics
                     doOneTest(3013);    // passes extracted parasitics
                     doOneTest(3014);    // passes extracted parasitics
-                    doOneTest(3015);    // fails extracted parasitics
-                    doOneTest(3019);    // fails extracted parasitics
+                    doOneTest(3015);    // passes extracted parasitics
+                    doOneTest(3019);    // passes extracted parasitics
                     doOneTest(3020);    // passes extracted parasitics
                     doOneTest(3022);    // passes extracted parasitics
                     doOneTest(3023);    // passes extracted parasitics
@@ -2064,7 +2108,7 @@ public class MarinaTest {
                     doOneTest(3027);    // passes extracted parasitics
                     doOneTest(3028);    // passes extracted parasitics
                     
-                                        // these tests take a while and usually pass
+                    // these tests take a while and usually pass
                     doOneTest(1002);
                     doOneTest(1004);
                     doOneTest(1005);
@@ -2143,6 +2187,10 @@ public class MarinaTest {
             printTestTime();
             //Infrastructure.exit(0);
         } catch (MarinaUtils.FailureException fe) {
+            System.out.println("******************************************************************************");
+            System.out.println("******************************************************************************");
+            System.out.println("******************************************************************************");
+            System.out.println("******************************************************************************");
             fe.printStackTrace();
         }
     }