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

index f26bf5a..a01c0d8 100644 (file)
@@ -1910,6 +1910,45 @@ public class MarinaTest {
         prln("End testTorpedoOnAnInfinite");
     }
 
+    private void testDFlagWhenTorpedoLyingInWait(Marina marina) {
+        marina.fillSouthProperStopper(new Instruction[] {
+                RECV_DATA,
+                TORPEDOABLE_RECV_DATA,
+                marina.kesselsCounter ? null : FLAG_NOP,
+                SEND_DATA_IF_D_SET,
+            });
+        marina.instrIn.fillTorpedo();
+        model.waitNS(64 * CYCLE_TIME_NS);
+        marina.fillNorthProperStopper();
+        model.waitNS(64 * CYCLE_TIME_NS);
+        expectNorthFifoExactly(1);
+    }
+
+    private void testSetOlcFollowedByDPredicated(Marina marina) {
+        for(boolean d_set : new boolean[] { false, true }) {
+            prln("");
+            marina.fillSouthProperStopper(new Instruction[] {
+                    setOlc(0),
+                    marina.kesselsCounter ? null : FLAG_NOP,
+                    d_set ? SEND_DATA_IF_D_SET : SEND_DATA_IF_D_NOT_SET,
+                });
+            expectNorthFifoExactly(d_set ? 1 : 0);
+
+            prln("");
+            marina.fillSouthProperStopper(new Instruction[] {
+                    setOlc(32),
+                    marina.kesselsCounter ? null : FLAG_NOP,
+                    d_set ? SEND_DATA_IF_D_SET : SEND_DATA_IF_D_NOT_SET,
+                });
+            expectNorthFifoExactly(d_set ? 0 : 1);
+
+            if (marina.kesselsCounter) {
+                marina.masterClear();
+                marina.enableInstructionSend(true);
+            }
+        }
+    }
+
     private void testOlcDecrementAtHighSpeed(Marina marina) {
         prln("Begin testOlcDecrementAtHighSpeed");
         adjustIndent(2);