Specifies instance restrictions for resource allocation.
The ALLOCATION pragma or directive can limit the number of RTL
instances and hardware resources used to implement specific functions, loops, or
operations. For example, if the C/C++ source has four instances of a function
set_directive_allocation command can ensure that there is only one
foo_sub in the final RTL. All four
instances are implemented using the same RTL block. This reduces resources used by
the function, but negatively impacts performance by sharing those resources.
The operations in the C/C++ code, such as additions,
multiplications, array reads, and writes, can also be limited by the
set_directive_allocation [OPTIONS] <location> <instances>
<location>is the location string in the format
<instances>is a function or operator.
The function can be any function in the original C/C++ code that has not been either inlined by the
set_directive_inlinecommand or inlined automatically by Vitis HLS.
For a complete list of operations that can be limited using the
ALLOCATIONpragma, refer to the config_op command.
Sets a maximum limit on the number of instances (of the type defined by the
-typeoption) to be used in the RTL design.
- The instance type can be
Given a design
foo_top with multiple instances of function
foo, limits the number of instances of
the RTL to 2.
set_directive_allocation -limit 2 -type function foo_top foo
Limits the number of multipliers used in the implementation of
to 1. This limit does not apply to any multipliers that might reside
in sub-functions of
My_func. To limit the multipliers
used in the implementation of any sub-functions, specify an allocation
directive on the sub-functions or inline the sub-function into function
set_directive_allocation -limit 1 -type operation My_func mul