Xilinx / xfopencv

Other
321 stars 144 forks source link

Vivado HLS compilation code [HLS 200-70] Help #60

Closed Hooyuan closed 5 years ago

Hooyuan commented 5 years ago

ERROR: [HLS 200-70] Compilation errors found: In file included from ../Users/zf/Desktop/sobelxpy.cpp:1: ../Users/zf/Desktop/sobelxpy.cpp:116:3: error: no matching function for call to 'Sobel'

hls::Sobel<0

^~~~

C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_imgproc.h:2623:6: note: candidate template ignored: failed template argument deduction void Sobel (

 ^

C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_imgproc.h:2606:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'BORDERMODE' void Sobel (

 ^

In file included from ../Users/zf/Desktop/sobelxpy.cpp:1:

../Users/zf/Desktop/sobelxpy.cpp:119:3: error: no matching function for call to 'Sobel'

hls::Sobel<0,0,1,3>(img_in, img_out);

^~~~~~~

C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_imgproc.h:2623:6: note: candidate template ignored: failed template argument deduction void Sobel (

 ^

C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_imgproc.h:2606:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'BORDERMODE' void Sobel (

 ^

In file included from ../Users/zf/Desktop/sobelxpy.cpp:1:

../Users/zf/Desktop/sobelxpy.cpp:121:3: error: no matching function for call to 'Sobel'

hls::Sobel<0,0,1,3>(img_in, img_out);

^~~~~~~

C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_imgproc.h:2623:6: note: candidate template ignored: failed template argument deduction void Sobel (

 ^

C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_imgproc.h:2606:6: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'BORDERMODE' void Sobel (

 ^

In file included from ../Users/zf/Desktop/sobelxpy.cpp:1:

In file included from ../Users/zf/Desktop/sobelxpy.cpp:4:

In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\hls_video.h:48:

In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_axi_io.h:39:

In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_axi_sdata.h:86:

In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot/ap_int.h:349:

In file included from C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed.h:55:

C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed_base.h:837:13: warning: shift count is negative [-Wshift-count-negative] ret.V <<= (_AP_I - _AP_W);

        ^   ~~~~~~~~~~~~~~~

C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed_base.h:868:69: note: in instantiation of member function 'ap_fixed_base<20, 12, true, 5, 3, 0>::to_ap_int_base' requested here inline attribute((always_inline)) int to_int() const { return to_ap_int_base().to_int(); }

                                                                ^

C:/Xilinx/Vivado/2018.3/common/technology/autopilot\ap_fixed_base.h:1031:78: note: in instantiation of member function 'ap_fixed_base<20, 12, true, 5, 3, 0>::to_int' requested here inline attribute((always_inline)) operator char() const { return (char)to_int(); }

                                                                         ^

../Users/zf/Desktop/sobelxpy.cpp:50:13: note: in instantiation of member function 'ap_fixed_base<20, 12, true, 5, 3, 0>::operator char' requested here gray = const1 pin.val[0] + const2 pin.val[1] + const3 * pin.val[2];

        ^

1 warning and 3 errors generated.

Failed during preprocessing.

while executing

"source C:/projectYuan/sobelXpY/solution1/csynth.tcl"

invoked from within

"hls::main C:/projectYuan/sobelXpY/solution1/csynth.tcl"

("uplevel" body line 1)

invoked from within

"uplevel 1 hls::main {*}$args"

(procedure "hls_proc" line 5)

invoked from within

"hls_proc $argv" sobelXpY:solution1 Jun 25, 2019, 2:40:26 PM

Code: #ifndef _EXAMPLE_SPLITH

define _EXAMPLE_SPLITH

include

typedef hls::stream< ap_axiu<24,1,1,1> > AXI_STREAM; typedef hls::Mat<1080,1920, HLS_8UC3> RGB_IMAGE;

typedef hls::Scalar<1, unsigned char> GRAY_PIX; typedef hls::Scalar<3, unsigned char> RGB_PIX;

typedef ap_fixed<10,2, AP_RND, AP_SAT> coeff_type;

define INPUT_IMAGE "test_1080p.bmp"

define OUTPUT_IMAGE "test_output_1080p.bmp"

void split_ip(AXI_STREAM& input, AXI_STREAM& output, int a);

endif

/*

coeff_type const1 = 0.114; coeff_type const2 = 0.587; coeff_type const3 = 0.2989;

void RGB2Gray( RGB_IMAGE& img_in, RGB_IMAGE& img_out ) {

RGB_PIX pin;
RGB_PIX pout;
char gray;

L_row: for(int row = 0; row < 1080; row++) {

pragma HLS LOOP_TRIPCOUNT min=1 max=1080

L_col: for(int col = 0; col < 1920; col++) {

pragma HLS LOOP_TRIPCOUNT min=1 max=1920

pragma HLS loop_flatten off

pragma HLS PIPELINE II = 1

       img_in >> pin;

       gray =  const1 * pin.val[0] + const2 * pin.val[1] + const3 * pin.val[2];
       pout.val[0] = gray;
       pout.val[1] = gray;
       pout.val[2] = gray;

       img_out << pout;
    }
}

}

/*

/*

L_row: for(int row = 0; row < 1080; row++) {

pragma HLS LOOP_TRIPCOUNT min=720 max=1080

L_col: for(int col = 0; col < 1920; col++) {

pragma HLS LOOP_TRIPCOUNT min=1280 max=1920

pragma HLS loop_flatten off

pragma HLS PIPELINE II = 1

       img_in0 >> pin0;
       img_in1 >> pin1;

       pout = (pin0 + pin1);

       img_out << pout;
    }
}

}

void add( RGB_IMAGE& img_in, RGB_IMAGE& img_out, char direction ) {

if(direction==1)
    hls::Sobel<0
    ,1,0,3>(img_in, img_out);
else if(direction == 0)
    hls::Sobel<0,0,1,3>(img_in, img_out);
else
    hls::Sobel<0,0,1,3>(img_in, img_out);

}

/*

L_row: for(int row = 0; row < 1080; row++) {

pragma HLS LOOP_TRIPCOUNT min=720 max=1080

L_col: for(int col = 0; col < 1920; col++) {

pragma HLS LOOP_TRIPCOUNT min=1280 max=1920

pragma HLS loop_flatten off

pragma HLS PIPELINE II = 1

       img_in >> pin;

       pout = pin;

       img_out0 << pout;
       img_out1 << pout;
    }
}

}

void split_ip(AXI_STREAM& in_data, AXI_STREAM& out_data) {

pragma HLS INTERFACE axis register port=in_data

pragma HLS INTERFACE axis register port=out_data

pragma HLS INTERFACE ap_ctrl_none port=return

pragma HLS dataflow

RGB_IMAGE img_0(1080, 1920);
RGB_IMAGE img_1(1080, 1920);
RGB_IMAGE img_2(1080, 1920);
RGB_IMAGE img_3(1080, 1920);
RGB_IMAGE img_4(1080, 1920);
RGB_IMAGE img_5(1080, 1920);
RGB_IMAGE img_6(1080, 1920);

// Convert AXI4 Stream data to hls::mat format
hls::AXIvideo2Mat(in_data, img_0);

//Convert to gray image
RGB2Gray(img_0, img_1);

//copy the input image
copy2(img_1, img_2, img_3);

//sobel functions
sobel(img_2, img_4, 0);
sobel(img_3, img_5, 1);

//add sobel x and y
add2(img_4, img_5, img_6);

//Convert the mat to Axi video stream
hls::Mat2AXIvideo(img_6, out_data);

}

Hi, im new to Vivado HLS and i am trying out an online Video Processing project where i have to create a Sobel IP for the vivado proect but i can't seem to get past this compilation error. Please teach me/ help me out