add test 1, testProperStoppers(), as well as commented-out code to spawn the ChainG gui
authorAdam Megacz <adam.megacz@sun.com>
Fri, 6 Mar 2009 03:00:42 +0000 (03:00 +0000)
committerAdam Megacz <adam.megacz@sun.com>
Fri, 6 Mar 2009 03:00:42 +0000 (03:00 +0000)
testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java

index 87b70bd..b7d0e6e 100644 (file)
@@ -5,6 +5,7 @@ import java.util.List;
 
 import com.sun.async.test.BitVector;
 import com.sun.async.test.ChainControl;
+import com.sun.async.test.ChainG;
 import com.sun.async.test.ChainTest;
 import com.sun.async.test.ChipModel;
 import com.sun.async.test.HP34401A;
@@ -252,6 +253,11 @@ public class MarinaTest {
         ccs.addChain(Marina.CONTROL_CHAIN, ccC);
                
         marina = new Marina(ccs, model, !cmdArgs.jtagShift, indenter);
+
+        //System.out.println("launching");
+        //ChainG.createAndShowGUI(marina.cc.getChainControlFromPath(Marina.REPORT_CHAIN));
+        //System.out.println("  launched.");
+
         doOneTest(cmdArgs.testNum);
         
         ((SimulationModel)model).finish();
@@ -421,6 +427,26 @@ public class MarinaTest {
 
     //=========================================================================
     // Put top level tests here
+
+    private void testProperStoppers(Marina marina) {
+        prln("Begin testProperStoppers");
+       adjustIndent(2);
+
+        for(ProperStopper ps : new ProperStopper[] { marina.data, marina.instrIn }) {
+            prln("testing " + (ps == marina.data ? "data" : "instruction") + " stopper");
+            adjustIndent(2);
+            prln("getting status");
+            fatal( !ps.getStopped(), "stopper should have been stopped, but was not");
+            prln("un-stopping stopper");
+            ps.run();
+            prln("getting status");
+            fatal( ps.getStopped(), "stopper should not have been stopped, but was");
+            adjustIndent(-2);
+        }
+
+       adjustIndent(-2);
+    }
+
     private void sendInstructions(Marina marina) {
        prln("Begin sendInstructions");
        adjustIndent(2);
@@ -1981,6 +2007,7 @@ public class MarinaTest {
         marina.enableInstructionSend(true);
         
                switch (testNum) {
+               case 1:                 testProperStoppers(marina);             break;
                case 2:                 sendInstructions(marina);               break;
                case 3:                 sendToken(marina);                              break;
                case 4:                 getCtrsFlags(marina);                   break;