xilpuf
Vitis Drivers API Documentation
XilPuf Server APIs

Macros

#define XPUF_STATUS_WAIT_TIMEOUT   (1000000U)
 Recommended software timeout is 1 second. More...
 
#define XPUF_AUX_MASK_VALUE   (0x0FFFFFF0U)
 Mask value for AUX. More...
 
#define XPUF_AUX_SHIFT_VALUE   (4U)
 No of bits aux has to shift. More...
 

Functions

int XPuf_Registration (XPuf_Data *PufData)
 This functions performs PUF registration. More...
 
int XPuf_Regeneration (XPuf_Data *PufData)
 This function regenerates PUF data using helper data stored in eFUSE or external memory. More...
 
int XPuf_ClearPufID (void)
 This function clears PUF ID. More...
 
int XPuf_GenerateFuseFormat (XPuf_Data *PufData)
 Converts the PUF Syndrome data to eFUSE writing format. More...
 

Macro Definition Documentation

#define XPUF_AUX_MASK_VALUE   (0x0FFFFFF0U)

Mask value for AUX.

Referenced by XPuf_Registration().

#define XPUF_AUX_SHIFT_VALUE   (4U)

No of bits aux has to shift.

Referenced by XPuf_Registration().

#define XPUF_STATUS_WAIT_TIMEOUT   (1000000U)

Recommended software timeout is 1 second.

Referenced by XPuf_ClearPufID().

Function Documentation

int XPuf_ClearPufID ( void  )

This function clears PUF ID.

Returns
  • XST_SUCCESS if PUF ID is cleared successfully
  • XPUF_ERROR_PUF_ID_ZERO_TIMEOUT if time out while clearing PUF ID

Set least significant bit in the PUF_CLEAR register.

The API waits for ID_ZERO bit to be set in PUF Status register. If ID zero bit is not set within 1 second then returns XPUF_ERROR_PUF_ID_ZERO_TIMEOUT else returns XST_SUCCESS.

References XPUF_STATUS_WAIT_TIMEOUT.

int XPuf_GenerateFuseFormat ( XPuf_Data *  PufData)

Converts the PUF Syndrome data to eFUSE writing format.

Parameters
PufDataPointer to XPuf_Data structure which includes options to configure PUF.
Returns
  • XST_SUCCESS Syndrome data is successfully trimmed
  • XPUF_ERROR_INVALID_PARAM PufData instance pointer is NULL
Note
Formatted data will be available at PufData->EfuseSynData

Check if PufData instance pointer is NULL. If NULL, return XPUF_ERROR_INVALID_PARAM.

Copy syndrome data from instance pointer to a local variable.

Trimming logic for PUF Syndrome Data:

Space allocated in eFUSE for syndrome data = 4060bits

eFUSE02 - 2032bits

eFUSE03 - 2028bits

PUF Helper data generated for 4K Mode through registration is 140 Words = 140*32 = 4480 bits. Remove lower 12 bits of every fourth word of syndrome data.

After removing these bits remaining syndrome data will be exactly 4060bits which will fit into eFUSE.

Illustration:

454D025B

CDCB36FC

EE1FE4C5

3FE53F74 –> F74 has to removed & next word upper 12 bits have to be shifted here

3A0AE7F8

2373F03A

C83188AF

3A5EB687–> 687 has to be removed

B83E4A1D

D53B5C50

FA8B33D9

07EEFF43 –> F43 has to be removed

CD01973F

........

........

........

Use the above mentioned logic to trim the data and copy the trimmed data in EfuseSynData array in the instance pointer and return XST_SUCCESS.

int XPuf_Regeneration ( XPuf_Data *  PufData)

This function regenerates PUF data using helper data stored in eFUSE or external memory.

Parameters
PufDataPointer to XPuf_Data structure which includes options to configure PUF.
Returns
  • XST_SUCCESS on successful PUF Regeneration
  • XPUF_ERROR_INVALID_PARAM if PufData is NULL
  • XPUF_ERROR_INVALID_REGENERATION_TYPE if selected regeneration type is invalid
  • XPUF_ERROR_CHASH_NOT_PROGRAMMED Helper data not provided
  • XPUF_ERROR_PUF_STATUS_DONE_TIMEOUT Timeout occurred while waiting for PUF done bit
  • XPUF_ERROR_PUF_DONE_KEY_NT_RDY Key ready bit and ID ready bit is not set
  • XPUF_ERROR_PUF_DONE_ID_NT_RDY Id ready bit is not set
  • XPUF_IRO_FREQ_WRITE_MISMATCH Mismatch in writing or reading IRO frequency at the time of PUF regeneration
  • XST_FAILURE Unexpected event
Note
PUF is only supported when using a nominal VCC_PMC of 0.70V and IRO frequency of 320 MHz

Perform input parameters validation, return XPUF_ERROR_INVALID_PARAM if input parameters are invalid.

Check if requested PUF operation is not PUF on demand regeneration or ID only regeneration. If yes, return XPUF_ERROR_INVALID_PARAM.

Check that MSB of PUF shutter value is in sync with Global variation filter option. In case of mismatch, return XPUF_SHUTTER_GVF_MISMATCH.

When registering the PUF, the PMC internal ring oscillator (IRO) frequency must be set to 320 MHz. When the Versal ACAP boots, it always uses the default frequency of 320 MHz for -LP devices and 400 MHz for -MP,-HP devices. If the IRO frequency at boot does not match the IRO frequency during registration, there is a potential of reduced stability which can impact the PUFs ability to regenerate properly.

Validate the access rules for PUF regeneration. If PUF_DIS or PUF_REGEN_DIS eFuse bits are set, then return XPUF_ERROR_REGENERATION_INVALID. If read from eFuse cache is selected and PUF_HD_INVLD bit is set then return XPUF_ERROR_REGEN_PUF_HD_INVALID.

Update the helper data for PUF regeneration according to the location of helper data provided by the user.

Configures the Global Variation Filter option provided by user and updates PUF Configuration0 register.

Update PUF Configuration1 register as 4k Registration mode.

Update Shutter value in PUF_SHUT register.

Checks if SLVERR is enabled for PMC_GLOBAL, then disable the SLVERR for PMC_GLOBAL before regeneration starts and enables it again once PUF regeneration is done.

Update PUF Ring Oscillator Swap setting for Versal Net device, do nothing in case of Versal.

If On demand regeneration is selected by user then trigger PUF_CMD for PUF On Demand regeneration. If ID only regeneration is selected then trigger PUF_CMD for PUF ID only regeneration. If invalid input, return XPUF_ERROR_INVALID_REGENERATION_TYPE.

Enabling the SLVERR after regeneration, if SLVERR is enabled previously in PMC_GLOBAL.

If IRO frequency is updated to 320MHz then set frequency back to 400MHz and if the frequency is not set then return XPUF_IRO_FREQ_WRITE_MISMATCH else, Return status.

References XPUF_REGEN_ID_ONLY, and XPUF_REGEN_ON_DEMAND.

int XPuf_Registration ( XPuf_Data *  PufData)

This functions performs PUF registration.

Parameters
PufDataPointer to XPuf_Data structure which includes options to configure PUF.
Returns
  • XST_SUCCESS PUF registration successful
  • XPUF_ERROR_INVALID_PARAM PufData is NULL
  • XPUF_ERROR_SYNDROME_WORD_WAIT_TIMEOUT Timeout occurred while waiting for PUF Syndrome data
  • XPUF_ERROR_PUF_DONE_WAIT_TIMEOUT Timeout occurred while waiting for PUF done bit at the time of PUF registration
  • XPUF_IRO_FREQ_WRITE_MISMATCH Mismatch in writing or reading IRO frequency
  • XST_FAILURE Unexpected event
Note
Helper data will be available in PufData->SyndromeData, PufData->Chash, PufData->Aux. PUF is only supported when using a nominal VCC_PMC of 0.70V and IRO frequency of 320 MHz

Perform input parameters validation, return XPUF_ERROR_INVALID_PARAM if input parameters are invalid.

Check that MSB of PUF shutter value is in sync with Global variation filter option. In case of mismatch, return XPUF_SHUTTER_GVF_MISMATCH.

When registering the PUF, the PMC internal ring oscillator (IRO) frequency must be set to 320 MHz. When the Versal ACAP boots, it always uses the default frequency of 320 MHz for -LP devices and 400 MHz for -MP,-HP devices. If the IRO frequency at boot does not match the IRO frequency during registration, there is a potential of reduced stability which can impact the PUFs ability to regenerate properly.

Validate if secure control bits for each PUF operations are set or not.

Check GlobalVariationFilter user option. If TRUE then set GLBL_FILTER and HASH_SEL bits else, set only HASH_SEL bit in in PUF_CFG0 register.

Update PUF Configuration1 register as 4k Registration mode.

Update shutter value for PUF registration.

Update PUF Ring Oscillator Swap setting for Versal Net device, do nothing in case of Versal.

Trigger PUF registration.

PUF helper data includes Syndrome data, CHash and Auxiliary data. Capturing Syndrome data word by word.

Once complete Syndrome data is captured and PUF operation is done, read CHash, Auxiliary data and PUF ID.

If IRO frequency is updated to 320MHz then set frequency back to 400MHz and if the frequency is not set then return XPUF_IRO_FREQ_WRITE_MISMATCH. else, return Status.

References XPUF_AUX_MASK_VALUE, XPUF_AUX_SHIFT_VALUE, XPUF_OV_MASK_VALUE, XPUF_PMC_GLOBAL_PUF_ID_CAPTURE, and XPUF_PMC_GLOBAL_PUF_KEY_CAPTURE.