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: 
Newbie humans
Newbie
281 Views
Registered: ‎10-26-2018

using xf::mat in custum hardware function

Hi guys,

I'm trying to make my custom hardware function through SDSOC revision platform.

I am using ZCU104 board and, I read image and try to find center of white parts of image after threshold.

The code to find center should use image data. So, I made xf::mat and used it to compare with value.

However, error message is occurred. 

 

Please let me know why it is not supported..

 

Here is my code. 

 

void findcenter_accel(xf::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX> &_src)
{

#pragma SDS data access_pattern("_src.data":SEQUENTIAL)
#pragma SDS data copy("_src.data"[0:"_src.size"])
#pragma SDS data mem_attribute("_src_mat.data":NON_CACHEABLE|PHYSICAL_CONTIGUOUS)

unsigned short width = _src.cols;
unsigned short height = _src.rows;

int center_calx = 0, center_caly = 0;
int count = 0;
cols:
for (int i = 0; i < width ; i++)
rows:
for (int j = 0; j < height ; j++)
{
if (_src.data[i*width +j] == 255)
{
center_calx = center_calx + j;
center_caly = center_caly + i;
count++;
}
}

 

Error Message: 

Description Resource Path Location Type
DMAnalysis 83-4432: An unsupported inferred interface type (ap_memory) was detected 

 

0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
232 Views
Registered: ‎08-20-2018

Re: using xf::mat in custum hardware function

Hi @humans 

below pragmas are located at wrong place.These pragmas must be specified immediately preceding a function declaration or immediately
preceding another #pragma SDS bound to the function declaration. I also suggest you to check the order.

#pragma SDS data access_pattern("_src.data":SEQUENTIAL)
#pragma SDS data copy("_src.data"[0:"_src.size"])
#pragma SDS data mem_attribute("_src_mat.data":NON_CACHEABLE|PHYSICAL_CONTIGUOUS)

Please refer below guide.

https://www.xilinx.com/content/dam/xilinx/support/documentation/sw_manuals/xilinx2018_2/ug1253-sdx-pragma-reference.pdf

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
175 Views
Registered: ‎10-17-2017

Re: using xf::mat in custum hardware function

@humans Write the pragmas immediately preceding the function declaration, like this: 

#pragma SDS data access_pattern("_src.data":SEQUENTIAL)
#pragma SDS data copy("_src.data"[0:"_src.size"])
#pragma SDS data mem_attribute("_src_mat.data":NON_CACHEABLE|PHYSICAL_CONTIGUOUS)

void findcenter_accel(xf::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX> &_src); 





 

0 Kudos