move RingIfc to inner class of ProperStopper, rename to CommandCodes
authorAdam Megacz <adam.megacz@sun.com>
Tue, 24 Mar 2009 18:01:54 +0000 (18:01 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Tue, 24 Mar 2009 18:01:54 +0000 (18:01 +0000)
testCode/com/sun/vlsi/chips/marina/test/MarinaUtils.java
testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java

index 5e59fcd..63cd7b8 100644 (file)
@@ -7,35 +7,7 @@ import java.util.Random;
 import java.util.ArrayList;
 
 public class MarinaUtils {
-    /**
-     * (Note by Bill and Adam: Ivan has struck again!)
-     * As of 05 March 2009 the new bits are:
-     *    Block Extra Fill Go Clear Silent
-     *      => Note: "Extra" gets fed to the mux in the counter
-     *         that selects the frequency output that goes off-chip
-     *
-     * Caution: Ivan changes the order of the ProperStopper control bits 
-     * from chip to chip.  Here is the current order for Marina
-     * as of 14 Aug 2008: 
-     *  Block, Fill, Go, Silent, Clear
-     *
-     *  The old bit order for Infinity was: Fill, Block, Clear, Silent, Go
-     */
-    public static enum RingIfc {
-        RUN        ("000100"),
-            IDLE       ("100000"),
-            FILL       ("101000"),
-            BLOCK      ("100100"),
-            STOP       ("000000"),
-            CLEAR      ("100010"),
-            SOURCE     ("001100"),
-            STOPSOURCE ("001000"),
-            SINK       ("000101"),
-            STOPSINK   ("000001");
-        private BitVector scanBits;
-        RingIfc(String bits) {scanBits = new BitVector(bits,"RingIfc");}
-        public BitVector bits() {return scanBits;}
-    }
+
     /** StateWireState hides whether the state wire being high means FULL 
      * or whether high means EMPTY */
     public static enum StateWireState {FULL, EMPTY};
index 3c8c435..a83e30d 100644 (file)
@@ -105,43 +105,43 @@ public class ProperStopper {
 
     /** Put stopper in RUN state */
     public void run() {
-        setFillDrainControl(MarinaUtils.RingIfc.RUN.bits());
+        setFillDrainControl(CommandCodes.RUN.bits());
     }
     /** Put stopper in IDLE state */
     public void idle() {
-        setFillDrainControl(MarinaUtils.RingIfc.IDLE.bits());
+        setFillDrainControl(CommandCodes.IDLE.bits());
     }
     /** Put stopper in FILL state */
     public void fill() {
-        setFillDrainControl(MarinaUtils.RingIfc.FILL.bits());
+        setFillDrainControl(CommandCodes.FILL.bits());
     }
     /** Put stopper in BLOCK state */
     public void block() {
-        setFillDrainControl(MarinaUtils.RingIfc.BLOCK.bits());
+        setFillDrainControl(CommandCodes.BLOCK.bits());
     }
     /** Put stopper in STOP state */
     public void stop() {
-        setFillDrainControl(MarinaUtils.RingIfc.STOP.bits());
+        setFillDrainControl(CommandCodes.STOP.bits());
     }
     /** Put stopper in CLEAR state */
     public void clear() {
-        setFillDrainControl(MarinaUtils.RingIfc.CLEAR.bits());
+        setFillDrainControl(CommandCodes.CLEAR.bits());
     }
     /** Put stopper in SOURCE state */
     public void source() {
-        setFillDrainControl(MarinaUtils.RingIfc.SOURCE.bits());
+        setFillDrainControl(CommandCodes.SOURCE.bits());
     }
     /** Put stopper in STOPSOURCE state */
     public void stopSource() {
-        setFillDrainControl(MarinaUtils.RingIfc.STOPSOURCE.bits());
+        setFillDrainControl(CommandCodes.STOPSOURCE.bits());
     }
     /** Put stopper in SINK state */
     public void sink() {
-        setFillDrainControl(MarinaUtils.RingIfc.SINK.bits());
+        setFillDrainControl(CommandCodes.SINK.bits());
     }
     /** Put stopper in STOPSINK state */
     public void stopSink() {
-        setFillDrainControl(MarinaUtils.RingIfc.STOPSINK.bits());
+        setFillDrainControl(CommandCodes.STOPSINK.bits());
     }
     /** Stop a running stopper in order to add items.  Ensure that we don't
      * lose the item in the fill stage.  
@@ -352,5 +352,34 @@ public class ProperStopper {
     }
 
 
+    /**
+     * (Note by Bill and Adam: Ivan has struck again!)
+     * As of 05 March 2009 the new bits are:
+     *    Block Extra Fill Go Clear Silent
+     *      => Note: "Extra" gets fed to the mux in the counter
+     *         that selects the frequency output that goes off-chip
+     *
+     * Caution: Ivan changes the order of the ProperStopper control bits 
+     * from chip to chip.  Here is the current order for Marina
+     * as of 14 Aug 2008: 
+     *  Block, Fill, Go, Silent, Clear
+     *
+     *  The old bit order for Infinity was: Fill, Block, Clear, Silent, Go
+     */
+    private static enum CommandCodes {
+        RUN        ("000100"),
+            IDLE       ("100000"),
+            FILL       ("101000"),
+            BLOCK      ("100100"),
+            STOP       ("000000"),
+            CLEAR      ("100010"),
+            SOURCE     ("001100"),
+            STOPSOURCE ("001000"),
+            SINK       ("000101"),
+            STOPSINK   ("000001");
+        private BitVector scanBits;
+        CommandCodes(String bits) {scanBits = new BitVector(bits,"CommandCodes");}
+        public BitVector bits() {return scanBits;}
+    }
 
 }