I would require to crop out the first 20 and the last 10 columns of an image on Vivado HLS.
Top Level Function:
#include "video_crop.h"
#include <math.h>
//Top Level Function
void video_crop(AXI_STREAM& s_axis_video,AXI_STREAM& m_axis_video, int hsize_in, int vsize_in)
{
#pragma HLS INTERFACE axis register both port=s_axis_video
#pragma HLS INTERFACE axis register both port=m_axis_video
ap_axiu<24, 1, 1, 1> video;
for(int i = 0; i < vsize_in ; i ++)
{
for(int j = 0; j < hsize_in ; j ++)
{
s_axis_video >> video;
if(j<hsize_in-10) //to crop the last 10 columns
{
if(j>=hsize_in-80) //to crop the first 20 columns
{
m_axis_video << video;
}
}
}
}
}
The first IF statement of the nested IF isn't causing any problems, but the second IF statement is resulting in RTL Simulation Hanging. Would lke to seek help resolving this issue.
In my case, hsize_in and vsize_in are 100, so in the first IF statement, when j<hsize_in-10 and in the second IF statement when j>=hsize_in-80, the last 10 columns and the first 20 columns are to be cropped.
If the column number (j) satisfies both the IF conditions i.e. column number less than 90 and the column number is greater than or equal to 20, then the input should be written into the output video.
However it results in a WARNING: Hls::stream 'hls::stream<ap_axiu<24, 1, 1, 1> >.2' is read while empty, which may result in RTL simulation hanging.
I suspect the issue to be: in the second IF condition when I crop the first 20 columns, the information in column number 20 must be written to column number 0 of the output - This is not happening. I think the information in column number 20 of input is being written into column number 20 of output, hence, the first 20 columns of the output is empty.
How do I solve this?
I've attached the test bench below.
The second IF statement is resulting in RTL Hanging, would like to get some help resolving this issue.
Aucun commentaire:
Enregistrer un commentaire