3.5.1.6 Specifying the Top-level Function

When compiling software to HLS hardware with SmartHLS, you must specify the top-level function for your program. Then SmartHLS will compile the specified top-level function and all of its descendant functions to hardware. The remainder of the program (for example, parent functions of the top-level function, typically the main function) becomes a software testbench that is used for Simulate HLS Hardware (SW/HW Co-Simulation). The top-level function is specified with the pragma, #pragma HLS function top, directly on the source code, below the function prototype, as shown below:

void hw_top(int a, int b) {
   #pragma HLS function top
   ...
   ...
}