Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21611 Discussions

Checksum of the SOF file

Altera_Forum
Honored Contributor II
2,825 Views

When I download any sof file into the SRAM cells of the FPGA, in the programmer window there is a random checksum ID specific to some design. 

SOF file when edited using a textpad shows few english characters and other special characters. 

My question is, 

1. Can we read back the checksum from the sof file downloaded into the SRAM cell in the FPGA other than the what is showed in the programmer window? What are its readback modes? 

2. How to calculate the checksum for ex: Cyclone III EPC3120F780CN device? 

3. Can the checksum be decoded to get original bit streams and other configuration settings? 

4. A sof file for a small design (And Gate) is of the same size as compared to a large design (Display Controller SoC), even though there is difference in design sizes and more LE's consumed sof file size remains same. Does it mean for a small design if it uses few LE's, then the remaining LE's P&R data is dummy? 

 

Thank your time. 

Regards, 

Sriram
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,853 Views

1) No - you cannot read back the checksum. You cannot read back anything from the FPGA's configuration SRAM. 

 

2) I doubt you can unless Altera publish how they calculate this. I'm not aware they do. 

 

3) No - you certainly cannot reverse engineer a design purely from the checksum. 

 

4) Configuration sizes for a particular device are always the same size (unless the particular FPGA family/device supports compressed configuration images. 

 

I'm a little troubled as to your motives for knowing these things... 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
1,853 Views

if this is what I think it is, the Checksum is just a CRC32 of the sof file.  

There are lots of tools out there to calculate the CRC32 of a file for you. 

 

using this, you can tell if the file you have infront of you is the same as some file you found randomly on your drive somewhere, and so the logic should be identical. But you cannot determin what the logic is. 

 

Ive seen it used in a manufacturing setting where the CRC is documented, so the person loading the .sof file knows it is the correct .sof file. 

 

A tool like hashtab can be used for this: 

http://implbits.com/products/hashtab/
0 Kudos
Altera_Forum
Honored Contributor II
1,853 Views

Tricky, It would make sense if it was. However, I'm not convinced it is. A quick play around in python, and with an independent CRC32 calculator, reveals consistent results but different values as compared to the Checksum the Quartus programmer displays. 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
1,853 Views

Thank you Alex for your insights about this, 

Thank you Tricky, i will surely try the tool. 

Thank you for your time. 

Regards, 

Sriram
0 Kudos
Reply