我正在使用 Vivado HLS 2015.4 上的图像。
我得到了大约 311774 个时钟周期的非常高的延迟。即使程序只需要两个输入图像并将其从 RGB 转换为灰色。总延迟为 311774,因为我得到所有三个 77-78k 延迟Axi2Mat
,RGB2GRAY
并且Mat2AXI
.
有什么方法可以减少它,以便我可以通过管道将它的最终延迟设置为 78k 左右?
我附上我的代码和综合报告:
#include <hls_video.h>
#include <hls/hls_video_types.h>
#include "top.h"
void toGray(AXI_IN_STREAM &IN_STREAM_1, AXI_IN_STREAM &IN_STREAM_2, AXI_OUT_STREAM &OUT_STREAM_1, AXI_OUT_STREAM &OUT_STREAM_2, unsigned int cols, unsigned int rows){
#pragma HLS INTERFACE axis port=IN_STREAM_1
#pragma HLS INTERFACE axis port=OUT_STREAM_1
#pragma HLS INTERFACE axis port=IN_STREAM_2
#pragma HLS INTERFACE axis port=OUT_STREAM_2
#pragma HLS RESOURCE core=AXI_SLAVE variable=rows metadata="-bus_bundle CONTROL"
#pragma HLS RESOURCE core=AXI_SLAVE variable=cols metadata="-bus_bundle CONTROL"
#pragma HLS RESOURCE core=AXI_SLAVE variable=return metadata="-bus_bundle CONTROL"
#pragma HLS INTERFACE ap_stable port=rows
#pragma HLS INTERFACE ap_stable port=cols
hls::Mat<MAX_HEIGHT, MAX_WIDTH, HLS_8UC3> inMat_1(rows, cols);
hls::Mat<MAX_HEIGHT, MAX_WIDTH, HLS_8UC3> inMat_2(rows, cols);
hls::Mat<MAX_HEIGHT, MAX_WIDTH, HLS_8UC1> grayMat_1(rows, cols);
hls::Mat<MAX_HEIGHT, MAX_WIDTH, HLS_8UC1> grayMat_2(rows, cols);
// hls::Mat<MAX_HEIGHT, MAX_WIDTH, HLS_8UC1> outMat(rows, cols);
hls::AXIvideo2Mat(IN_STREAM_1, inMat_1);
hls::AXIvideo2Mat(IN_STREAM_2, inMat_2);
hls::CvtColor<HLS_BGR2GRAY, HLS_8UC3, HLS_8UC1>(inMat_1, grayMat_1);
hls::CvtColor<HLS_BGR2GRAY, HLS_8UC3, HLS_8UC1>(inMat_2, grayMat_2);
// hls::EqualizeHist(grayMat, outMat );
hls::Mat2AXIvideo(grayMat_1, OUT_STREAM_1);
hls::Mat2AXIvideo(grayMat_2, OUT_STREAM_2);
}