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: 
Observer mustafa60
Observer
715 Views
Registered: ‎07-17-2019

hls::mat () error

hi all,

 I have a problem and I am stuck. I wanna try a code to make a HLS IP for my video processing purposes. The compiler gives an error while synthisizing the cpp code.

 

Compiling ../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/test.cpp in debug mode
Compiling ../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/opencv_top.cpp in debug mode
Compiling ../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/top.cpp in debug mode
In file included from C:/Xilinx/Vivado_HLS/2015.4/include/floating_point_v7_0_bitacc_cmodel.h:143:0,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_half.h:40,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls/utils/x_hls_utils.h:37,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls/hls_axi_io.h:40,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_video.h:48,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_opencv.h:50,
from ../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/test.cpp:50:
C:/Xilinx/Vivado_HLS/2015.4/include/gmp.h:62:0: warning: "__GMP_LIBGMP_DLL" redefined [enabled by default]
C:/Xilinx/Vivado_HLS/2015.4/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition
In file included from C:/Xilinx/Vivado_HLS/2015.4/include/floating_point_v7_0_bitacc_cmodel.h:143:0,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_half.h:40,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls/utils/x_hls_utils.h:37,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls/hls_axi_io.h:40,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_video.h:48,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_opencv.h:50,
from ../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/opencv_top.cpp:44:
C:/Xilinx/Vivado_HLS/2015.4/include/gmp.h:62:0: warning: "__GMP_LIBGMP_DLL" redefined [enabled by default]
C:/Xilinx/Vivado_HLS/2015.4/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition
In file included from C:/Xilinx/Vivado_HLS/2015.4/include/floating_point_v7_0_bitacc_cmodel.h:143:0,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_half.h:40,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls/utils/x_hls_utils.h:37,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls/hls_axi_io.h:40,
from C:/Xilinx/Vivado_HLS/2015.4/include/hls_video.h:48,
from ../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/top.h:47,
from ../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/top.cpp:43:
C:/Xilinx/Vivado_HLS/2015.4/include/gmp.h:62:0: warning: "__GMP_LIBGMP_DLL" redefined [enabled by default]
C:/Xilinx/Vivado_HLS/2015.4/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition
../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/top.cpp: In function 'void image_filter(AXI_STREAM&, AXI_STREAM&, long long unsigned int*, int, int)':
../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/top.cpp:72:39: error: no matching function for call to 'Sum(GRAY_IMAGE&)'
../../../../../FPGA-Motion-Detector-master/Vivado_HLS_MotionDetect/src_files/top.cpp:72:39: note: candidate is:
C:/Xilinx/Vivado_HLS/2015.4/include/hls/hls_video_arithm.h:1027:34: note: template<class DST_T, int ROWS, int COLS, int SRC_T> hls::Scalar<(((SRC_T & ((512 - 1) << 4)) >> 4) + 1), DST_T> hls::Sum(hls::Mat<ROWS, COLS, T>&)
make: *** [obj/top.o] Error 1
@E [SIM-1] 'csim_design' failed: compilation error(s).

 

 

 

and the code is 

 

 

/***************************************************************************
Modified by Russell Barnes for ECE 253 Final Project, Fall 2016

* © Copyright 2013 Xilinx, Inc. All rights reserved.

* This file contains confidential and proprietary information of Xilinx,
* Inc. and is protected under U.S. and international copyright and other
* intellectual property laws.

* DISCLAIMER
* This disclaimer is not a license and does not grant any rights to the
* materials distributed herewith. Except as otherwise provided in a valid
* license issued to you by Xilinx, and to the maximum extent permitted by
* applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH
* ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
* EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES
* OF MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR
* PURPOSE; and (2) Xilinx shall not be liable (whether in contract or
* tort, including negligence, or under any other theory of liability)
* for any loss or damage of any kind or nature related to, arising under
* or in connection with these materials, including for any direct, or any
* indirect, special, incidental, or consequential loss or damage (including
* loss of data, profits, goodwill, or any type of loss or damage suffered
* as a result of any action brought by a third party) even if such damage
* or loss was reasonably foreseeable or Xilinx had been advised of the
* possibility of the same.

* CRITICAL APPLICATIONS
* Xilinx products are not designed or intended to be fail-safe, or for use
* in any application requiring fail-safe performance, such as life-support
* or safety devices or systems, Class III medical devices, nuclear facilities,
* applications related to the deployment of airbags, or any other applications
* that could lead to death, personal injury, or severe property or environmental
* damage (individually and collectively, "Critical Applications"). Customer
* assumes the sole risk and liability of any use of Xilinx products in Critical
* Applications, subject only to applicable laws and regulations governing
* limitations on product liability.

* THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE AT
* ALL TIMES.

***************************************************************************/
#include "top.h"


void image_filter(AXI_STREAM& video_in1, AXI_STREAM& video_in2, unsigned long long *result, int rows, int cols) {
//Create AXI streaming interfaces for the core
#pragma HLS INTERFACE axis port=video_in1
#pragma HLS INTERFACE axis port=video_in2

#pragma HLS INTERFACE s_axilite port=result bundle=OUTPUT

#pragma HLS INTERFACE s_axilite port=rows bundle=CONTROL_BUS offset=0x14
#pragma HLS INTERFACE s_axilite port=cols bundle=CONTROL_BUS offset=0x1C

#pragma HLS INTERFACE ap_stable port=rows
#pragma HLS INTERFACE ap_stable port=cols

#pragma HLS INTERFACE ap_stable port=return

GRAY_IMAGE img_0(rows, cols);
GRAY_IMAGE img_1(rows, cols);
GRAY_IMAGE img_diff(rows, cols);
hls::Scalar<1, unsigned long long> result_pixel(0);

#pragma HLS dataflow
hls::AXIvideo2Mat(video_in1, img_0);
hls::AXIvideo2Mat(video_in2, img_1);
// Take difference between frames
hls::AbsDiff(img_0, img_1, img_diff);
// Accumulate
result_pixel = hls::Sum( img_diff );    // ERROR İS GİVEN HERE 
*result = result_pixel.val[0];
}

 

 

I couldnt understand whether a header file or something is missing or not.

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
684 Views
Registered: ‎09-04-2017

Re: hls::mat () error

top.h is not included in the attachment that you sent. Can you add it?

Thanks,

Nithin

Observer mustafa60
Observer
675 Views
Registered: ‎07-17-2019

Re: hls::mat () error

top.h is in the attachment file. btw, I dont know whether it helps or not but I am using vivado HLS 2018.3 and the code is written in an old version around 2016.2.

0 Kudos
Xilinx Employee
Xilinx Employee
658 Views
Registered: ‎09-04-2017

Re: hls::mat () error

Can you archive the HLS project and send it, i am facing some other errors trying to reproduce the issue

Thanks,

Nithin

0 Kudos
Observer mustafa60
Observer
649 Views
Registered: ‎07-17-2019

Re: hls::mat () error

Yes of course ,  I am facing this errors too,   I follow the header files and  discover that the input argument of hls:Sum can be wrong and arranged it in such a way described below.

result_pixel = hls::Sum<unsigned long long, MAX_HEIGHT,MAX_WIDTH,HLS_8UC1>(img_diff);

 But gives another error which says the input images cannot be found.

0 Kudos
Observer mustafa60
Observer
648 Views
Registered: ‎07-17-2019

Re: hls::mat () error

Since ı cannot add more than 6 files the other are in the attachment.

0 Kudos