01-21-2020 12:15 PM - edited 01-21-2020 01:27 PM
I have 8 calls to the same functions (functionX in the code below) on different inputs (and different ports).
Each parameter is connected to its respective HBM bank.
I would expect Vitis to parallelize them all, instead they run 2 at the time.
Even if I use function instantiate and actually get 8 different hw functions, they still run 2 at the time.
I removed some global variables (static constants) that were used across the functions.
My assumption is that there's some dependencies that I am not seeing.
What can I do to uncover those?
C++ kernel on Vitis targeting Alveo U280, HW Emu, linux Ubuntu.
Pseudo code below.
void functionX(B512 *hbm, uint32 size, char zzz)
#pragma HLS function_instantiate variable=zzz
typedef ap_uint<512> B512;
void kernel(B512 *hbm0, B512 *hbm1, ... , B512 *hbm15, uint32 size)
#pragma HLS INTERFACE m_axi port = hbm0 offset = slave bundle = hbm0
#pragma HLS INTERFACE s_axilite port = hbm0 bundle = control
#pragma HLS INTERFACE m_axi port = hbm15 offset = slave bundle = hbm15
#pragma HLS INTERFACE s_axilite port = hbm15 bundle = control
preprocessBank(hbm0, hbm4, hbm5);
preprocessBank(hbm1, hbm6, hbm7);
preprocessBank(hbm2, hbm8, hbm9);
preprocessBank(hbm3, hbm10, hbm11);
functionX(hbm4, size, 1);
functionX(hbm5, size, 2);
functionX(hbm6, size, 3);
functionX(hbm7, size, 4);
functionX(hbm8, size, 5);
functionX(hbm9, size, 6);
functionX(hbm10, size, 7);
functionX(hbm11, size, 8);
01-22-2020 05:17 AM
After lots of attempts I finally got the tool to generate parallel functions.
The key change was to put each of those 8 functions in 8 different namespaces.
However the question why they weren't parallelized is still open.
More generally, my question is: what are the tools or steps we have to check to make sure whether functions are dependent?