X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fedu%2Fberkeley%2Ffleet%2Fmarina%2FMarinaTest.java;fp=src%2Fedu%2Fberkeley%2Ffleet%2Fmarina%2FMarinaTest.java;h=ae4c569ef003ae36927871cd399b6d6bbf9ab068;hb=bd813b43b873780101ce956001d5f809a655025d;hp=1d279aa92c0e80a41a54cc82edd16723d7136b1a;hpb=aee85d3dd0435554e14e03b97f268752843a441f;p=fleet.git diff --git a/src/edu/berkeley/fleet/marina/MarinaTest.java b/src/edu/berkeley/fleet/marina/MarinaTest.java index 1d279aa..ae4c569 100644 --- a/src/edu/berkeley/fleet/marina/MarinaTest.java +++ b/src/edu/berkeley/fleet/marina/MarinaTest.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import com.sun.electric.tool.simulation.test.*; -import edu.berkeley.fleet.marina.Marina.Ilc; import edu.berkeley.fleet.marina.CmdArgs; import edu.berkeley.fleet.marina.CmdArgs.Mode; @@ -563,7 +562,7 @@ public class MarinaTest { prln("Begin sendDataIlcInfinite"); adjustIndent(2); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.Infinity), SEND_DATA, }); @@ -606,7 +605,7 @@ public class MarinaTest { "predicate olc"+(predicate_olc_nonzero?"!=0":"==0")); adjustIndent(2); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { setOlc(olc), new Instruction.Move(dock, predicate_olc_nonzero // predicate @@ -706,10 +705,9 @@ public class MarinaTest { adjustIndent(2); showOlc(); - Ilc ilc = marina.getILC(); - prln("ILC.done=="+ilc.getDone()+ - " ILC.infinity=="+ilc.getInfinity()+ - " ILC.count=="+ilc.getCount()); + prln("ILC.done=="+marina.getILCDone()+ + " ILC.infinity=="+marina.getILCInfinity()+ + " ILC.count=="+marina.getILC()); prln("flagA=="+marina.getFlagA()); prln("flagB=="+marina.getFlagB()); adjustIndent(-2); @@ -718,10 +716,10 @@ public class MarinaTest { private void walkOneOLC(Marina marina) { prln("Begin walkOneOLC"); - adjustIndent(2); /* + adjustIndent(2); //for (int i=-1; i<6; i++) { - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { new Instruction.Head(dock), @@ -739,7 +737,7 @@ public class MarinaTest { new Instruction.Tail(dock), }); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { null, }, true); @@ -761,7 +759,7 @@ public class MarinaTest { System.out.println("master-clearing..."); // master clear on each iteration; otherwise we'd need to "run down" the olc marina.masterClear(); - marina.enableInstructionSend(true); + marina.southRing.enableInstructionSend(true); } expectTokensExactly(0); @@ -792,15 +790,13 @@ public class MarinaTest { int inIlc = 1 << i; prln("inIlc="+inIlc); marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, inIlc)); - Ilc ilc = marina.getILC(); - int outIlc = ilc.getCount(); + int outIlc = marina.getILC(); fatal(outIlc!=inIlc, "bad ILC count: "+outIlc+" expected: "+inIlc); - fatal(ilc.getInfinity(), "bad Infinity bit: true"); + 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)); - Ilc ilc = marina.getILC(); - fatal(!ilc.getInfinity(), "bad Infinity bit: false"); + fatal(!marina.getILCInfinity(), "bad Infinity bit: false"); adjustIndent(-2); prln("End walkOneILC"); } @@ -812,7 +808,7 @@ public class MarinaTest { marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, maxIlc)); - int ilc = marina.getILC().getCount(); + 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"); @@ -834,7 +830,7 @@ public class MarinaTest { //model.waitNS(10000); prln("Check that ILC==0"); - ilc = marina.getILC().getCount(); + ilc = marina.getILC(); fatal(ilc!=0, "bad ILC count: "+ilc+" expected: "+0); adjustIndent(-2); @@ -868,11 +864,11 @@ public class MarinaTest { System.out.println("master-clearing..."); // master clear on each iteration; otherwise we'd need to "run down" the olc marina.masterClear(); - marina.enableInstructionSend(true); + marina.southRing.enableInstructionSend(true); } int inOlc = i; - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { setIlc(1), @@ -889,7 +885,7 @@ public class MarinaTest { }); model.waitNS(128 * CYCLE_TIME_NS); - marina.fillNorthProperStopper(); + marina.northRing.fill(); model.waitNS(128 * CYCLE_TIME_NS); expectOlc(inOlc); @@ -1115,40 +1111,40 @@ public class MarinaTest { private void testFlagDRecomputationTime(Marina marina) { marina.instrIn.fill(setIlc(1)); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { RECV_DATA, new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,0), SEND_DATA_IF_D_NOT_SET }); - marina.fillNorthProperStopper(); + marina.northRing.fill(); expectNorthFifoNoMoreThan(0); - marina.fillSouthProperStopper(new Instruction[] { + 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), SEND_DATA_IF_D_NOT_SET }); - marina.fillNorthProperStopper(); + marina.northRing.fill(); expectNorthFifoNoMoreThan(0); - marina.fillSouthProperStopper(new Instruction[] { + 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), SEND_DATA_IF_D_NOT_SET }); - marina.fillNorthProperStopper(); + marina.northRing.fill(); expectNorthFifoExactly(1); marina.instrIn.fill(DEC); - marina.fillSouthProperStopper(new Instruction[] { + 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), SEND_DATA_IF_D_NOT_SET }); - marina.fillNorthProperStopper(); + marina.northRing.fill(); expectNorthFifoExactly(1); } @@ -1156,8 +1152,8 @@ public class MarinaTest { marina.instrIn.fill(setIlc(1)); marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63)); - marina.enableInstructionSend(false); - marina.enableInstructionRecirculate(true); + marina.southRing.enableInstructionSend(false); + marina.southRing.enableInstructionRecirculate(true); marina.instrIn.fill(TORPEDOABLE_RECV_DATA); marina.instrIn.fill(new Instruction.Head(dock)); @@ -1168,13 +1164,13 @@ public class MarinaTest { marina.instrIn.fill(new Instruction.Tail(dock)); marina.instrIn.fillTorpedo(); - marina.enableInstructionRecirculate(false); - marina.enableInstructionSend(true); + marina.southRing.enableInstructionRecirculate(false); + marina.southRing.enableInstructionSend(true); marina.instrIn.run(); expectNorthFifoNoMoreThan(0); prln("inserting into north proper stopper"); - marina.fillNorthProperStopper(); + marina.northRing.fill(); expectNorthFifoExactly(1); int nbToks = marina.getNumTokens(); fatal(nbToks!=1, "Expected one token to emerge but got: "+nbToks+" tokens"); @@ -1204,7 +1200,7 @@ public class MarinaTest { private void testTailWithoutHead(Marina marina) { marina.instrIn.fill(setIlc(1)); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63), new Instruction.Tail(dock), SEND_DATA, @@ -1220,7 +1216,7 @@ public class MarinaTest { adjustIndent(2); marina.instrIn.fill(setIlc(1)); - marina.fillSouthProperStopper(new Instruction[] { + 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), @@ -1237,7 +1233,7 @@ public class MarinaTest { private void testNonTorpedoableMoveDoesNotResetDFlag(Marina marina) { marina.instrIn.fill(setIlc(1)); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,63), new Instruction.Move(dock, Predicate.IgnoreFlagD, // predicate @@ -1264,7 +1260,7 @@ public class MarinaTest { }); marina.instrIn.fillTorpedo(); expectNorthFifoExactly(1); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { new Instruction.Move(dock, Predicate.Default, // predicate false, // torpedoable @@ -1283,7 +1279,7 @@ public class MarinaTest { private void testAbort(Marina marina) { marina.instrIn.fill(setIlc(1)); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.DataLatch,1), new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,2), SEND_DATA_IF_D_NOT_SET, @@ -1321,7 +1317,7 @@ public class MarinaTest { private void testAbortOutsideOfLoop(Marina marina) { marina.instrIn.fill(setIlc(1)); - marina.fillSouthProperStopper(new Instruction[] { + 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), SEND_DATA, @@ -1360,13 +1356,13 @@ public class MarinaTest { b ? one : zero ); if (fast) { - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { RECV_DATA, inst, NOP, }); model.waitNS(64 * CYCLE_TIME_NS); - marina.fillNorthProperStopper(); + marina.northRing.fill(); } else { marina.instrIn.fill(inst); } @@ -1416,7 +1412,7 @@ public class MarinaTest { for(int i=0; i=olc ? 0 : 1; @@ -2140,7 +2136,7 @@ public class MarinaTest { if (marina.kesselsCounter) { // master clear on each iteration; otherwise we'd need to "run down" the olc marina.masterClear(); - marina.enableInstructionSend(true); + marina.southRing.enableInstructionSend(true); } } @@ -2158,7 +2154,7 @@ public class MarinaTest { int notZero = 1< 24.3ns for 62 counts => 390ps cycle time => 2.5Ghz - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { new Instruction.Head(dock), setOlc(xx), FLAG_NOP, @@ -2513,7 +2508,7 @@ public class MarinaTest { new Instruction.Tail(dock), }, false, false); - marina.fillSouthProperStopper(new Instruction[] { + marina.southRing.fill(new Instruction[] { /* new Instruction.Set(dock,Predicate.FlagD, Instruction.Set.FlagFunction.ZERO.add(Predicate.NotFlagA), @@ -2581,12 +2576,12 @@ public class MarinaTest { marina.data.sink(); marina.stopAndResetCounters(); - marina.enableInstructionSend(true); - marina.fillSouthProperStopper(setOlc(1)); - marina.fillSouthProperStopper(new Instruction.Head(dock)); + marina.southRing.enableInstructionSend(true); + marina.southRing.fill(setOlc(1)); + marina.southRing.fill(new Instruction.Head(dock)); for(int i=0; i