设为首页 加入收藏

TOP

在DSP671x上使用Timer统计信号处理算法的时间消耗
2014-11-24 00:14:55 来源: 作者: 【 】 浏览:8
Tags:DSP671x 使用 Timer 统计 信号处理 算法 时间 消耗

代码实例

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正则表达式特性及BRE与ERE的.. 下一篇DSP6000的几个简单优化技巧

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: