你好,游客 登录 注册 搜索
背景:
阅读新闻

在DSP671x上使用Timer统计信号处理算法的时间消耗

[日期:2014-03-31] 来源:Linux社区  作者:xiahouzuoxin [字体: ]

代码实例
 
hTimer = TIMER_open(TIMER_DEVANY,0); /* open a timer */

/* Configure the timer. 1 count corresponds to 4 CPU cycles in C67 */
/* control period initial value */
TIMER_configArgs(hTimer, 0x000002C0, 0xFFFFFFFF, 0x00000000);

/* Compute the overhead of calling the timer. */
start = TIMER_getCount(hTimer); /* to remove L1P miss overhead */
start = TIMER_getCount(hTimer); /* get count */
stop = TIMER_getCount(hTimer); /* get count */

overhead = stop - start;
start = TIMER_getCount(hTimer); /* get count */

/* Call a function here. */

/* get count */
diff = (TIMER_getCount(hTimer) – start) ? overhead;
TIMER_close(hTimer);
printf(”%d cycles \n”, diff*4);

 
注意,C6713上定时器的一个计数值对应4个时钟周期。
 
overhead表示Timer本身配置过程的时钟消耗,所以有diff计算,
 
diff = (TIMER_getCount(hTimer) – start) ? overhead; /* get count */

linux
相关资讯       信号处理算法  DSP671x 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款