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 remy561
Observer
702 Views
Registered: ‎06-20-2018

Demosaic kernel: getting II to 1

Jump to solution

Hi all,

 

I'm currently implementing a Demosaic kernel by moving a matrix along the input image. For caching the pixels, I used the prefetching method used in the sobel and convolution examples. However, the compiler seems to be unable to get II lower than 2 due to the two accesses to loadbuffer. My code is as shown below, executing what occurs in the Sobel example on line 130 & 134.

 

 

loop_buf_row: for( int r = 0; r < MATRIX_HEIGHT - 1; r++ ) {			
	// Add values from loadbuffer to end of pixelbuffer
	loop_buf_loadbuf: for( int c = 0; c < BURST_SIZE; c++ ) {
		pixelbuffer[r][(PIXELBUF_WIDTH - BURST_SIZE) + c] = loadbuffer[r][c + index];
	}

	// Write values from start of next line to buffer
	loop_buf_store: for( int c = 0; c < BURST_SIZE; c++ ) {
		loadbuffer[r][c + index] = pixelbuffer[r + 1][c];
		}
	}
}

 

Additionally, my buffers are partitioned similarly as well to lines 93 and 97 in the example:

// Buffer used to process the pixels
uchar pixelbuffer[MATRIX_HEIGHT][PIXELBUF_WIDTH]		
	__attribute__((xcl_array_partition(complete,1)))
	__attribute__((xcl_array_partition(complete,2)))
	;
	
// Buffer used to store loaded pixels
uchar loadbuffer[MATRIX_HEIGHT - 1][LOADBUF_WIDTH]
	__attribute__((xcl_array_partition(complete,1)))
	__attribute__((xcl_array_partition(cyclic,BURST_SIZE,2)))
	;

So, can anybody help me with what I can do to get my II to 1?

My idea so far is to double the cyclic partitioning factor, add an additional burst-sized buffer, and write to loadbuffer on the next cycle. However, as this is not needed in the example, I'd like to know why the approach of the example does not work on my end.

Thanks for your help in advance!

Kind regards,
Remy

0 Kudos
1 Solution

Accepted Solutions
Observer remy561
Observer
626 Views
Registered: ‎06-20-2018

Re: Demosaic kernel: getting II to 1

Jump to solution

Hi Brucey,

 

Thanks for your response.

I have solved the issue by copying the Sobel example one to one, and gradually replacing the Sobel parts with my demosaicing function, making sure II remains 1 with every change I made. :)

Likely some unlucky addressing in my old code caused the dependency issue, however as I'm close to a deadline I do not have the time to analyze my code to find where the exact issue is located.

 

Thanks for your help though!

 

Kind regards,
Remy

View solution in original post

0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
641 Views
Registered: ‎03-24-2010

Re: Demosaic kernel: getting II to 1

Jump to solution

Is "index" used here multiple of BURST_SIZE? It should be.

loadbuffer[r][c + index];  

 And what's the warning message about II not achieved?

Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
Observer remy561
Observer
627 Views
Registered: ‎06-20-2018

Re: Demosaic kernel: getting II to 1

Jump to solution

Hi Brucey,

 

Thanks for your response.

I have solved the issue by copying the Sobel example one to one, and gradually replacing the Sobel parts with my demosaicing function, making sure II remains 1 with every change I made. :)

Likely some unlucky addressing in my old code caused the dependency issue, however as I'm close to a deadline I do not have the time to analyze my code to find where the exact issue is located.

 

Thanks for your help though!

 

Kind regards,
Remy

View solution in original post

0 Kudos