DMAs: Moving Data Across Areas

group aml_dma

Management of low-level memory movements.

AML DMA is the abstraction for handling memory movements. AML DMA can asynchronously move data from one area to another. While performing a movement, DMA operation may also translates from a source tiling to a different destination tiling.

build-doxygen/xml/dma.png

Defines

AML_DMA_REQUEST_TYPE_INVALID

Internal macros used for tracking DMA request types. Invalid request type. Used for marking inactive requests in the vector.

AML_DMA_REQUEST_TYPE_COPY

Internal macros used for tracking DMA request types. Copy request type. Uses memcpy() for data migration.

Functions

int aml_dma_copy(struct aml_dma *dma, ...)

Requests a synchronous data copy between two different tiles, using memcpy() or equivalent.

Return

0 if successful; an error code otherwise.

Parameters
  • dma: an initialized DMA structure.

  • dt: an argument of type struct aml_tiling*; the destination tiling structure.

  • dptr: an argument of type void*; the start address of the complete destination user data structure.

  • dtid: an argument of type int; the destination tile identifier.

  • st: an argument of type struct aml_tiling*; the source tiling structure.

  • sptr: an argument of type void*; the start address of the complete source user data structure.

  • stid: an argument of type int; the source tile identifier.

int aml_dma_async_copy(struct aml_dma *dma, struct aml_dma_request **req, ...)

Requests a data copy between two different tiles. This is an asynchronous version of aml_dma_copy().

Return

0 if successful; an error code otherwise.

Parameters
  • dma: an initialized DMA structure.

  • req: an address where the pointer to the newly assigned DMA request will be stored. Variadic arguments: see aml_dma_copy().

int aml_dma_wait(struct aml_dma *dma, struct aml_dma_request *req)

Waits for an asynchronous DMA request to complete.

Return

0 if successful; an error code otherwise.

Parameters
  • dma: an initialized DMA structure.

  • req: a DMA request obtained using aml_dma_async_*() calls.

int aml_dma_cancel(struct aml_dma *dma, struct aml_dma_request *req)

Tears down an asynchronous DMA request before it completes.

Return

0 if successful; an error code otherwise.

Parameters
  • dma: an initialized DMA structure.

  • req: a DMA request obtained using aml_dma_async_*() calls.

struct aml_dma_ops
#include <aml.h>

aml_dma_ops is a structure containing operations for a specific aml_dma implementation. These operation are operation are detailed in the structure. They are specific in:

  • the type of aml_area source and destination,

  • the progress engine performing the operation,

  • the type of of source and destination data structures.

Each different combination of these three points may require a different set of dma operations.

struct aml_dma
#include <aml.h>

aml_dma is an abstraction for (asynchronously) moving data from one area to another. The implementation of dma to use is depends on the source and destination areas. The appropriate dma choice is delegated to the user.

See

struct aml_area.