Description
Specifies instance restrictions for resource allocation.
syn.directive.allocation can limit
the number of RTL instances and hardware resources used to implement specific
functions, loops, or operations. If the C/C++ source has four instances of a
function foo_sub, syn.directive.allocation ensures there is only one instance of 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 syn.directive.allocation
command also limits operations in the C/C++ code (additions, multiplications, array
reads, and writes).
Syntax
syn.directive.allocation=[OPTIONS] <location> <instances>
-
<location>is the location string in the formatfunction[/label]. -
<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 thesyn.directive.allocationcommand or inlined automatically by Vitis HLS.
Options
-
limit=<integer> -
Sets a maximum limit on the number of instances (of the type defined by the
typeoption) to be used in the RTL design. -
type=[function|operation] - The instance type can be
function(default) oroperation. For a complete list of supported operations refer to Operator Configuration.
Examples
Given a design foo_top with multiple instances of function
foo, limits the number of instances of foo in
the RTL to 2.
syn.directive.allocation=limit=2 type=function foo_top foo
Limits the number of multipliers used in the implementation of My_func to 1. This limit does not apply to any
multipliers that can 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 My_func.
syn.directive.allocation=limit=1 type=operation My_func mul