System utilities#
System utilities to define entrypoint and query information which is only known at VPU runtime.
Macros#
- CUPVA_VPU_MAIN
Entrypoint to CUPVA VPU code.
Functions#
- uint32_t cupvaGetChannelRegAddr(int8_t channel_idx, uint16_t reg_ofst)
Return a channel register address given channel id and register offset.
- uint32_t cupvaGetDmaDescBase(void)
Return base address of the DMA descriptor memory used by this VPU's DMA.
- uint32_t cupvaGetHwseqRamBase(void)
Return base address of the Hwseq memory used by this VPU's DMA.
- uint32_t cupvaGetL2Base(void)
Get the base address of our L2SRAM allocation.
- void cupvaGetL2ExtMemPointer(ExtMemPointer *ptr, uint32_t offset)
Create an ExtMemPointer from a L2 offset.
- uint32_t cupvaGetL2Size(void)
Get the size our L2SRAM allocation.
- uint32_t cupvaGetVmemAddress(void *ptr)
Convert VMEM pointer to arch address.
- uint32_t cupvaGetVmemBase(void)
Return base address of the VMEM owned by this VPU.
- uint32_t cupvaGetVpuId(void)
Return index of the current VPU.
Data Structures#
- ExtMemPointer
Structure to hold information about buffers not stored in VMEM.
- VPUSurfaceData
Structure to hold surface information to be populated at runtime by host API.
- VPUSurfaceMetadata
Structure to hold surface metadata to be populated at runtime by host API.
Typedefs#
- VPUSymbolPointerData
Typedef provided for compatibility.
Functions#
- inline uint32_t cupvaGetChannelRegAddr(
- int8_t channel_idx,
- uint16_t reg_ofst,
Return a channel register address given channel id and register offset.
- Returns:
a channel register address
-
inline uint32_t cupvaGetDmaDescBase(void)#
Return base address of the DMA descriptor memory used by this VPU’s DMA.
For VPU config applications, it is required to update DMA descriptors. This function can be used to get the starting base address of where those DMA descriptors are stored at runtime.
- Returns:
DMA descriptor RAM base address
-
inline uint32_t cupvaGetHwseqRamBase(void)#
Return base address of the Hwseq memory used by this VPU’s DMA.
For VPU config applications, it is required to update Hwseq RAM. This function can be used to get the starting base address of Hwseq memory at runtime.
- Returns:
Hwseq RAM base address
-
inline uint32_t cupvaGetL2Base(void)#
Get the base address of our L2SRAM allocation.
For VPU config applications involving L2SRAM, it is required to know the base of L2 allocation when reconfiguring DMA. Note that the application must have requested an L2 allocation for this value to be valid.
- Returns:
L2 base address which can be used to configure DMA descriptors
- inline void cupvaGetL2ExtMemPointer(
- ExtMemPointer *ptr,
- uint32_t offset,
Create an ExtMemPointer from a L2 offset.
This API fills a pointer to ExtMemPointer object with proper L2 address info.
Pointers passed to this function must be valid and must not be NULL. Failure to do so will result in undefined behavior.
- Parameters:
ptr – The pointer to an ExtMemPointer object.
offset – The offset to a L2 allocation.
-
inline uint32_t cupvaGetL2Size(void)#
Get the size our L2SRAM allocation.
Query the size of the L2 allocation provisioned for this application.
- Returns:
L2 size in bytes
-
inline uint32_t cupvaGetVmemAddress(void *ptr)#
Convert VMEM pointer to arch address.
- Parameters:
ptr – Pointer to some VMEM address. Pointer must be valid and must not be NULL. Failure to do so will result in undefined behavior.
- Returns:
DMA compatible address corresponding to the memory pointed at by ptr.
-
inline uint32_t cupvaGetVmemBase(void)#
Return base address of the VMEM owned by this VPU.
A VPU application can query its base VMEM address for use in reconfiguring DMA.
- Returns:
DMA compatible address corresponding to the base of this VPU’s VMEM.
-
inline uint32_t cupvaGetVpuId(void)#
Return index of the current VPU.
A VPU application can query which VPU it has been dispatched to with this function.
- Returns:
VPU index (0 or 1)
Typedefs#
-
typedef struct ExtMemPointer VPUSymbolPointerData#
Typedef provided for compatibility.
- Deprecated:
VPUSymbolPointerData is deprecated, use ExtMemPointer instead
The type VPUSymbolPointerData has been renamed to ExtMemPointer to better reflect its purpose. This typedef is provided for compatibility reasons, and will be removed in a future release.