![]() |
aiengine
Vitis Drivers API Documentation
|
This file contains the generic definitions for the AIE drivers.
MODIFICATION HISTORY:
Ver Who Date Changes
1.0 Naresh 03/27/2018 Initial creation 1.1 Naresh 05/23/2018 Added support for bare-metal BSP 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 11/14/2018 Move platform dependent code to xaielib.c 1.6 Nishad 12/05/2018 Renamed ME attributes to AIE 1.7 Hyun 01/08/2019 Add XAieLib_MaskPoll() 1.8 Tejus 10/14/2019 Enable assertion for linux and simulation 1.9 Wendy 02/25/2020 Add Logging API
| 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... | |
| 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. 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_InterruptEnable (void) |
| This API enables AIE interrupt. More... | |
| void | XAieLib_InterruptDisable (void) |
| This API disables AIE interrupt. More... | |
| void | XAieLib_IntPrint (const char *Format,...) |
| This API re-routes to platform print function. More... | |
| void | XAieLib_log (XAieLib_LogLevel Level, const char *Format,...) |
| This API implements AIE logging. More... | |
| u32 | XAieLib_OpenLogFile (const char *File) |
| This API set the log file. More... | |
| void | XAieLib_CloseLogFile (void) |
| This API close the log file. More... | |
| void | XAieLib_MemFinish (XAieLib_MemInst *XAieLib_MemInstPtr) |
| This is the memory function to free the platform specific memory instance. More... | |
| XAieLib_MemInst * | XAieLib_MemInit (u8 idx) |
| This is the memory function to initialize the platform specific memory instance. More... | |
| void | XAieLib_MemDetach (XAieLib_MemInst *XAieLib_MemInstPtr) |
| This is the memory function to detach the memory from device. 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_MemFree (XAieLib_MemInst *XAieLib_MemInstPtr) |
| This is the memory function to free the memory. More... | |
| XAieLib_MemInst * | XAieLib_MemAllocate (u64 Size, u32 Attr) |
| This is the memory function to allocate a 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_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_CloseLogFile | ( | void | ) |
This API close the log file.
| 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().
| void XAieLib_InterruptDisable | ( | void | ) |
| void XAieLib_InterruptEnable | ( | void | ) |
| 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 |
Referenced by XAieLib_OpenLogFile(), and XAieTile_ErrorRegisterNotification().
| 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().
| void XAieLib_log | ( | XAieLib_LogLevel | Level, |
| const char * | Format, | ||
| ... | |||
| ) |
This API implements AIE logging.
| Level | - Log level |
| Format | - format string |
| 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().
| 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().
| u32 XAieLib_OpenLogFile | ( | const char * | File | ) |
This API set the log file.
| File | - path of the file for logging. |
References XAieLib_IntPrint().
| 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().