XAie_MemAttach - 2024.1 English

AI Engine System Software Driver Reference Manual (UG1642)

Document ID
UG1642
Release Date
2024-05-30
Version
2024.1 English

This is the memory function to attach user allocated memory to the AI Engine partition device instance.

Prototype

AieRC XAie_MemAttach(XAie_DevInst *DevInst, XAie_MemInst *MemInst, u64 DevAddr, u64 VAddr, u64 Size, XAie_MemCacheProp Cache, u64 MemHandle);

Parameters

The following table lists the XAie_MemAttach function arguments.

Table 1. XAie_MemAttach Arguments
Type Member Description
XAie_DevInst * DevInst Device Instance
XAie_MemInst * MemInst Pointer to memory instance which will be filled with attached AI Engine memory instance information by this function.
u64 DevAddr Device address of the allocated memory. It is usually the physical address of the memory. For Linux dmabuf memory, it is the offset to the start of the dmabuf.
u64 VAddr Virtual address of the allocated memory. For Linux dmabuf memory, it is not required, it can be NULL. Cache: Buffer is cacheable or not. MemHandle: Handle of the allocated memory. It is ignored for other backends except Linux backend. For Linux backend, it is the file descriptor of a dmabuf.

Returns

XAIE_OK for success, or error code for failure.