The c2h compiler operates at the function level – Altera Nios II C2H Compiler User Manual
Page 14

1–8
9.1
Altera Corporation
Nios II C2H Compiler User Guide
November 2009
C2H Compiler Concepts
The C2H Compiler Operates at the Function Level
Code you want to accelerate must be expressed as an individual C
function. The C2H Compiler converts all code within and below the
chosen function to a hardware accelerator block. If the function you are
accelerating calls a subfunction, the C2H Compiler also converts the
subfunction to a hardware accelerator. Therefore, you must be careful that
subfunctions are also good candidates for C2H acceleration.
If the code you want to accelerate is not isolated in a separate function, a
good practice is to partition the function to separate the critical section
into its own function. The resulting hardware accelerator then replaces
only processor-intensive tasks, rather than setup or control tasks which
the processor can implement efficiently.