add tests 3011 (passes) and 3012 (fails)
authorAdam Megacz <adam.megacz@sun.com>
Sat, 22 Nov 2008 18:25:08 +0000 (18:25 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Sat, 22 Nov 2008 18:25:08 +0000 (18:25 +0000)
testCode/com/sun/vlsi/chips/marina/test/Marina.java
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index 706d487..a4d8b9f 100644 (file)
@@ -162,8 +162,17 @@ public class Marina {
        shiftReport(true, false);
        return cc.getOutBits(REPORT_CHAIN+"."+FLAGS_PATH).get(B_FLAG_NDX);
     }
-    /** Enable the transmission of instructions from the South FIFO
-     * to the EPI FIFO. */
+    /** Fill the "North" Fifo ring */
+    public void fillNorthProperStopper(BitVector data, boolean tokenhood, BitVector address) {
+        int len = 37+1+14;
+        BitVector bv = new BitVector(len, "empty");
+        for(int i=0; i<37; i++) bv.set(i, data.get(i));
+        bv.set(37, !tokenhood);
+        for(int i=38; i<38+14; i++) bv.set(i, address.get(i-38));
+        this.data.fill(bv);
+    }
+    /** Enable the transmission of instructions from the instruction
+     * ring test structure to the EPI FIFO. */
     public void enableInstructionSend(boolean b) {
        BitVector bv = cc.getInBits(CONTROL_CHAIN+"."+INSTR_RING_CONTROL_PATH);
        bv.set(INSTRUCTION_SEND_NDX, b);
index 326ca71..b316f5e 100644 (file)
@@ -996,6 +996,10 @@ public class MarinaTest {
         prln("Begin testRequeueStageDrop");
        adjustIndent(2);
 
+        // We have decided that this issue will not be fixed in
+        // Marina.  Therefore, the test is commented out.
+
+        /*
         prln("inserting instruction: Set OLC=63");
         setOLC(marina, 63);
 
@@ -1003,10 +1007,8 @@ public class MarinaTest {
        marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC,SetDest.InnerLoopCounter,1));
 
         // if you uncomment this, then the NOP will be dropped and the test will pass
-        /*
-       prln("inserting instruction: [Rq] Nop; this will cause 0->1 transition and possibly be discarded");
-        marina.instrIn.fill(REQUEUEING_NOP);
-        */
+       //prln("inserting instruction: [Rq] Nop; this will cause 0->1 transition and possibly be discarded");
+        //marina.instrIn.fill(REQUEUEING_NOP);
 
        prln("inserting instruction: [Rq] Send Data; this will cause 0->1 transition and be discarded");
         marina.instrIn.fill(REQUEUEING_SEND_DATA);
@@ -1019,6 +1021,7 @@ public class MarinaTest {
 
         dataItems = marina.data.drainMany(3);
         fatal(dataItems.size()<3, "Expected exactly unlimited data items to emerge but got only: "+dataItems.size());
+        */
 
        adjustIndent(-2);
         prln("End testRequeueStageDrop");
@@ -1060,6 +1063,99 @@ public class MarinaTest {
        adjustIndent(-2);
        prln("End testFlagAB");         
     }
+
+
+    private void recvData(Marina marina) {
+       prln("Begin recvData");
+       adjustIndent(2);
+
+        marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC, CLEAR_FLAG, CLEAR_FLAG));
+        marina.instrIn.fill(new Instruction.Move(DOCK,
+                                                 false,                /* requeueing  */
+                                                 Predicate.IgnoreOLC,   /* predicate   */
+                                                 true,                  /* torpedoable */
+                                                 null,                  /* path        */
+                                                 false,                 /* tokenIn     */
+                                                 true,                  /* dataIn      */
+                                                 false,                 /* latchData   */
+                                                 false,                 /* latchPath   */
+                                                 false,                 /* dataOut     */
+                                                 false                  /* tokenOut    */
+                                                 ));
+        marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC, SET_FLAG, SET_FLAG));
+
+        prln("checking to confirm that A flag is cleared");
+        fatal(marina.getFlagA(), "bad A flag: "+marina.getFlagA());
+        
+        prln("inserting data item in north fifo ring");
+        BitVector data = new BitVector(37, "empty");
+        BitVector addr = new BitVector(14, "empty");
+        for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
+        for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
+        marina.fillNorthProperStopper(data, false, addr);
+
+        prln("checking to see if A flag got set");
+        fatal(!marina.getFlagA(), "bad A flag: "+marina.getFlagA());
+
+       adjustIndent(-2);
+       prln("End recvData");           
+    }
+
+    private void testFlagC(Marina marina) {
+       prln("Begin testFlagC");
+       adjustIndent(2);
+
+        // addr[0] == sigS
+        // addr[13] == sigA
+       
+        for(boolean dc : new boolean[] { false, true }) {
+            for(boolean c_flag : new boolean[] { true, false, true }) {
+
+                prln("****** checking case where dc="+dc+", cflag="+c_flag);
+                BitVector data = new BitVector(37, "empty");
+                BitVector addr = new BitVector(14, "empty");
+                for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
+                for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
+
+                int whichbit = dc ? 0 : 13;
+                prln("setting addr["+whichbit+"] to "+(c_flag?"1":"0"));
+                addr.set(whichbit, c_flag);
+
+                prln("... and filling north fifo proper stopper");
+                marina.fillNorthProperStopper(data, false, addr);
+                
+                prln("clearing flags");
+                marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC, CLEAR_FLAG, CLEAR_FLAG));
+                
+                prln("executing recv data with Dc="+dc);
+                marina.instrIn.fill(new Instruction.Move(DOCK,
+                                                         false,                        /* requeueing  */
+                                                         Predicate.IgnoreOLC,   /* predicate   */
+                                                         true,                  /* torpedoable */
+                                                         null,                  /* path        */
+                                                         false,                 /* tokenIn     */
+                                                         true,                  /* dataIn      */
+                                                         dc,                    /* latchData   */
+                                                         false,                 /* latchPath   */
+                                                         false,                 /* dataOut     */
+                                                         false                  /* tokenOut    */
+                                                         ));
+                
+                prln("copying c-flag to a-flag");
+                marina.instrIn.fill(new Instruction.Set(DOCK,false,Predicate.IgnoreOLC,
+                                                        Instruction.Set.FlagFunction.ZERO.add(Predicate.FlagC),
+                                                        CLEAR_FLAG
+                                                        ));
+                
+                prln("checking to confirm that A flag is " + c_flag);
+                fatal(marina.getFlagA()!=c_flag, "bad A flag: "+marina.getFlagA());
+            }
+
+        }
+       adjustIndent(-2);
+       prln("End testFlagC");          
+    }
+
     private void sendTorpedo(Marina marina) {
        prln("Begin sendTorpedo");
        adjustIndent(2);
@@ -1263,6 +1359,8 @@ public class MarinaTest {
                case 3008: testWaitForTail(marina); break;
                case 3009: testRequeueStageDrop(marina); break;         
                case 3010: testRequeueStage0to2to3to0(marina); break;
+               case 3011: recvData(marina); break;
+                case 3012: testFlagC(marina); break;
 
                default:
                        fatal(true, "Test number: "+testNum+" doesn't exist.");