public static void printFDRIWrite(XilinxConfigurationSpecification spec, Iterator<Packet> pi,
boolean printAllFrames) {
boolean debug = false;
while (pi.hasNext()) {
Packet p = pi.next();
if (debug) System.out.println(p.toString(false));
if (p.getPacketType() == PacketType.ONE &&
p.getOpcode() == PacketOpcode.WRITE &&
p.getRegType() == RegisterType.FAR) {
// Get FAR address
int farAddress = p.getData().get(0);
// Skip all following commands until the FDRI command arrives
while (pi.hasNext() && !(p.getOpcode() == PacketOpcode.WRITE && p.getRegType() == RegisterType.FDRI)) {
p = pi.next();
if (debug) System.out.println("skip:"+p.toString(false));
}
// get the write command after the FDRI
if (pi.hasNext()) {
p = pi.next();
if (debug) System.out.println("final write:"+p.toString(false));
if (p.getOpcode() == PacketOpcode.WRITE) {
// Print out command
int words = p.getData().size();
int frames = (words/spec.getFrameSize());
if (!printAllFrames) {
System.out.println("Initial FAR:"+ FrameAddressRegister.toString(spec,farAddress));
System.out.println("FDRI words="+words + " (" + frames + " frames)");
//System.out.println("Ending FAR:"+ FrameAddressRegister.toString(spec,farAddress+frames-1));