tb中
void get_cfg_dat(ap_uint<512>* hbuf, const char* cfgdat, int i) {
int size = 64 * 9;
ap_uint<512>* b = hbuf;
memset(b, 0, sizeof(ap_uint<512>) * 9);
std::ifstream p;
p.open(cfgdat, std::ios::in | std::ios::binary);
if (p.is_open()) {
p.seekg(i * size);
char* buffer = new char[size];
p.read(buffer, size);
memcpy(&b[0], buffer, size);
std::cout << "Tags(1x5):" << std::endl;
std::cout << std::hex << b[0].range(7, 0) << std::endl;
...
}
---
ap_uint<512>* ping_buf0; // ping buffer
ping_buf0 = (ap_uint<512>*)malloc(hbm_depth * sizeof(ap_uint<512>));
unsigned char* low_thresh = (unsigned char*)malloc(9 * sizeof(unsigned char));
ap_uint<INPUT_WIDTH>* gen_list = (ap_uint<INPUT_WIDTH>*)malloc(100 * sizeof(long long));
ap_uint<INPUT_WIDTH>* gen_list = (ap_uint<INPUT_WIDTH>*)malloc(100 * sizeof(long long));
bool* check_res = (bool*)calloc(10000, sizeof(bool));