1)利用file操作。
FILE *fp;
fp=fopen("result.dat","w");
for (i = 0; i < WINDOW_LEN; i++) {
fprintf(fp, "%d %d \n", hw_result[i],sw_result[i]);
}
fclose(fp);
2)利用printf在console上打印测试信息。
3)利用ap_cint.h定义bit_vector位宽。
// for c type
#include "ap_cint.h"
typedef int16 in_data_t;
typedef int32 out_data_t;
//for cpp type
#include "ap_int.h"
typedef ap_int<16> in_data_t;
typedef ap_int<32> out_data_t;
4)如果需要open wave viewer,必须选择vivado simulator,而不能选择auto或者其他。
dump 选择all或者port,
运行Cosim之后,在simulation->open wave viewer。
在viewer中,
使用ctrl+鼠标滚轮,实现zoom in out 功能,
使用shift+鼠标滚轮,实现scroll left right 功能。
使用shift+鼠标左键,实现measure time 功能,