Hi,
While debugging my xsvf parser for ft2232 jtag programmers I experience some really odd behavior; if I swapped my buffer and then send (essentially) 'junk' to my device it would actually boot, but, without any sensible configuration and it would keep GHIGH asserted. It didn't detect a CRC error however and completed the rest of the bootcycle, which was really odd. So I dug a little further and found this;
The data in the .rbt, since it's rbt we have to read from left to right in bits;
00000000 00000000 01011111 01010111 00110000 00000000 10000000 00000001The associated .bit, should be interpreted as MSB first;
00 00 5F 57 30 00 80 01 gives 00000000 00000000 01011111 01010111 00110000 00000000 10000000 00000001 which is a perfect match with the rbt, thus so far so good.Now, 1.xsvf is generated using iMPACT with just the fpga in the chain, no other devices. Program with .bit while exporting to xsvf;
80 01 00 0C EA FA 00 00 read as LSB first (because it's xsvf) gives 00000001 10000000 00000000 00110000 01010111 01011111 00000000 00000000 which is indeed a flipped buffer (as it should be with xsvf) and matches the .bit.Then, 2.xsvf, LSB first, flipped buffer with more devices in the chain (FPGA = 2nd out of 3, so shift 1 bit right)
40 00 80 06 75 7D 00 00 gives 00000010 00000000 00000001 01100000 10101110 10111110 00000000 00000000 Compensate 1 bit x0000001 00000000 00000000 10110000 01010111 01011111 00000000 00000000 What the @#$? We've got some bits going all over the place. The only explanation I can think of it this; Take the MSB first .bit; 00 00 5F 57 30 00 80 01 00000000 00000000 01011111 01010111 00110000 00000000 10000000 00000001 Compensate -1 bit 00000000 00000000 10111110 10101110 01100000 00000001 00000000 0000001x Which then reads, LSB first; 40 00 80 06 75 7D 00 00 Familiar, no?If we take more devices (say, FPGA being 3th out of 4) gives in the xsvf; 20 00 40 03 3A BE 80 00 which means the .bit has been compensated
-2 before being byte swapped.
So really what iMPACT does is take the bit file, shift it, and _then_ byte swaps, while it should byte swap first and only after that shift the data to compensate for the other devices in the chain.
Am I a crackpot or is this a bug?
Cheers,
Mike