RC1000-PP Host:
FPGA Configuration Functions


 

PP1000ConfigureFPGA


  PP1000_STATUS PP1000ConfigureFPGA(
                      PP1000_HANDLE Card,
                      PP1000_IMAGE Image);
 

 

Arguments
Card

Handle of card to configure.

Image Handle of configuration image to use.
Return Values
PP1000_SUCCESS Success.
PP1000_FPGA_MISMATCH File is not for the FPGA fitted to this card.
PP1000_INVALID_HANDLE Card is not valid card handle.
PP1000_INVALID_IMAGE Image is not a valid handle.
PP1000_INTERNAL_ERROR Error while talking to driver.
PP1000_TIMEOUT Operation timed out before configuration could complete.
Description

This function is used to configure the FPGA on a card with a configuration image. The configuration image should be registered with the support software either with the PP1000LoadFile() function or with the PP1000RegisterImage() function.

If there is an FPGA part mismatch between the configuration image and the FPGA on the card, PP1000_FPGA_MISMATCH will be returned.

This function times out, if unsuccessful, after the period set for by using PP1000SetTimeOut().

 

 

PP1000ConfigureFromFile


  PP1000_STATUS PP1000ConfigureFromFile(
                      PP1000_HANDLE Card,
                      char * FileName);
 

 

Arguments
Card

Handle of card to configure.

FileName Name of configuration file.
Return Values
PP1000_SUCCESS Success.
PP1000_FILE_NOT_FOUND Could not open file FileName.
PP1000_FILE_ACCESS_ERROR Error while reading file.
PP1000_INVALID_FILE File not correct format.
PP1000_NO_MEMORY Not enough memory to load file.
PP1000_INVALID_PART_TYPE File is for an unrecognised FPGA.
PP1000_FPGA_MISMATCH File is not for the FPGA fitted to this card.
PP1000_INVALID_HANDLE Card is not valid card handle.
PP1000_INTERNAL_ERROR Error while talking to driver.
PP1000_TIMEOUT Operation timed out before configuration could complete.
Description

This function is used to configure the FPGA on a card from a configuration image file.

The file must be in Xilinx BIT format. The card to be configured is specified with the Card parameter which is obtained by a call to the PP1000OpenCard() or PP1000OpenFirstCard() function.

The FileName parameter is a string containing the full path name of the configuration file to use.

This function times out, if unsuccessful, after the period set for by using PP1000SetTimeOut().

 

 

PP1000FreeImage


  PP1000_STATUS PP1000FreeImage(
                      PP1000_IMAGE Image);
 

 

Arguments
Image Handle of configuration image to use.
Return Values
PP1000_SUCCESS Success.
PP1000_INVALID_IMAGE Image is not a valid file handle.
Description

This function is used to free the handle of an FPGA configuration image when it is no longer required.

 

 

PP1000LoadFile


  PP1000_STATUS PP1000LoadFile(
                      char * FileName,
                      PP1000_IMAGE * Image);
 

 

Arguments
FileName

Name of configuration file.

Image Pointer to location to receive configuration image handle.
Return Values
PP1000_SUCCESS Success.
PP1000_FILE_NOT_FOUND Could not open file FileName.
PP1000_FILE_ACCESS_ERROR Error while reading file.
PP1000_INVALID_FILE File not in correct format.
PP1000_NO_MEMORY Not enough memory to load file.
PP1000_INVALID_PART_TYPE File is for an unrecognised FPGA.
Description

This function is used to load an FPGA configuration image into host RAM and obtains a handle for that image. This handle will be required by the PP1000ConfigureFPGA() function when you wish to configure the FPGA. The file must be in Xilinx BIT format.

The FileName parameter is a string containing the full name of the file to read.

The PP1000LoadFile() function will attempt to automatically determine the intended part type of the configuration image from the file.

 

 

PP1000RegisterImage


  PP1000_STATUS PP1000RegisterImage(
                      unsigned char * Buffer,
                      unsigned long BufferLength
                      PP1000_IMAGE * Image);
 

 

Arguments
Buffer

Pointer to start of configuration image.

BufferLength Length of configuration image in bytes.
Image Pointer to location to receive configuration image handle.
Return Values
PP1000_SUCCESS Success.
PP1000_NULL_POINTER Image or Buffer is a NULL pointer.
PP1000_NO_MEMORY Not enough memory to load file.
PP1000_INVALID_PART_TYPE File is for an unrecognised FPGA.
Description

This function is used to register a configuration image with the support software and obtain a handle for that image. This handle will be required by the PP1000ConfigureFPGA() function when you wish to configure the FPGA.

The FPGA part type is determined automatically from the buffer length.

The gencfg utility can be used to generate suitable information for this function from a Xilinx .bit file. Refer to the Software Reference Manual for details of this utility.