UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer roader
Observer
1,042 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
Scholar u4223374
Scholar
1,288 Views
Registered: ‎04-26-2015

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

Jump to solution

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
Scholar jmcclusk
Scholar
1,018 Views
Registered: ‎02-24-2014

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

Jump to solution

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
Scholar u4223374
Scholar
1,289 Views
Registered: ‎04-26-2015

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

Jump to solution

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
Observer roader
Observer
973 Views
Registered: ‎10-14-2015

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

Jump to solution

Thanks

0 Kudos