• 0
David B

Enable pin for Hls hardware accelerated image processing

Question

Hi,

 

I have created an hls ip for sobel on nexys video. It takes the video in via hdmi in port , push it via my ip and then send it out via hdmi out port.

Now, i want to able to control if it display the sobel or display the original image by using a switch. I added a new parameter to top function and an if condition, but i get "ERROR: [XFORM 203-733] An internal stream 'img_6.data_stream[2].V10' (SobelVideoWorking/a.cpp:17) 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.   SobelVideoWorking:solution1  Jan 27, 2019 12:49:03 PM" error.

this is my cpp file:

#include "a.hpp"

void Sobel_filter(AXI_STREAM& INPUT_STREAM, AXI_STREAM& OUTPUT_STREAM, char enable)//, int rows, int cols)
{

#pragma HLS INTERFACE axis port=INPUT_STREAM
#pragma HLS INTERFACE axis port=OUTPUT_STREAM

RGB_IMAGE  img_0(MAX_HEIGHT, MAX_WIDTH);
GRAY_IMAGE img_1(MAX_HEIGHT, MAX_WIDTH);
GRAY_IMAGE  img_2(MAX_HEIGHT, MAX_WIDTH);
GRAY_IMAGE  img_2a(MAX_HEIGHT, MAX_WIDTH);
GRAY_IMAGE  img_2b(MAX_HEIGHT, MAX_WIDTH);
GRAY_IMAGE  img_3(MAX_HEIGHT, MAX_WIDTH);
GRAY_IMAGE  img_4(MAX_HEIGHT, MAX_WIDTH);
GRAY_IMAGE  img_5(MAX_HEIGHT, MAX_WIDTH);
RGB_IMAGE  img_6(MAX_HEIGHT, MAX_WIDTH);
;

#pragma HLS dataflow
hls::AXIvideo2Mat(INPUT_STREAM, img_0);


if(0 == enable)
{
	hls::Mat2AXIvideo(img_0, OUTPUT_STREAM);
} else {
	hls::CvtColor<HLS_BGR2GRAY>(img_0, img_1);
	hls::GaussianBlur<3,3>(img_1,img_2);
	hls::Duplicate(img_2,img_2a,img_2b);
	hls::Sobel<1,0,3>(img_2a, img_3);
	hls::Sobel<0,1,3>(img_2b, img_4);
	hls::AddWeighted(img_4,0.5,img_3,0.5,0.0,img_5);
	hls::CvtColor<HLS_GRAY2RGB>(img_5, img_6);
	hls::Mat2AXIvideo(img_6, OUTPUT_STREAM);
}
}

 and this is the header:

#include  "hls_video.h"
#include <ap_fixed.h>

#define MAX_WIDTH  1280
#define MAX_HEIGHT 720


typedef hls::stream<ap_axiu<24,1,1,1> >           AXI_STREAM;
typedef hls::Mat<MAX_HEIGHT,   MAX_WIDTH,   HLS_8UC3> RGB_IMAGE;
typedef hls::Mat<MAX_HEIGHT,   MAX_WIDTH,   HLS_8UC1> GRAY_IMAGE;


void Sobel_filter(AXI_STREAM& INPUT_STREAM, AXI_STREAM& OUTPUT_STREAM);//int rows, int cols);

I haven't found any solution to the problem. 

 

Thank you!

 

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @David B,

I do not have much experience with HSL. It looks like the Xilinx forums has been working on this issue as well here.

1) At this point I would suggest simulation. Here is a PDF that looks to be helpful for simulating HLS projects.

2) I would also suggest finding other HLS projects that use an enable switch as see how they accomplished the task.

thank you,

Jon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now