PipelineC icon indicating copy to clipboard operation
PipelineC copied to clipboard

force pipeline stages in for loops

Open suarezvictor opened this issue 2 years ago • 2 comments

It seems that in a foor loop, amount of stages for each iteration ca be fractional, it would be good to force at least one for iteration

for (i=0; i<10; i+=1)
{
    force_pipeline(); //or #pragma
    other_code();
}

suarezvictor avatar Jan 06 '23 08:01 suarezvictor

Sounding very familiar with Vitis HLS style stuff: https://docs.xilinx.com/r/en-US/ug1399-vitis-hls/pragma-HLS-pipeline

#pragma HLS pipeline ex.

   for (int i = 0; i < size; i++) {
       #pragma HLS PIPELINE II=1
        out = in + inc;
    }

image

JulianKemmerer avatar Jan 06 '23 15:01 JulianKemmerer

Also reminded of https://github.com/JulianKemmerer/PipelineC/issues/97

Where by specifying a number of loops and pragma pipeline = "~each loop iteration is pipelined" - you are almost specifying the number of pipeline stages to use directly...

JulianKemmerer avatar Jan 06 '23 15:01 JulianKemmerer