--- In motoroladsp@y..., "Nitin Madhukar Yewale"
<nitin.yewale@w...> wrote: > Hi, > Does codewarrior provide any utility like profiler? I want to > know how much time/machine cycles are required for a specific function. > Just to count machine cycles we can use simulator but I don't > know how to use it for each function. > > Regards, > nitin See section 5.2.4.2", Cycle Count Services Specifications", in the SDK Programmer's Guide. Here you can learn how to use the stopwatch function provided by SDK to time your code. Here's an example: void main (void) { UWord32 pCycleCount[2]; cycleCountCalibrate(); cycleCountStart(); // EXECUTE 4 NOPs asm(nop); asm(nop); asm(nop); asm(nop); pCycleCount[0] = cycleCountStop(); if (pCycleCount[0] == CYCLECOUNT_CALIBRATION_FAILURE) { // test failed } cycleCountStart(); // EXECUTE 8 NOPs asm(nop); asm(nop); asm(nop); asm(nop); asm(nop); asm(nop); asm(nop); asm(nop); pCycleCount[1] = cycleCountStop(); if (pCycleCount[1] == CYCLECOUNT_CALIBRATION_FAILURE) { // test failed } cycleCountReport((long *) pCycleCount, 2); } |