new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.Infinity),
SEND_DATA,
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.Infinity),
SEND_DATA,
});
setOlc(olc),
new Instruction.Move(dock,
predicate_olc_nonzero // predicate
setOlc(olc),
new Instruction.Move(dock,
predicate_olc_nonzero // predicate
- 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());
System.out.println("master-clearing...");
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
System.out.println("master-clearing...");
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
int inIlc = 1 << i;
prln("inIlc="+inIlc);
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, inIlc));
int inIlc = 1 << i;
prln("inIlc="+inIlc);
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, inIlc));
}
prln("Now test the infinity bit");
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity));
}
prln("Now test the infinity bit");
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity));
marina.instrIn.fill(new
Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, maxIlc));
marina.instrIn.fill(new
Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, maxIlc));
fatal(ilc!=maxIlc, "bad ILC count: "+ilc+" expected: "+maxIlc);
prln("execute a move instruction that does nothing except decrement the ILC to zero");
fatal(ilc!=maxIlc, "bad ILC count: "+ilc+" expected: "+maxIlc);
prln("execute a move instruction that does nothing except decrement the ILC to zero");
System.out.println("master-clearing...");
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
System.out.println("master-clearing...");
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
RECV_DATA,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,0),
SEND_DATA_IF_D_NOT_SET
});
RECV_DATA,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,0),
SEND_DATA_IF_D_NOT_SET
});
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
});
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
});
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
});
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
});
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
});
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.instrIn.fill(setIlc(1));
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
marina.instrIn.fill(setIlc(1));
marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63));
expectNorthFifoExactly(1);
int nbToks = marina.getNumTokens();
fatal(nbToks!=1, "Expected one token to emerge but got: "+nbToks+" tokens");
expectNorthFifoExactly(1);
int nbToks = marina.getNumTokens();
fatal(nbToks!=1, "Expected one token to emerge but got: "+nbToks+" tokens");
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63),
new Instruction.Tail(dock),
SEND_DATA,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63),
new Instruction.Tail(dock),
SEND_DATA,
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(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 63),
new Instruction.Head(dock),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
private void testNonTorpedoableMoveDoesNotResetDFlag(Marina marina) {
marina.instrIn.fill(setIlc(1));
private void testNonTorpedoableMoveDoesNotResetDFlag(Marina marina) {
marina.instrIn.fill(setIlc(1));
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,63),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,63),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
new Instruction.Move(dock,
Predicate.Default, // predicate
false, // torpedoable
new Instruction.Move(dock,
Predicate.Default, // predicate
false, // torpedoable
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.DataLatch,1),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,2),
SEND_DATA_IF_D_NOT_SET,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.DataLatch,1),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,2),
SEND_DATA_IF_D_NOT_SET,
// ensure that an abort doesn't cause problems if no loop is in progress
new Instruction.Abort(dock, Predicate.IgnoreFlagD),
SEND_DATA,
// ensure that an abort doesn't cause problems if no loop is in progress
new Instruction.Abort(dock, Predicate.IgnoreFlagD),
SEND_DATA,
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
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);
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
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);
new Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
new Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
BitVector addr = new BitVector(14, "empty");
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
BitVector addr = new BitVector(14, "empty");
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
for(int i=0; i<addr.getNumBits(); i++) addr.set(i, 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);
data.set(bit, true);
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
data.set(bit, true);
RECV_DATA,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.DataLatch,-1),
RECV_DATA,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,SetSource.DataLatch),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.DataLatch,-1),
if (marina.kesselsCounter) {
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
if (marina.kesselsCounter) {
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
data.set(bit, true);
for(int i=0; i<data.getNumBits(); i++) data.set(i, false);
for(int i=0; i<addr.getNumBits(); i++) addr.set(i, false);
data.set(bit, true);
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
RECV_DATA,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.DataLatch),
});
model.waitNS(CYCLE_TIME_NS * 64);
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
RECV_DATA,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.DataLatch),
});
model.waitNS(CYCLE_TIME_NS * 64);
marina.instrIn.fill(setIlc(1));
for(long val : new long[] { (-1L << 14), -1, 0, 1 }) {
marina.instrIn.fill(setIlc(1));
for(long val : new long[] { (-1L << 14), -1, 0, 1 }) {
new Instruction.Set(dock,Predicate.IgnoreFlagD,
Instruction.Set.SetDest.DataLatch,
val),
new Instruction.Set(dock,Predicate.IgnoreFlagD,
Instruction.Set.SetDest.DataLatch,
val),
new Instruction.Shift(dock,Predicate.IgnoreFlagD,immediate),
SEND_DATA,
});
new Instruction.Shift(dock,Predicate.IgnoreFlagD,immediate),
SEND_DATA,
});
addr.set(whichbit, c_flag);
prln("... and filling north fifo proper stopper");
addr.set(whichbit, c_flag);
prln("... and filling north fifo proper stopper");
new Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, /* predicate */
new Instruction.Set(dock,Predicate.IgnoreFlagD, CLEAR_FLAG, CLEAR_FLAG),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, /* predicate */
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, /* predicate */
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, /* predicate */
BitVector packet_path = new BitVector(14, "inbound data item");
for(int i=0; i<14; i++) packet_path.set(i, false);
BitVector packet_path = new BitVector(14, "inbound data item");
for(int i=0; i<14; i++) packet_path.set(i, false);
prln("recv path, send data (using recv'd path)");
marina.instrIn.fill(new Instruction.Move(dock,
prln("recv path, send data (using recv'd path)");
marina.instrIn.fill(new Instruction.Move(dock,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,ilc),
SEND_DATA,
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,ilc),
SEND_DATA,
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,0),
SEND_DATA,
SEND_TOKEN,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,0),
SEND_DATA,
SEND_TOKEN,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, SetSource.Infinity),
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
marina.instrIn.fill(setIlc(1));
for(boolean torpedoable : new boolean[] { true, false }) {
marina.instrIn.fill(setIlc(1));
for(boolean torpedoable : new boolean[] { true, false }) {
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
false, // torpedoable
new Instruction.Move(dock,
Predicate.IgnoreFlagD, // predicate
false, // torpedoable
dataItems = marina.data.drainMany(2);
fatal(dataItems.size()!=expected, "Expected "+expected+" item to emerge but got: "+dataItems.size()+" data items");
dataItems = marina.data.drainMany(2);
fatal(dataItems.size()!=expected, "Expected "+expected+" item to emerge but got: "+dataItems.size()+" data items");
private void testSetOlcFollowedByDPredicated(Marina marina) {
for(boolean d_set : new boolean[] { false, true }) {
prln("");
private void testSetOlcFollowedByDPredicated(Marina marina) {
for(boolean d_set : new boolean[] { false, true }) {
prln("");
setOlc(0),
marina.kesselsCounter ? null : FLAG_NOP,
d_set ? SEND_DATA_IF_D_SET : SEND_DATA_IF_D_NOT_SET,
setOlc(0),
marina.kesselsCounter ? null : FLAG_NOP,
d_set ? SEND_DATA_IF_D_SET : SEND_DATA_IF_D_NOT_SET,
setOlc(32),
marina.kesselsCounter ? null : FLAG_NOP,
d_set ? SEND_DATA_IF_D_SET : SEND_DATA_IF_D_NOT_SET,
setOlc(32),
marina.kesselsCounter ? null : FLAG_NOP,
d_set ? SEND_DATA_IF_D_SET : SEND_DATA_IF_D_NOT_SET,
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,olc),
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter,olc),
});
if (marina.kesselsCounter) {
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
if (marina.kesselsCounter) {
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, notZero),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 0),
});
if (marina.kesselsCounter) {
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
if (marina.kesselsCounter) {
// master clear on each iteration; otherwise we'd need to "run down" the olc
marina.masterClear();
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
});
if (!marina.kesselsCounter) {
prln("Set OLC="+notZero);
prln("Then immediately set OLC=0");
if (!marina.kesselsCounter) {
prln("Set OLC="+notZero);
prln("Then immediately set OLC=0");
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
});
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, notZero),
new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, 0),
});
System.out.println("******************************************************************************");
System.out.println("******************************************************************************");
fe.printStackTrace();
System.out.println("******************************************************************************");
System.out.println("******************************************************************************");
fe.printStackTrace();
- marina.enableInstructionSend(true);
- marina.fillSouthProperStopper(new Instruction.Set(dock,Predicate.IgnoreFlagD,
+ marina.southRing.enableInstructionSend(true);
+ marina.southRing.fill(new Instruction.Set(dock,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
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
/*
new Instruction.Set(dock,Predicate.FlagD,
Instruction.Set.FlagFunction.ZERO.add(Predicate.NotFlagA),
/*
new Instruction.Set(dock,Predicate.FlagD,
Instruction.Set.FlagFunction.ZERO.add(Predicate.NotFlagA),
- 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));
- marina.enableInstructionSend(true);
- marina.fillSouthProperStopper(setOlc(1));
- marina.fillSouthProperStopper(new Instruction.Set(dock,Predicate.IgnoreFlagD,
+ marina.southRing.enableInstructionSend(true);
+ marina.southRing.fill(setOlc(1));
+ marina.southRing.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,
Instruction.Set.FlagFunction.ZERO,
Instruction.Set.FlagFunction.ZERO));
Instruction.Set.FlagFunction.ZERO,
Instruction.Set.FlagFunction.ZERO));
- marina.fillSouthProperStopper(new Instruction.Head(dock));
- //marina.fillSouthProperStopper(setIlc(31));
- marina.fillSouthProperStopper(SEND_DATA);
+ marina.southRing.fill(new Instruction.Head(dock));
+ //marina.southRing.fill(setIlc(31));
+ marina.southRing.fill(SEND_DATA);