pragma SDS partition

Description

The SDSoC environment can automatically generate multiple bitstreams for a single application that are loaded dynamically at run-time. Each bitstream has a corresponding partition identifier.

Important: Your platform might not support bitstream reloading, for example, due to platform peripherals that cannot be shut down and then brought back up after reloading.

The PARTITION pragma is specified immediately preceding a call to a hardware function, directing the compiler to assign the implementation of the hardware function to the specified partition ID. When the SDSoC compiler sees the pragma, it automatically creates the bitstream for the partition, and inserts a call to load the bitstream when it is needed.

Tip: By default, a hardware function is implemented in partition 0.

Syntax

The syntax of this pragma is:
#pragma SDS partition(<ID>)
Where:
  • <ID>: Specified as a positive integer.
    Important: Partition ID 0 is reserved.

Example 1

The following shows an example of the PARTITION pragma:
foo(a, b, c);
 #pragma SDS partition (1)
 bar(c, d);
 #pragma SDS partition (2)
 bar(d, e);

In this example, hardware function foo has no partition pragma, so it is implemented in partition 0. The first call to function bar is implemented in partition 1, which has a separate bitstream that is loaded prior to running the function. The second call to bar is implemented in partition 2.

Example 2

The following example shows an example of using this pragma:
#pragma SDS partition (1)   
    sobel_filter(yc_out_tmp, out_frames[frame]);

In this example, the sobel_filter function is implemented in partition 1, with a unique bitstream that is duynamically loaded when the partition is encountered during execution. After the partition 1 completes, partition 0 resumes operation.

The complete example of the sobel_filter can be found in <install_path>/samples/file_io_manr_sobel_partitions.

See Also