我正在使用 cpp 在 Vivado HLS 中编写图像处理应用程序。我收到一个错误,说对ISP(函数调用)的未定义引用我已经多次看到这个错误,并查看了堆栈溢出中的类似情况,并且之前能够进行调试。以前主要是数据类型不匹配,但是我现在似乎无法找到当前版本的问题所在,我花了几个小时试图寻找它,认为全新的眼睛可以提供帮助以及我在这里发布它的原因。我在下面发布了代码的相关部分:
//header file
#include "hls_stream.h"
#include <ap_fixed.h>
//#include <ap_int.h>
#include "ap_int.h"
typedef ap_ufixed<24,24> bit_24;
typedef ap_fixed<11,8> fix;
typedef unsigned char uc;
typedef ap_uint<24> stream_width;
//typedef hls::stream<uc> Stream_t;
typedef hls::stream<stream_width> Stream_t;
struct configuration
{
bool dn;
bool ct;
bool gm;
bool tm;
};
struct pixel_f
{
float r;
float g;
float b;
};
struct pixel_8
{
uc r;
uc g;
uc b;
};
void ISP(Stream_t& in,Stream_t& out, float weights_ct[3][3],float ctrl_pts[3702][3],float weights[3702][3],float coefs[4][3],int num_ctrl_pts,float rev_tone[256][3], configuration config);
.
//testbench file(where the function is called)
float TsTw_tran[3][3];
float ctrl_pts[3702][3];
float coefs[4][3];
float weights[3702][3];
float rev_tone_s[256][3];
Mat img_rev = imread("C:/Users/20181217/Desktop/images/imgs/output_rev.png");
bit_24 pix_in;
configuration config;
config.ct = true;
config.gm = true;
config.tm = true;
Stream_t in("in_tb");
Stream_t out("out_tb");
const int rows = 256;
const int cols = 512;
for(int i=0;i<256;i++)
{
for(int j=0; j<512;j++)
{
in << ((img_rev.at<Vec3b>(i, j)[2] << 16) | (img_rev.at<Vec3b>(i, j)[1] << 8) | (img_rev.at<Vec3b>(i, j)[0]));
}
}
ISP(in,out,TsTw_tran,ctrl_pts,weights,coefs,num_ctrl_pts,rev_tone_s,config);
.
//core file(wher the function is defined)
void ISP(Stream_t& in,Stream_t& out, float TsTw_tran_rec[3][3],float ctrl_pts_rec[3702][3],float weights_rec[3702][3],float coefs_rec[4][3],float num_ctrl_pts, float rev_tone[256][3],configuration version)
我得到的错误是:undefined reference to ISP(hls::stream<ap_uint<24> >&, hls::stream<ap_uint<24> >&, float (*) [3], float (*) [3], float (*) [3], float (*) [3], int, float (*) [3], configuration)' collect2.exe: error: ld returned 1 exit status
任何帮助/建议将不胜感激,
提前致谢