Forum Discussion
Altera_Forum
Honored Contributor
16 years agoThe length of the file is found within the file but it's encoded. The best place I can point you too is the assembly source code for the NIOS II bootloader found in "c:\altera\90\nios2eds\components\altera_nios2\boot_loader_sources\boot_loader_epcs_bits_sii_siii_ciii.S":
//
// If we arrive at this point we have verified that there is valid-looking
// configuration data. Extract its length.
//
// Like searching for the Software-Device ID code, the configuration
// bitstream length is encoded in a particular bit of a run of bytes.
// Total length field is 32 bits, which goes from CB Option bits 86..55
// corresponding to bit of byte to byte (for the most
// significant 7 bits) followed by the range of bits
// made up of bit of bytes. The above note about EPCS
// bit reversal still applies (so we're really looking at bits and ,
// respectively.
// Jake