HLS中CSIM和C_RTL_Cosim常用的技巧

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 功能,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值