![]() |
Altera HWLIB
16.0
The Altera HW Manager API Reference Manual
|
The functions in this group manage access, configuration, and control of the AXI bridges between the FPGA and HPS.
Macros | |
#define | ALT_BRIDGE_PROVISION_F2S_SUPPORT (0) |
Typedefs | |
typedef enum ALT_BRIDGE_e | ALT_BRIDGE_t |
typedef ALT_STATUS_CODE(* | alt_bridge_fpga_is_ready_t )(void *user_arg) |
typedef ALT_STATUS_CODE(* | alt_bridge_teardown_handshake_t )(void *user_arg) |
ENUMS | |
enum | ALT_BRIDGE_e { ALT_BRIDGE_F2H, ALT_BRIDGE_H2F, ALT_BRIDGE_LWH2F } |
Functions | |
ALT_STATUS_CODE | alt_bridge_init (ALT_BRIDGE_t bridge, alt_bridge_fpga_is_ready_t fpga_is_ready, void *user_arg) |
ALT_STATUS_CODE | alt_bridge_uninit (ALT_BRIDGE_t bridge, alt_bridge_teardown_handshake_t handshake, void *user_arg) |
#define ALT_BRIDGE_PROVISION_F2S_SUPPORT (0) |
This preprocessor definition determines if support for initializing and uninitializing the F2S (FPGA to HPS SDRAM) bridge is included in the bridge management APIs. When compiling with F2S support, be sure to assemble and link in the appropriate helper assembly file for the compiler being used.
To enable F2S bridge support, define ALT_BRIDGE_PROVISION_F2S_SUPPORT=1 in the Makefile, assemble and link in the appropriate bridge helper assembly file.
typedef enum ALT_BRIDGE_e ALT_BRIDGE_t |
This type definition enumerates the AXI bridge interfaces between the FPGA and HPS.
typedef ALT_STATUS_CODE(* alt_bridge_fpga_is_ready_t)(void *user_arg) |
Type definition for a callback function prototype used by the alt_bridge_init() bridge initialization function to determine whether the FPGA is ready to begin transactions across the bridge interface.
The implementation of the callback function is user defined allowing the user to define a flexible signaling protocol for the FPGA to indicate its readiness to begin transactions across the initialized bridge interface.
The range of values returned by the callback function may be extended per the user defined FPGA readiness signaling protocol but any return value other than ALT_E_SUCCESS will be interpreted by the alt_bridge_init() bridge initialization function as an indication that the FPGA is not ready to commence bridge interface transactions.
user_arg | This is a user defined parameter available to pass additional data that might be needed to support the user defined FPGA readiness signaling protocol. |
ALT_E_SUCCESS | The FPGA is ready to commence bridge interface transactions. |
ALT_E_ERROR | An error has occurred. The FPGA is not ready to commence bridge interface transactions. |
ALT_E_TMO | The FPGA failed to signal a ready to commence bridge interface transactions indication before the response timeout period expired. |
typedef ALT_STATUS_CODE(* alt_bridge_teardown_handshake_t)(void *user_arg) |
Type definition for a callback function prototype used by the alt_bridge_uninit() function to conduct a handshake protocol with the FPGA notifying it that the bridge interface is being taken down.
The callback function implementation is user defined and allows the user to implement a flexible handshake notification protocol with the FPGA to allow an orderly interface shutdown prior to the bridge being taken down.
The handshake protocol is user defined but normally consists of two parts:
The range of return values for the callback function may be extended per the user defined handshake notification protocol but any return value other than ALT_E_SUCCESS will be interpreted by the alt_bridge_uninit() function as an indication that the handshake protocol was unsuccessful.
user_arg | This is a user defined parameter available to pass additional data that might be needed to support the user defined handshake notification protocol. |
ALT_E_SUCCESS | The handshake notification protocol was successful. |
ALT_E_ERROR | An error has occurred. The handshake notification protocol was unsuccessful. |
ALT_E_TMO | The handshake notification protocol failed because a response timeout period expired. |
enum ALT_BRIDGE_e |
This type definition enumerates the AXI bridge interfaces between the FPGA and HPS.
ALT_STATUS_CODE alt_bridge_init | ( | ALT_BRIDGE_t | bridge, |
alt_bridge_fpga_is_ready_t | fpga_is_ready, | ||
void * | user_arg | ||
) |
Initialize the bridge for bus transactions by bringing up the interface in a safe, controlled sequence.
The following actions are performed as part of the process of initializing the bridge interface for transactions:
The mechanism used by alt_bridge_init() to determine whether the FPGA soft IP is ready to begin bus transactions across the interface is the user defined callback fpga_is_ready.
bridge | The bridge interface to initialize. |
fpga_is_ready | A pointer to a user defined callback function to determine whether the FPGA is ready to commence bridge interface transactions. If NULL is passed, then bridge interface initialization proceeds without making a determination of whether the FPGA is ready to commence bridge interface transactions or not. |
user_arg | A user defined argument value for passing support data to the fpga_is_ready callback function. |
ALT_E_SUCCESS | The operation was succesful. |
ALT_E_ERROR | The operation failed. |
ALT_STATUS_CODE alt_bridge_uninit | ( | ALT_BRIDGE_t | bridge, |
alt_bridge_teardown_handshake_t | handshake, | ||
void * | user_arg | ||
) |
Uninitialize the bridge by tearing down the interface in a safe and controlled sequence.
The process of taking down the bridge interface entails:
The mechanism used by alt_bridge_uninit() to initiate the handshake notification to the FPGA soft IP that the bridge interface is being taken down is the user defined handshake callback.
bridge | The bridge interface to uninitialize. |
handshake | A pointer to a user defined tear-down handshake protocol. If NULL is passed, then the bridge interface take down proceeds without conducting any handshake notification protocol. |
user_arg | A user defined argument value for passing support data to the teardown_hs callback function. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |