set_directive_inline - 2023.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
Release Date
2023.2 English


Removes a function as a separate entity in the RTL hierarchy. After inlining, the function is dissolved into the calling function, and no longer appears as a separate level of hierarchy.

Important: Inlining a function also dissolves any pragmas or directives applied to that function. In Vitis HLS, any pragmas or directives applied to the inlined function are ignored.

In some cases, inlining a function allows operations within the function to be shared and optimized more effectively with the calling function. However, an inlined function cannot be shared or reused, so if the parent function calls the inlined function multiple times, this can increase the area and resource utilization.

By default, inlining is only performed on the next level of function hierarchy.


set_directive_inline [OPTIONS] <location>
  • <location> is the location (in the format function[/label]) where inlining is to be performed.


By default, Vitis HLS performs inlining of smaller functions in the code. Using the -off option disables inlining for the specified function.
By default, only one level of function inlining is performed. The functions within the specified function are not inlined. The -recursive option inlines all functions recursively within the specified function hierarchy.
Important: Recursive inlining of functions in a dataflow region can result in a single function in the region which does not meet the conditions of dataflow. In this case the INLINE -recursive pragma or directive is ignored.


The following example inlines function func_sub1, but no sub-functions called by func_sub1.

set_directive_inline func_sub1
This example inlines function func_sub1, recursively down the hierarchy, except function func_sub2:
set_directive_inline -recursive func_sub1
set_directive_inline -off func_sub2