pragma SDS data buffer_depth


This pragma must be specified immediately preceding a function declaration, or immediately preceding another #pragma SDS bound to the function declaration, and applies to all the callers of the function.

This pragma only applies to arrays that map to BRAM or FIFO interfaces. For a BRAM-mapped array, the <BufferDepth> value specifies hardware multi-buffer depth. For a FIFO-mapped array, the <BufferDepth> value specifies the depth of the hardware FIFO allocated for the array. For this pragma, the following must be true:
  • BRAM: 1 ≤ <BufferDepth> ≤ 4, and 2 ≤ ArraySize ≤ 16384.
  • FIFO: <BufferDepth> = 2n, where 4 ≤ n ≤ 20.
Tip: When the pragma is not specified, the default BUFFER_DEPTH is 1.


The syntax of this pragma is:
#pragma SDS data buffer_depth(ArrayName:<BufferDepth>)
  • ArrayName: Specifies one of the formal parameters of the function to assign the pragma to.
  • <BufferDepth> must a compile-time constant value.
  • Multiple arrays can be specified as a comma separated list in one pragma. For example:
    #pragma SDS data buffer_depth(ArrayName1:BufferDepth1, ArrayName2:BufferDepth2)

Example 1

This example specifies a multi-buffer of size 4 used for the RAM interface of argument a:

#pragma SDS data buffer_depth(a:4)
void foo(int a[1024], b[1024);

See Also