further cleanup of MarinaTest
authorAdam Megacz <adam@megacz.com>
Fri, 20 Nov 2009 06:38:14 +0000 (22:38 -0800)
committerAdam Megacz <adam@megacz.com>
Fri, 20 Nov 2009 06:38:14 +0000 (22:38 -0800)
src/edu/berkeley/fleet/marina/InstructionStopper.java
src/edu/berkeley/fleet/marina/Marina.java
src/edu/berkeley/fleet/marina/MarinaFleet.java
src/edu/berkeley/fleet/marina/MarinaPacket.java
src/edu/berkeley/fleet/marina/MarinaTest.java
src/edu/berkeley/fleet/marina/ProperStopper.java

index 530724f..8cbcf10 100644 (file)
@@ -1,14 +1,8 @@
 package edu.berkeley.fleet.marina;
-
-import java.util.ArrayList;
-import java.util.List;
-
+import java.util.*;
 import com.sun.electric.tool.simulation.test.*;
-
 import edu.berkeley.fleet.api.Dock;
 import edu.berkeley.fleet.api.Instruction;
-import edu.berkeley.fleet.marina.MarinaFleet;
-
 import static edu.berkeley.fleet.marina.Marina.INSTRUCTION_LENGTH;
 
 /**
index 6da458e..5b74b5a 100644 (file)
@@ -3,18 +3,18 @@ import edu.berkeley.fleet.api.*;
 import com.sun.electric.tool.simulation.test.*;
 import com.sun.electric.tool.simulation.test.BitVector;
 
-public class Marina {
+public class Marina extends MarinaFleet {
 
     JtagLogicLevel mc0;
     JtagLogicLevel mc1;
     private final Indenter indenter;
+
     public final ChainControl controlChain;
     public final ChainControl dataChain;
     public final ChainControl dukeChain;
     public final ChainControl reportChain;
+
     private final ChipModel model;
-    public final ProperStopper data;
-    public final InstructionStopper instrIn;
     public final ProperStopper      northRing;
     public final InstructionStopper southRing;
     int northCount = 0;
@@ -33,22 +33,22 @@ public class Marina {
         this.reportChain = reportChain;
         this.model = model;
         this.indenter = indenter;
-        northRing = data = new ProperStopper(prefix+"northFif@1.fillDrai@1",
-                                 controlChain,
-                                 dataChain,
-                                 reportChain,
-                                 model,
-                                 clockHack,
-                                 indenter,
-                                 prefix+"northFif@1.fillDrai@1.instruct@0.cntScnTh@1.cntScnOn@1");
-        southRing = instrIn = new InstructionStopper(prefix+"southFif@1.tapPropS@1", 
-                                         controlChain,
-                                         dataChain,
-                                         reportChain,
-                                         model,
-                                         clockHack,
-                                         indenter,
-                                         prefix+"southFif@1.tapPropS@1.instruct@0.cntScnTh@1.cntScnOn@1");
+        northRing = new ProperStopper(prefix+"northFif@1.fillDrai@1",
+                                      controlChain,
+                                      dataChain,
+                                      reportChain,
+                                      model,
+                                      clockHack,
+                                      indenter,
+                                      prefix+"northFif@1.fillDrai@1.instruct@0.cntScnTh@1.cntScnOn@1");
+        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");
     }
 
     public static final int INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ONE  = 5;
@@ -85,7 +85,7 @@ public class Marina {
         // value is bit reversed and complemented
         private int value;
         private Ilc() {
-            shiftReport(true, false);
+            reportChain.shift(REPORT_CHAIN, true, false);
             BitVector odd  = reportChain.getOutBits(REPORT_CHAIN+"."+ILC_PATH_ODD).bitReverse().not();
             BitVector even = reportChain.getOutBits(REPORT_CHAIN+"."+ILC_PATH_EVEN).bitReverse().not();
             BitVector ret  = new BitVector(8, "olc");
@@ -112,39 +112,19 @@ public class Marina {
         }
     }
         
-    /** Shift the report scan chain */
-    public void shiftReport(boolean readEnable, boolean writeEnable) {
-        reportChain.shift(REPORT_CHAIN, readEnable, writeEnable);
-    }
-    
-    /** Shift the report scan chain */
-    private void shiftControl(boolean readEnable, boolean writeEnable) {
-        controlChain.shift(CONTROL_CHAIN, readEnable, writeEnable);
-    }
-        
-    /** Shift the data scan chain */
-    private void shiftData(boolean readEnable, boolean writeEnable) {
-        dataChain.shift(DATA_CHAIN, readEnable, writeEnable);
-    }
-
-    /** Shift the data scan chain */
-    public void shiftDuke(boolean readEnable, boolean writeEnable) {
-        dukeChain.shift(DUKE_CHAIN, readEnable, writeEnable);
-    }
-
     public void stopAndResetCounters() {
-        instrIn.setCounterEnable(false);
-        data.setCounterEnable(false);
+        southRing.setCounterEnable(false);
+        northRing.setCounterEnable(false);
         dataChain.shift(DATA_CHAIN, true, false);        
-        northCount = data.getCounterValue();
-        southCount = instrIn.getCounterValue();
-        data.setCounterValue(0);
-        instrIn.setCounterValue(0);
+        northCount = northRing.getCounterValue();
+        southCount = southRing.getCounterValue();
+        northRing.setCounterValue(0);
+        southRing.setCounterValue(0);
     }
     public void startCounters() { startCounters(true, true); }
     public void startCounters(boolean south, boolean north) {
-        instrIn.setCounterEnable(south);
-        data.setCounterEnable(north);
+        southRing.setCounterEnable(south);
+        northRing.setCounterEnable(north);
     }
     public int getNorthCount() { return northCount; }
     public int getSouthCount() { return southCount; }
@@ -154,8 +134,8 @@ public class Marina {
         // Put a high going pulse on the internal chip master clear signal
         if (model instanceof VerilogModel) {
 
-            data.clear();
-            instrIn.clear();
+            northRing.clear();
+            southRing.clear();
 
             VerilogModel vm = (VerilogModel)model;
             //
@@ -248,8 +228,8 @@ public class Marina {
             // state, so under Verilog we need to force them to a
             // known state
 
-            data.idle();
-            instrIn.idle();
+            northRing.idle();
+            southRing.idle();
 
         } else if (model instanceof NanosimModel) {
             NanosimModel nModel = (NanosimModel) model;
@@ -277,37 +257,26 @@ public class Marina {
             model.waitNS(1000);
 
         }
-        resetAfterMasterClear();
-    }
 
-    private void resetAfterMasterClear() {
         // The following call to ChainControl.resetInBits() is vital!
         // If you forget, then the inBits member initializes 
-        // with random data. Then when you do your first write,
+        // with random northRing. Then when you do your first write,
         // some bits are written randomly.
+        controlChain.resetInBits();
         dataChain.resetInBits();
         dukeChain.resetInBits();
         reportChain.resetInBits();
-        controlChain.resetInBits();
 
-        // For reset, I want to clear all the stoppers simultaneously
-        data.clear();
-        //tokOut.clear();
-        instrIn.clear();
-        
-        data.stop();
-        //tokOut.stop();
-        instrIn.stop();
-        
-        data.resetAfterMasterClear();
-        //tokOut.resetAfterMasterClear();
-        instrIn.resetAfterMasterClear();
+        northRing.clear();
+        southRing.clear();
+        northRing.stop();
+        southRing.stop();
     }
 
 
     /** Get the 6 bit outer loop counter. */
     public int getOLC() {
-        shiftReport(true, false);
+        reportChain.shift(REPORT_CHAIN, true, false);
         if (omegaCounter) {
             BitVector bits = null;
             for(int i=0; i<4; i++) {
@@ -399,11 +368,11 @@ public class Marina {
     public boolean getILCDone() { return new Ilc().getDone(); }
     public int getILC() { return new Ilc().getCount(); }
     public boolean getFlagA() {
-        shiftReport(true, false);
+        reportChain.shift(REPORT_CHAIN, true, false);
         return reportChain.getOutBits(REPORT_CHAIN+"."+FLAGS_PATH).get(0);
     }
     public boolean getFlagB() {
-        shiftReport(true, false);
+        reportChain.shift(REPORT_CHAIN, true, false);
         return reportChain.getOutBits(REPORT_CHAIN+"."+FLAGS_PATH).get(1);
     }
     /** get the number of tokens in the token FIFO.
@@ -411,7 +380,7 @@ public class Marina {
      * and Token predecessor wire.
      * Master clear clears the token FIFO. */
     public int getNumTokens() {
-        shiftReport(true, false);
+        reportChain.shift(REPORT_CHAIN, true, false);
         // get the token successor and token FIFO wires
         BitVector bv = reportChain.getOutBits(REPORT_CHAIN+"."+TOK_FIFO_PATH);
         int sz = bv.getNumBits();
index 192e9b6..22c7a86 100644 (file)
@@ -37,7 +37,7 @@ public class MarinaFleet extends FleetTwoFleet {
         return ((MarinaPath)path).bv;
     }
 
-    public Dock getOnlyInputDock() {
+    public Dock getOnlyDock() {
         return onlyDock;
     }
 }
index 503950c..ee9ec09 100644 (file)
@@ -3,7 +3,6 @@ package edu.berkeley.fleet.marina;
 import com.sun.electric.tool.simulation.test.*;
 import edu.berkeley.fleet.api.Dock;
 import edu.berkeley.fleet.api.Instruction;
-import edu.berkeley.fleet.marina.MarinaFleet;
 
 /**
  * This class encapsulates a "packet" -- a data item in flight plus
@@ -53,8 +52,8 @@ public class MarinaPacket {
 
     /** another constructor which uses an all-zeroes path, for convenience */
     public MarinaPacket(Instruction inst) {
-        BitVector instr =
-            MarinaUtils.berkToSun(MarinaTest.marinaFleet.encodeInstruction(MarinaTest.marinaFleet.getOnlyInputDock(), inst));
+        Marina marina = (Marina)inst.dock.getShip().getFleet();
+        BitVector instr = MarinaUtils.berkToSun(marina.encodeInstruction(marina.getOnlyDock(), inst));
         MarinaUtils.expectLength(instr, MarinaPacket.WORD_WIDTH);
         
         //
index ae4c569..4f89b51 100644 (file)
@@ -1,47 +1,80 @@
 package edu.berkeley.fleet.marina;
-/* -*- tab-width: 4 -*- */
-import java.util.ArrayList;
-import java.util.List;
-
+import java.util.*;
 import com.sun.electric.tool.simulation.test.*;
 import edu.berkeley.fleet.marina.CmdArgs;
 import edu.berkeley.fleet.marina.CmdArgs.Mode;
-
 import edu.berkeley.fleet.api.Dock;
 import edu.berkeley.fleet.api.Instruction;
 import edu.berkeley.fleet.api.Predicate;
 import edu.berkeley.fleet.api.Instruction.Set.SetDest;
 import edu.berkeley.fleet.api.Instruction.Set.SetSource;
-import edu.berkeley.fleet.marina.MarinaFleet;
-import edu.berkeley.fleet.marina.MarinaPath;
-
 import java.io.*;
 
 /**
  * Tests for Marina
  */
 public class MarinaTest {
-    public static final MarinaFleet marinaFleet = new MarinaFleet();
-    public static final Dock dock = marinaFleet.getOnlyInputDock();
+
+    private static Marina marina;
+    private MarinaTest(Marina marina) throws Exception {
+        this.marina = marina;
+        go("marina.spi");
+    }
+
+    private void go(String netListName) throws Exception {
+        if (model instanceof NanosimModel) {
+            NanosimLogicSettable mc = (NanosimLogicSettable)
+                ((SimulationModel)model).createLogicSettable(Marina.MASTER_CLEAR);
+            mc.setInitState(true);
+        }
+
+        prln("starting model");
+        if (model instanceof VerilogModel)
+            ((SimulationModel)model).start("verilog", "marina.v", VerilogModel.DUMPVARS, !cmdArgs.jtagShift);
+        else if (model instanceof HsimModel)
+            ((SimulationModel)model).start("hsim64", netListName, 0, !cmdArgs.jtagShift);
+        else if (model instanceof NanosimModel)
+            ((SimulationModel)model).start("nanosim -c cfg", netListName, 0, !cmdArgs.jtagShift);
+        else
+            {}
+        prln("model started");
+
+        model.waitNS(1000);
+        prln("deasserting master clear");
+        if (model instanceof SimulationModel)
+            ((SimulationModel)model).setNodeState(Marina.MASTER_CLEAR, 0);
+        else
+            marina.masterClear();
+        model.waitNS(1000);
+
+        if (cmdArgs.testNum!=0 && cmdArgs.testNum!=1) {
+            cc.resetInBits();
+            cc.shift(Marina.CONTROL_CHAIN, false, true);
+        }
+        
+        doOneTest(cmdArgs.testNum);
+
+        if (model instanceof SimulationModel)
+            ((SimulationModel)model).finish();
+    }
 
     public static float vdd = 1.0f;
 
     //--------------------------  constants -----------------------------------
     private static final String SCAN_CHAIN_XML = "marina.xml";
-    private static final String NET_LIST = "marina.spi";
 
     public static final int INSTR_SZ = 36;
 
        
-    public static final Instruction.Set.FlagFunction CLEAR_FLAG 
+    public final Instruction.Set.FlagFunction CLEAR_FLAG 
         = Instruction.Set.FlagFunction.ZERO;
-    public static final Instruction.Set.FlagFunction SET_FLAG 
+    public final Instruction.Set.FlagFunction SET_FLAG 
         = Instruction.Set.FlagFunction.ZERO.add(Predicate.FlagA)
         .add(Predicate.NotFlagA);
-    public static final Instruction.Set.FlagFunction A_FLAG 
+    public final Instruction.Set.FlagFunction A_FLAG 
         = Instruction.Set.FlagFunction.ZERO.add(Predicate.FlagA);
 
-    public static final Instruction.Set.FlagFunction B_FLAG 
+    public final Instruction.Set.FlagFunction B_FLAG 
         = Instruction.Set.FlagFunction.ZERO.add(Predicate.FlagB);
     
     // COLUMN_LATENCY is a delay that is larger than the latency through an Infinity column
@@ -91,18 +124,17 @@ public class MarinaTest {
     private static long startTime;
 
     public static Indenter indenter = new Indenter();
-    private Marina marina;
-    private ChipModel model;
+    private static ChipModel model;
     //private ChainControl cc;
     //private JtagTester tester;
-    private CmdArgs cmdArgs;
+    private static CmdArgs cmdArgs;
     private PowerChannel corePowerSupply, padsPowerSupply;
     private VoltageReadable coreVoltmeter, voltmeterForCurrent;
 
 
 
-    private ChainTest ctD, ctR, ctC, ct;
-    private ChainControl ccD, ccR, ccC, cc;
+    private static ChainTest ctD, ctR, ctC, ct;
+    private static ChainControl ccD, ccR, ccC, cc;
         
     //--------------------------  private methods -----------------------------
     /** @return true if simulation. Return false if we're testing silicon. */
@@ -154,172 +186,16 @@ public class MarinaTest {
         }
     }
 
-    private MarinaTest(String[] args) throws Exception {
-        cmdArgs = new CmdArgs(args);
-        reportTask(cmdArgs);
-        doSim();
-    }
         
     static PowerChannel vdd18;
     static PowerChannel vdd10;
     static PowerChannel vdds;
 
-    private void setVdd10(float v) {
+    private static void setVdd10(float v) {
         if (vdd10==null) return;
         vdd10.setVoltageWait(v);
     }
 
-    private void doSim() throws Exception {
-        String netListName;
-        switch (cmdArgs.mode) {
-            case WHOLE_CHIP_SCHEMATIC_PARASITICS:
-                netListName = NET_LIST; 
-                break;
-            case WHOLE_CHIP_LAYOUT_PARASITICS:
-                netListName = "marina_pads_guts.spi"; 
-                break;
-            default:
-                fatal(true, "unrecognized CmdArgs.Mode");
-                return;
-        }
-
-
-        Infrastructure.gpibControllers = new int[]{1};
-        vdd18 = new Pst3202Channel("ch1", "tiPST3202", 1);
-        vdd18 = new Pst3202Channel("ch3", "tiPST3202", 3);
-        vdd10 = new PowerChannelResistorVoltageReadable(new Pst3202Channel("ch2", "tiPST3202", 2),
-                                                        1000, 
-                                                        new HP34401A("HP34970"),
-                                                        true);
-        
-        if (vdd10!=null) setVdd10(vdd);
-        if (vdd18!=null) vdd18.setVoltageNoWait(1.8f);
-
-        model = cmdArgs.useVerilog
-            ? new VerilogModel()
-            : cmdArgs.useHsim
-            ? new HsimModel()
-            : cmdArgs.silicon
-            ? new SiliconChip()
-            : new NanosimModel();
-            
-        if (model instanceof SimulationModel)
-            ((SimulationModel)model).setOptimizedDirectReadsWrites(true);
-
-        CYCLE_TIME_NS = cmdArgs.useVerilog ? (100*20) : 0.250;
-        int khz   =
-            model instanceof VerilogModel
-            ? 100000
-            : cmdArgs.jtagShift
-            ? 20000
-            : model instanceof ChipModel
-            ? 1000
-            : 1000000;
-
-        System.err.println("constructing jtag controller");
-        JtagTester tester =
-            model instanceof SimulationModel
-            ? ((SimulationModel)model).createJtagTester("TCK", "TMS", "TRSTb", "TDI", "TDO")
-            : new Netscan("jtag2");
-        //: new Netscan("10.0.0.200");
-        //: new Signalyzer();
-        //: new Netscan("jtag2");
-        JtagLogicLevel mc0=null;
-        JtagLogicLevel mc1=null;
-        if (tester instanceof NetscanGeneric) {
-            ((NetscanGeneric)tester).reset();
-            // master clear
-            // not sure if "GPIO1" means "index 0" or not
-            mc0 = new JtagLogicLevel(tester, 0);
-            mc1 = new JtagLogicLevel(tester, 1);
-            mc1 = mc0;
-            mc0.setLogicState(true);
-            mc1.setLogicState(true);
-        }
-        /*
-          Logger.setLogInits(true);
-          tester.setLogSets(true);
-          tester.setLogOthers(true);
-          tester.setAllLogging(true);
-          tester.printInfo = true;
-        */
-        tester.printInfo = false;
-
-        PowerChannel pc = new ManualPowerChannel("pc", false);
-        /*
-          JtagTester testerD, testerR, testerC;
-          testerD = ((SimulationModel)model).createJtagSubchainTester("sid[1:9]", null); 
-          testerR = ((SimulationModel)model).createJtagSubchainTester("sir[1:9]", null); 
-          testerC = ((SimulationModel)model).createJtagSubchainTester("sic[1:9]", null); 
-          testerD.printInfo = testerR.printInfo = testerC.printInfo = false;
-
-          ccD = new ChainControl(SCAN_CHAIN_XML, testerD, 1.8f, khz);
-          ccR = new ChainControl(SCAN_CHAIN_XML, testerR, 1.8f, khz);
-          ccC = new ChainControl(SCAN_CHAIN_XML, testerC, 1.8f, khz);
-          ccD.noTestSeverity = ccR.noTestSeverity = ccC.noTestSeverity = Infrastructure.SEVERITY_NOMESSAGE;
-
-        
-          ctD = new ChainTest(ccD, pc);
-          ctR = new ChainTest(ccR, pc);
-          ctC = new ChainTest(ccC, pc);
-        */        
-        /*
-          ccs.addChain(Marina.DATA_CHAIN, ccD);
-          ccs.addChain(Marina.REPORT_CHAIN, ccR);
-          ccs.addChain(Marina.CONTROL_CHAIN, ccC);
-        */
-        /*
-          PowerChannel ch2 = new Pst3202Channel("ch2", "tiPST3202", 2);
-          PowerChannel ch3 = new Pst3202Channel("ch3", "tiPST3202", 3);
-          Infrastructure.gpibControllers = new int[]{1};
-          ch2.setVoltageNoWait(1f);
-          ch3.setVoltageNoWait(1.8f);
-        */
-
-
-        cc = new ChainControl(SCAN_CHAIN_XML, tester, 1.8f, khz);
-        cc.noTestSeverity = Infrastructure.SEVERITY_NOMESSAGE;
-        ct = new ChainTest(cc, pc);
-
-        marina = new Marina(cc, cc, cc, cc, model, !cmdArgs.jtagShift, indenter);
-        marina.mc0=mc0;
-        marina.mc1=mc1;
-
-        if (model instanceof NanosimModel) {
-            NanosimLogicSettable mc = (NanosimLogicSettable)
-                ((SimulationModel)model).createLogicSettable(Marina.MASTER_CLEAR);
-            mc.setInitState(true);
-        }
-
-        prln("starting model");
-        if (model instanceof VerilogModel)
-            ((SimulationModel)model).start("verilog", "marina.v", VerilogModel.DUMPVARS, !cmdArgs.jtagShift);
-        else if (model instanceof HsimModel)
-            ((SimulationModel)model).start("hsim64", netListName, 0, !cmdArgs.jtagShift);
-        else if (model instanceof NanosimModel)
-            ((SimulationModel)model).start("nanosim -c cfg", netListName, 0, !cmdArgs.jtagShift);
-        else
-            {}
-        prln("model started");
-
-        model.waitNS(1000);
-        prln("deasserting master clear");
-        if (model instanceof SimulationModel)
-            ((SimulationModel)model).setNodeState(Marina.MASTER_CLEAR, 0);
-        else
-            marina.masterClear();
-        model.waitNS(1000);
-
-        if (cmdArgs.testNum!=0 && cmdArgs.testNum!=1) {
-            cc.resetInBits();
-            cc.shift(Marina.CONTROL_CHAIN, false, true);
-        }
-        
-        doOneTest(cmdArgs.testNum);
-
-        if (model instanceof SimulationModel)
-            ((SimulationModel)model).finish();
-    }
 
     /** In the absence of looping, the longest path through Infinity is 4 column delays */
     private void waitUntilQuiescent() {
@@ -478,9 +354,9 @@ public class MarinaTest {
         prln("Begin testProperStoppers");
         adjustIndent(2);
 
-        for(ProperStopper ps : new ProperStopper[] { marina.data, marina.instrIn }) {
+        for(ProperStopper ps : new ProperStopper[] { marina.northRing, marina.southRing }) {
 
-            prln("testing " + (ps == marina.data ? "data" : "instruction") + " stopper");
+            prln("testing " + (ps == marina.northRing ? "data" : "instruction") + " stopper");
             adjustIndent(2);
 
             prln("un-stopping stopper");
@@ -513,7 +389,7 @@ public class MarinaTest {
         }
 
         for(BitVector d : din)
-            marina.instrIn.fill(new MarinaPacket(d, false, MarinaPacket.null_path));
+            marina.southRing.fill(new MarinaPacket(d, false, MarinaPacket.null_path));
 
         adjustIndent(-2);
         prln("End sendInstructions");
@@ -528,8 +404,8 @@ public class MarinaTest {
         int nbToks = marina.getNumTokens();
         fatal(nbToks!=0, "Expected no tokens on initialization but got: "+nbToks+" tokens");
 
-        marina.instrIn.fill(setIlc(1));
-        marina.instrIn.fill(SEND_TOKEN);
+        marina.southRing.fill(setIlc(1));
+        marina.southRing.fill(SEND_TOKEN);
         nbToks = marina.getNumTokens();
         fatal(nbToks!=1, "Expected one token to emerge but got: "+nbToks+" tokens");
         
@@ -543,12 +419,12 @@ public class MarinaTest {
         
         edu.berkeley.fleet.api.BitVector bv = new edu.berkeley.fleet.api.BitVector(13);
         for(int i=0; i<bv.length(); i+=2) bv.set(i, false);
-        MarinaPath path = new MarinaPath((MarinaFleet)dock.getShip().getFleet(), bv);
+        MarinaPath path = new MarinaPath(marina, bv);
 
-        marina.instrIn.fill(setIlc(1));
-        marina.instrIn.fill(SEND_DATA);
+        marina.southRing.fill(setIlc(1));
+        marina.southRing.fill(SEND_DATA);
         
-        List<BitVector> dataItems = marina.data.drainMany();
+        List<BitVector> dataItems = marina.northRing.drainMany();
         fatal(dataItems.size()!=1, "Expected one data item to emerge but got: "+dataItems.size()+" data items");
 
         MarinaPacket mp = new MarinaPacket(dataItems.get(0));
@@ -563,13 +439,13 @@ public class MarinaTest {
         adjustIndent(2);
         
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.Infinity),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.Infinity),
                 SEND_DATA,
             });
         
         // more than MAX_ILC
         int howmany = 70;
-        List<BitVector> dataItems = marina.data.drainMany(howmany);
+        List<BitVector> dataItems = marina.northRing.drainMany(howmany);
         fatal(dataItems.size()!=howmany,
               "Expected an unending supply of data items to emerge but only got got: "+dataItems.size());
 
@@ -578,13 +454,13 @@ public class MarinaTest {
     }
 
     private Instruction setOlc(int olc) {
-        return new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, olc);
+        return new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, olc);
     }
     private Instruction setOlcIfZero(int olc) {
-        return new Instruction.Set(dock,Predicate.Default,SetDest.OuterLoopCounter, olc);
+        return new Instruction.Set(marina.getOnlyDock(),Predicate.Default,SetDest.OuterLoopCounter, olc);
     }
     private Instruction setIlc(int ilc) {
-        return new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, ilc);
+        return new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, ilc);
     }
 
     private void testFlagD(Marina marina) {
@@ -596,7 +472,7 @@ public class MarinaTest {
         Predicate only_if_olc_zero    = Predicate.FlagD;
         Predicate only_if_olc_nonzero = Predicate.Default;
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
 
         for(int olc : new int[] { 1, 0 }) {
             for(boolean predicate_olc_nonzero : new boolean[] { true, false }) {
@@ -607,7 +483,7 @@ public class MarinaTest {
 
                 marina.southRing.fill(new Instruction[] {
                         setOlc(olc),
-                        new Instruction.Move(dock,
+                        new Instruction.Move(marina.getOnlyDock(),
                                              predicate_olc_nonzero  // predicate   
                                              ? only_if_olc_nonzero
                                              : only_if_olc_zero
@@ -625,7 +501,7 @@ public class MarinaTest {
                 expectNorthFifoExactly((predicate_olc_nonzero == (olc!=0)) ? 1 : 0);
 
                 for(int i=0; i<olc; i++)
-                    marina.instrIn.fill(DEC);
+                    marina.southRing.fill(DEC);
 
                 adjustIndent(-2);
             }
@@ -640,13 +516,13 @@ public class MarinaTest {
         
         List<BitVector> dItems;
 
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 1));
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 1));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 1));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 1));
 
         for(boolean flag_a : new boolean[] { false, true }) {
             for(boolean flag_b : new boolean[] { false, true }) {
                 prln("Setting flags, a="+flag_a+" b="+flag_b);
-                marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,
+                marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                                         flag_a
                                                         ? Instruction.Set.FlagFunction.ONE
                                                         : Instruction.Set.FlagFunction.ZERO,
@@ -667,7 +543,7 @@ 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,
+                    marina.southRing.fill(new Instruction.Move(marina.getOnlyDock(),
                                                              predicate,  // predicate   
                                                              false,      // torpedoable 
                                                              null,       // path        
@@ -679,7 +555,7 @@ public class MarinaTest {
                                                              false       // tokenOut    
                                                              ));
                     adjustIndent(-2);
-                    dItems = marina.data.drainMany();
+                    dItems = marina.northRing.drainMany();
                     int expected = predicate.evaluate(flag_a, flag_b, false, false) ? 1 : 0;
                     fatal(dItems.size()!=expected, "Expected "+expected+" data items to emerge but got: "+
                           dItems.size()+" items(s)");
@@ -721,9 +597,9 @@ public class MarinaTest {
         //for (int i=-1; i<6; i++) {
         marina.southRing.fill(new Instruction[] {
 
-        new Instruction.Head(dock),
+        new Instruction.Head(marina.getOnlyDock()),
 
-        //                new Instruction.Set(dock,Predicate.IgnoreFlagD, SetDest.OuterLoopCounter, 1),
+        //                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD, SetDest.OuterLoopCounter, 1),
         FLAG_NOP,
         FLAG_NOP,
         FLAG_NOP,
@@ -733,9 +609,9 @@ public class MarinaTest {
         FLAG_NOP,
 
 
-        //new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, SetSource.Decrement),
+        //new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, SetSource.Decrement),
                 
-        new Instruction.Tail(dock),
+        new Instruction.Tail(marina.getOnlyDock()),
         });
         marina.southRing.fill(new Instruction[] {
         null,
@@ -767,10 +643,10 @@ public class MarinaTest {
 
                   int inOlc = i==-1 ? 0 : (1<<i);
                   inOlc = i;
-                  marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, inOlc));
-                  marina.instrIn.fill(SEND_DATA_IF_D_SET);
-                  marina.instrIn.fill(SEND_DATA_IF_D_NOT_SET);
-                  marina.instrIn.fill(SEND_DATA);
+                  marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, inOlc));
+                  marina.southRing.fill(SEND_DATA_IF_D_SET);
+                  marina.southRing.fill(SEND_DATA_IF_D_NOT_SET);
+                  marina.southRing.fill(SEND_DATA);
 
                   model.waitNS(128 * CYCLE_TIME_NS);
 
@@ -789,13 +665,13 @@ public class MarinaTest {
             // Mask off the "zero" bit position
             int inIlc = 1 << i;
             prln("inIlc="+inIlc);
-            marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, inIlc));
+            marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, inIlc));
             int outIlc = marina.getILC();
             fatal(outIlc!=inIlc, "bad ILC count: "+outIlc+" expected: "+inIlc);
             fatal(marina.getILCInfinity(), "bad Infinity bit: true");
         }
         prln("Now test the infinity bit");
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity));
         fatal(!marina.getILCInfinity(), "bad Infinity bit: false");
         adjustIndent(-2);
         prln("End walkOneILC");
@@ -805,15 +681,15 @@ public class MarinaTest {
         prln("Begin countIlc");
         adjustIndent(2);
         
-        marina.instrIn.fill(new 
-                            Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, maxIlc));
+        marina.southRing.fill(new 
+                            Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, maxIlc));
 
         int ilc = marina.getILC();
         fatal(ilc!=maxIlc, "bad ILC count: "+ilc+" expected: "+maxIlc);
                 
         prln("execute a move instruction that does nothing except decrement the ILC to zero");
-        marina.instrIn.fill(
-                            new Instruction.Move(dock,
+        marina.southRing.fill(
+                            new Instruction.Move(marina.getOnlyDock(),
                                                  Predicate.IgnoreFlagD, // predicate   
                                                  false,                 // torpedoable 
                                                  null,                  // path        
@@ -842,14 +718,14 @@ public class MarinaTest {
         prln("Begin countOlc");
         adjustIndent(2);
 
-        marina.instrIn.fill(setOlc(maxOlc));
+        marina.southRing.fill(setOlc(maxOlc));
 
         for (int i=maxOlc; i>=0; i--) {
             model.waitNS(128 * CYCLE_TIME_NS);
             prln("OLC should be: "+i);
             expectOlc(i);
-            marina.instrIn.fill(new 
-                                Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, SetSource.Decrement));
+            marina.southRing.fill(new 
+                                Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, SetSource.Decrement));
         }
 
         adjustIndent(-2);
@@ -876,11 +752,11 @@ public class MarinaTest {
                     RECV_DATA,
 
                     // the Set-OLC instruction
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, inOlc),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, inOlc),
 
                     // put a Set-ILC instruction right behind it with inverted bits to be sure we're
                     // not capturing the instruction-latch value too late in the cycle
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, (inOlc ^ (~(-1<<6)))),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, (inOlc ^ (~(-1<<6)))),
                     
                 });
 
@@ -900,8 +776,8 @@ public class MarinaTest {
         int i=0;
         for(i=0; i<quantity; i++) {
             prln("Inserting instruction " + (i+1) +"/"+ quantity);
-            marina.instrIn.fill(instruction);
-            boolean jammed = (marina.instrIn.getFillStateWire()==MarinaUtils.StateWireState.FULL);
+            marina.southRing.fill(instruction);
+            boolean jammed = (marina.southRing.getFillStateWire()==MarinaUtils.StateWireState.FULL);
             if (jammed && expect_it_to_jam_up) {
                 prln("Stopper remained full after inserting instruction; this was expected; we are happy.");
                 adjustIndent(-2);
@@ -914,24 +790,23 @@ public class MarinaTest {
         prln("Successfully inserted " + i + " instructions");
     }
 
-    private static MarinaPath null_path = new MarinaPath((MarinaFleet)dock.getShip().getFleet(),
-                                                         MarinaUtils.sunToBerk(MarinaPacket.null_path));
+    private MarinaPath null_path = new MarinaPath(marina, MarinaUtils.sunToBerk(MarinaPacket.null_path));
 
-    private static final Instruction DEC = 
-        new Instruction.Set(dock,Predicate.Default,SetDest.OuterLoopCounter, SetSource.Decrement);
+    private final Instruction DEC = 
+        new Instruction.Set(marina.getOnlyDock(),Predicate.Default,SetDest.OuterLoopCounter, SetSource.Decrement);
 
-    private static final Instruction FLAG_NOP =
-        new Instruction.Set(dock, Predicate.IgnoreFlagD,
+    private final Instruction FLAG_NOP =
+        new Instruction.Set(marina.getOnlyDock(), Predicate.IgnoreFlagD,
                             CLEAR_FLAG.add(Predicate.FlagA),
                             CLEAR_FLAG.add(Predicate.FlagB));
 
-    private static final Instruction FLAG_NOP_IF_FLAG_A =
-        new Instruction.Set(dock, Predicate.FlagA,
+    private final Instruction FLAG_NOP_IF_FLAG_A =
+        new Instruction.Set(marina.getOnlyDock(), Predicate.FlagA,
                             CLEAR_FLAG.add(Predicate.FlagA),
                             CLEAR_FLAG.add(Predicate.FlagB));
 
-    private static final Instruction NOP =
-        new Instruction.Move(dock,
+    private final Instruction NOP =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.IgnoreFlagD, /* predicate   */
                              false,                 /* torpedoable */
                              null,                  /* path        */
@@ -943,8 +818,8 @@ public class MarinaTest {
                              false                  /* tokenOut    */
                              );
 
-    private static final Instruction SEND_DATA =
-        new Instruction.Move(dock,
+    private final Instruction SEND_DATA =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.IgnoreFlagD,   /* predicate   */
                              false,                 /* torpedoable */
                              null_path,                  /* path        */
@@ -956,8 +831,8 @@ public class MarinaTest {
                              false                  /* tokenOut    */
                              );
 
-    private static final Instruction SEND_DATA_IF_D_NOT_SET =
-        new Instruction.Move(dock,
+    private final Instruction SEND_DATA_IF_D_NOT_SET =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.Default,     /* predicate   */
                              false,                 /* torpedoable */
                              null_path,             /* path        */
@@ -969,8 +844,8 @@ public class MarinaTest {
                              false                  /* tokenOut    */
                              );
 
-    private static final Instruction SEND_DATA_IF_A_SET_AND_D_NOT_SET =
-        new Instruction.Move(dock,
+    private final Instruction SEND_DATA_IF_A_SET_AND_D_NOT_SET =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.FlagA,       /* predicate   */
                              false,                 /* torpedoable */
                              null_path,             /* path        */
@@ -982,8 +857,8 @@ public class MarinaTest {
                              false                  /* tokenOut    */
                              );
 
-    private static final Instruction SEND_DATA_IF_D_SET =
-        new Instruction.Move(dock,
+    private final Instruction SEND_DATA_IF_D_SET =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.FlagD,       /* predicate   */
                              false,                 /* torpedoable */
                              null_path,             /* path        */
@@ -995,8 +870,8 @@ public class MarinaTest {
                              false                  /* tokenOut    */
                              );
 
-    private static final Instruction SEND_TOKEN_IF_D_SET =
-        new Instruction.Move(dock,
+    private final Instruction SEND_TOKEN_IF_D_SET =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.FlagD,       /* predicate   */
                              false,                 /* torpedoable */
                              null_path,             /* path        */
@@ -1008,8 +883,8 @@ public class MarinaTest {
                              true                   /* tokenOut    */
                              );
 
-    private static final Instruction SEND_TOKEN_IF_D_NOT_SET =
-        new Instruction.Move(dock,
+    private final Instruction SEND_TOKEN_IF_D_NOT_SET =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.Default,     /* predicate   */
                              false,                 /* torpedoable */
                              null_path,             /* path        */
@@ -1021,8 +896,8 @@ public class MarinaTest {
                              true                   /* tokenOut    */
                              );
 
-    private static final Instruction TORPEDOABLE_RECV_DATA =
-        new Instruction.Move(dock,
+    private final Instruction TORPEDOABLE_RECV_DATA =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.IgnoreFlagD, /* predicate   */
                              true,                  /* torpedoable */
                              null,                  /* path        */
@@ -1034,8 +909,8 @@ public class MarinaTest {
                              false                  /* tokenOut    */
                              );
 
-    private static final Instruction RECV_DATA =
-        new Instruction.Move(dock,
+    private final Instruction RECV_DATA =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.IgnoreFlagD,   /* predicate   */
                              false,                 /* torpedoable */
                              null,                  /* path        */
@@ -1047,8 +922,8 @@ public class MarinaTest {
                              false                  /* tokenOut    */
                              );
 
-    private static final Instruction SEND_TOKEN =
-        new Instruction.Move(dock,
+    private final Instruction SEND_TOKEN =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.IgnoreFlagD,   /* predicate   */
                              false,                 /* torpedoable */
                              null_path,                  /* path        */
@@ -1060,8 +935,8 @@ public class MarinaTest {
                              true                   /* tokenOut    */
                              );
 
-    private static final Instruction RECV_TOKEN =
-        new Instruction.Move(dock,
+    private final Instruction RECV_TOKEN =
+        new Instruction.Move(marina.getOnlyDock(),
                              Predicate.IgnoreFlagD,   /* predicate   */
                              false,                 /* torpedoable */
                              null,                  /* path        */
@@ -1076,28 +951,28 @@ public class MarinaTest {
 
     private void expectNorthFifoNoMoreThan(int num) {
         model.waitNS(128 * CYCLE_TIME_NS);
-        List<BitVector> dataItems = marina.data.drainMany(num+1);
+        List<BitVector> dataItems = marina.northRing.drainMany(num+1);
         fatal(dataItems.size()>num,
               "Expected no more than "+num+
               " data items to emerge but got at least: "+dataItems.size());
     }
     private void expectNorthFifoExactly(int num) {
         model.waitNS(128 * CYCLE_TIME_NS);
-        List<BitVector> dataItems = marina.data.drainMany(num+1);
+        List<BitVector> dataItems = marina.northRing.drainMany(num+1);
         fatal(dataItems.size()!=num,
               "Expected exactly "+num+
               " data items to emerge but got at least: "+dataItems.size());
     }
     private void expectNorthFifoAtLeast(int num) {
         model.waitNS(128 * CYCLE_TIME_NS);
-        List<BitVector> dataItems = marina.data.drainMany(num);
+        List<BitVector> dataItems = marina.northRing.drainMany(num);
         fatal(dataItems.size()<num,
               "Expected at least "+num+
               " data items to emerge but got only: "+dataItems.size());
     }
     private void expectTokensNoMoreThan(int num) {
         int x = marina.getNumTokens();
-        List<BitVector> dataItems = marina.data.drainMany(num+1);
+        List<BitVector> dataItems = marina.northRing.drainMany(num+1);
         fatal(x>num,
               "Expected no more than "+num+
               " tokens to emerge but got at least: "+x);
@@ -1110,10 +985,10 @@ public class MarinaTest {
     }
 
     private void testFlagDRecomputationTime(Marina marina) {
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
                 RECV_DATA,
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,0),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,0),
                 SEND_DATA_IF_D_NOT_SET
             });
         marina.northRing.fill();
@@ -1121,8 +996,8 @@ public class MarinaTest {
 
         marina.southRing.fill(new Instruction[] {
                 RECV_DATA,
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,1),
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.Decrement),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,1),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.Decrement),
                 SEND_DATA_IF_D_NOT_SET
             });
         marina.northRing.fill();
@@ -1130,18 +1005,18 @@ public class MarinaTest {
 
         marina.southRing.fill(new Instruction[] {
                 RECV_DATA,
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,2),
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.Decrement),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,2),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.Decrement),
                 SEND_DATA_IF_D_NOT_SET
             });
         marina.northRing.fill();
         expectNorthFifoExactly(1);
-        marina.instrIn.fill(DEC);
+        marina.southRing.fill(DEC);
 
         marina.southRing.fill(new Instruction[] {
                 RECV_DATA,
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,0),
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,1),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,0),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,1),
                 SEND_DATA_IF_D_NOT_SET
             });
         marina.northRing.fill();
@@ -1149,24 +1024,24 @@ public class MarinaTest {
     }
 
     private void testTailWaitsForHead(Marina marina) {
-        marina.instrIn.fill(setIlc(1));
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
+        marina.southRing.fill(setIlc(1));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
         
         marina.southRing.enableInstructionSend(false);
         marina.southRing.enableInstructionRecirculate(true);
         
-        marina.instrIn.fill(TORPEDOABLE_RECV_DATA);
-        marina.instrIn.fill(new Instruction.Head(dock));
-        marina.instrIn.fill(SEND_DATA);
-        marina.instrIn.fill(TORPEDOABLE_RECV_DATA);
-        marina.instrIn.fill(SEND_TOKEN);
-        marina.instrIn.fill(TORPEDOABLE_RECV_DATA);
-        marina.instrIn.fill(new Instruction.Tail(dock));
-        marina.instrIn.fillTorpedo();
+        marina.southRing.fill(TORPEDOABLE_RECV_DATA);
+        marina.southRing.fill(new Instruction.Head(marina.getOnlyDock()));
+        marina.southRing.fill(SEND_DATA);
+        marina.southRing.fill(TORPEDOABLE_RECV_DATA);
+        marina.southRing.fill(SEND_TOKEN);
+        marina.southRing.fill(TORPEDOABLE_RECV_DATA);
+        marina.southRing.fill(new Instruction.Tail(marina.getOnlyDock()));
+        marina.southRing.fillTorpedo();
         
         marina.southRing.enableInstructionRecirculate(false);
         marina.southRing.enableInstructionSend(true);
-        marina.instrIn.run();
+        marina.southRing.run();
         
         expectNorthFifoNoMoreThan(0);
         prln("inserting into north proper stopper");
@@ -1177,35 +1052,35 @@ public class MarinaTest {
     }
 
     /*
-      marina.instrIn.fill(setIlc(1));
-      marina.instrIn.fill(setOlc(1));
+      marina.southRing.fill(setIlc(1));
+      marina.southRing.fill(setOlc(1));
 
       // this makes the head wait for the torpedo
-      marina.instrIn.fill(TORPEDOABLE_RECV_DATA);
+      marina.southRing.fill(TORPEDOABLE_RECV_DATA);
 
       // the head should wait for the tail
-      marina.instrIn.fill(new Instruction.Head(dock));
-      marina.instrIn.fill(NOP);
-      marina.instrIn.fill(SEND_DATA);
-      marina.instrIn.fill(RECV_DATA);
+      marina.southRing.fill(new Instruction.Head(marina.getOnlyDock()));
+      marina.southRing.fill(NOP);
+      marina.southRing.fill(SEND_DATA);
+      marina.southRing.fill(RECV_DATA);
 
       expectNorthFifoNoMoreThan(0);
 
-      marina.instrIn.fillTorpedo();
+      marina.southRing.fillTorpedo();
       expectNorthFifoNoMoreThan(0);
 
-      marina.instrIn.fill(new Instruction.Tail(dock));
+      marina.southRing.fill(new Instruction.Tail(marina.getOnlyDock()));
       expectNorthFifoExactly(1);
     */
 
     private void testTailWithoutHead(Marina marina) {
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63),
-                new Instruction.Tail(dock),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63),
+                new Instruction.Tail(marina.getOnlyDock()),
                 SEND_DATA,
             });
-        List<BitVector> dataItems = marina.data.drainMany(1);
+        List<BitVector> dataItems = marina.northRing.drainMany(1);
         fatal(dataItems.size()!=0, "Expected exactly no data items to emerge but got at least: "+dataItems.size());
     }
 
@@ -1215,16 +1090,16 @@ public class MarinaTest {
         prln("Begin testHeadWaitsForTail");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63),
-                new Instruction.Head(dock),
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63),
+                new Instruction.Head(marina.getOnlyDock()),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
                 SEND_DATA,
             });
 
         expectNorthFifoExactly(0);
-        marina.instrIn.fill(new Instruction.Tail(dock));
+        marina.southRing.fill(new Instruction.Tail(marina.getOnlyDock()));
         expectNorthFifoAtLeast(1);
 
         adjustIndent(-2);
@@ -1232,10 +1107,10 @@ public class MarinaTest {
     }
 
     private void testNonTorpedoableMoveDoesNotResetDFlag(Marina marina) {
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,63),
-                new Instruction.Move(dock,
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,63),
+                new Instruction.Move(marina.getOnlyDock(),
                                      Predicate.IgnoreFlagD, // predicate   
                                      true,                  // torpedoable 
                                      null,                  // path        
@@ -1246,7 +1121,7 @@ public class MarinaTest {
                                      false,                 // dataOut     
                                      false                  // tokenOut    
                                      ),
-                new Instruction.Move(dock,
+                new Instruction.Move(marina.getOnlyDock(),
                                      Predicate.FlagD,       // predicate   
                                      false,                 // torpedoable 
                                      null,                  // path        
@@ -1258,10 +1133,10 @@ public class MarinaTest {
                                      false                  // tokenOut    
                                      ),
             });
-        marina.instrIn.fillTorpedo();
+        marina.southRing.fillTorpedo();
         expectNorthFifoExactly(1);
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Move(dock,
+                new Instruction.Move(marina.getOnlyDock(),
                                      Predicate.Default,     // predicate   
                                      false,                 // torpedoable 
                                      null,                  // path        
@@ -1278,36 +1153,36 @@ public class MarinaTest {
 
     private void testAbort(Marina marina) {
         
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.DataLatch,1),
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,2),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.DataLatch,1),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,2),
                 SEND_DATA_IF_D_NOT_SET,
-                new Instruction.Head(dock),
+                new Instruction.Head(marina.getOnlyDock()),
                 SEND_DATA_IF_D_NOT_SET,
-                new Instruction.Set(dock,Predicate.Default,SetDest.DataLatch,2),
-                new Instruction.Abort(dock, Predicate.FlagD),
-                new Instruction.Set(dock,Predicate.Default,SetDest.OuterLoopCounter,SetSource.Decrement),
-                new Instruction.Tail(dock),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.Default,SetDest.DataLatch,2),
+                new Instruction.Abort(marina.getOnlyDock(), Predicate.FlagD),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.Default,SetDest.OuterLoopCounter,SetSource.Decrement),
+                new Instruction.Tail(marina.getOnlyDock()),
             }, true);
         
         for(int i=0; i<4; i++) {
             BitVector bv;
             
             model.waitNS(128 * CYCLE_TIME_NS);
-            bv = new MarinaPacket(marina.data.drain()).data.bitReverse();
+            bv = new MarinaPacket(marina.northRing.drain()).data.bitReverse();
             fatal(bv==null, "no data item found");
             prln("got " + bv.toLong());
             fatal(bv.toLong()!=1, "expected 1, got " + bv.toLong());
             
             model.waitNS(128 * CYCLE_TIME_NS);
-            bv = new MarinaPacket(marina.data.drain()).data.bitReverse();
+            bv = new MarinaPacket(marina.northRing.drain()).data.bitReverse();
             fatal(bv==null, "no data item found");
             prln("got " + bv.toLong());
             fatal(bv.toLong()!=1, "expected 1, got " + bv.toLong());
             
             model.waitNS(128 * CYCLE_TIME_NS);
-            bv = new MarinaPacket(marina.data.drain()).data.bitReverse();
+            bv = new MarinaPacket(marina.northRing.drain()).data.bitReverse();
             fatal(bv==null, "no data item found");
             prln("got " + bv.toLong());
             fatal(bv.toLong()!=2, "expected 2, got " + bv.toLong());
@@ -1316,10 +1191,10 @@ public class MarinaTest {
     }
 
     private void testAbortOutsideOfLoop(Marina marina) {
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
                 // ensure that an abort doesn't cause problems if no loop is in progress
-                new Instruction.Abort(dock, Predicate.IgnoreFlagD),
+                new Instruction.Abort(marina.getOnlyDock(), Predicate.IgnoreFlagD),
                 SEND_DATA,
             });
         expectNorthFifoExactly(1);
@@ -1344,14 +1219,14 @@ public class MarinaTest {
         one = one.add(Predicate.FlagC);
         one = one.add(Predicate.NotFlagC);
 
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1));
         for(boolean fast : new boolean[] { true, false }) {
             // clear the flags to a known state, then check both 0->1 and 1->0 transitions
             for(boolean b : new boolean[] { false, true, false }) {
                 prln("state: a="+marina.getFlagA()+", b="+marina.getFlagB());
                 prln((b?"Setting":"Clearing")+" flags");
                 
-                Instruction inst = new Instruction.Set(dock,Predicate.IgnoreFlagD,
+                Instruction inst = new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                                        b ? one : zero,
                                                        b ? one : zero
                                                        );
@@ -1364,7 +1239,7 @@ public class MarinaTest {
                     model.waitNS(64 * CYCLE_TIME_NS);
                     marina.northRing.fill();
                 } else {
-                    marina.instrIn.fill(inst);
+                    marina.southRing.fill(inst);
                 }
 
                 fatal(marina.getFlagA()!=b,
@@ -1386,7 +1261,7 @@ public class MarinaTest {
         prln("Begin testFlagTruthTable");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         Instruction.Set.FlagFunction zero = Instruction.Set.FlagFunction.ZERO;
         Instruction.Set.FlagFunction one  = zero.add(Predicate.FlagA).add(Predicate.NotFlagA);
 
@@ -1400,8 +1275,8 @@ public class MarinaTest {
 
                                     prln("before instruction: a="+a_state+", b="+b_state+", c="+c_state);
                                     // set A,B flags to a_state and b_state
-                                    marina.instrIn.fill(new 
-                                                        Instruction.Set(dock,Predicate.IgnoreFlagD,
+                                    marina.southRing.fill(new 
+                                                        Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                                                         a_state ? one : zero,
                                                                         b_state ? one : zero
                                                                         ));
@@ -1413,7 +1288,7 @@ public class MarinaTest {
                                     for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
                                     addr.set(Marina.INDEX_OF_ADDRESS_BIT_COPIED_TO_C_FLAG_WHEN_DC_EQUALS_ONE, c_state);
                                     marina.northRing.fill(new MarinaPacket(data, false, addr));
-                                    marina.instrIn.fill(RECV_DATA);
+                                    marina.southRing.fill(RECV_DATA);
                                     
                                     Instruction.Set.FlagFunction func = zero;
                                     if (a_input!=null) func = func.add(a_input);
@@ -1421,12 +1296,12 @@ public class MarinaTest {
                                     if (c_input!=null) func = func.add(c_input);
 
                                     Instruction inst = new 
-                                        Instruction.Set(dock,Predicate.IgnoreFlagD,
+                                        Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                                         !which ? func : zero.add(Predicate.FlagA),
                                                         which  ? func : zero.add(Predicate.FlagB)
                                                         );
 
-                                    marina.instrIn.fill(inst);
+                                    marina.southRing.fill(inst);
 
                                     boolean expected_a = !which ? func.evaluate(a_state, b_state, c_state, false) : a_state;
                                     boolean expected_b =  which ? func.evaluate(a_state, b_state, c_state, false) : b_state;
@@ -1444,10 +1319,10 @@ public class MarinaTest {
         prln("Begin recvData");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
-                new Instruction.Move(dock,
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
+                new Instruction.Move(marina.getOnlyDock(),
                                      Predicate.IgnoreFlagD, // predicate   
                                      false,                 // torpedoable 
                                      null,                  // path        
@@ -1458,7 +1333,7 @@ public class MarinaTest {
                                      false,                 // dataOut     
                                      false                  // tokenOut    
                                      ),
-                new Instruction.Set(dock,Predicate.IgnoreFlagD, SET_FLAG, SET_FLAG),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD, SET_FLAG, SET_FLAG),
             });
         model.waitNS(64 * CYCLE_TIME_NS);
 
@@ -1485,7 +1360,7 @@ public class MarinaTest {
         prln("Begin testRecvAndSendWalkingOne");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
 
         List<BitVector> dataItems;
         for(int bit=0; bit<37; bit++) {
@@ -1501,13 +1376,13 @@ public class MarinaTest {
             marina.northRing.fill(new MarinaPacket(data, false, addr));
 
             prln("stopping the north proper stopper");
-            marina.data.stop();
+            marina.northRing.stop();
 
-            dataItems = marina.data.drainMany(1);
+            dataItems = marina.northRing.drainMany(1);
             fatal(dataItems.size()!=0,
                   "found a data item waiting in the north proper stopper, but should not have");
 
-            marina.instrIn.fill(new Instruction.Move(dock,
+            marina.southRing.fill(new Instruction.Move(marina.getOnlyDock(),
                                                      Predicate.IgnoreFlagD,  // predicate   
                                                      false,                  // torpedoable 
                                                      null_path,              // path        
@@ -1519,7 +1394,7 @@ public class MarinaTest {
                                                      false                   // tokenOut    
                                                      ));
 
-            dataItems = marina.data.drainMany(2);
+            dataItems = marina.northRing.drainMany(2);
             fatal(dataItems.size()!=1,
                   "found "+dataItems.size()+" data items in north fifo; expected one");
             MarinaPacket mp = new MarinaPacket(dataItems.get(0));
@@ -1536,7 +1411,7 @@ public class MarinaTest {
         prln("Begin setOlcFromDataLatch");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
 
         // walk a bit from 0 to 5
         for(int bit=0; bit<6; bit++) {
@@ -1550,8 +1425,8 @@ public class MarinaTest {
 
             marina.southRing.fill(new Instruction[] {
                     RECV_DATA,
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch),
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.DataLatch,-1),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.DataLatch,-1),
                 });
 
             model.waitNS(CYCLE_TIME_NS * 64);
@@ -1573,7 +1448,7 @@ public class MarinaTest {
         prln("Begin setIlcFromDataLatch");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
 
         // walk a bit from 0 to 5
         for(int bit=5; bit>=0; bit--) {
@@ -1586,9 +1461,9 @@ public class MarinaTest {
             marina.northRing.fill(new MarinaPacket(data, false, addr));
 
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
                     RECV_DATA,
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.DataLatch),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.DataLatch),
                 });
             model.waitNS(CYCLE_TIME_NS * 64);
 
@@ -1604,7 +1479,7 @@ public class MarinaTest {
         prln("Begin testSendAndRecvToken");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         marina.southRing.fill(new Instruction[] {
                 SEND_TOKEN,
                 RECV_TOKEN,
@@ -1620,18 +1495,18 @@ public class MarinaTest {
         prln("Begin testSignExtendedLiteral");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         for(long val : new long[] { (-1L << 14), -1, 0, 1 }) {
 
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                         Instruction.Set.SetDest.DataLatch,
                                         val),
                     SEND_DATA,
                 });
             model.waitNS(CYCLE_TIME_NS * 64);
 
-            List<BitVector> dataItems = marina.data.drainMany(3);
+            List<BitVector> dataItems = marina.northRing.drainMany(3);
             fatal(dataItems.size()!=1, "expected exactly one data item, got " + dataItems.size());
 
             MarinaPacket mp = new MarinaPacket(dataItems.get(0));
@@ -1657,8 +1532,8 @@ public class MarinaTest {
         prln("Begin testShiftedLiteral");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,
+        marina.southRing.fill(setIlc(1));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                                 Instruction.Set.SetDest.DataLatch,
                                                 0));
 
@@ -1679,12 +1554,12 @@ public class MarinaTest {
                 dreg.set(i, immediate.get(i));
 
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Shift(dock,Predicate.IgnoreFlagD,immediate),
+                    new Instruction.Shift(marina.getOnlyDock(),Predicate.IgnoreFlagD,immediate),
                     SEND_DATA,
                 });
 
             model.waitNS(CYCLE_TIME_NS * 64);
-            List<BitVector> dataItems = marina.data.drainMany(3);
+            List<BitVector> dataItems = marina.northRing.drainMany(3);
             fatal(dataItems.size()!=1, "expected exactly one data item, got " + dataItems.size());
 
             BitVector bv = new MarinaPacket(dataItems.get(0)).data;
@@ -1709,7 +1584,7 @@ public class MarinaTest {
         // Dc=1 => sigS is copied into C-flag
         // Dc=0 => sigA is copied into C-flag
        
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         for(boolean dc : new boolean[] { false, true }) {
             for(boolean c_flag : new boolean[] { true, false, true }) {
 
@@ -1733,8 +1608,8 @@ public class MarinaTest {
                 prln("executing recv data with Dc="+dc);
                 prln("copying c-flag to a-flag");
                 marina.southRing.fill(new Instruction[] {
-                        new Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
-                        new Instruction.Move(dock,
+                        new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
+                        new Instruction.Move(marina.getOnlyDock(),
                                              Predicate.IgnoreFlagD,   /* predicate   */
                                              true,                  /* torpedoable */
                                              null,                  /* path        */
@@ -1746,7 +1621,7 @@ public class MarinaTest {
                                              false                  /* tokenOut    */
                                              ),
                         FLAG_NOP,
-                        new Instruction.Set(dock,Predicate.IgnoreFlagD,
+                        new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                             Instruction.Set.FlagFunction.ZERO.add(Predicate.FlagC),
                                             CLEAR_FLAG
                                             ),
@@ -1767,7 +1642,7 @@ public class MarinaTest {
         adjustIndent(2);
 
         edu.berkeley.fleet.api.BitVector bv = new edu.berkeley.fleet.api.BitVector(13);
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
 
         // alternating ones and zeroes
         for(int i=0; i<bv.length(); i+=2)
@@ -1776,11 +1651,11 @@ public class MarinaTest {
         for(int i=0; i<4; i++)
             bv.set(i, true);
 
-        MarinaPath path = new MarinaPath((MarinaFleet)dock.getShip().getFleet(), bv);
+        MarinaPath path = new MarinaPath(marina, bv);
 
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
-                new Instruction.Move(dock,
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
+                new Instruction.Move(marina.getOnlyDock(),
                                      Predicate.IgnoreFlagD, /* predicate   */
                                      false,                 /* torpedoable */
                                      path,                  /* path        */
@@ -1796,7 +1671,7 @@ public class MarinaTest {
         List<BitVector> dataItems;
         MarinaPacket mp;
 
-        dataItems = marina.data.drainMany();
+        dataItems = marina.northRing.drainMany();
         fatal(dataItems.size()!=1, "Expected one data item to emerge but got: "+dataItems.size()+" data items");
         mp = new MarinaPacket(dataItems.get(0));
 
@@ -1805,7 +1680,7 @@ public class MarinaTest {
         fatalIfBitVectorsDoNotMatch(MarinaUtils.berkToSun(bv), mp.path.get(0,13));
 
         prln("send data with no change to path");
-        marina.instrIn.fill(new Instruction.Move(dock,
+        marina.southRing.fill(new Instruction.Move(marina.getOnlyDock(),
                                                  Predicate.IgnoreFlagD, /* predicate   */
                                                  false,                 /* torpedoable */
                                                  null,                  /* path        */
@@ -1817,7 +1692,7 @@ public class MarinaTest {
                                                  false                  /* tokenOut    */
                                                  ));
 
-        dataItems = marina.data.drainMany();
+        dataItems = marina.northRing.drainMany();
         fatal(dataItems.size()!=1, "Expected one data item to emerge but got: "+dataItems.size()+" data items");
         mp = new MarinaPacket(dataItems.get(0));
 
@@ -1833,7 +1708,7 @@ public class MarinaTest {
         prln("Begin recvPath");
         adjustIndent(2);
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         for(int bit=0; bit<11; bit++) {
             BitVector packet_data = new BitVector(37, "inbound data item");
             for(int i=0; i<37; i++) packet_data.set(i, false);
@@ -1844,7 +1719,7 @@ public class MarinaTest {
             marina.northRing.fill(new MarinaPacket(packet_data, false, packet_path));
                                            
             prln("recv path, send data (using recv'd path)");
-            marina.instrIn.fill(new Instruction.Move(dock,
+            marina.southRing.fill(new Instruction.Move(marina.getOnlyDock(),
                                                      Predicate.IgnoreFlagD,   /* predicate   */
                                                      false,                 /* torpedoable */
                                                      null,                  /* path        */
@@ -1856,7 +1731,7 @@ public class MarinaTest {
                                                      false                  /* tokenOut    */
                                                      ));
 
-            List<BitVector> dataItems = marina.data.drainMany();
+            List<BitVector> dataItems = marina.northRing.drainMany();
             fatal(dataItems.size()!=1, "Expected one data item to emerge but got: "+dataItems.size()+" data items");
             MarinaPacket mp = new MarinaPacket(dataItems.get(0));
             
@@ -1875,10 +1750,10 @@ public class MarinaTest {
         for(int bit=0; bit<6; bit++) {
             int ilc = bit<0 ? 0 : (1<<bit);
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,ilc),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,ilc),
                     SEND_DATA,
                 });
-            List<BitVector> dataItems = marina.data.drainMany();
+            List<BitVector> dataItems = marina.northRing.drainMany();
             fatal(dataItems.size()!=ilc, "Expected "+ilc+" data item(s) to emerge but got: "+dataItems.size()+" data items");
         }
 
@@ -1889,7 +1764,7 @@ public class MarinaTest {
     private void testILCZero(Marina marina) {
         adjustIndent(2);
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,0),
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,0),
                 SEND_DATA,
                 SEND_TOKEN,
             });
@@ -1901,14 +1776,14 @@ public class MarinaTest {
     private void sendTorpedo(Marina marina) {
         prln("Begin sendTorpedo");
         adjustIndent(2);
-        marina.instrIn.fill(setIlc(1));
-        marina.instrIn.fill(setOlc(63));
+        marina.southRing.fill(setIlc(1));
+        marina.southRing.fill(setOlc(63));
 
         model.waitNS(128 * CYCLE_TIME_NS);
         expectOlc(63);
 
-        marina.instrIn.fill(new 
-                            Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG));
+        marina.southRing.fill(new 
+                            Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG));
         fatal(marina.getFlagA(), "bad A flag: true");
         fatal(marina.getFlagB(), "bad B flag: true");
 
@@ -1919,8 +1794,8 @@ public class MarinaTest {
         model.waitNS(128 * CYCLE_TIME_NS);
 
         marina.southRing.fill(new Instruction[] {
-                new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity),
-                new Instruction.Move(dock,
+                new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity),
+                new Instruction.Move(marina.getOnlyDock(),
                                      Predicate.IgnoreFlagD, // predicate   
                                      true,                  // torpedoable 
                                      null,                  // path        
@@ -1931,11 +1806,11 @@ public class MarinaTest {
                                      false,                 // dataOut     
                                      false                  // tokenOut    
                                      ),
-                new Instruction.Set(dock,Predicate.Default,
+                new Instruction.Set(marina.getOnlyDock(),Predicate.Default,
                                     SET_FLAG,
                                     Instruction.Set.FlagFunction.ZERO.add(Predicate.FlagB)
                                     ),
-                new Instruction.Set(dock, Predicate.FlagD,
+                new Instruction.Set(marina.getOnlyDock(), Predicate.FlagD,
                                     Instruction.Set.FlagFunction.ZERO.add(Predicate.FlagA),
                                     SET_FLAG
                                     ),
@@ -1944,7 +1819,7 @@ public class MarinaTest {
         model.waitNS(128 * CYCLE_TIME_NS);
 
         prln("send torpedo. This should clear the OLC");
-        marina.instrIn.fillTorpedo();
+        marina.southRing.fillTorpedo();
         model.waitNS(128 * CYCLE_TIME_NS);
 
         model.waitNS(128 * CYCLE_TIME_NS);
@@ -1956,15 +1831,15 @@ public class MarinaTest {
         model.waitNS(128 * CYCLE_TIME_NS);
 
         prln("Reload OLC after torpedo, clears D-flag");
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
 
         // FIXME: find another way to test this
         model.waitNS(128 * CYCLE_TIME_NS);
         expectOlc(63);
                 
         prln("Set A=1, B=1 This instruction should execute because OLC!=0");
-        marina.instrIn.fill(new 
-                            Instruction.Set(dock,Predicate.Default, SET_FLAG, SET_FLAG));
+        marina.southRing.fill(new 
+                            Instruction.Set(marina.getOnlyDock(),Predicate.Default, SET_FLAG, SET_FLAG));
 
         prln("A and B should be true");
         fatal(!marina.getFlagA(), "bad A flag: false");
@@ -1980,11 +1855,11 @@ public class MarinaTest {
 
         List<BitVector> dataItems;
 
-        marina.instrIn.fill(setIlc(1));
+        marina.southRing.fill(setIlc(1));
         for(boolean torpedoable : new boolean[] { true, false }) {
             
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Move(dock,
+                    new Instruction.Move(marina.getOnlyDock(),
                                          Predicate.IgnoreFlagD, // predicate   
                                          false,                 // torpedoable 
                                          null,                  // path        
@@ -1995,8 +1870,8 @@ public class MarinaTest {
                                          false,                 // dataOut     
                                          true                   // tokenOut    
                                          ),
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.Infinity),
-                    new Instruction.Move(dock,
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.Infinity),
+                    new Instruction.Move(marina.getOnlyDock(),
                                          Predicate.IgnoreFlagD, // predicate   
                                          torpedoable,           // torpedoable 
                                          null,                  // path        
@@ -2008,19 +1883,19 @@ public class MarinaTest {
                                          true                   // tokenOut    
                                          ),
                     // FIXME: this probably should be removed, unless Ivan doesn't want to change the behavior
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
 
                     SEND_DATA,
                 });
             
             // expect nothing to come out, because the NOP is executing
-            dataItems = marina.data.drainMany(2);
+            dataItems = marina.northRing.drainMany(2);
             fatal(dataItems.size()!=0, "Expected no data item(s) to emerge but got at least: "+dataItems.size()+" data items");
             
-            marina.instrIn.fillTorpedo();
+            marina.southRing.fillTorpedo();
             
             int expected = torpedoable?1:0;
-            dataItems = marina.data.drainMany(2);
+            dataItems = marina.northRing.drainMany(2);
             fatal(dataItems.size()!=expected, "Expected "+expected+" item to emerge but got: "+dataItems.size()+" data items");
 
             fatal(!marina.getILCDone(), "Expected ilc=done, but got "+marina.getILC());
@@ -2045,7 +1920,7 @@ public class MarinaTest {
 
         // changing the order of these lines should work, but it does not
         marina.northRing.fill();
-        marina.instrIn.fillTorpedo();
+        marina.southRing.fillTorpedo();
 
         expectTokensExactly(1);
     }
@@ -2097,8 +1972,8 @@ public class MarinaTest {
             prln("inserting set olc="+olc);
             prln("inserting set ilc=1");
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,olc),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,olc),
                 });
 
             // commenting the following four lines causes this test to pass
@@ -2108,12 +1983,12 @@ public class MarinaTest {
             Instruction[] instructions = new Instruction[decr_amount+1];
             for(int i=0; i<decr_amount; i++)
                 instructions[i] =
-                    new Instruction.Set(dock,
+                    new Instruction.Set(marina.getOnlyDock(),
                                         Predicate.Default,
                                         SetDest.OuterLoopCounter,
                                         SetSource.Decrement);
             instructions[instructions.length-1] =
-                new Instruction.Move(dock,
+                new Instruction.Move(marina.getOnlyDock(),
                                      Predicate.Default,     // predicate   
                                      false,                 // torpedoable 
                                      null,                  // path        
@@ -2129,7 +2004,7 @@ public class MarinaTest {
             model.waitNS(64 * CYCLE_TIME_NS);
 
             int expected = decr_amount>=olc ? 0 : 1;
-            dataItems = marina.data.drainMany(2);
+            dataItems = marina.northRing.drainMany(2);
             fatal(dataItems.size()!=expected, "Expected "+expected+" item to emerge but got: "+dataItems.size()+" data items");
             expectOlc(Math.max(0,olc-decr_amount));
 
@@ -2155,8 +2030,8 @@ public class MarinaTest {
 
             prln("Then immediately set ILC="+notZero);
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
                 });
                 
             model.waitNS(64 * CYCLE_TIME_NS);
@@ -2167,8 +2042,8 @@ public class MarinaTest {
             fatal(marina.getILCInfinity(), "bad ILC Infinity bit: true");
                    
             marina.southRing.fill(new Instruction[] {     
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
                 });
 
             model.waitNS(64 * CYCLE_TIME_NS);
@@ -2188,7 +2063,7 @@ public class MarinaTest {
         prln("Using the set OLC instruction, toggle a single bit between zero and one. \n" +
              "Check correct setting of the OLC zero bit");
 
-        marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG));
+        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG));
 
         for (int i=0; i<6; i++) {
             int notZero = 32 >> i;
@@ -2203,8 +2078,8 @@ public class MarinaTest {
             prln("Set OLC=0");
             prln("Then immediately set OLC="+notZero);
             marina.southRing.fill(new Instruction[] {
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
-                    new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
+                    new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
                 });
 
             model.waitNS(64 * CYCLE_TIME_NS);
@@ -2215,8 +2090,8 @@ public class MarinaTest {
                 prln("Set OLC="+notZero);
                 prln("Then immediately set OLC=0");
                 marina.southRing.fill(new Instruction[] {
-                        new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
-                        new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
+                        new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
+                        new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
                     });
                 
                 model.waitNS(64 * CYCLE_TIME_NS);
@@ -2243,13 +2118,13 @@ public class MarinaTest {
             BitVector data = new BitVector(MarinaPacket.WORD_WIDTH, "path");
             path.set(0, MarinaPacket.PATH_WIDTH, false);
             data.setFromLong(i+9);
-            marina.instrIn.fill(new MarinaPacket(data, false, path));
+            marina.southRing.fill(new MarinaPacket(data, false, path));
         }
         adjustIndent(-2);
 
         prln("Drain south ring and check contents");
         adjustIndent(2);
-        List<BitVector> out = marina.instrIn.drainMany();
+        List<BitVector> out = marina.southRing.drainMany();
         boolean bad = false;
         for (int i=0; i<AMOUNT; i++) {
             prln("extracting item " + (i+1) + " / " + AMOUNT);
@@ -2278,8 +2153,8 @@ public class MarinaTest {
         adjustIndent(2);
 
         for(int i=0; i<marina.TOKEN_FIFO_CAPACITY + 3; i++)
-            marina.instrIn.fill(SEND_TOKEN);
-        marina.instrIn.fill(SEND_DATA);
+            marina.southRing.fill(SEND_TOKEN);
+        marina.southRing.fill(SEND_DATA);
         expectNorthFifoExactly(0);
         
         adjustIndent(-2);
@@ -2465,7 +2340,7 @@ public class MarinaTest {
                     for(int j=0; j<12; j++)
                         root.getInBits().set(bitIndex+j, false);
                     root.getInBits().set(bitIndex+i, true);
-                    marina.shiftDuke(false, true);
+                    marina.dukeChain.shift(Marina.DUKE_CHAIN, false, true);
                     System.in.read();
                 }
                 break;
@@ -2486,18 +2361,18 @@ public class MarinaTest {
 
                 for(int xx=1; xx<65; xx++) {
                 marina.masterClear();
-                marina.data.sink();
+                marina.northRing.sink();
                 marina.stopAndResetCounters();
                     
                 marina.southRing.enableInstructionSend(true);
-                marina.southRing.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,
+                marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                                                   Instruction.Set.FlagFunction.ZERO
                                                                   .add(Predicate.FlagA).add(Predicate.NotFlagA),
                                                                   Instruction.Set.FlagFunction.ZERO));
                 //int xx = 63;      // 1.802ms
                 //int xx = 1;         // 0.207ms  =>  24.3ns for 62 counts => 390ps cycle time => 2.5Ghz
                 marina.southRing.fill(new Instruction[] {
-                        new Instruction.Head(dock),
+                        new Instruction.Head(marina.getOnlyDock()),
                         setOlc(xx),
                         FLAG_NOP,
                         FLAG_NOP,
@@ -2505,12 +2380,12 @@ public class MarinaTest {
                         FLAG_NOP,
                         FLAG_NOP,
                         SEND_DATA,
-                        new Instruction.Tail(dock),
+                        new Instruction.Tail(marina.getOnlyDock()),
                     }, false, false);
 
                 marina.southRing.fill(new Instruction[] {
                         /*
-                          new Instruction.Set(dock,Predicate.FlagD,
+                          new Instruction.Set(marina.getOnlyDock(),Predicate.FlagD,
                           Instruction.Set.FlagFunction.ZERO.add(Predicate.NotFlagA),
                           Instruction.Set.FlagFunction.ZERO),
                           setOlcIfZero(32),
@@ -2536,13 +2411,13 @@ public class MarinaTest {
 
                 //marina.startCounters(false, false);
                     
-                marina.instrIn.run();
+                marina.southRing.run();
 
                 vdd10.setVoltageWait(vdd);
                 marina.startCounters(false, true);
 
                 try { Thread.sleep(wait); } catch (Exception e) { }
-                //marina.instrIn.stop();
+                //marina.southRing.stop();
                     
                 marina.stopAndResetCounters();
                 int countNorth = marina.getNorthCount();
@@ -2573,19 +2448,19 @@ public class MarinaTest {
                         for(int iter = 0; iter < MAX_ITER; iter++) {
 
                             marina.masterClear();
-                            marina.data.sink();
+                            marina.northRing.sink();
                             marina.stopAndResetCounters();
                                 
                             marina.southRing.enableInstructionSend(true);
                             marina.southRing.fill(setOlc(1));
-                            marina.southRing.fill(new Instruction.Head(dock));
+                            marina.southRing.fill(new Instruction.Head(marina.getOnlyDock()));
                             for(int i=0; i<toks; i++)
                                 marina.southRing.fill(/*SEND_DATA*/NOP);
                             marina.southRing.fill(new Instruction[] {
-                                    new Instruction.Tail(dock),
+                                    new Instruction.Tail(marina.getOnlyDock()),
                                 }, false, true);
                                 
-                            marina.instrIn.run();
+                            marina.southRing.run();
 
                             // have to set the voltage while drawing current
                             vdd10.setVoltageWait(vdd);
@@ -2593,7 +2468,7 @@ public class MarinaTest {
                             marina.startCounters();
                             try { Thread.sleep(wait); } catch (Exception e) { }
                             marina.stopAndResetCounters();
-                            //marina.instrIn.stop();
+                            //marina.southRing.stop();
 
                             int countNorth = marina.getNorthCount();
                             int countSouth = marina.getSouthCount();
@@ -2645,15 +2520,15 @@ public class MarinaTest {
                     for(int iter = 0; iter < MAX_ITER; iter++) {
                             
                         marina.masterClear();
-                        marina.data.sink();
+                        marina.northRing.sink();
                         marina.stopAndResetCounters();
                             
                         marina.southRing.enableInstructionSend(true);
                         marina.southRing.fill(setOlc(1));
-                        marina.southRing.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,
+                        marina.southRing.fill(new Instruction.Set(marina.getOnlyDock(),Predicate.IgnoreFlagD,
                                                                           Instruction.Set.FlagFunction.ZERO,
                                                                           Instruction.Set.FlagFunction.ZERO));
-                        marina.southRing.fill(new Instruction.Head(dock));
+                        marina.southRing.fill(new Instruction.Head(marina.getOnlyDock()));
                         //marina.southRing.fill(setIlc(31));
                         marina.southRing.fill(SEND_DATA);
                         for(int i=0; i<toks+1; i++) {
@@ -2661,11 +2536,11 @@ public class MarinaTest {
                             marina.southRing.fill(FLAG_NOP);
                         }
                         marina.southRing.fill(new Instruction[] {
-                                new Instruction.Tail(dock),
+                                new Instruction.Tail(marina.getOnlyDock()),
                             }, false, true);
                         marina.startCounters();
                             
-                        marina.instrIn.run();
+                        marina.southRing.run();
                         try { Thread.sleep(wait); } catch (Exception e) { }
                             
                         marina.stopAndResetCounters();
@@ -2696,23 +2571,74 @@ public class MarinaTest {
                 fatal(true, "Test number: "+testNum+" doesn't exist.");
                 break;
         }
-        // If we get here then test passed
         prln("Test Result: Passed");
         printTestTime();
-        //Infrastructure.exit(0);
     }
 
-
-    //============================ for public use =============================
-
-    /** Exit codes:
-     * 0: test detected success
-     * 2: test detected failure
-     * 1: test crashed
-     */ 
     public static void main(String[] args) throws Exception {
         startTime = System.currentTimeMillis();
-        new MarinaTest(args);
+        cmdArgs = new CmdArgs(args);
+        reportTask(cmdArgs);
+        Infrastructure.gpibControllers = new int[]{1};
+        vdds  = new Pst3202Channel("ch1", "tiPST3202", 1);
+        vdd18 = new Pst3202Channel("ch3", "tiPST3202", 3);
+        vdd10 = new PowerChannelResistorVoltageReadable(new Pst3202Channel("ch2", "tiPST3202", 2),
+                                                        1000, 
+                                                        new HP34401A("HP34970"),
+                                                        true);
+        if (vdd10!=null) setVdd10(vdd);
+        if (vdd18!=null) vdd18.setVoltageNoWait(1.8f);
+
+        model = cmdArgs.useVerilog
+            ? new VerilogModel()
+            : cmdArgs.useHsim
+            ? new HsimModel()
+            : cmdArgs.silicon
+            ? new SiliconChip()
+            : new NanosimModel();
+            
+        if (model instanceof SimulationModel)
+            ((SimulationModel)model).setOptimizedDirectReadsWrites(true);
+
+        CYCLE_TIME_NS = cmdArgs.useVerilog ? (100*20) : 0.250;
+        int khz   =
+            model instanceof VerilogModel
+            ? 100000
+            : cmdArgs.jtagShift
+            ? 20000
+            : model instanceof ChipModel
+            ? 1000
+            : 1000000;
+
+        System.err.println("constructing jtag controller");
+        JtagTester tester =
+            model instanceof SimulationModel
+            ? ((SimulationModel)model).createJtagTester("TCK", "TMS", "TRSTb", "TDI", "TDO")
+            : new Netscan("jtag2");
+        //: new Netscan("10.0.0.200");
+        //: new Signalyzer();
+        //: new Netscan("jtag2");
+        JtagLogicLevel mc0=null;
+        JtagLogicLevel mc1=null;
+        if (tester instanceof NetscanGeneric) {
+            ((NetscanGeneric)tester).reset();
+            // master clear
+            // not sure if "GPIO1" means "index 0" or not
+            mc0 = new JtagLogicLevel(tester, 0);
+            mc1 = new JtagLogicLevel(tester, 1);
+            mc1 = mc0;
+            mc0.setLogicState(true);
+            mc1.setLogicState(true);
+        }
+        tester.printInfo = false;
+        PowerChannel pc = new ManualPowerChannel("pc", false);
+        cc = new ChainControl(SCAN_CHAIN_XML, tester, 1.8f, khz);
+        cc.noTestSeverity = Infrastructure.SEVERITY_NOMESSAGE;
+        ct = new ChainTest(cc, pc);
+        marina = new Marina(cc, cc, cc, cc, model, !cmdArgs.jtagShift, indenter);
+        marina.mc0=mc0;
+        marina.mc1=mc1;
+        new MarinaTest(marina);
     }
 
 }
index 3f47881..f9c378d 100644 (file)
@@ -254,16 +254,6 @@ public class ProperStopper {
         this.reportChain = reportChain;
     }
 
-    /** Reset ProperStopper after the JTAG TRST has been pulsed */
-    public void resetAfterMasterClear() {
-        BitVector we = new BitVector(2, "write enable");
-        BitVector packet = new BitVector(MarinaPacket.PACKET_WIDTH, "packet");
-        we.setFromLong(0);
-        packet.setFromLong(0);
-        BitVector wdta = we.cat(packet);
-        dataChain.setInBits(dataPath, wdta);
-    }
-    
     /** Insert one item into the fill stage.
      * Fill stage must be empty. 
      * You must stop stopper before calling fill.