cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mohammadhgh
Observer
Observer
2,455 Views
Registered: ‎10-31-2019

HLS failed dataflow checking

Jump to solution

Hi,

I am trying to implement a Median-Blur filter with AXI4-Stream interfaces in Vivado-HLS 2019.2 using Vitis vision library. I started from the example design in Vitis Github repository and then added the streaming interfaces.

I used '#pragma HLS INTERFACE axis' for the input ports and '#pragma HLS stream variable=' for the xf::cv::Mat variables to the Median_Blur function. The code in the cpp file is as follows:

 

 

#include "xf_median_blur_config.h"

void median_blur_accel_ip(hls::stream< xf::cv::ap_axiu<8,1,1,1> >& _src,
						  hls::stream< xf::cv::ap_axiu<8,1,1,1> >& _dst) {

#pragma HLS INTERFACE axis port=_src
#pragma HLS INTERFACE axis port=_dst

	xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPxPC> _img1;
	xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPxPC> _img2;

#pragma HLS stream variable=_img1.data dim=1 depth=1
#pragma HLS stream variable=_img2.data dim=1 depth=1
#pragma HLS dataflow

	xf::cv::AXIvideo2xfMat(_src, _img1);

    xf::cv::medianBlur<WINDOW_SIZE, XF_BORDER_REPLICATE, TYPE, HEIGHT, WIDTH, NPxPC>(_img1, _img2);

    xf::cv::xfMat2AXIvideo(_img2, _dst);
}

 

and the header file is:

 

 

#define NO 1 // Normal Operation
#define RO 0 // Resource Optimized

#define RGB 0
#define GRAY 1
/* Filter window size*/
#define WINDOW_SIZE 3
/*  set the height and weight  */
#define HEIGHT 1290
#define WIDTH 1337

#ifndef _AU_MEDIAN_BLUR_CONFIG_
#define _AU_MEDIAN_BLUR_CONFIG_

#include "hls_stream.h"
#include "ap_int.h"
#include "common/xf_common.hpp"
#include "imgproc/xf_median_blur.hpp"

//mhg includes
#include "common/xf_axi_sdata.hpp"
#include "common/xf_infra.hpp"

#if NO
#define NPxPC XF_NPPC1
#else
#if GRAY
#define NPC1 XF_NPPC8
#define NPxPC XF_NPPC8
#else
#define NPC1 XF_NPPC4
#define NPxPC XF_NPPC4
#endif
#endif

#if GRAY
#define TYPE XF_8UC1
#define CHANNELS 1
#else
#define TYPE XF_8UC3
#define CHANNELS 3
#endif

void median_blur_accel(xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPxPC>& _src,
					   xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPxPC>& _dst);

void median_blur_accel_ip(hls::stream< xf::cv::ap_axiu<8,1,1,1> >& _src,
						  hls::stream< xf::cv::ap_axiu<8,1,1,1> >& _dst);

#endif // end of _AU_MEDIAN_BLUR_CONFIG_H_

 

 

The problem is when I synthesize the design with '#pragma HLS dataflow' directive, it comes with the error of 'failed dataflow checking' on '_src' variable and if I don't use the '#pragma HLS dataflow'  directive, it uses a lot of BRAM blocks for xf::cv::Mat variables. A part of the output log of the synthesis process is:

 

WARNING: [XFORM 203-561] Updating loop lower bound from 1 to 3 for loop 'Loop-0' (/home/mhg/tools/Xilinx/Vitis_Libraries/vision/L1/include/imgproc/xf_median_blur.hpp:386:1) in function 'xf::cv::xFMedian3x3<1290, 1337, 1, 0, 1, 0, 1338, 3, 9>'.
INFO: [XFORM 203-721] Changing loop 'Loop_loop_wait_for_start_proc' (/home/mhg/tools/Xilinx/Vitis_Libraries/vision/L1/include/common/xf_infra.hpp:117) to a process function for dataflow in function 'median_blur_accel_ip'.
INFO: [XFORM 203-721] Changing loop 'Loop_loop_height_proc' (/home/mhg/tools/Xilinx/Vitis_Libraries/vision/L1/include/common/xf_infra.hpp:126) to a process function for dataflow in function 'median_blur_accel_ip'.
INFO: [XFORM 203-721] Changing loop 'Loop_loop_height_proc' (/home/mhg/tools/Xilinx/Vitis_Libraries/vision/L1/include/common/xf_infra.hpp:196) to a process function for dataflow in function 'median_blur_accel_ip'.
ERROR: [XFORM 203-711] Argument '_src.V.data.V' failed dataflow checking: it can only be used in one process.
WARNING: [XFORM 203-713] Argument '_src.V.data.V' has read operations in process function 'Loop_loop_wait_for_start_proc49'.
WARNING: [XFORM 203-713] Argument '_src.V.data.V' has read operations in process function 'Loop_loop_height_proc'.
ERROR: [XFORM 203-711] Argument '_src.V.keep.V' failed dataflow checking: it can only be used in one process.
WARNING: [XFORM 203-713] Argument '_src.V.keep.V' has read operations in process function 'Loop_loop_wait_for_start_proc49'.
WARNING: [XFORM 203-713] Argument '_src.V.keep.V' has read operations in process function 'Loop_loop_height_proc'.
ERROR: [XFORM 203-711] Argument '_src.V.strb.V' failed dataflow checking: it can only be used in one process.
WARNING: [XFORM 203-713] Argument '_src.V.strb.V' has read operations in process function 'Loop_loop_wait_for_start_proc49'.
WARNING: [XFORM 203-713] Argument '_src.V.strb.V' has read operations in process function 'Loop_loop_height_proc'.
ERROR: [XFORM 203-711] Argument '_src.V.user.V' failed dataflow checking: it can only be used in one process.
WARNING: [XFORM 203-713] Argument '_src.V.user.V' has read operations in process function 'Loop_loop_wait_for_start_proc49'.
WARNING: [XFORM 203-713] Argument '_src.V.user.V' has read operations in process function 'Loop_loop_height_proc'.
ERROR: [XFORM 203-711] Argument '_src.V.last.V' failed dataflow checking: it can only be used in one process.
WARNING: [XFORM 203-713] Argument '_src.V.last.V' has read operations in process function 'Loop_loop_wait_for_start_proc49'.
WARNING: [XFORM 203-713] Argument '_src.V.last.V' has read operations in process function 'Loop_loop_height_proc'.
ERROR: [XFORM 203-711] Argument '_src.V.id.V' failed dataflow checking: it can only be used in one process.
WARNING: [XFORM 203-713] Argument '_src.V.id.V' has read operations in process function 'Loop_loop_wait_for_start_proc49'.
WARNING: [XFORM 203-713] Argument '_src.V.id.V' has read operations in process function 'Loop_loop_height_proc'.
ERROR: [XFORM 203-711] Argument '_src.V.dest.V' failed dataflow checking: it can only be used in one process.
WARNING: [XFORM 203-713] Argument '_src.V.dest.V' has read operations in process function 'Loop_loop_wait_for_start_proc49'.
WARNING: [XFORM 203-713] Argument '_src.V.dest.V' has read operations in process function 'Loop_loop_height_proc'.
ERROR: [HLS 200-70] Pre-synthesis failed.
command 'ap_source' returned error code
    while executing
"source /home/mhg/KnitVision/knitvision_embedded/knitvision_hls/hls_median/hls_median/solution1/csynth.tcl"
    invoked from within
"hls::main /home/mhg/KnitVision/knitvision_embedded/knitvision_hls/hls_median/hls_median/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"
Finished C synthesis.

 

In the explanation of the 'ERROR: [XFORM 203-711]', it says that the '#pragma HLS dataflow'  should only be used for variables with single-producer and single-consumer which seems to be true about this design. So does any one know what is the problem with this code?

I would appreciate any help on this issue.

0 Kudos
1 Solution

Accepted Solutions
scampbell
Moderator
Moderator
1,727 Views
Registered: ‎10-04-2011

Hello @ali_flt  and @mohammadhgh ,

We have identified an issue with the xf_infra.hpp file and are working on verifying that. The bug was related to a slightly different issue, but should repair this as well. I think this verified file is the best way forward but appreciate @ali_flt  creating a work around until we can release that to the community. I will update this thread with that new file once verified then.

Thank you,
Scott

View solution in original post

0 Kudos
6 Replies
2,276 Views
Registered: ‎12-28-2018

There seems to be a bug in the AXIvideo2xfMat function in xf_infra.hpp that causes this error in Vivado 2019.2 when using the library with AXI Stream Inputs/Outputs to the accelerated function.

It doesn't like the fact that the AXI_video_strm >> axi; statement is happening in the "loop_wait_for_start" loop and the "loop_height" loop.  If you re-write the function into a single loop reading the AXI_video_strm >> axi; statement, it works.

Hopefully this will get resolved in the next revision, but hope this helps for now.

0 Kudos
wgabor
Contributor
Contributor
2,022 Views
Registered: ‎01-22-2019

Since HLS video library was removed from 2020.1, I will have to move to Vitis Vision - however this issue is a blocker.

Any input from Xilinx, will this be fixed? (Also it is astonishing that this code was not even tested by Xilinx...)

0 Kudos
ali_flt
Adventurer
Adventurer
1,833 Views
Registered: ‎08-10-2020

hi mpotts@minnetronix.com

can you share the changed function with us?

0 Kudos
ali_flt
Adventurer
Adventurer
1,753 Views
Registered: ‎08-10-2020

You were absolutely right mpotts@minnetronix.com 

After waiting for the Xilinx Employees for a fix and not receiving even a comment, I've tried to fix the function myself. I tested it in Csim and in hardware implementation and it seems to be working. What I basically did was merging the loop_wait_for_start and loop_height in a single loop. I've attached the modified "xf_infra.hpp" file.

Note: Additionally I've noticed that the structs defined in "xf_axi_sdata.hpp" are not getting synthesized correctly either :))
so I included <ap_axi_sdata.h> library instead to get the ap_axiu struct working properly.

 

0 Kudos
scampbell
Moderator
Moderator
1,728 Views
Registered: ‎10-04-2011

Hello @ali_flt  and @mohammadhgh ,

We have identified an issue with the xf_infra.hpp file and are working on verifying that. The bug was related to a slightly different issue, but should repair this as well. I think this verified file is the best way forward but appreciate @ali_flt  creating a work around until we can release that to the community. I will update this thread with that new file once verified then.

Thank you,
Scott

View solution in original post

0 Kudos
praseetha
Visitor
Visitor
788 Views
Registered: ‎02-05-2021

Hi ,

I am currently using vitis HLS and still facing the same issue. 

This is the error I am getting-  while executing
"source C:/Users/WS2-Praseetha/Pictures/loop_pipeline2/loop_pipeline/solution1/csynth.tcl"
invoked from within

I am only using 

#praga HLS UNROll 

for two of my loops, when I synthesise it without unrolling I have no erros, but when I use this I get this error. Are there any extra header files i need to add or this an issue with the tool?

 

0 Kudos