DSPRelated.com
Forums

Regarding MIPS/MCPS calculation

Started by Ramana Reddy Polaka October 4, 2005
Hi,
Can anybody tell me how to calculate MIPS or MCPS on ARM, Which cycle count
has to be considered, is it Total or Core_cycles from Debugger
internals->statistics.
I used below formula for calculation of MIPS
MIPS = Total cycles*Sampling frequency/(No of frames * Samples per frame
*100000)
Thanks in advance
John Ramana P


hi ramana ,

it depends on whether u r using ADS or AEL ( working with simulator on
windows / board using linux respectively).

if u r doing ADS , then better way is to use batch file instead of
using core cycles from Debugger internals -> statistics.

say ur module is ABC and function u r calling is XYZ.

to find the cycles consumed by function ABC , use the function clock( );

the skeleton is like this .

itn main(void){

long int cycle=0, max_cycles=0, total_cycles=0,i=0;

for(i=0;i<NUMBER_OF_FRAMES,i++)

cycle = clock();
XYZ(Arg1, Arg2 ..... ArgN);
cycle = clock()-cycle;
total_cycles += cycle;

if(max_cycles < cycle)
max_cycles = cycle;
} /* for() ends */

printf("Max cycles are %d\n", max_cycles);
printf("Total cycles are %d\n", total_cycles);
}/* main() ends*/ The batch file say xyz.bat (this should present in the folder
where test wrapper exists) contents are like this ...
@-
echo on
del *.log
@echo Copy the .axf file from the debugrel to the current folder

copy XYZ_Data\DebugRel\XYZ.axf xyz_run.axf

armsd -cpu arm9e-s -exec -Clock 100 xyz_run.axf LIST OF COMMAND LINE
ARGUMENTS >> XYZ.log
fc/b XYZ_out.bin XYZ_ref.bin
@- The batch file does the following :

just copies the *.axf from DebugRel folder to current folder and runs
the executable.
LIST OF COMMAND LINE ARGUMENTS are the arguments that the wrapper is
expecting as inputs.
The results will be logged into the file XYZ.log.

As we know the total speech duration we have processed , and so can
easily find out the MCPS.

MCPS are the cycles consumed to process the 1 sec speech data.

Say if the Max cycles we have got are MAX_CYCLES . Say we have
processed speech of "N" frames and each frame is of
"M" samples , speech is sampled at Fs samples per second , then

MAX_CYCLES * Fs
Max MCPS = ----------------------------
(N * M) * (10^6)

And MIPS is different from MCPS , MIPS is Million Instructions Per
Second.
And as we know , some instructions may take more than 1 cycle , MIPS >=
MCPS
provided the processor doesnt support VILW or super scalar architecture.
Incase it support VLIW or super scalar , the pocessor may execute more
than 1 instruction per cycles , in that case
we cant gaurantee MIPS>=MCPS.

Note : When u r using the above mentioned method , u must use batch
file concept . If u just use clock() to find cycles and print the total
cycles and max cycles
on console of debugger u get wrong results , becos we are not providing
the debugger the value of processor speed in MHz. But in batch file we
are providing the processor speed 100MHz.

If any mistakes , pls let me know .

Regards
Murali Mohan Ramana Reddy Polaka wrote:

>Hi,
> Can anybody tell me how to calculate MIPS or MCPS on ARM, Which cycle count
>has to be considered, is it Total or Core_cycles from Debugger
>internals->statistics.
> I used below formula for calculation of MIPS
> MIPS = Total cycles*Sampling frequency/(No of frames * Samples per frame
>*100000)
> Thanks in advance
> John Ramana P
>


Hi Ramana,
The way ur calculating MIPS on ARM is correct. The
cycle count is the total cycles (the last column)on
the debugger internals statistics.r u using ADS 1.2.
regards
Bob

--- Ramana Reddy Polaka <ramana.polaka@rama...>
wrote:

> Hi,
> Can anybody tell me how to calculate MIPS or MCPS
> on ARM, Which cycle count
> has to be considered, is it Total or Core_cycles
> from Debugger
> internals->statistics.
> I used below formula for calculation of MIPS
> MIPS = Total cycles*Sampling frequency/(No of
> frames * Samples per frame
> *100000)
> Thanks in advance
> John Ramana P