3.5.1.10 Loop Dependence

SmartHLS Loop Dependence can be applied to specify the loop-carried dependence of a variable to eliminate false dependency and improve pipeline initiation interval (II). The example below illustrates a read-after-write case. Without knowing the run time value of offset, this loop can only achieve II=2. If user knows that offset is always 0, and indicates that there is no loop-carried dependence with the pragma, then II=1 can be achieved.

void dut( int a[N], int b[N], int offset ) {
#pragma HLS function top
 
    #pragma HLS loop pipeline
    #pragma HLS loop dependence argument(a) type(inter) direction(RAW) dependent(false)
    for (int i = 0; i<N; i++) {
      b[i] = a[i];
      a[i+offset] = 0;
    }
}