I am working on accelerating a C++ function using SDSoC 2018.3 Vivado HLS. This function simply takes an array of pointers (allocated in the PS using sds_alloc). Then, it loops over this array, extracts each element of it (which is an address to a DDR memory), and reads the data located in this address.
Here is a simple function that demonstrates the idea:
float get_data_from_DDR(float *data_addresses_array[10], unsigned int size)
{
float * address;
float sum = 0;
for(unsigned int i = 0; i< 10; i++)
{
address = data_addresses_array[i];
for(unsigned int j = 0; j<size; j++ ) {
sum += address[j];
}
}
return sum;
}
The issue is that, SDSoC raises an error if I pass array of pointers as an argument for the top level function.
After digging in "ug902" manual of Vivado, I found that:
“Vivado HLS supports pointers to pointers for synthesis but does not support them on the top-level interface, that is, as argument to the top-level function. If you use a pointer to pointer in multiple functions, Vivado HLS inlines all functions that use the pointer to pointer. Inlining multiple functions can increase run time.”
I don't know how to tackle this problem.
Any help is appreciated.