xilfpga
Vitis Drivers API Documentation
XilFPGA APIs for Versal Adative SoC and Zynq UltraScale+ MPSoC

Modules

 XilFPGA APIs for Zynq UltraScale+ MPSoC
 

Data Structures

struct  XFpgatag
 Structure to the XFpga instance. More...
 

Typedefs

typedef struct XFpgatag XFpga
 Structure to the XFpga instance. More...
 

Functions

u32 XFpga_BitStream_Load (XFpga *InstancePtr, UINTPTR BitstreamImageAddr, UINTPTR KeyAddr, u32 Size, u32 Flags)
 The API is used to load the bitstream file into the PL region. More...
 
u32 XFpga_ValidateImage (XFpga *InstancePtr, UINTPTR BitstreamImageAddr, UINTPTR KeyAddr, u32 Size, u32 Flags)
 This function is used to validate the bitstream image. More...
 
u32 XFpga_PL_Preconfig (XFpga *InstancePtr)
 This function prepares the FPGA to receive configuration data. More...
 
u32 XFpga_Write_Pl (XFpga *InstancePtr, UINTPTR BitstreamImageAddr, UINTPTR KeyAddr, u32 Size, u32 Flags)
 This function writes the count bytes of configuration data into the PL. More...
 
u32 XFpga_PL_PostConfig (XFpga *InstancePtr)
 This function sets the FPGA to the operating state after writing. More...
 
u32 XFpga_Initialize (XFpga *InstancePtr)
 This API, when called, initializes the XFPGA interface with default settings. More...
 
u32 XFpga_GetPlConfigData (XFpga *InstancePtr, UINTPTR ReadbackAddr, u32 NumFrames)
 This function provides functionality to read back the PL configuration data. More...
 
u32 XFpga_GetPlConfigReg (XFpga *InstancePtr, UINTPTR ReadbackAddr, u32 ConfigRegAddr)
 This function provides PL specific configuration register values. More...
 
u32 XFpga_InterfaceStatus (XFpga *InstancePtr)
 This function provides the status of the PL programming interface. More...
 

Typedef Documentation

typedef struct XFpgatag XFpga

Structure to the XFpga instance.

Function Documentation

u32 XFpga_BitStream_Load ( XFpga InstancePtr,
UINTPTR  BitstreamImageAddr,
UINTPTR  KeyAddr,
u32  Size,
u32  Flags 
)

The API is used to load the bitstream file into the PL region.

It supports AMD Vivadoâ„¢ Design Suite generated bitstream (*.bit, *.bin) and Bootgen-generated bitstream (*.bin) loading, Passing valid bitstream size(Size) information is mandatory for Vivado Design Suite generated bitstream, For Bootgen-generated bitstreams bitstream size is taken from the bitstream header.

Parameters
InstancePtrPointer to the XFpga structure.
BitstreamImageAddrLinear memory bitstream image base address
KeyAddrAES key address which is used for decryption.
SizeUsed to store size of bitstream image.
FlagsFlags are used to specify the type of bitstream file.
  • BIT(0) - Bitstream type
    • 0 - Full bitstream
    • 1 - Partial bitstream
  • BIT(1) - Authentication using DDR
    • 1 - Enable
    • 0 - Disable
  • BIT(2) - Authentication using OCM
    • 1 - Enable
    • 0 - Disable
  • BIT(3) - User-key Encryption
    • 1 - Enable
    • 0 - Disable
  • BIT(4) - Device-key Encryption
    • 1 - Enable
    • 0 - Disable
Returns
  • XFPGA_SUCCESS on success
  • Error code on failure.
  • XFPGA_VALIDATE_ERROR.
  • XFPGA_PRE_CONFIG_ERROR.
  • XFPGA_WRITE_BITSTREAM_ERROR.
  • XFPGA_POST_CONFIG_ERROR.

References XFpga_Write::BitstreamAddr, XFpga_Write::Flags, XFpga_Write::KeyAddr, XFpga_Write::Size, XFpgatag::WriteInfo, XFpga_PL_PostConfig(), XFpga_PL_Preconfig(), XFpga_ValidateImage(), and XFpga_Write_Pl().

u32 XFpga_GetPlConfigData ( XFpga InstancePtr,
UINTPTR  ReadbackAddr,
u32  NumFrames 
)

This function provides functionality to read back the PL configuration data.

Parameters
InstancePtrPointer to the XFpga structure
ReadbackAddrAddress which is used to store the PL readback data.
NumFramesThe number of FPGA configuration frames to read.
Returns
  • XFPGA_SUCCESS, if successful
  • XFPGA_FAILURE, if unsuccessful
  • XFPGA_OPS_NOT_IMPLEMENTED, if implementation not exists.
Note
  • This API is not supported for the Versal platform.

References XFpgatag::ReadInfo, and XFpgatag::XFpga_GetConfigData.

u32 XFpga_GetPlConfigReg ( XFpga InstancePtr,
UINTPTR  ReadbackAddr,
u32  ConfigRegAddr 
)

This function provides PL specific configuration register values.

Parameters
InstancePtrPointer to the XFpga structure
ReadbackAddrAddress which is used to store the PL Configuration register data.
ConfigRegAddrConfiguration register address as mentioned in the UG570.
Returns
  • XFPGA_SUCCESS if, successful
  • XFPGA_FAILURE if, unsuccessful
  • XFPGA_OPS_NOT_IMPLEMENTED, if implementation not exists.
Note
  • This API is not supported for the Versal platform.

References XFpgatag::ReadInfo, and XFpgatag::XFpga_GetConfigReg.

u32 XFpga_Initialize ( XFpga InstancePtr)

This API, when called, initializes the XFPGA interface with default settings.

Parameters
InstancePtrPointer to the XFpga structure.
Returns
Returns Status
  • XFPGA_SUCCESS on success
  • Error code on failure

References XFpgatag::XFpga_GetConfigData, XFpgatag::XFpga_GetConfigReg, XFpgatag::XFpga_GetFeatureList, XFpgatag::XFpga_GetInterfaceStatus, XFpgatag::XFpga_PostConfig, XFpgatag::XFpga_PreConfig, XFpgatag::XFpga_ValidateBitstream, and XFpgatag::XFpga_WriteToPl.

Referenced by main().

u32 XFpga_InterfaceStatus ( XFpga InstancePtr)

This function provides the status of the PL programming interface.

Parameters
InstancePtrPointer to the XFpga structure
Returns
Status of the PL programming interface
Note
  • This API is not supported for the Versal platform.

References XFpgatag::XFpga_GetInterfaceStatus.

u32 XFpga_PL_PostConfig ( XFpga InstancePtr)

This function sets the FPGA to the operating state after writing.

Parameters
InstancePtrPointer to the XFpga structure
Returns
Codes as mentioned in xilfpga.h

References XFpgatag::XFpga_PostConfig.

Referenced by XFpga_BitStream_Load().

u32 XFpga_PL_Preconfig ( XFpga InstancePtr)

This function prepares the FPGA to receive configuration data.

Parameters
InstancePtris the pointer to the XFpga.
Returns
Codes as mentioned in xilfpga.h

References XFpgatag::XFpga_PreConfig.

Referenced by XFpga_BitStream_Load().

u32 XFpga_ValidateImage ( XFpga InstancePtr,
UINTPTR  BitstreamImageAddr,
UINTPTR  KeyAddr,
u32  Size,
u32  Flags 
)

This function is used to validate the bitstream image.

Parameters
InstancePtrPointer to the XFpga structure
BitstreamImageAddrLinear memory bitstream image base address
KeyAddrAes key address which is used for decryption.
SizeUsed to store size of bitstream image.
FlagsFlags are used to specify the type of bitstream file.
  • BIT(0) - Bitstream type
    • 0 - Full bitstream
    • 1 - Partial bitstream
  • BIT(1) - Authentication using DDR
    • 1 - Enable
    • 0 - Disable
  • BIT(2) - Authentication using OCM
    • 1 - Enable
    • 0 - Disable
  • BIT(3) - User-key Encryption
    • 1 - Enable
    • 0 - Disable
  • BIT(4) - Device-key Encryption
    • 1 - Enable
    • 0 - Disable
Returns
Codes as mentioned in xilfpga.h

References XFpga_Write::BitstreamAddr, XFpga_Write::Flags, XFpga_Write::KeyAddr, XFpga_Write::Size, XFpgatag::WriteInfo, and XFpgatag::XFpga_ValidateBitstream.

Referenced by XFpga_BitStream_Load().

u32 XFpga_Write_Pl ( XFpga InstancePtr,
UINTPTR  BitstreamImageAddr,
UINTPTR  KeyAddr,
u32  Size,
u32  Flags 
)

This function writes the count bytes of configuration data into the PL.

Parameters
InstancePtrPointer to the XFpga structure
BitstreamImageAddrLinear memory bitstream image base address
KeyAddrAes key address which is used for decryption.
SizeUsed to store size of bitstream image.
FlagsFlags are used to specify the type of bitstream file.
  • BIT(0) - Bitstream type
    • 0 - Full bitstream
    • 1 - Partial bitstream
  • BIT(1) - Authentication using DDR
    • 1 - Enable
    • 0 - Disable
  • BIT(2) - Authentication using OCM
    • 1 - Enable
    • 0 - Disable
  • BIT(3) - User-key Encryption
    • 1 - Enable
    • 0 - Disable
  • BIT(4) - Device-key Encryption
    • 1 - Enable
    • 0 - Disable
Returns
Codes as mentioned in xilfpga.h

References XFpga_Write::BitstreamAddr, XFpga_Write::Flags, XFpga_Write::KeyAddr, XFpga_Write::Size, XFpgatag::WriteInfo, and XFpgatag::XFpga_WriteToPl.

Referenced by XFpga_BitStream_Load().