3.6.1.5 Loop Dependence
(Ask a Question)- Syntax
#pragma HLS loop dependence variable(<var_name>) type(inter) direction(RAW|WAR|WAW) dependent(true|false)
- Description
- Specifies the loop-carried dependence of a variable to eliminate false
dependency and improve pipeline initiation interval (II).
HLS loop dependence
pragma configuration overrides the loop dependency analysis result in the tool.Important: Users are advised to carefully verify the loop dependency information specified. An incorrect loop dependency information leads the tool to generate incorrect hardware design. - Parameters
-
Parameter Value Optional Default Description variable/argument
String No - Variable/Argument Name. type
inter
No - Dependence Type. inter
is the dependence between different loop iterations.direction
RAW|WAR|WAW
Yes - Specifies the loop dependence direction. Only valid for
Whentype(inter).
direction
is not specified, thedependent
parameter is applicable to all 3 directions.dependent
true|false
Yes false
Specifies if there is a loop-carried dependence for the given type
anddirection
. - Position
- Before the beginning of the loop. If there is a loop label, the pragma should be placed after the label.
- Examples
-
int f(int x[100], int j /*j is odd*/) { int res = 0; loop: #pragma HLS loop pipeline #pragma HLS loop dependence argument(x) type(inter) direction(RAW) dependent(false) for (int i = 0; i < 100; i = i + 2 /*i is even*/) { res += x[i]; x[i + j] += 1; } return res; }