marina: add some additional control over the proper stopper counter
authorAdam Megacz <adam@megacz.com>
Sun, 10 Jan 2010 19:18:29 +0000 (11:18 -0800)
committerAdam Megacz <adam@megacz.com>
Sun, 10 Jan 2010 19:18:29 +0000 (11:18 -0800)
src/edu/berkeley/fleet/marina/InstructionStopper.java
src/edu/berkeley/fleet/marina/Marina.java
src/edu/berkeley/fleet/marina/MarinaTest.java
src/edu/berkeley/fleet/marina/ProperStopper.java

index 8cbcf10..9a9ffc3 100644 (file)
@@ -21,8 +21,9 @@ public class InstructionStopper extends ProperStopper {
                               ChainControl reportChain,
                               ChipModel model,
                               boolean clockHack,
-                              Indenter indenter, String counterPath) {
-        super(propInst, controlChain, dataChain, reportChain, model, clockHack, indenter, counterPath);
+                              Indenter indenter) {
+        super(propInst, controlChain, dataChain, reportChain, model, clockHack, indenter,
+              propInst+".instruct@0.cntScnTh@1.cntScnOn@1");
         INSTR_RING_CONTROL_PATH = propInst+".tapStage@2";
     }
 
index 1956bce..16af0df 100644 (file)
@@ -77,16 +77,14 @@ public class Marina extends FleetTwoFleet {
                                       reportChain,
                                       model,
                                       clockHack,
-                                      indenter,
-                                      prefix+"northFif@1.fillDrai@1.instruct@0.cntScnTh@1.cntScnOn@1");
+                                      indenter);
         southRing = new InstructionStopper(prefix+"southFif@1.tapPropS@1", 
                                            controlChain,
                                            dataChain,
                                            reportChain,
                                            model,
                                            clockHack,
-                                           indenter,
-                                           prefix+"southFif@1.tapPropS@1.instruct@0.cntScnTh@1.cntScnOn@1");
+                                           indenter);
     }
 
     public static final int INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ONE  = 5;
index 4f89b51..ed4c51e 100644 (file)
@@ -805,6 +805,19 @@ public class MarinaTest {
                             CLEAR_FLAG.add(Predicate.FlagA),
                             CLEAR_FLAG.add(Predicate.FlagB));
 
+    private final Instruction NOP_IF_FLAG_A =
+        new Instruction.Move(marina.getOnlyDock(),
+                             Predicate.FlagA,       /* predicate   */
+                             false,                 /* torpedoable */
+                             null,                  /* path        */
+                             false,                 /* tokenIn     */
+                             false,                 /* dataIn      */
+                             false,                 /* latchData   */
+                             false,                 /* latchPath   */
+                             false,                 /* dataOut     */
+                             false                  /* tokenOut    */
+                             );
+
     private final Instruction NOP =
         new Instruction.Move(marina.getOnlyDock(),
                              Predicate.IgnoreFlagD, /* predicate   */
@@ -2328,6 +2341,8 @@ public class MarinaTest {
             case 3031: testOverfillTokens(marina); break;
 
             case 3040: loadEveryValueOLC(marina); break;
+
+                // Duke Test //////////////////////////////////////////////////////////////////////////////
             case 6666: {
                 SubchainNode chainNode =
                     (SubchainNode)marina.dukeChain
@@ -2346,6 +2361,7 @@ public class MarinaTest {
                 break;
             }
 
+                // Kessels Counter //////////////////////////////////////////////////////////////////////////////
             case 7777: {
 
                 int wait = 300;
@@ -2429,6 +2445,9 @@ public class MarinaTest {
                 pw.close();
                 break;
             }
+
+
+                // General Purpose //////////////////////////////////////////////////////////////////////////////
             case 8888: {
 
                 //int wait = 1000;
@@ -2436,14 +2455,16 @@ public class MarinaTest {
                 //int toks = 1;
 
                 PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream("out.dat")));
+                /*
                 for(double myvdd = 1.00; myvdd<1.01; myvdd += 0.05) {
                     vdd = (float)myvdd;
                     vdd18.setVoltageWait((float)Math.max(1.8,vdd));
                     vdd10.setVoltageWait(vdd);
                     Thread.sleep(1000);
+                */
 
                     for(int toks = 0; toks < 13; toks++) {
-                        int MAX_ITER = 10;
+                        int MAX_ITER = 1;
                         double total = 0;
                         for(int iter = 0; iter < MAX_ITER; iter++) {
 
@@ -2453,9 +2474,29 @@ public class MarinaTest {
                                 
                             marina.southRing.enableInstructionSend(true);
                             marina.southRing.fill(setOlc(1));
+                            /*
+                            marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),
+                                                                      Predicate.IgnoreFlagD,
+                                                                      Instruction.Set.FlagFunction.ONE,
+                                                                      Instruction.Set.FlagFunction.ZERO
+                                                                      ));
+                            */
                             marina.southRing.fill(new Instruction.Head(marina.getOnlyDock()));
                             for(int i=0; i<toks; i++)
-                                marina.southRing.fill(/*SEND_DATA*/NOP);
+                                marina.southRing.fill(NOP);
+                                /*
+                                marina.southRing.fill(setOlc(32));
+                                marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),
+                                                                          Predicate.IgnoreFlagD,
+                                                                          Instruction.Set.SetDest.DataLatch,
+                                                                          0));
+                            marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),
+                                                                      Predicate.IgnoreFlagD,
+                                                                      Instruction.Set.FlagFunction.ZERO.add(Predicate.NotFlagA),
+                                                                      Instruction.Set.FlagFunction.ZERO
+                                                                      ));
+                                */
+
                             marina.southRing.fill(new Instruction[] {
                                     new Instruction.Tail(marina.getOnlyDock()),
                                 }, false, true);
@@ -2482,12 +2523,6 @@ public class MarinaTest {
 
                             System.out.println();
                             System.out.println();
-                            /*
-                              System.out.println("counters are " + count + " and " + countNorth + "; ratio is "+
-                              (((double)countNorth)/((double)(count*2))) + " " +
-                              (((double)countNorth)/((double)(count*2+1))) + " " +
-                              "");
-                            */
                         }
                         float vdd10v = vdd10.readVoltage();
                         float vdd18v = vdd18.readVoltage();
@@ -2497,14 +2532,16 @@ public class MarinaTest {
                         pw.println(vdd + " " +
                                    toks + " " +
                                    (((double)total) / MAX_ITER) + " " +
-                                   //vddsv  + " " + 
                                    vdd10c + " " +
+
                                    vdd18v + " " +
                                    vdd18c + " " +
                                    "");
                         pw.flush();
                     }
+                    /*
                 }
+                    */
                 break;
             }
             case 8889: {
@@ -2583,7 +2620,7 @@ public class MarinaTest {
         vdds  = new Pst3202Channel("ch1", "tiPST3202", 1);
         vdd18 = new Pst3202Channel("ch3", "tiPST3202", 3);
         vdd10 = new PowerChannelResistorVoltageReadable(new Pst3202Channel("ch2", "tiPST3202", 2),
-                                                        1000, 
+                                                        250, 
                                                         new HP34401A("HP34970"),
                                                         true);
         if (vdd10!=null) setVdd10(vdd);
index f9c378d..ac4f261 100644 (file)
@@ -253,6 +253,16 @@ public class ProperStopper {
         this.dataChain = dataChain;
         this.reportChain = reportChain;
     }
+    public ProperStopper(String propInst,
+                         ChainControl controlChain,
+                         ChainControl dataChain,
+                         ChainControl reportChain,
+                         ChipModel model,
+                         boolean clockHack,
+                         Indenter indenter) {
+        this(propInst, controlChain, dataChain, reportChain, model, clockHack, indenter, propInst+".instruct@0.cntScnTh@1.cntScnOn@1");
+    }
+                         
 
     /** Insert one item into the fill stage.
      * Fill stage must be empty.