Hi everyone,
I have a question regarding the usage of hls::task when using an OOP structure for the design.
Suppose to have the following design in main.cc:
fab@fedora: $ make
/usr/bin/g++ main.cc -o main.out -I/eda/xilinx/Vitis_HLS/2022.2/include
main.cc: In function ‘void dut(hls::stream<bool>&, hls::stream<unsigned int>&)’:
main.cc:25:36: error: invalid use of non-static member function ‘void Counter::stream(hls::stream<bool>&, hls::stream<unsigned int>&)’
25 | hls_thread_local hls::task t(cnt.stream, inStream, outStream);
If we try in Vitis HLS:
vitis_hls> csynth_design
INFO: [HLS 200-1510] Running: csynth_design
INFO: [HLS 200-111] Finished File checks and directory preparation: CPU user time: 0.01 seconds. CPU system time: 0.01 seconds. Elapsed time: 0.01 seconds; current allocated memory: 772.094 MB.
INFO: [HLS 200-10] Analyzing design file 'main.cc' ...
ERROR: [HLS 207-2295] reference to non-static member function must be called (main.cc:25:36)
Since when compiling this design I get the error ERROR: Invalid use of non-static member function from the compiler, what is the best solution to wrap the method of a class so that it can be used in an hls::task? With exposed objects like the one I posted here, I can define some helper functions and use the objects as global variables, but now I am starting to call the tasks inside the class itself and this is not feasible anymore. I tried a lambda but it doesn't work. This is the error I get in execution of the C simulation:
terminate called after throwing an instance of 'std::system_error'
what(): Resource temporarily unavailable.
Hi everyone, I have a question regarding the usage of
hls::task
when using an OOP structure for the design. Suppose to have the following design inmain.cc
:Using the following Makefile:
When compiling the design:
If we try in Vitis HLS:
Since when compiling this design I get the error
ERROR: Invalid use of non-static member function
from the compiler, what is the best solution to wrap the method of a class so that it can be used in anhls::task
? With exposed objects like the one I posted here, I can define some helper functions and use the objects as global variables, but now I am starting to call the tasks inside the class itself and this is not feasible anymore. I tried a lambda but it doesn't work. This is the error I get in execution of the C simulation:Thanks in advance :)