Xilinx / xfopencv

Other
321 stars 144 forks source link

xfopencv triggers the use of wrong version of clang(3.1) when using in barebone HLS #53

Closed 3togo closed 5 years ago

3togo commented 5 years ago

Whenever, I want to use xfopencv to synthesis code, it will trigger the following errors.

Strangely enough this bug happens in Vivaldo HLS 2018.3 and 2019.1 but not in 2018.2

ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_storeups': /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/xmmintrin.h:630 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_movntps'; did you mean 'builtin_ia32_movntss'?: /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/xmmintrin.h:678 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_cvtps2pd': /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:380 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_cvtdq2pd'; did you mean 'builtin_ia32_cvtdq2ps'?: /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:386 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_storeupd': /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:586 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_pavgb128': /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:671 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_pavgw128': /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:677 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_storedqu': /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:1177 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_storelv4si'; did you mean 'builtin_ia32_storelps'?: /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:1189 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_movntpd'; did you mean 'builtin_ia32_movntsd'?: /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:1195 ERROR: [HLS 214-124] use of undeclared identifier 'builtin_ia32_movntdq'; did you mean 'builtin_ia32_movntq'?: /tools/Xilinx/Vivado/2019.1/lnx64/tools/clang/lib/clang/3.1/include/emmintrin.h:1201

bgouthamb commented 5 years ago

@3togo Can you post the files that you are trying to synthesize, along with the complete log file?

3togo commented 5 years ago

I assume that opencv and xfopencv are installed in /opt /opt/opencv2/include /opt/xfopencv/include dilation.zip

bgouthamb commented 5 years ago

@3togo You are not supposed to include non-synthesizable files like

opencv/cv.h
opencv2/highgui.hpp
common/xf_sw_utils.h
common/xf_axi.h

in the file targeted for synthesis.

or

The files/code that is not intended for synthesis should be masked with the pre-defined macro __SYNTHESIS__

Example considering your _axiconfig.h:

#ifndef `__SYNTHESIS__`
#include  "common/xf_sw_utils.h"
#include  "common/xf_axi.h"
#include "opencv2/opencv.hpp"
#include  "opencv2/imgproc.hpp"
#include "opencv/cv.h"
#include "opencv2/core/core.hpp"
#include  "opencv2/highgui.hpp"
#endif

#include  "hls_stream.h"
#include "common/xf_common.h"
#include "common/xf_utility.h"
#include  "common/xf_infra.h"
#include "common/xf_axi_sdata.h"
typedef hls::stream< ap_axiu<24,1,1,1> > AXI_STREAM;
/////////////////////////////////////////////////////////////

void dilation_accel(AXI_STREAM& img_data_l, AXI_STREAM& img_data_r, AXI_STREAM& img_data_d);

Go through UG902 to understand HLS Synthesis.

3togo commented 5 years ago

bgouthamb,

Many thanks . Problem Solved

AbdullahHassan041 commented 2 years ago

@3togo how?