cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
roader
Observer
Observer
1,611 Views
Registered: ‎10-14-2015

Why cannot this loop get a low initiation interval and latency even after complete partitioning

Jump to solution

Hi,

 

I have the following code . The global variable is completely partitioned. I still get a latency of 33 . I am looking to complete this function in 1 clock cycle . I keep getting 

 

Unable to schedule 'load' operation ('window_right_arr_0_l_2', ) on array 'window_right_arr_0' due to limited memory ports. Please consider using a memory core with more ports or partitioning the array 'window_right_arr_0'.

 

Could someone please help me out?

 

 

unsigned char clc()
{
#pragma HLS LATENCY max=1
#pragma HLS INLINE off
#pragma HLS PIPELINE II=1
#pragma HLS ARRAY_PARTITION variable=window_right_arr complete dim=1
#pragma HLS ARRAY_PARTITION variable=window_left_arr complete dim=1


	unsigned char acc = 0;
	unsigned char left_center;
	unsigned char right_center;
	unsigned char right_val;
	unsigned char left_val;
	left_center=window_left_arr[MASK_CENTER][MASK_CENTER];
	right_center=window_right_arr[MASK_CENTER][MASK_CENTER];
	for (int i = 0; i < MASK_HEIGHT; i++) {

		for (int j = 0; j < MASK_WIDTH; j++) {

right_val=window_right_arr[i][j];
left_val=window_left_arr[i][j];
			if (((right_val
					< right_center)
					&& (left_val
							< left_center))
					|| ((right_val
							> right_center)
							&& (left_val
									> left_center))) {

			} else {
				acc = acc + 3;
			}
		}
	}
	return acc;
}

 

 

0 Kudos
1 Solution

Accepted Solutions
u4223374
Advisor
Advisor
1,857 Views
Registered: ‎04-26-2015

Try changing that partition pragma to dim=0 (all dimensions).

 

Also, you're not likely to get latency=1 from this block, simply because for the operation you're doing (potentially over 1000 additions, assuming that MASK_HEIGHT is 33) is going to take a long time. You may well still get II=1.

View solution in original post

0 Kudos
3 Replies
jmcclusk
Mentor
Mentor
1,587 Views
Registered: ‎02-24-2014

your code seems to be mangled a bit..  it's missing the action to take if the if statement in the loop is true..   What happens there?

Don't forget to close a thread when possible by accepting a post as a solution.
0 Kudos
u4223374
Advisor
Advisor
1,858 Views
Registered: ‎04-26-2015

Try changing that partition pragma to dim=0 (all dimensions).

 

Also, you're not likely to get latency=1 from this block, simply because for the operation you're doing (potentially over 1000 additions, assuming that MASK_HEIGHT is 33) is going to take a long time. You may well still get II=1.

View solution in original post

0 Kudos
roader
Observer
Observer
1,542 Views
Registered: ‎10-14-2015

Thanks

0 Kudos