Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

Compilation step gets very slow with shift register (multiple unrolled shifts)

Altera_Forum
Honored Contributor II
1,484 Views

I just ran into this behaviour when trying to compile an unrolled loop over a shift register. 

The code needs an incredible amount of time to get past the compilation step (Altera Offline Compiler on Windows). 

 

-->The compilation step right before the logic - estimation output. 

 

Issuing Code: 

# pragma unroll for(int i = 0; i < NUM_DISPARITIES; ++i) { ushort sum = 0; # pragma unroll for(int wx = 0; wx < BM_WINDOW; ++wx) { sum += abs((left) - (right)); } //shift register # pragma unroll for (int s = (BM_WINDOW * IMAGE_WIDTH - 1); s > 0; --s) { linSums = linSums; } linSums = sum; }  

 

'left' and 'right' are also shift registers, the problem was the same with using 'linSums' as a 1-Dimensional shift register. 

With NUM_DISPARITIES = 2 the Code needs little more than expected. 

At NUM_DISPARITIES = 16 the compilation step needed over 20 mins. 

 

Maybe this isnt a bug, but bad code or misunderstand use of shift registers ^^ 

 

However I would appreciate any help! 

 

Regards 

Steffen
0 Kudos
0 Replies
Reply