Complete Partitioning

Complete partitioning deconstructs the array into individual elements along the specified dimension. For a multi-dimensional array, each element of the specified dimension will correspond to a partition with the rest of the dimensions preserved. For a one-dimensional array, individual elements are mapped to registers. If dim(0) is specified, complete partitioning is applied across all dimensions resulting in scalar elements.

Important: Applying complete partitioning on a (array of) struct, partitions all struct fields (including nested struct elements) and array dimensions.

Example

#pragma HLS memory partition variable(_array)
int _array[8];
int _result = 0;
//...
    for (i = 0; i < 8; i++) {
        _result += _array[i];
    }

The example above shows the same example that was shown for access-based partitioning, however, the loop is not unrolled in this case. Access-based partitioning will try to partition the array but will only find one load instruction in the loop that accesses the entire array. This preventing access-based partitioning as all eight accesses come from the same load instruction.

User-specified partitioning can be used to force partitioning of this array with a predefined structure. In the example above, the memory partition pragma specifies the array to be partitioned completely into eight individual elements.

Info: Partitioning memory: _array into 8 partitions.

The benefit in this case is that the loop does not have to be unrolled, which can be useful in cases like when the loop is pipelined and cannot be unrolled (see 3.5.1.8 Loop Pipelining).