03-01-2020 11:11 PM
I am new to Vitis environment and currently working on application acceleration. The target application extensively uses new function for creating class objects dynamically and object pointers for accessing class member functions. As per my knowledge both of these are not supported in HLS thus not synthesizable. Is there any workaround or equivalent code for such constructs that give similar functionality in hardware?
Thanks in Advance
03-02-2020 12:23 AM
I don't think so....
You could rewrite program to plain "C" or write it without using dynamic elements.
What about making IP container in your code and using it like big function? (still without classes tho) but usings 'if' statements you could synthesise functions and activate it accordingly to needs.
The best workaround is using zynq for abstract logic and fpga for calculations...
03-02-2020 01:02 AM - edited 03-02-2020 01:07 AM
@ramakant_joshi The obvious approach is to create a fixed-length array of these objects at the start and use them as required. You will need to define the maximum number you will ever use, so that HLS can define the total amount of RAM required. If the maximum is unbounded, then you need to define a sensible limit and include appropriate behaviour for when you exceed the limit.
If you also deallocate objects, then you need some memory management system to ensure that they can be reallocated as appropriate.
Edit: or you can find a different algorithm. As @bartokon has said, FPGAs aren't well-suited to this sort of processing.
03-02-2020 01:35 AM
You mean club all the functions at one place and access individual class functions conditionally? Like hardcoding it for a given piece of code.