Function Inlining

Similar to function inlining of software functions, it can be beneficial to inline hardware functions.

Function inlining replaces a function call by substituting a copy of the function body after resolving the actual and formal arguments. After that, the inlined function is dissolved and no longer appears as a separate level of hierarchy. Function inlining allows operations within the inlined function be optimized more effectively with surrounding operations, thus improving the overall latency or the initiation interval for a loop.

To inline a function, put #pragma HLS inlineat the beginning of the body of the desired function. The following code snippet directs Vivado HLS to inline the mmult_kernelfunction:
void mmult_kernel(float in_A[A_NROWS][A_NCOLS], float in_B[A_NCOLS][B_NCOLS], float out_C[A_NROWS][B_NCOLS]) { #pragma HLS INLINE int index_a, index_b, index_d; // rest of code body omitted }