private void walkOneOLC(Marina marina) {
prln("Begin walkOneOLC");
adjustIndent(2);
- for (int i=5; i>=0; i--) {
- int inOlc = 1<<i;
+ for (int i=-1; i<=5; i++) {
+
+ if (marina.kesselsCounter) {
+ // master clear on each iteration; otherwise we'd need to "run down" the olc
+ marina.masterClear();
+ marina.enableInstructionSend(true);
+ }
+
+ int inOlc = i==-1 ? 0 : (1<<i);
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, inOlc));
+
+ model.waitNS(128 * CYCLE_TIME_NS);
+
int outOlc = marina.getOLC();
+
fatal(outOlc!=inOlc, "walkOneOLC: got="+outOlc+" expected="+inOlc);
prln("walkOneOLC: "+inOlc+" checks out");
}
marina.fillSouthProperStopper(new Instruction[] {
RECV_DATA,
- new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch)
+ new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch),
+ // FIXME: try a load literal right here to be evil
});
model.waitNS(CYCLE_TIME_NS * 64);
int olc = marina.getOLC();
fatal(olc != (1<<bit), "expected olc to be " + (1<<bit) + ", but got " + olc);
+
+ if (marina.kesselsCounter) {
+ // master clear on each iteration; otherwise we'd need to "run down" the olc
+ marina.masterClear();
+ marina.enableInstructionSend(true);
+ }
}
adjustIndent(-2);
marina.instrIn.fill(setOlc(63));
int olc;
+ model.waitNS(128 * CYCLE_TIME_NS);
olc = marina.getOLC();
- fatal(olc!=63, "bad OLC: "+olc+" expected: 1");
+ fatal(olc!=63, "bad OLC: "+olc+" expected: 63");
marina.instrIn.fill(new
Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG));
prln("execute a move instruction that does nothing but loops until torpedo arrives");
prln("A=1, B=B This instruction should not execute because D-flag is set");
prln("Set A=A, B=1 This instruction should execute because D-flag is set");
+
+ model.waitNS(128 * CYCLE_TIME_NS);
+ prln("infoz: olc="+marina.getOLC());
+
marina.fillSouthProperStopper(new Instruction[] {
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity),
new Instruction.Move(dock,
),
});
+ model.waitNS(128 * CYCLE_TIME_NS);
+ prln("infoz: olc="+marina.getOLC());
+
prln("send torpedo. This should clear the OLC");
marina.instrIn.fillTorpedo();
model.waitNS(128 * CYCLE_TIME_NS);
+
+ model.waitNS(128 * CYCLE_TIME_NS);
+ prln("infoz: olc="+marina.getOLC());
prln("A should remain false, B should be true");
fatal(marina.getFlagA(), "bad A flag: true");
fatal(!marina.getFlagB(), "bad B flag: false");
- prln("OLC = 63. Reload OLC after torpedo, clears D-flag");
- marina.instrIn.fill(new
- Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
+ model.waitNS(128 * CYCLE_TIME_NS);
+ prln("infoz: olc="+marina.getOLC());
+
+ prln("Reload OLC after torpedo, clears D-flag");
+ marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
// FIXME: find another way to test this
+ model.waitNS(128 * CYCLE_TIME_NS);
olc = marina.getOLC();
fatal(olc!=63, "bad OLC: "+olc+" expected: 63");
int expected = decr_amount>=olc ? 0 : 1;
dataItems = marina.data.drainMany(2);
fatal(dataItems.size()!=expected, "Expected "+expected+" item to emerge but got: "+dataItems.size()+" data items");
- for(int i=0; i<Math.max(0, olc-decr_amount); i++)
- marina.instrIn.fill(new Instruction.Set(dock,
- Predicate.Default,
- SetDest.OuterLoopCounter,
- SetSource.Decrement));
+
+ if (marina.kesselsCounter) {
+ // master clear on each iteration; otherwise we'd need to "run down" the olc
+ marina.masterClear();
+ marina.enableInstructionSend(true);
+ }
}
adjustIndent(-2);
for (int i=0; i<6; i++) {
int notZero = 32 >> i;
+
+ if (marina.kesselsCounter) {
+ // master clear on each iteration; otherwise we'd need to "run down" the olc
+ marina.masterClear();
+ marina.enableInstructionSend(true);
+ }
+
+ int outOlc;
prln("Set OLC=0");
prln("Then immediately set OLC="+notZero);
marina.fillSouthProperStopper(new Instruction[] {
model.waitNS(64 * CYCLE_TIME_NS);
prln("Verify OLC count using scan chain");
- int outOlc = marina.getOLC();
+ outOlc = marina.getOLC();
fatal(outOlc!=notZero, "bad OLC count: "+outOlc+" expected: "+notZero);
- prln("Set OLC="+notZero);
- prln("Then immediately set OLC=0");
- marina.fillSouthProperStopper(new Instruction[] {
- new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
- new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
- });
-
- model.waitNS(64 * CYCLE_TIME_NS);
- prln("Verify OLC count using scan chain");
- outOlc = marina.getOLC();
- fatal(outOlc!=0, "bad OLC count: "+outOlc+" expected: 0");
+ if (!marina.kesselsCounter) {
+ prln("Set OLC="+notZero);
+ prln("Then immediately set OLC=0");
+ marina.fillSouthProperStopper(new Instruction[] {
+ new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
+ new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
+ });
+
+ model.waitNS(64 * CYCLE_TIME_NS);
+ prln("Verify OLC count using scan chain");
+ outOlc = marina.getOLC();
+ fatal(outOlc!=0, "bad OLC count: "+outOlc+" expected: 0");
+ }
}
adjustIndent(-2);
case 0: {
// these tests run fairly quickly
+
doOneTest(1); // passes extracted parasitics
doOneTest(2); // passes extracted parasitics
doOneTest(3); // passes extracted parasitics
doOneTest(3006); // passes extracted parasitics
doOneTest(3007); // passes extracted parasitics
doOneTest(3008); // passes extracted parasitics
- doOneTest(3009); // fails extracted parasitics
+ doOneTest(3009); // passes extracted parasitics
doOneTest(3010); // passes extracted parasitics
doOneTest(3011); // passes extracted parasitics
doOneTest(3012); // passes extracted parasitics
doOneTest(3013); // passes extracted parasitics
doOneTest(3014); // passes extracted parasitics
- doOneTest(3015); // fails extracted parasitics
- doOneTest(3019); // fails extracted parasitics
+ doOneTest(3015); // passes extracted parasitics
+ doOneTest(3019); // passes extracted parasitics
doOneTest(3020); // passes extracted parasitics
doOneTest(3022); // passes extracted parasitics
doOneTest(3023); // passes extracted parasitics
doOneTest(3027); // passes extracted parasitics
doOneTest(3028); // passes extracted parasitics
- // these tests take a while and usually pass
+ // these tests take a while and usually pass
doOneTest(1002);
doOneTest(1004);
doOneTest(1005);
printTestTime();
//Infrastructure.exit(0);
} catch (MarinaUtils.FailureException fe) {
+ System.out.println("******************************************************************************");
+ System.out.println("******************************************************************************");
+ System.out.println("******************************************************************************");
+ System.out.println("******************************************************************************");
fe.printStackTrace();
}
}