add MarinaTest.loadEveryValueOLC()
authorAdam Megacz <adam@megacz.com>
Thu, 23 Jul 2009 23:49:17 +0000 (16:49 -0700)
committerAdam Megacz <adam@megacz.com>
Thu, 23 Jul 2009 23:49:17 +0000 (16:49 -0700)
marina/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index 25a58fb..798dd4e 100644 (file)
@@ -817,6 +817,41 @@ public class MarinaTest {
         adjustIndent(-2);
         prln("End countOlc");
     }
+    private void loadEveryValueOLC(Marina marina) {
+        adjustIndent(2);
+        for (int i=0; i<(1<<6); i++) {
+
+            if (marina.kesselsCounter) {
+                System.out.println("master-clearing...");
+                // master clear on each iteration; otherwise we'd need to "run down" the olc
+                marina.masterClear();
+                marina.enableInstructionSend(true);
+            }
+
+            int inOlc = i;
+            marina.fillSouthProperStopper(new Instruction[] {
+
+                    // to ensure that instruction is bubble-limited
+                    RECV_DATA,
+
+                    // the Set-OLC instruction
+                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, inOlc),
+
+                    // put a Set-ILC instruction right behind it with inverted bits to be sure we're
+                    // not capturing the instruction-latch value too late in the cycle
+                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, (inOlc ^ (~(-1<<6)))),
+                    
+                });
+
+            model.waitNS(128 * CYCLE_TIME_NS);
+            marina.fillNorthProperStopper();
+            model.waitNS(128 * CYCLE_TIME_NS);
+
+            expectOlc(inOlc);
+            prln("loadEveryValueOLC: "+inOlc+" checks out");
+        }
+        adjustIndent(-2);
+    }
 
     private void saturateInstructionFifo(Marina marina, Instruction instruction, int quantity, boolean expect_it_to_jam_up) {
         prln("Inserting "+quantity+" copies of \"" + instruction + "\"");