![]() |
aiengine
Xilinx SDK Drivers API Documentation
|
This file contains the low level layer interface of the AIE driver with the definitions for the memory write and read operations.
MODIFICATION HISTORY:
Ver Who Date Changes
1.0 Naresh 03/23/2018 Initial creation 1.1 Naresh 05/23/2018 Added bare-metal BSP support 1.2 Naresh 06/18/2018 Updated code as per standalone driver framework 1.3 Naresh 07/11/2018 Updated copyright info 1.4 Hyun 10/10/2018 Added the mask write API 1.5 Hyun 10/11/2018 Don't include the xaieio header for sim build 1.6 Hyun 10/16/2018 Added the baremetal compile switch everywhere it's needed 1.7 Hyun 11/14/2018 Move platform dependent code to xaielib.c 1.8 Nishad 12/05/2018 Renamed ME attributes to AIE 1.9 Hyun 01/08/2019 Implement 128bit IO operations for baremetal 2.0 Hyun 01/08/2019 Add XAieLib_MaskPoll() 2.1 Hyun 04/05/2019 NPI support for simulation 2.2 Nishad 05/16/2019 Fix deallocation of pointer not on heap MISRA-c mandatory violation 2.3 Nishad 08/07/2019 Remove OS specific gaurd from XAieLib_usleep API 2.4 Hyun 09/13/2019 Use the simulation elf loader function 2.5 Hyun 09/13/2019 Use XAieSim_LoadElfMem() 2.6 Tejus 10/14/2019 Enable assertion for linux and simulation
u32 | XAieLib_AssertNonvoid (u8 Cond, const char *func, const u32 line) |
This asserts if the condition doesn't meet. More... | |
void | XAieLib_AssertVoid (u8 Cond, const char *func, const u32 line) |
This asserts if the condition doesn't meet. More... | |
int | XAieLib_usleep (u64 Usec) |
This provides to sleep in micro seconds. More... | |
u32 | XAieLib_LoadElf (XAieGbl_Tile *TileInstPtr, u8 *ElfPtr, u8 LoadSym) |
This API loads the elf to corresponding tile. More... | |
u32 | XAieLib_LoadElfMem (XAieGbl_Tile *TileInstPtr, u8 *ElfPtr, u8 LoadSym) |
This API loads the elf to corresponding tile. More... | |
void | XAieLib_InitDev (void) |
This API initializes the platform specific device instance if needed. More... | |
u32 | XAieLib_InitTile (XAieGbl_Tile *TileInstPtr) |
This API initializes the platform specific tile instance if needed. More... | |
void | XAieLib_InterruptUnregisterIsr (int Offset) |
This API unregisters the interrupt. More... | |
int | XAieLib_InterruptRegisterIsr (int Offset, int(*Handler)(void *Data), void *Data) |
This API registers the handler for interrupt. More... | |
void | XAieLib_IntPrint (const char *Format,...) |
This API re-routes to platform print function. More... | |
XAieLib_MemInst * | XAieLib_MemInit (u8 idx) |
This is the memory function to initialize the platform specific memory instance. More... | |
void | XAieLib_MemFinish (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to free the platform specific memory instance. More... | |
XAieLib_MemInst * | XAieLib_MemAttach (u64 Vaddr, u64 Paddr, u64 Size, u64 MemHandle) |
This is the memory function to attach the external memory to device. More... | |
void | XAieLib_MemDetach (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to detach the memory from device. More... | |
XAieLib_MemInst * | XAieLib_MemAllocate (u64 Size, u32 Attr) |
This is the memory function to allocate a memory. More... | |
void | XAieLib_MemFree (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to free the memory. More... | |
u8 | XAieLib_MemSyncForCPU (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to sync the memory for CPU. More... | |
u8 | XAieLib_MemSyncForDev (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to sync the memory for device. More... | |
u64 | XAieLib_MemGetSize (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to return the size of the memory instance. More... | |
u64 | XAieLib_MemGetVaddr (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to return the virtual address of the memory instance. More... | |
u64 | XAieLib_MemGetPaddr (XAieLib_MemInst *XAieLib_MemInstPtr) |
This is the memory function to return the virtual address of the memory instance. More... | |
void | XAieLib_MemWrite32 (XAieLib_MemInst *XAieLib_MemInstPtr, u64 Addr, u32 Data) |
This is the memory function to write to the physical address. More... | |
u32 | XAieLib_MemRead32 (XAieLib_MemInst *XAieLib_MemInstPtr, u64 Addr) |
This is the memory function to read from the physical address. More... | |
u32 | XAieLib_Read32 (u64 Addr) |
This is the memory IO function to read 32bit data from the specified address. More... | |
void | XAieLib_Read128 (u64 Addr, u32 *Data) |
This is the memory IO function to read 128b data from the specified address. More... | |
void | XAieLib_Write32 (u64 Addr, u32 Data) |
This is the memory IO function to write 32bit data to the specified address. More... | |
void | XAieLib_MaskWrite32 (u64 Addr, u32 Mask, u32 Data) |
This is the memory IO function to write a masked 32bit data to the specified address. More... | |
void | XAieLib_Write128 (u64 Addr, u32 *Data) |
This is the memory IO function to write 128bit data to the specified address. More... | |
void | XAieLib_WriteCmd (u8 Command, u8 ColId, u8 RowId, u32 CmdWd0, u32 CmdWd1, u8 *CmdStr) |
This is the memory IO function to write 128bit data to the specified address. More... | |
u32 | XAieLib_MaskPoll (u64 Addr, u32 Mask, u32 Value, u32 TimeOutUs) |
This is the IO function to poll until the value at the address to be given masked value. More... | |
u32 | XAieLib_NPIRead32 (u64 Addr) |
This is the NPI IO function to read 32bit data from the specified address. More... | |
void | XAieLib_NPIWrite32 (u64 Addr, u32 Data) |
This is the NPI IO function to write 32bit data to the specified address. More... | |
void | XAieLib_NPIMaskWrite32 (u64 Addr, u32 Mask, u32 Data) |
This is the NPI IO function to write a masked 32bit data to the specified address. More... | |
u32 | XAieLib_NPIMaskPoll (u64 Addr, u32 Mask, u32 Value, u32 TimeOutUs) |
This is the NPI IO function to poll until the value at the address to be given masked value. More... | |
u32 XAieLib_AssertNonvoid | ( | u8 | Cond, |
const char * | func, | ||
const u32 | line | ||
) |
This asserts if the condition doesn't meet.
Cond,: | Condition to meet. Should be 0 or 1. |
void XAieLib_AssertVoid | ( | u8 | Cond, |
const char * | func, | ||
const u32 | line | ||
) |
This asserts if the condition doesn't meet.
Can be used for void return function.
Cond,: | Condition to meet. Should be 0 or 1. |
void XAieLib_InitDev | ( | void | ) |
This API initializes the platform specific device instance if needed.
None. |
References XAieIO_Init().
Referenced by XAieGbl_CfgInitialize().
u32 XAieLib_InitTile | ( | XAieGbl_Tile * | TileInstPtr | ) |
This API initializes the platform specific tile instance if needed.
TileInstPtr,: | Tile instance to be initialized |
References XAieTileProc_Init().
Referenced by XAieGbl_CfgInitialize().
int XAieLib_InterruptRegisterIsr | ( | int | Offset, |
int(*)(void *Data) | Handler, | ||
void * | Data | ||
) |
This API registers the handler for interrupt.
Offset,: | The value should one of 1 - 3. |
Handler,: | the callback to be called upon interrupt. |
Data,: | the data to be used with the handler. |
References XAieIO_IntrRegisterIsr().
void XAieLib_InterruptUnregisterIsr | ( | int | Offset | ) |
This API unregisters the interrupt.
Offest,: | Should be 1 - 3. |
References XAieIO_IntrUnregisterIsr().
void XAieLib_IntPrint | ( | const char * | Format, |
... | |||
) |
This API re-routes to platform print function.
format | strings |
u32 XAieLib_LoadElf | ( | XAieGbl_Tile * | TileInstPtr, |
u8 * | ElfPtr, | ||
u8 | LoadSym | ||
) |
This API loads the elf to corresponding tile.
TileInstPtr,: | Tile instance for the elf to be loaded |
ElfPtr,: | path to the elf file |
References XAieSim_LoadElf().
u32 XAieLib_LoadElfMem | ( | XAieGbl_Tile * | TileInstPtr, |
u8 * | ElfPtr, | ||
u8 | LoadSym | ||
) |
This API loads the elf to corresponding tile.
TileInstPtr,: | Tile instance for the elf to be loaded |
ElfPtr,: | pointer to the elf in memory |
References XAieSim_LoadElfMem().
u32 XAieLib_MaskPoll | ( | u64 | Addr, |
u32 | Mask, | ||
u32 | Value, | ||
u32 | TimeOutUs | ||
) |
This is the IO function to poll until the value at the address to be given masked value.
Addr,: | Address to write to. |
Mask,: | Mask to be applied to read data. |
Value,: | The expected value |
TimeOutUs,: | Minimum timeout in usec. |
References XAieLib_Read32(), XAieLib_usleep(), and XAieSim_MaskPoll().
void XAieLib_MaskWrite32 | ( | u64 | Addr, |
u32 | Mask, | ||
u32 | Data | ||
) |
This is the memory IO function to write a masked 32bit data to the specified address.
Addr,: | Address to write to. |
Mask,: | Mask to be applied to Data. |
Data,: | 32-bit data to be written. |
References XAieIO_Read32(), XAieIO_Write32(), and XAieSim_MaskWrite32().
XAieLib_MemInst* XAieLib_MemAllocate | ( | u64 | Size, |
u32 | Attr | ||
) |
This is the memory function to allocate a memory.
Size,: | Size of the memory |
Attr,: | Any of XAIELIB_MEM_ATTR_* |
References XAieIO_MemAllocate().
XAieLib_MemInst* XAieLib_MemAttach | ( | u64 | Vaddr, |
u64 | Paddr, | ||
u64 | Size, | ||
u64 | MemHandle | ||
) |
This is the memory function to attach the external memory to device.
Vaddr,: | Vaddr of the memory |
Paddr,: | Paddr of the memory |
Size,: | Size of the memory |
MemHandle,: | Handle of the memory. For linux, dmabuf fd |
References XAieIO_MemAttach().
void XAieLib_MemDetach | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to detach the memory from device.
XAieLib_MemInstPtr,: | Memory instance pointer. |
References XAieIO_MemDetach().
void XAieLib_MemFinish | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to free the platform specific memory instance.
XAieLib_MemInstPtr,: | Memory instance pointer. |
References XAieIO_MemFinish().
void XAieLib_MemFree | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to free the memory.
XAieLib_MemInstPtr,: | IO Memory instance pointer. |
References XAieIO_MemFree().
u64 XAieLib_MemGetPaddr | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to return the virtual address of the memory instance.
XAieLib_MemInstPtr,: | Memory instance pointer. |
References XAieIO_MemGetPaddr().
u64 XAieLib_MemGetSize | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to return the size of the memory instance.
XAieLib_MemInstPtr,: | Memory instance pointer. |
References XAieIO_MemGetSize().
u64 XAieLib_MemGetVaddr | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to return the virtual address of the memory instance.
XAieLib_MemInstPtr,: | Memory instance pointer. |
References XAieIO_MemGetVaddr().
XAieLib_MemInst* XAieLib_MemInit | ( | u8 | idx | ) |
This is the memory function to initialize the platform specific memory instance.
idx,: | Index of the memory to initialize. |
References XAieIO_MemInit().
u32 XAieLib_MemRead32 | ( | XAieLib_MemInst * | XAieLib_MemInstPtr, |
u64 | Addr | ||
) |
This is the memory function to read from the physical address.
XAieLib_MemInstPtr,: | Memory instance pointer. |
Addr,: | Absolute physical address to write. |
References XAieIO_MemRead32().
u8 XAieLib_MemSyncForCPU | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to sync the memory for CPU.
XAieLib_MemInstPtr,: | IO Memory instance pointer. |
References XAieIO_MemSyncForCPU().
u8 XAieLib_MemSyncForDev | ( | XAieLib_MemInst * | XAieLib_MemInstPtr | ) |
This is the memory function to sync the memory for device.
XAieLib_MemInstPtr,: | IO Memory instance pointer. |
References XAieIO_MemSyncForDev().
void XAieLib_MemWrite32 | ( | XAieLib_MemInst * | XAieLib_MemInstPtr, |
u64 | Addr, | ||
u32 | Data | ||
) |
This is the memory function to write to the physical address.
XAieLib_MemInstPtr,: | Memory instance pointer. |
Addr,: | Absolute physical address to write. |
Data,: | A 32 bit data to write. |
References XAieIO_MemWrite32().
u32 XAieLib_NPIMaskPoll | ( | u64 | Addr, |
u32 | Mask, | ||
u32 | Value, | ||
u32 | TimeOutUs | ||
) |
This is the NPI IO function to poll until the value at the address to be given masked value.
Addr,: | Address to write to. |
Mask,: | Mask to be applied to read data. |
Value,: | The expected value |
TimeOutUs,: | Minimum timeout in usec. |
References XAieLib_NPIRead32(), XAieLib_usleep(), and XAieSim_NPIMaskPoll().
void XAieLib_NPIMaskWrite32 | ( | u64 | Addr, |
u32 | Mask, | ||
u32 | Data | ||
) |
This is the NPI IO function to write a masked 32bit data to the specified address.
Addr,: | Address to write to. |
Mask,: | Mask to be applied to Data. |
Data,: | 32-bit data to be written. |
References XAieIO_NPIRead32(), XAieIO_NPIWrite32(), and XAieSim_NPIMaskWrite32().
u32 XAieLib_NPIRead32 | ( | u64 | Addr | ) |
This is the NPI IO function to read 32bit data from the specified address.
Addr,: | Address to read from. |
References XAieIO_NPIRead32(), and XAieSim_NPIRead32().
Referenced by XAieLib_NPIMaskPoll().
void XAieLib_NPIWrite32 | ( | u64 | Addr, |
u32 | Data | ||
) |
This is the NPI IO function to write 32bit data to the specified address.
Addr,: | Address to write to. |
Data,: | 32-bit data to be written. |
References XAieIO_NPIWrite32(), and XAieSim_NPIWrite32().
void XAieLib_Read128 | ( | u64 | Addr, |
u32 * | Data | ||
) |
This is the memory IO function to read 128b data from the specified address.
Addr,: | Address to read from. |
Data,: | Pointer to the 128-bit buffer to store the read data. |
References XAieIO_Read32(), and XAieSim_Read32().
u32 XAieLib_Read32 | ( | u64 | Addr | ) |
This is the memory IO function to read 32bit data from the specified address.
Addr,: | Address to read from. |
References XAieIO_Read32(), and XAieSim_Read32().
Referenced by XAieLib_MaskPoll().
int XAieLib_usleep | ( | u64 | Usec | ) |
This provides to sleep in micro seconds.
Usec,: | Micro seconds to sleep |
FIXME: Platform implementation of usleep() API, returns void when it is expected to return SUCCESS/FAILURE code. Instead of returning a zero, this API must return SUCCESS/FAILURE code when usleep API is fixed.
Referenced by XAieLib_MaskPoll(), and XAieLib_NPIMaskPoll().
void XAieLib_Write128 | ( | u64 | Addr, |
u32 * | Data | ||
) |
This is the memory IO function to write 128bit data to the specified address.
Addr,: | Address to write to. |
Data,: | Pointer to the 128-bit data buffer. |
References XAieIO_Write128(), and XAieSim_Write128().
void XAieLib_Write32 | ( | u64 | Addr, |
u32 | Data | ||
) |
This is the memory IO function to write 32bit data to the specified address.
Addr,: | Address to write to. |
Data,: | 32-bit data to be written. |
References XAieIO_Write32(), and XAieSim_Write32().
void XAieLib_WriteCmd | ( | u8 | Command, |
u8 | ColId, | ||
u8 | RowId, | ||
u32 | CmdWd0, | ||
u32 | CmdWd1, | ||
u8 * | CmdStr | ||
) |
This is the memory IO function to write 128bit data to the specified address.
Addr,: | Address to write to. |
Data,: | Pointer to the 128-bit data buffer. |
References XAieSim_WriteCmd().