TI C64x系列DSP时间计量
来源:互联网 发布:软件行业数据 编辑:程序博客网 时间:2024/04/28 02:36
http://hi.baidu.com/myyb/blog/item/e1071dce1878d032b700c8c7.html
TI C64x可以有两种方法来得到程序的运行cycle,一个是Enable clock后调用用clock()(这个在VC下是得到以ms为单位的时间,这里得到的是cycle),另一个就是CSL(Chip Support Library)提供的timer。
下面给出两种方法的程序段
/**************************************************************/ /* */ /* Auth:wb0330 */ /* Dest: used to measure cycle counts for TI C64x DSP */ /* Support by: http://hi.baidu.com/videocodec */ /* or QQ group: 24960630,10714050, 11216191 */ /* */ /**************************************************************/ #include <stdio.h> int main() { unsigned int start,stop, overhead,cycles; /*––––––––––––––––––––––––––*/ /* The following example demonstrates how to include */ /* the clock() function in your C code. */ /*––––––––––––––––––––––– – –*/ start = clock(); /* Calculate overhead of calling clock*/ stop = clock(); /* and subtract this value from The results*/ overhead = stop - start; start = clock(); /* ––––––––––––––––––––––––––*/ /* Call a function here. */ /* ––––––––––––––––––––––––––*/ stop = clock(); cycles = stop - start - overhead; printf( “cycles: %d /n ” , cycles); printf("times: %.2f s with cpu 600MHz, /n",((float) cycles /(float)600000000)); // clock() end return 0; } 这里给出CSL_Timer 部分的 /**************************************************************/ /* */ /* Auth:wb0330 */ /* Dest: used to measure cycle counts for TI C64x DSP */ /* Support by: http://hi.baidu.com/videocodec */ /* or QQ group:24960630, 10714050, 11216191 */ /* */ /**************************************************************/ #include <stdio.h> #include "csl.h" #include "csl_timer.h" int main() { TIMER_Handle hTimer; unsigned int start,stop, overhead,diff,cycles; /*––––––––––––––––––––––––––––––––––*/ /* The following sample code shows how to set up the timer */ /* and measure cycle counts with Chip Support Library (CSL) */ /*––––––––––––––––––––––––––––––––––*/ hTimer = TIMER_open(TIMER_DEVANY,0); /* open a timer */ /*––––––––––––––––––––––––––––––––––*/ /* Configure the timer. count corresponds to 8 CPU cycles in C64 */ /*––––––––––––––––––––––––––––––––––*/ /* 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); stop = TIMER_getCount(hTimer); overhead = stop - start; start = TIMER_getCount(hTimer); /* ––––––––––––––––––––––––––––––––––*/ /* Call a function here. */ /* ––––––––––––––––––––––––––––––––––*/ diff = (TIMER_getCount(hTimer) - start) - overhead; TIMER_close(hTimer); cycles =diff*8; printf( “cycles %d /n”,cycles); printf("times: %.2f s with cpu 600MHz, /n",((float) cycles /(float)600000000)); // The maximum resolution of the timer is 8 CPU cycles, since the input clock to // the timer is fixed to the CPU clock divided by eight // CSL_timer end return 0; }
- TI C64x系列DSP时间计量
- TI C64X 程序运行时间
- TI C64X 程序运行时间
- TI DSP C64X 优化基本方法
- TI DSP系列分类
- TI C64X DSP中断向量表配置(硬件中断)
- TI C64X DSP中断向量表配置(硬件中断)
- TI C64x+ DSP CACHE 一致性分析与维护
- TI C64x+ DSP CACHE 一致性分析与维护
- TI C64X DSP中断向量表的配置实现总结
- TI C64x+ DSP CACHE 一致性分析与维护
- TI C64X DSP中断向量表的配置(硬件中断)
- TI C64X DSP中断向量表的配置(硬件中断)
- TI C64X DSP中断向量表的配置(硬件中断)
- 写给TI 6000系列DSP初学者
- TI的tms320系列DSP对比
- 写给TI 6000系列DSP初学者
- TI C6000 系列 DSP 之COFF文件格式
- Struts2与Struts1的对比
- exit(header('location:'.$url));
- Sysgen和Build and Sysgen
- UNIX内核和Shell的交互方法(转)
- 谈谈兽药行业的困惑与希望
- TI C64x系列DSP时间计量
- 关于Cannot use a scalar value as an array的解决办法
- qt qt/embedded qtopia 介绍
- resin eclipse debug模式配置
- Asp 调用WebService示例
- [转]我对CTO的理解
- Facebook应用PHP开发框架Fabos
- JDK 1.6 写Webservice时,runtime modeler error: Wrapper class com.ws.jaxws.DoSomething is not found问题的解决办法
- VB与Matlab混合编程