add explicit name parameter to proper stoppers, better c-flag initialization, break...
authorAdam Megacz <adam.megacz@sun.com>
Wed, 29 Apr 2009 21:32:07 +0000 (21:32 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Wed, 29 Apr 2009 21:32:07 +0000 (21:32 +0000)
testCode/com/sun/vlsi/chips/marina/test/InstructionStopper.java
testCode/com/sun/vlsi/chips/marina/test/Marina.java
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java
testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java
testCode/edu/berkeley/fleet/api/Instruction.java

index 63969a0..626f751 100644 (file)
@@ -19,13 +19,14 @@ import static com.sun.vlsi.chips.marina.test.Marina.INSTRUCTION_LENGTH;
  */
 public class InstructionStopper extends ProperStopper {
 
-    public InstructionStopper(String propInst,
+    public InstructionStopper(String name,
+                              String propInst,
                               String controlChain, String dataChain,
                               String reportChain,
                               ChainControls cc, ChipModel model,
                               boolean clockHack,
                               Indenter indenter) {
-        super(propInst, controlChain, dataChain, reportChain, cc, model, clockHack, indenter);
+        super(name, propInst, controlChain, dataChain, reportChain, cc, model, clockHack, indenter);
     }
 
     /** put one Instruction into InstructionStopper */
index d804351..cdcd7a7 100644 (file)
@@ -114,12 +114,14 @@ public class Marina {
         this.cc = cc;
         this.model = model;
         this.indenter = indenter;
-        data = new ProperStopper("northFif@1.fillDrai@1.properSt@1",
+        data = new ProperStopper("north fifo",
+                                 "northFif@1.fillDrai@1.properSt@1",
                                  CONTROL_CHAIN, 
                                  DATA_CHAIN,  
                                  REPORT_CHAIN,
                                  cc, model, clockHack, indenter);
-        instrIn = new InstructionStopper("southFif@1.tapPropS@1.properSt@1", 
+        instrIn = new InstructionStopper("south fifo",
+                                         "southFif@1.tapPropS@1.properSt@1", 
                                          CONTROL_CHAIN,
                                          DATA_CHAIN,
                                          REPORT_CHAIN,
@@ -150,8 +152,8 @@ public class Marina {
             vm.setNodeState("outputDo@0.outM1Pre@0.litDandP@0.latch2in@0.hi2inLat@0.latchKee@0.out_B_", 0); // C
 
             // possible C-flag inputs
-            vm.setNodeState("southFif@1.tapPropS@1.tapStage@2.addr1in6@0.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ONE+1)+"]", 0);
-            vm.setNodeState("southFif@1.tapPropS@1.tapStage@2.addr1in6@0.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ZERO+1)+"]", 0);
+            vm.setNodeState("northFif@1.upDown8w@2.weakStag@22.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ONE+1)+"]", 0);
+            vm.setNodeState("northFif@1.upDown8w@2.weakStag@22.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ZERO+1)+"]", 0);
 
             // force the OLC to zero
             for(int i=1; i<=6; i++)
@@ -166,11 +168,11 @@ public class Marina {
             // pulse ilc[load] and olc[load]
             vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.ilc@0.ilc_load_", 1);
             vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.olc_load_", 1);
-            vm.setNodeState("southFif@1.tapPropS@1.tapStage@2.addr1in6@0.fire", 1);
+            vm.setNodeState("northFif@1.upDown8w@2.weakStag@22.addr1in2@0.fire", 1);
             model.waitNS(1000);
             vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.ilc@0.ilc_load_", 0);
             vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.olc_load_", 0);
-            vm.setNodeState("southFif@1.tapPropS@1.tapStage@2.addr1in6@0.fire", 0);
+            vm.setNodeState("northFif@1.upDown8w@2.weakStag@22.addr1in2@0.fire", 0);
             model.waitNS(1000);
 
             vm.setNodeState("sid[9]", 1);
@@ -196,9 +198,9 @@ public class Marina {
             // which will then leak into the flags and from there the
             // predicate.
             vm.releaseNode("outputDo@0.outM1Pre@0.litDandP@0.latch2in@0.hi2inLat@0.latchKee@0.out_B_");
-            vm.releaseNode("southFif@1.tapPropS@1.tapStage@2.addr1in6@0.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ONE+1)+"]");
-            vm.releaseNode("southFif@1.tapPropS@1.tapStage@2.addr1in6@0.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ZERO+1)+"]");
-            vm.releaseNode("southFif@1.tapPropS@1.tapStage@2.addr1in6@0.fire");
+            vm.releaseNode("northFif@1.upDown8w@2.weakStag@22.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ONE+1)+"]");
+            vm.releaseNode("northFif@1.upDown8w@2.weakStag@22.ain["+(INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ZERO+1)+"]");
+            vm.releaseNode("northFif@1.upDown8w@2.weakStag@22.addr1in2@0.fire");
 
             vm.releaseNode("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.ilc@0.ilc_load_");
             for(int i=1; i<=8; i++) {
index 312624e..9b588eb 100644 (file)
@@ -260,15 +260,18 @@ public class MarinaTest {
         }
 
         if (cmdArgs.testChains) {
+            prln("Testing control chain...");
             ctC.testOneChain(Marina.CONTROL_CHAIN, Infrastructure.SEVERITY_WARNING);
         }
         ccC.resetInBits();
         ccC.shift(Marina.CONTROL_CHAIN, false, true);
         if (cmdArgs.testChains) {            
+            prln("Testing data chain...");
             ctD.testOneChain(Marina.DATA_CHAIN, Infrastructure.SEVERITY_WARNING);
             //ccD.resetInBits();
             //ccD.shift(Marina.DATA_CHAIN, false, true);
-            
+
+            prln("Testing report chain...");            
             ctR.testOneChain(Marina.REPORT_CHAIN, Infrastructure.SEVERITY_WARNING);
             //ccR.resetInBits();
             //ccR.shift(Marina.REPORT_CHAIN, false, true);
@@ -280,10 +283,6 @@ public class MarinaTest {
 
         marina = new Marina(ccs, model, !cmdArgs.jtagShift, indenter);
 
-        //System.out.println("launching");
-        //ChainG.createAndShowGUI(marina.cc.getChainControlFromPath(Marina.REPORT_CHAIN));
-        //System.out.println("  launched.");
-
         doOneTest(cmdArgs.testNum);
         
         ((SimulationModel)model).finish();
@@ -677,15 +676,15 @@ public class MarinaTest {
                     prln("Attempting send data with a="+flag_a+", b="+flag_b+", predicate="+predicate);
                     adjustIndent(2);
                     marina.instrIn.fill(new Instruction.Move(dock,
-                                                             predicate,             /* predicate   */
-                                                             false,                 /* torpedoable */
-                                                             null,                  /* path        */
-                                                             false,                 /* tokenIn     */
-                                                             false,                 /* dataIn      */
-                                                             false,                 /* latchData   */
-                                                             false,                 /* latchPath   */
-                                                             true,                 /* dataOut     */
-                                                             false                  /* tokenOut    */
+                                                             predicate,  // predicate   
+                                                             false,      // torpedoable 
+                                                             null,       // path        
+                                                             false,      // tokenIn     
+                                                             false,      // dataIn      
+                                                             false,      // latchData   
+                                                             false,      // latchPath   
+                                                             true,       // dataOut     
+                                                             false       // tokenOut    
                                                              ));
                     adjustIndent(-2);
                     dItems = marina.data.drainMany();
@@ -742,7 +741,7 @@ public class MarinaTest {
             marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, inIlc));
             Ilc ilc = marina.getILC();
             int outIlc = ilc.getCount();
-            fatal(outIlc!=inIlc, "bad ILC count: "+outIlc+" expected: "+outIlc);
+            fatal(outIlc!=inIlc, "bad ILC count: "+outIlc+" expected: "+inIlc);
             fatal(ilc.getInfinity(), "bad Infinity bit: true");
         }
         prln("Now test the infinity bit");
@@ -1932,12 +1931,10 @@ public class MarinaTest {
         adjustIndent(-2);
         prln("End flipOlcBit");
     }
-    private void testSouthRecirculate(Marina marina) {
-        prln("Begin testSouthRecirculate");
+    private void testSouthRecirculate(Marina marina, int AMOUNT) {
+        prln("Begin testSouthRecirculate("+AMOUNT+")");
         adjustIndent(2);
 
-        int AMOUNT = Marina.SOUTH_RING_CAPACITY-1;
-
         marina.enableInstructionSend(false);
         marina.enableInstructionRecirculate(true);
         
@@ -1975,7 +1972,7 @@ public class MarinaTest {
         for (int i=0; i<5; i++) {}
         
         adjustIndent(-2);
-        prln("End testSouthRecirculate");
+        prln("End testSouthRecirculate("+AMOUNT+")");
     }
     private void doOneTest(int testNum) {
         prln("");
@@ -1989,10 +1986,13 @@ public class MarinaTest {
             case 0: {
 
                 // these tests run fairly quickly
+
                 doOneTest(1);
                 doOneTest(2);
                 doOneTest(4);
                 doOneTest(5);
+                doOneTest(6);
+
                 doOneTest(1001);
                 doOneTest(1003);
                 doOneTest(3000);
@@ -2001,13 +2001,16 @@ public class MarinaTest {
                 doOneTest(3004);
                 doOneTest(3009);
                 doOneTest(3010);
+
                 doOneTest(3011);
                 doOneTest(3012);
                 doOneTest(3013);
+
                 doOneTest(3014);
                 doOneTest(3015);
                 doOneTest(3019);
                 doOneTest(3020);
+                doOneTest(3022);
                 doOneTest(3023);
 
                 // these tests take a while and usually pass
@@ -2032,6 +2035,7 @@ public class MarinaTest {
 
             case 4:    getCtrsFlags(marina);                   break; //         20-Apr (+verilog)
             case 5:    walkOneOLC(marina);                     break; //         21-Apr (+verilog)
+            case 6:    testSouthRecirculate(marina, 1);        break; // passes, 24-Mar (+verilog)
                 
                 // Russell's tests begin with 1000
             case 1000: walkOneILC(marina);                     break; //         20-Apr (+verilog)
@@ -2043,8 +2047,8 @@ public class MarinaTest {
             case 1004: flipIlcBit(marina);                     break; //         20-Apr (+verilog)
             case 1005: flipOlcBit(marina);                     break; //         21-Apr (+verilog)
 
-            case 1006: testSouthRecirculate(marina);           break; // passes, 24-Mar (+verilog)
-                
+            case 1006: testSouthRecirculate(marina, Marina.SOUTH_RING_CAPACITY-1);        break; // passes, 24-Mar (+verilog)
+
                 // Adam's tests begin with 3000
             case 3000: sendToken(marina);                      break; // passes, 24-Mar (+verilog)
             case 3001: testFlagAB(marina);                     break; // passes, 08-Apr (+verilog)
@@ -2075,7 +2079,7 @@ public class MarinaTest {
             case 3020: setIlcFromDataLatch(marina);            break; //         23-Apr (+verilog)
             case 3021: recvPath(marina);                       break; //         22-Apr (+verilog)
             case 3022: testILC(marina);                        break; //         23-Apr (+verilog)
-            case 3023: testTorpedoOnAnInfinite(marina);        break;
+            case 3023: testTorpedoOnAnInfinite(marina);        break; //         23-Apr (+verilog)
             case 3024: testRecvAndSendWalkingOne(marina);      break; //         21-Apr (+verilog)
             case 3025: testOlcDecrementAtHighSpeed(marina);    break; //         23-Apr (+verilog)
 
index 4d21c86..74e96bc 100644 (file)
@@ -210,13 +210,14 @@ public class ProperStopper {
     }
 
     /** construct a ProperStopper */
-    public ProperStopper(String propInst,
+    public ProperStopper(String name,
+                         String propInst,
                          String controlChain, String dataChain, 
                          String reportChain,
                          ChainControls cc, ChipModel model,
                          boolean clockHack,
                          Indenter indenter) {
-        this.name = propInst;
+        this.name = name;
         this.controlChain = controlChain;
         this.controlPath = controlChain+'.'+propInst;
         this.dataChain = dataChain;
@@ -368,15 +369,22 @@ public class ProperStopper {
 
             if (myState==StateWireState.EMPTY || cnt>=maxNbItems) break;
                 
-            if (traceDrain) prln("drainMany: reading word number: "+cnt++);
-                
+            cnt++;
+            if (maxNbItems>1)
+                indenter.pr("  drainMany: reading word number: "+cnt+
+                            "/"+(maxNbItems==Integer.MAX_VALUE
+                                 ?"unlimited":(""+maxNbItems))+
+                            "... ");
+
             BitVector d = drainNoCheck();
+            if (maxNbItems>1)
+                prln("  done.");
 
             ans.add(d);
         }
         
-        adjustIndent(-2);
         prln("end drainMany, got "+ans.size()+" items");
+        adjustIndent(-2);
         
         return ans;
     }
index a9698ed..aad94ec 100644 (file)
@@ -176,7 +176,7 @@ public abstract class Instruction {
                         Predicate.FlagB, Predicate.NotFlagB,
                         Predicate.FlagC, Predicate.NotFlagC })
                     if (predicates.contains(p)) {
-                        if (!empty) ret.append("| ");
+                        if (!empty) ret.append("|");
                         ret.append(p);
                         empty = false;
                     }