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: 
Highlighted
Observer hud789
Observer
162 Views
Registered: ‎04-24-2019

Is video stream pipeline in a lengthy process automatically by HLS?

Jump to solution

Hi,

I am new in HLS design. I have a simple demo pseudo code below/ process_function is doing image processing

typedef hls::stream< ap_axiu<24,1,1,1> > AXI_STREAM;
typedef hls::Mat<IMAGE_MAX_ROWS, IMAGE_MAX_COLS, HLS_8UC3> RGB_IMAGE

void top_process_function(AXI_STREAM& inputStream, AXI_STREAM& outputStream)

{

RGB_IMAGE src_mat(rows, cols);
RGB_IMAGE dst_mat(rows, cols);

#pragma HLS DATAFLOW
hls::AXIvideo2Mat(inputStream, src_mat);

process_function(src_mat, dst_mat, cdf_ram);
hls::Mat2AXIvideo(dst_mat, outputStream);

}

In process function

template<int ROWS, int COLS, int SRC_T, int DST_T>
void process_function(hls::Mat<ROWS, COLS, SRC_T>& src_mat, hls::Mat<ROWS, COLS, DST_T>& dst_mat)

{

hls::Scalar<HLS_MAT_CN(SRC_T), HLS_TNAME(SRC_T)> s, d;

for(int y = 0; y < src_mat.rows; y++)
{
    for(int x = 0; x < src_mat.cols; x++)
    {
        #pragma HLS loop_flatten off
        #pragma HLS pipeline II=6

        src_mat >> s;

        lenthy process here to process s and write to d

        dst_mat << d;

}

I have to use #pragma HLS pipeline II=6 to avoid II violation.

My question is, does HLS pipeline the video stream automatically for the lengthy process? Or I have to consider to make the process as fast as possible to keep the pipeline?

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
132 Views
Registered: ‎09-04-2017

Re: Is video stream pipeline in a lengthy process automatically by HLS?

Jump to solution

If there are no data, loop carried dependencies, pipelining would be possible. Since II=6 is what you have given, what you need to make sure is that if there's any data that needs to be present at the start of next iteration be computed and ready within these cycles.

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
133 Views
Registered: ‎09-04-2017

Re: Is video stream pipeline in a lengthy process automatically by HLS?

Jump to solution

If there are no data, loop carried dependencies, pipelining would be possible. Since II=6 is what you have given, what you need to make sure is that if there's any data that needs to be present at the start of next iteration be computed and ready within these cycles.

0 Kudos