Cyclic Partitioning

Cyclic partitioning interleaves elements from the original array into partitions. The number of interleaved partitions is defined by the factor argument. The array is partitioned cyclically by arbitrating the elements between the partitions, putting one element into each partition before coming back to the first one until the array is fully partitioned.

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

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

Important: If the number of elements N in the specified dimension is not divisible by factor, the number of complete partitions with B = ceil(N/factor) elements will be M = N % factor, and the rest of partitions will have B-1 elements. For example, if N = 10 and factor = 3, the resulting partitions will have 4, 3 and 3 elements respectively.