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!

取消
显示结果 
搜索替代 
您的意思是: 
Observer yanjian
Observer
737 次查看
注册日期: ‎11-28-2018

vivado hls 把Mat型变成数组函数Mat2Array怎么用????

void thinning(AXI_STREAM& src, AXI_STREAM& dst_axi, int rows, int cols)
{

gray_IMAGE     dst(rows,cols);

int **arry_imga = new int *[rows];
for (int i = 0; i < rows; i++) {
arry_imga[i] = new int [cols];
}

int* Mat2Array(dst,arry_imga[rows*cols]);

}

 

错误提示:expression list treated as compound expression in initializer [-fpermissive]

0 项奖励
5 条回复5
Xilinx Employee
Xilinx Employee
706 次查看
注册日期: ‎07-17-2008

回复: vivado hls 把Mat型变成数组函数Mat2Array怎么用????

hls::Mat2Array的输入image必须是hls::Mat格式的。

请参考UG902,第532页关于hls::Mat2Array的描述。

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Observer yanjian
Observer
699 次查看
注册日期: ‎11-28-2018

回复: vivado hls 把Mat型变成数组函数Mat2Array怎么用????

我反复研究过UG902参考内容,能否给一个例程。谢谢!!!1
0 项奖励
Xilinx Employee
Xilinx Employee
680 次查看
注册日期: ‎07-17-2008

回复: vivado hls 把Mat型变成数组函数Mat2Array怎么用????

没有现成的例子。从文档表述来看,

首先,你要确认输入的image(在你代码里的dst)是定义成hls::Mat类型的。

其次,你需要定义一个一维数组,例如int array_image[rows*cols];

函数调用采用以下形式:

hls::Mat2Array<cols>(dst,array_image);

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 项奖励
Observer yanjian
Observer
675 次查看
注册日期: ‎11-28-2018

回复: vivado hls 把Mat型变成数组函数Mat2Array怎么用????

能否是二维数组呢???array_img[rows][cols]    ,

hls::Mat2Array<cols>(dst,array_image);  其中<cols>是什么意思??UG902没有这么表达啊!!!

0 项奖励
Xilinx Employee
Xilinx Employee
664 次查看
注册日期: ‎07-17-2008

回复: vivado hls 把Mat型变成数组函数Mat2Array怎么用????

不能是二维数组,UG902里面描述得比较清楚了。

FB_T fb[ROWS*FB_COLS]

<cols>就是重定义模板中的FB_COLS,当rowStride缺省时,表示每行都写。

 

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------