Forum Discussion

Dennis_Nedry's avatar
Dennis_Nedry
Icon for New Contributor rankNew Contributor
13 hours ago

Manual checksum verification of CFM0

I am working on some post-build scripting for generating firmware update programming files for the Max 10 series FPGA.  My goal is to generate 2 separate files:

  1. POF file, for use with USB Blaster.
  2. Proprietary file, for use through a different communication channel.

The POF file is easy; the file is basically auto-generated when you compile in Quartus.  When loading the POF into the Quartus programmer software, it shows "Checksum" and "Usercode Checksum".  The usercode checksum can also be found in the RPT file.  So I have used my post-build scripting to make a copy of the POF file, with the usercode checksum appended to the POF filename.  That is all working great and goal #1 is satisfied.

I have been working on the proprietary file.  In this case, I would be storing something that amounts to the raw data that will end up written to the CFM0 section of the FPGA.  To get the raw data, I used quartus_cpf to generate RPD files from the compiled SOF file.  The raw data can then make its way into the FPGA's CFM0 section through undisclosed means other than USB-Blaster.  All of that is OK, but the problem I have is that I wish to use the SAME usercode checksum as the POF file for consistency, and I have not been able to figure out how to correctly calculate that.

One thing that I did where I got close was, I added this argument to the quartus_cpf command when generating the MAP file:  

-o memory_map_file=on

The MAP file generated shows a totally different checksum.  However, when I do a simple 32-bit checksum on the RPD data (just adding all 32-bit words of the file and coming to a 32-bit result), it DOES exactly match the checksum in the MAP file.

In summary:

I want the consistency between one of the POF's checksums shown in Quartus Programmer, vs. what I can calculate from the raw RPD data.  Since both methods of programming the FPGA should produce identical results, I want to be able to have the same checksum in both methods.  How may I correctly use the RPD data to calculate the same checksum shown in Quartus programmer when loading the POF file?

1 Reply

  • Farabi's avatar
    Farabi
    Icon for Regular Contributor rankRegular Contributor

    Hello, 

     

    Every bitstream generated will have different checksum. This is the default mechanism. 

    To have same checksum - only for same bitstream. 

     

    regards,
    Farabi