![]() |
Altera HWLIB
16.0
The Altera HW Manager API Reference Manual
|
This functional group provides the following services:
Members | |
FPGA Full Configuration | |
Typedefs | |
typedef enum ALT_FPGA_CFG_MODE_e | ALT_FPGA_CFG_MODE_t |
typedef int32_t(* | alt_fpga_istream_t )(void *buf, size_t buf_len, void *user_data) |
Functions | |
ALT_FPGA_CFG_MODE_t | alt_fpga_cfg_mode_get (void) |
ALT_STATUS_CODE | alt_fpga_cfg_mode_set (ALT_FPGA_CFG_MODE_t cfg_mode) |
typedef enum ALT_FPGA_CFG_MODE_e ALT_FPGA_CFG_MODE_t |
This type definition enumerates the available modes for configuring the FPGA.
typedef int32_t(* alt_fpga_istream_t)(void *buf, size_t buf_len, void *user_data) |
Type definition for the callback function prototype used by the FPGA Manager to read configuration bitstream data from a user defined input source stream.
The purpose of this callback function declaration is to provide a prototype for a user defined method of sequentially reading FPGA configuration bitstream data from an arbitrary input source. Example input sources include a file resident on a file system, a network stream socket, or a fixed address block in flash memory. The only requirement on the input source is that it is capable of supplying consecutive blocks of data of the requested size from the FPGA configuration bitstream as demanded by the FPGA Manager.
During FPGA configuration, the FPGA Manager periodically calls the user defined callback function to fetch the next buf_len consecutive configuration data bytes from the user defined input stream. The callback function fills the FPGA Manager supplied buffer buf with up to the next buf_len bytes of configuration bitsteam data as read from the input source stream. The callback function returns the number of configuration bytes read into buf or 0 upon reaching the end of the configuration bitstream data.
If an error occurs on the configuration bitstream input source, then the callback function should return an error code value less than 0.
buf | A pointer to a buffer to fill with FPGA configuration bitstream data bytes. |
buf_len | The length of the input buffer buf in bytes. The number of FPGA configuration bitstream data bytes copied into buf should not exceed buf_len. |
user_data | A 32-bit data word for passing user defined data. The content of this parameter is user defined. The FPGA Manager merely forwards the user_data value when it invokes the callback. |
>0 | The number of bytes returned in buf. |
=0 | The end of the input stream has been reached. |
<0 | An error occurred on the input stream. |
enum ALT_FPGA_CFG_MODE_e |
This type definition enumerates the available modes for configuring the FPGA.
ALT_FPGA_CFG_MODE_t alt_fpga_cfg_mode_get | ( | void | ) |
Gets the FPGA configuration mode currently in effect.
Presently, the FPGA configuration mode is statically set by the external MSEL pin values and cannot be programmatically overridden by HPS software.
ALT_STATUS_CODE alt_fpga_cfg_mode_set | ( | ALT_FPGA_CFG_MODE_t | cfg_mode | ) |
Sets the FPGA configuration mode.
Presently, the FPGA configuration mode is statically set by the external MSEL pin values and cannot be programmatically overridden by HPS software. This function should always return ALT_E_ERROR at least for Hammerhead-P. This may change with future SoCFPGA devices.
cfg_mode | The desired FPGA configuration mode. |
ALT_E_SUCCESS | Successful status. |
ALT_E_ERROR | Failed to set the FPGA configuration mode. |