cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
2,008 Views
Registered: ‎03-19-2017

Synchronization of two video AXI-Streams by HLS C code

Jump to solution

Please, any simple HLS C example for Synchronization of two video AXI-Streams, I need to do some operation for two input stream data. Thank you.

0 Kudos
1 Solution

Accepted Solutions
2,026 Views
Registered: ‎03-19-2017

Sorry, I make a mistake, the code of line "valOut.data = (valIn1.data>>1 + valIn2.data>>1);" is wrong itself.

After fixed it, HLS could sync two input stream great.

Thank you.

View solution in original post

0 Kudos
4 Replies
chrisz
Xilinx Employee
Xilinx Employee
1,955 Views
Registered: ‎05-06-2008

Hello p.ching.kuang@gmail.com,

 

Depending upon the functionality of the code, the two video streams maybe synchronized automatically. What are you wanting to do with the two video AXI-Streams?

 

Thanks,
Chris

0 Kudos
1,942 Views
Registered: ‎03-19-2017

Dear,

Below is my simple source code, it could work properly if I make outputimage is equal to be inputimage1 (by code of valOut.data = valIn1.data;), but it will failed if I do image average job by the code of below "valOut.data = (valIn1.data>>1 + valIn2.data>>1);" ? Why?

 

#define MAX_HEIGHT 1080

#define MAX_WIDTH 1920

void image32_two2one(AXI_STREAM32 &inputImage1, AXI_STREAM32 &inputImage2, AXI_STREAM32 &outputImage)
{

#pragma HLS INTERFACE axis port=inputImage1 bundle=INPUT1_STREAM
#pragma HLS STREAM depth=20000 variable=inputImage1
#pragma HLS INTERFACE axis port=inputImage2 bundle=INPUT2_STREAM
#pragma HLS STREAM depth=20000 variable=inputImage2
#pragma HLS INTERFACE axis port=outputImage bundle=OUTPUT_STREAM

const int rows = MAX_HEIGHT;
const int cols = MAX_WIDTH;
ap_axiu<32,1,1,1> valIn1, valIn2;
ap_axiu<32,1,1,1> valOut;

 

#pragma HLS DATAFLOW

 

for (int idy = 0; idy < rows; idy++)
{
for (int idx = 0; idx < cols; idx++)
{
#pragma HLS PIPELINE
// Read and cache (Block here if FIFO sender is empty)
valIn1 = inputImage1.read();
valIn2 = inputImage2.read();

//valOut.data = (valIn1.data>>1 + valIn2.data>>1); //failure ?
valOut.data = valIn1.data;  //pass

// Just copy from the input the other side-channels (keep,strobe,id,dest,last)
valOut.keep = valIn1.keep;
valOut.strb = valIn1.strb;
valOut.user = valIn1.user;
valOut.last = valIn1.last;
valOut.id = valIn1.id;
valOut.dest = valIn1.dest;

outputImage.write(valOut);
}
}

}

 

0 Kudos
1,941 Views
Registered: ‎03-19-2017
my vivado/hls version is for 2015.4
0 Kudos
2,027 Views
Registered: ‎03-19-2017

Sorry, I make a mistake, the code of line "valOut.data = (valIn1.data>>1 + valIn2.data>>1);" is wrong itself.

After fixed it, HLS could sync two input stream great.

Thank you.

View solution in original post

0 Kudos