HLS报错解决方法(csim_design failed)
1、undefined reference to `opencv_image_guassianblur(cv::Mat, cv::Mat)'原因:可能是输入或输出图像的通道数与要求的不同。(如应该为三通道输出,但是只定义了单通道的输出)解决方法:如:从改为解决问题。...
目录:
1、hls::stream仿真警告
2、'csim_design' failed: compilation error(s).(2种错误情况)
3、cvShowImage函数不显示,可能是没启用waitkey(0) 导致没有暂停直接消失
4、报错Internal stream ' ' failed dataflow checking: it must be produced and consumed exactly once.单图片只能使用一次的问题。
5、@E Simulation failed: SIGSEGV. ERROR: [SIM 211-100] CSim failed with errors.
6、找不到设计文件“Cannot find any design unit to elaborate”
7、error: non-type template argument of type 'int' is not an integral constant expression
8、with default size is used in a non-dataflow region, which may result in deadlock.
1、hls::stream仿真警告

解决办法:检查设计文件,查看是否定义了stream类型的结构,最后没有使用,或者被综合掉了。
若以上没问题,也可参考该篇文章中对该问题的探讨(stream的数据格式问题以及stream内的数据是否已经被使用):https://mp.csdn.net/editor/html/115481682
2、仿真时出现报错:'csim_design' failed: compilation error(s).

上面还有其他类型的报错:undefined reference to `opencv_image_guassianblur(cv::Mat, cv::Mat)'
原因1:可能是输入或输出图像的通道数与要求的不同。(如应该为三通道输出,但是只定义了单通道的输出)
解决方法:
如:从![]()
改为
解决问题。
原因2:这个理由更正常:没找到头文件。
方法1:尝试在run c simulation时,去掉optimizing compile的钩子,再次run c simulation。
方法2:多次粘贴test.c内的函数名到opencv_function.cpp和opencv_function.h,防止函数名书写错误,导致无法查到。

有时提示

在另一个工程中,打开相同的代码提示:

之后调节了读取图像的数据格式,解决问题。!!!
主要解决方法:1、换个工程下重写复制粘贴,更改图像的数据格式。
(务必要试下新建一个新工程,复制进去看能否成功!!可能是由于工程为复制的工程,引用的头文件还是原来连接的头文件,所以重新创建一个,连接上该有的头文件)
2、报错2:'csim_design' failed: compilation error(s).无其他报错

解决办法1:与1的报错很像,只是没有未定义的提示。
解决方法与1一样:尝试在run c simulation时,去掉optimizing compile的钩子,再次run c simulation。解决!
解决办法2:由于版本问题,同样在c simulation界面,勾选clean build和optimizing compile的钩子(与上面去掉相反,非笔误),再选ok。也解决问题!

![]()
可能是stream的格式错误的原因,需要将stream改为ap_axiu<32,1,1,1>
4、Internal stream ' ' failed dataflow checking: it must be produced and consumed exactly once.
![]()
内部流“img\u 0.data\u stream[0].V”的数据流检查失败:必须只生成和使用一次。
原因是:在上面的程序中,同一个图像数据流被使用了两次。(在vivado中,图像的mat类型其实为stream)。若要使用两次,则需复制一副副本。
解决方法:复制函数
hls::Duplicate(img_0, img_1, img_1_); 该函数可以避免 Hanging Up和read empty.
5、@E Simulation failed: SIGSEGV. ERROR: [SIM 211-100] CSim failed with errors.

问题:图像读取失败,可能是地址写错了。
6、找不到设计文件“Cannot find any design unit to elaborate”

出现原因:这是由于没有添加设计文件;或者是vivado hls的bug,没有及时识别出文件
解决办法:对design文件,删掉再重新添加一次。这样就可以顺利的通过C Synthesis。
7、error: non-type template argument of type 'int' is not an integral constant expression
![]()

在函数中定义mat,不可以使用传入的int参数,应该用常数。
修改为常数后报错误8.
8、 error: '_mask.data_stream[0].V' (mask_use/src/top.cpp:7) with default size is used in a non-dataflow region, which may result in deadlock. Please consider to resize the stream using the directive 'set_directive_stream' or the 'HLS stream' pragma.
暴力解决:添加dataflow

更多推荐




所有评论(0)