Forum Discussion
Altera_Forum
Honored Contributor
7 years agoThere is no such thing as "function calling" on FPGAs and hence, there is no calling overhead. When you have a separate function that is called in the kernel, the compiler will insert a copy of the function in place of every call. The reason why your II goes up to two must be something else. Can you archive and attach your reports folder?
Furthermore, I don't think it is possible to infer state machines in OpenCL since the compiler pipelines everything; e.g. all if/else or switch/case statement are implemented as multiple same-latency pipelines, each implementing one of the branches, and a MUX at the end to choose the correct output. You might be able to achieve your intended behavior using multiple kernels and blocking/non-blocking channel calls that will allow you to have implicit stalling/synchronizing when the channel is empty/full.