pragma SDS data access_pattern
Description
This pragma must be specified immediately preceding a function declaration, or immediately preceding another#pragma SDS
bound to the function declaration.
This pragma specifies the data access pattern in the hardware function. SDSoC checks the value of this pragma to determine the hardware interface to synthesize. If the access pattern isSEQUENTIAL
, a streaming interface (such asap_fifo
) will be generated. Otherwise, withRANDOM
access pattern, a RAM interface will be generated.SeeData Motion Network Generation in SDSoCfor more information on the use of this pragma in data motion network generation.
Syntax
#pragma SDS data access_pattern(ArrayName: )
ArrayName
: Specifies one of the formal parameters of the function to assign the pragma to.can be either SEQUENTIAL
orRANDOM
. The default isRANDOM
.
Example 1
A
):
#pragma SDS data access_pattern(A:SEQUENTIAL) void foo(int A[1024], int B[1024])
In the example shown above, a streaming interface will be generated for argumentA
, while a RAM interface will be generated for argumentB
. The access pattern for argumentA
must be A[0], A[1], A[2], ... , A[1023], and all elements must be accessed only once. On the other hand, argumentB
can be accessed in a random fashion, and each element can be accessed zero or more times.
Example 2
#pragma SDS data access_pattern(A:SEQUENTIAL) #pragma SDS data copy(A[0:1024]) void foo(int *A, int B[1024])
In the above example, if argumentA
is intended to be a streaming port, the two pragmas shown must be applied. Without these, SDSoC synthesizes argumentA
as a register (IN, OUT, or INOUT based on the usage ofA
in functionfoo
).
Example 3
zero_copy
pragma and the
access_pattern
pragma:
#pragma SDS data zero_copy(A) #pragma SDS data access_pattern(A:SEQUENTIAL) void foo(int A[1024], int B[1024])
In the above example, theaccess_pattern
pragma is ignored. After thezero_copy
pragma is applied to an argument, an AXI Master interface will be synthesized for that argument.SeeZero Copy Data Moverfor more information.
See Also
- SDSoC Environment Optimization Guide(UG1235)
- The SDSoC Environment