Description
set_performance_directive
applies to loops and loop nests, and requires a
known loop tripcount to determine the performance. If your loop has a variable tripcount
then you must also specify set_directive_tripcount
.This pragma or directive specifies a target performance value for the
transaction interval (target_ti
) of loops; where a
transaction is a complete set of loop iterations (tripcount) and the interval is the time
between when the first transaction starts and the second transaction starts. The
set_performance_directive
does not guarantee the specified value will be
achieved, and so it is only a target.
- Target Transaction Interval (
target_ti
) - Specifies the number of clock cycles from the first transaction of a loop, or nested loop, and the start of the next transaction of the loop. Specified as the cycles needed for the loop to complete all iterations and begin the next transaction.
The transaction interval is the initiation interval (II) of the loop times
the number of iterations, or tripcount: target_ti = II *
loop tripcount. Conversely, target_ti
= FreqHz / Operations per second.
For example, assuming an image processing function that processes a single
frame per invocation with a throughput goal of 60 fps, then the target throughput for the
function is 60 invocations per second. If the clock frequency is 180 MHz, then target_ti
is 180M/60, or 3 million clock cycles per function
invocation.
Vitis HLS always tries to achieve the
specified performance target in the design. When set_performance_directive
is specified, the tool automatically applies pragmas or directives such as PIPELINE, UNROLL,
or ARRAY_PARTITION to achieve the target_ti
.
Syntax
Specify the directive for a function, or a labeled loop, or region of code.
set_directive_performance <function/label> -target_ti=<value>
Where:
-
-target_ti=<value>
- Specifies a target transaction interval defined as the number of clock
cycles for the function, loop, or region of code to complete an iteration. The
<value> can be specified as an integer, floating point, or constant expression that
is resolved by the tool as an integer. Note: A warning will be returned if truncation occurs.
Example 1
Function func
is specified to have target
transaction interval of 4 clock cycles:
set_directive_performance func -target_ti=4