Block Partitioning

Block partitioning aggregates consecutive elements of the original array into partitions. The number of partitions (blocks) is defined by the factor argument.

#pragma HLS memory partition variable(array2d) type(block) dim(1) factor(2)
int array2d[10][20];

For example, in the above code snippet array2d is specified to partition dimension 1 with factor 2. The result is two int[5][20] partitions where the first partitions has elements 0, 1, 2, 3, 4, and the second has elements 5, 6, 7, 8, 9 of dimension 1.

Important: If the number of elements N in the specified dimension is not divisible by factor, all the partitions will have the same size B = ceil(N/factor), except the last partition which will have the remaining elements N - (factor - 1) * B. For example, if N = 10 and factor = 3, the resulting partitions will have 4, 4 and 2 elements respectively.