# Pipeline loop with sum

I'm working with a Zedboard and I'm trying to optimize some functions in Vivado HLS.

However, when there are functions like the following where I don't know what to do.

E.g:

for(i=0;i<end;i++){
sum+=i;
}


I can't pipeline this because each cycle depends on the previous. Is there any workaround to make the Pipeline directive function?

I found out what the problem was and why I wasn't able to pipeline this. Vivado HLS found a way to treat sum += ias a constant multiplication and so the latency remained constant.