452 - LatticeXP2: Why doesn't the USERCODE assigned using Spreadsheet View match the value retrieved from a LatticeXP2 programmed with an encrypted bitstream?

452 - LatticeXP2: Why doesn't the USERCODE assigned using Spreadsheet View match the value retrieved from a LatticeXP2 programmed with an encrypted bitstream?

The program that creates the FPGA bit stream encrypts the USERCODE in addition to the data used to configure the LatticeXP2. 

After the LatticeXP2 FPGA is programmed the USERCODE can be retrieved from the LaticeXP2.  The value is available from either secured or unsecured devices.  A secured  FPGA has the CONFIG_SECURE attribute set ON.  This attribute can be changed in the spreadsheet view of  the Diamond Design tool. 

The USERCODE value entered in the spreadsheet view will not match the value read from the LatticeXP2 because the value entered in spreadsheet view is not encrypted, but the value programmed into the LatticeXP2 is encrypted.  In order to match the USERCODE retrieved from the LatticeXP2 you must match it against the encrypted value located in the JEDEC file created by the Bitstream Generation tool.  The encrypted USERCODE is located at the bottom of the JEDEC.  The USERCODE record follows immediately after this header: NOTE User Electronic Signature Data*.