prln("End sendData");
}
+ private void sendDataIlcInfinite(Marina marina) {
+ prln("Begin sendDataIlcInfinite");
+ adjustIndent(2);
+
+ prln("ILC=\\infty");
+ marina.instrIn.fill(
+ new Instruction.Set(DOCK,false,Predicate.IgnoreOLC,SetDest.InnerLoopCounter,SetSource.Infinity));
+
+ getCtrsFlags(marina);
+
+ prln("send data");
+ marina.instrIn.fill(SEND_DATA);
+
+ getCtrsFlags(marina);
+
+ // more than MAX_ILC
+ int howmany = 70;
+ List<BitVector> dataItems = marina.data.drainMany(howmany);
+ fatal(dataItems.size()!=howmany,
+ "Expected an unending supply of data items to emerge but only got got: "+dataItems.size());
+
+ adjustIndent(-2);
+ prln("End sendDataIlcInfinite");
+ }
+
private void setOLC(Marina marina, int olc) {
// ugly hack, to be removed when we fix the zero-detect circuit
for(int i=0; i<2; i++) {
prln("End testFlagAB");
}
+ /**
+ * WARNING: this is a very, very, very long test case -- it goes
+ * through 216 iterations.
+ */
+ private void testFlagTruthTable(Marina marina) {
+ /*
+ prln("Begin testFlagTruthTable");
+ adjustIndent(2);
+
+ Instruction.Set.FlagFunction zero = Instruction.Set.FlagFunction.ZERO;
+ Instruction.Set.FlagFunction one = zero;
+
+ for(Predicate a_input : new Predicate[] { null, Predicate.FlagA, Predicate.NotFlagA })
+ for(Predicate b_input : new Predicate[] { null, Predicate.FlagB, Predicate.NotFlagB })
+ for(Predicate c_input : new Predicate[] { null, Predicate.FlagC, Predicate.NotFlagC })
+ for(boolean a_state : new boolean[] { false, true })
+ for(boolean b_state : new boolean[] { false, true })
+ for(boolean c_state : new boolean[] { false, true }) {
+
+ // set A,B flags to a_state and b_state
+ marina.instrIn.fill(new
+ Instruction.Set(DOCK,false,Predicate.IgnoreOLC,
+ a_state ? one : zero,
+ b_state ? one : zero
+ ));
+
+ // set C flag to c_state
+ // FIXME: implement this once we get the c-flag working
+ if (c_state) continue;
+
+ marina.instrIn.fill(new
+ Instruction.Set(DOCK,false,Predicate.IgnoreOLC,
+ ,
+ b_state
+ ));
+
+
+
+ }
+
+ // we should be able to use any pair of FlagX+NotFlagX,
+ // but we toss them all in to maximize the chances of the
+ // test passing (later we will try the individual
+ // combinations to maximize the chances of failure).
+ one = one.add(Predicate.FlagA);
+ one = one.add(Predicate.NotFlagA);
+ one = one.add(Predicate.FlagB);
+ one = one.add(Predicate.NotFlagB);
+ one = one.add(Predicate.FlagC);
+ one = one.add(Predicate.NotFlagC);
+
+ // 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((b?"Setting":"Clearing")+" flags");
+
+ fatal(marina.getFlagA()!=b, "after "+(b?"setting":"clearing")+" FlagA, it was still "+(b?"clear":"set"));
+ fatal(marina.getFlagB()!=b, "after "+(b?"setting":"clearing")+" FlagB, it was still "+(b?"clear":"set"));
+ }
+
+ adjustIndent(-2);
+ prln("End testFlagTruthTable");
+ */
+ }
+
private void recvData(Marina marina) {
prln("Begin recvData");
adjustIndent(2);
Instruction.Set.SetDest.DataLatch,
val));
- BitVector bv = marina.getDRegister();
+ prln("sending data item");
+ marina.instrIn.fill(SEND_DATA);
+
+ List<BitVector> dataItems = marina.data.drainMany(3);
+ fatal(dataItems.size()!=1, "expected exactly one data item, got " + dataItems.size());
+
+ BitVector bv = dataItems.get(0);
prln("got back " + bv);
boolean mismatch = false;
for(int i=0; i<19; i++)
dreg.set(36-i, immediate.get(i));
- BitVector bv = marina.getDRegister();
+ prln("sending data item");
+ marina.instrIn.fill(SEND_DATA);
+
+ List<BitVector> dataItems = marina.data.drainMany(3);
+ fatal(dataItems.size()!=1, "expected exactly one data item, got " + dataItems.size());
+
+ BitVector bv = dataItems.get(0);
prln("got back " + bv);
boolean mismatch = false;
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
- // FIXME: temporary modification to make
- // troublshooting easier; this will be removed
- //for(int i=0; i<addr.getNumBits(); i++) addr.set(i, c_flag);
-
- int whichbit = dc ? 13 : 0;
+ int whichbit = dc ? 0 : 13;
prln("setting addr["+whichbit+"] to "+(c_flag?"1":"0"));
addr.set(whichbit, c_flag);
null, /* path */
false, /* tokenIn */
true, /* dataIn */
- !dc, /* latchData */
+ dc, /* latchData */
false, /* latchPath */
false, /* dataOut */
false /* tokenOut */
case 3013: testSignExtendedLiteral(marina); break;
case 3014: testShiftedLiteral(marina); break;
case 3015: testSendAndRecvToken(marina); break;
+ case 3016: sendDataIlcInfinite(marina); break;
default:
fatal(true, "Test number: "+testNum+" doesn't exist.");