Data Mover

The data mover transfers data between PS and accelerators, and among accelerators. SDSoC™ can generate various types of data movers based on the properties and size of the data being transferred.
Scalar

Scalar data is always transferred by the AXI_LITE data mover.

Array

SDSoC can generate AXIDMA_SG, AXIDMA_SIMPLE, AXIFIFO, AXI_MM, or AXI_LITE data movers, depending on the memory attributes and data size of the array. For example, if the array is allocated usingmalloc(), hence the memory is not physically contiguous, SDSoC typically generates AXI_DMA_SG. However, if the data size is less than 300 bytes, AXI_FIFO is generated instead since the data transfer time is less than AXI_DMA_SG, and it occupies much less PL resource.

Struct or Class

The implementation of structs depends on how the struct is passed to the hardware—passed by value, passed by reference, or as an arrays of structs—and the type of datamover selected. The following table shows the various implementations.

Table 1.Struct Implementations
Struct Pass Method Default (no pragma) #pragma SDS data zero_copy (arg) #pragma SDS data zero_copy (arg[0:SIZE]) #pragma SDS data copy (arg) #pragma SDS data copy (arg[0:SIZE])
pass by value (struct RGB arg) Each field is flattened and passed individually as a scalar or an array. This is not supported and will result in an error. This is not supported and will result in an error. The struct is packed into a single wide scalar.

Each field is flattened and passed individually as a scalar or an array.

The value of SIZE is ignored.

pass by pointer (struct RGB *arg) or reference (struct RGB &arg) Each field is flattened and passed individually as a scalar or an array.

The struct is packed into a single wide scalar and transferred as a single value.

The data is transferred to the hardware accelerator via an AXI4 bus.

The struct is packed into a single wide scalar.

The number of data values transferred to the hardware accelerator via an AXI4 bus is defined by the value of SIZE.

The struct is packed into a single wide scalar.

The struct is packed into a single wide scalar.

The number of data values transferred to the hardware accelerator via an AXIDMA_SG or AXIDMA_SIMPLE is defined by the value of SIZE.

array of struct

(struct RGB arg[1024])

Each struct element of the array is packed into a single wide scalar.

Each struct element of the array is packed into a single wide scalar.

The data is transferred to the hardware accelerator via an AXI4 bus.

Each struct element of the array is packed into a single wide scalar.

The data is transferred to the hardware accelerator via an AXI4 bus.

The value of SIZE overrides the array size and determines the number of data values transferred to the accelerator.

Each struct element of the array is packed into a single wide scalar.

The data is transferred to the hardware accelerator via a data mover such as AXIDMA_SG or AXIDMA_SIMPLE.

Each struct element of the array is packed into a single wide scalar.

The data is transferred to the hardware accelerator via a data mover such as AXIDMA_SG or AXIDMA_SIMPLE.

The value of SIZE overrides the array size and determines the number of data values transferred to the accelerator.

The selection of which data mover to use for transferring an array is dependent on two attributes of the array: data size and physical memory contiguity. For example, if the memory size is 1 MB and not physically contiguous (allocated bymalloc()), you should use AXIDMA_SG. The following table shows the applicability of these data movers.

Table 2.Data Mover Selection
Data Mover Physical Memory Contiguity Data Size (bytes)
AXIDMA_SG Either > 300
AXIDMA_Simple Contiguous < 8M
AXIFIFO Non-contiguous < 300

Normally, the SDSoC™ compiler analyzes the array that is transferred to the hardware accelerator for these two attributes, and selects the appropriate data mover accordingly. However, there are cases where such analysis is not possible. At that time, SDSoC issues a warning message and asks you to specify the memory attributes via SDS pragmas. An example of the message:

WARNING: [SDSoC 0-0] Unable to determine the memory attributes passed to rgb_data_in of function img_process at C:/simple_sobel/src/main_app.c:84
The pragma to specify the memory attributes is:
#pragma SDS data mem_attribute(arg:contiguity)
Where contiguitycan be either PHYSICAL_CONTIGUOUSor NON_PHYSICAL_CONTIGUOUS. The pragma to specify the data size is:
#pragma SDS data copy(arg[offset:size])

Wheresizecan be a number or an arbitrary expression.