在软件模拟器上和开发板上测的的周期为什么不同呢?

[复制链接]
1302|3
 楼主| jxmzzr 发表于 2014-3-23 18:26 | 显示全部楼层 |阅读模式
下面这段程序中,在ccs4.12下的软件模拟器中和在dsp开发板上测出的时钟周期是不同的,为什么呢?谢谢!
#include <stdio.h>

#include<c6x.h>

unsigned int t_start_l,t_start_h;
unsigned int t_stop_l,t_stop_h;
unsigned int t_overhead_l,t_overhead_h;

int main(int argc, char *argv[])
{
   int i;
   TSCL = 0;
   TSCH = 0;
   t_start_l = TSCL;
   t_start_h = TSCH;
/*
   for (i=0; i<100000000; i++)
   {
      ;
   }
*/
/*此处是我想计时的代码,比较长,这里没有列出








*/
   t_stop_l = TSCL;
   t_stop_h = TSCH;
   t_overhead_l = t_stop_l - t_start_l;
   t_overhead_h = t_stop_h - t_start_h;
   printf("done, t_overhead_h = 0x%08x\tt_overhead_l=0x%08x\n",t_overhead_h,t_overhead_l);
}
拿起书本 发表于 2014-3-26 15:40 | 显示全部楼层
CCS的软件模拟器感觉不是太理想,还是在板子上测的比较靠谱吧。
zhangmangui 发表于 2014-3-30 21:47 | 显示全部楼层
嗯  还是参考板子上的吧
huangfeng33 发表于 2014-6-9 10:34 | 显示全部楼层
这个是肯定不同的呀, 跑的硬件平台不一样 ,速度不一样 ,结果怎么会一样呢?!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

460

主题

2188

帖子

12

粉丝
快速回复 在线客服 返回列表 返回顶部