File manage.h¶
FileList > docs > sw > include > opae > manage.h
Go to the source code of this file.
Functions for managing FPGA configurations. More...
#include <opae/types.h>
Public Functions¶
| Type | Name |
|---|---|
| fpga_result | fpgaAssignPortToInterface (fpga_handle fpga, uint32_t interface_num, uint32_t slot_num, int flags) Assign Port to a host interface. |
| fpga_result | fpgaAssignToInterface (fpga_handle fpga, fpga_token accelerator, uint32_t host_interface, int flags) Assign an accelerator to a host interface. |
| fpga_result | fpgaReconfigureSlot (fpga_handle fpga, uint32_t slot, const uint8_t * bitstream, size_t bitstream_len, int flags) Reconfigure a slot. |
| fpga_result | fpgaReleaseFromInterface (fpga_handle fpga, fpga_token accelerator) Unassign a previously assigned accelerator. |
Detailed Description¶
FPGA accelerators can be reprogrammed at run time by providing new partial bitstreams ("green bitstreams"). This file defines API functions for programming green bitstreams as well as for assigning accelerators to host interfaces for more complex deployment setups, such as virtualized systems.
Public Functions Documentation¶
function fpgaAssignPortToInterface¶
Assign Port to a host interface.
fpga_result fpgaAssignPortToInterface (
fpga_handle fpga,
uint32_t interface_num,
uint32_t slot_num,
int flags
)
This function assign Port to a host interface for subsequent use. Only Port that have been assigned to a host interface can be opened by fpgaOpen().
Parameters:
fpgaHandle to an FPGA object previously opened that both the host interface and the slot belong tointerface_numHost interface numberslot_numSlot numberflagsFlags (to be defined)
Returns:
FPGA_OK on success FPGA_INVALID_PARAM if input parameter combination is not valid. FPGA_EXCEPTION if an exception occcurred accessing the fpga handle. FPGA_NOT_SUPPORTED if driver does not support assignment.
function fpgaAssignToInterface¶
Assign an accelerator to a host interface.
fpga_result fpgaAssignToInterface (
fpga_handle fpga,
fpga_token accelerator,
uint32_t host_interface,
int flags
)
This function assigns an accelerator to a host interface for subsequent use. Only accelerators that have been assigned to a host interface can be opened by fpgaOpen().
Note:
This function is currently not supported.
Parameters:
fpgaHandle to an FPGA object previously opened that both the host interface and the accelerator belong toacceleratoraccelerator to assignhost_interfaceHost interface to assign accelerator toflagsFlags (to be defined)
Returns:
FPGA_OK on success
function fpgaReconfigureSlot¶
Reconfigure a slot.
fpga_result fpgaReconfigureSlot (
fpga_handle fpga,
uint32_t slot,
const uint8_t * bitstream,
size_t bitstream_len,
int flags
)
Sends a green bitstream file to an FPGA to reconfigure a specific slot. This call, if successful, will overwrite the currently programmed AFU in that slot with the AFU in the provided bitstream.
As part of the reconfiguration flow, all accelerators associated with this slot will be unassigned and reset.
Parameters:
fpgaHandle to an FPGA object previously openedslotToken identifying the slot to reconfigurebitstreamPointer to memory holding the bitstreambitstream_lenLength of the bitstream in bytesflagsFlags that control behavior of reconfiguration. Value of 0 indicates no flags. FPGA_RECONF_FORCE indicates that the bitstream is programmed into the slot without checking if the resource is currently in use.
Returns:
FPGA_OK on success. FPGA_INVALID_PARAM if the provided parameters are not valid. FPGA_EXCEPTION if an internal error occurred accessing the handle or while sending the bitstream data to the driver. FPGA_BUSY if the accelerator for the given slot is in use. FPGA_RECONF_ERROR on errors reported by the driver (such as CRC or protocol errors).
Note:
By default, fpgaReconfigureSlot will not allow reconfiguring a slot with an accelerator in use. Add the flag FPGA_RECONF_FORCE to force reconfiguration without checking for accelerators in use.
function fpgaReleaseFromInterface¶
Unassign a previously assigned accelerator.
This function removes the assignment of an accelerator to an host interface (e.g. to be later assigned to a different host interface). As a consequence, the accelerator referred to by token 'accelerator' will be reset during the course of this function.
Note:
This function is currently not supported.
Parameters:
fpgaHandle to an FPGA object previously opened that both the host interface and the accelerator belong toacceleratoraccelerator to unassign/release
Returns:
FPGA_OK on success
The documentation for this class was generated from the following file docs/sw/include/opae/manage.h