Forums

MIPS calculation for a given C code

Started by text...@yahoo.co.in May 9, 2007
HI,

I need to calculate the MIPS taken for a given C code. I have the formula for calculating Mips i.e., MIPS = (avg cycles per instruction)* processor frequency.

but how to calculate the cycles and instruction for the C code.

Now i am using Linux for C coding, also i am not using the TI processor, i am using PowerPC, so can anybody give me your ideas for doing this.

Also can u send me a reply to this mail id nbabu(at)hcl(dot)in
Regards
Narendra
Hi,

first of all this a group for TI's C6000 processors. I doubt someone can
give you an answer on PowerPC.

I would suggest to get a simulator for your processor.

Gustl

t...@yahoo.co.in schrieb:
> HI,
>
> I need to calculate the MIPS taken for a given C code. I have the
> formula for calculating Mips i.e., MIPS = (avg cycles per instruction)*
> processor frequency.
>
> but how to calculate the cycles and instruction for the C code.
>
> Now i am using Linux for C coding, also i am not using the TI processor,
> i am using PowerPC, so can anybody give me your ideas for doing this.
>
> Also can u send me a reply to this mail id nbabu(at)hcl(dot)in
>
> Regards
> Narendra
Narendra-

> I need to calculate the MIPS taken for a given C code. I have the formula for calculating Mips i.e., MIPS = (avg cycles per instruction)* processor frequency.
>
> but how to calculate the cycles and instruction for the C code.
>
> Now i am using Linux for C coding, also i am not using the TI processor, i am using PowerPC, so can anybody give me your ideas for doing this.
>
> Also can u send me a reply to this mail id nbabu(at)hcl(dot)in

My guess is you're asking a TI DSP group because it's active while those PowerPC
groups are fading... squeezed between Intel, Texas Inst, and FPGAs, I guess that's
not surprising.

The basic method for calculating MIPS for arbitrary code execution:

1) Determine MIPS capability of the processor. For example, 500 MIPS.

2) Measure time required for the code chunk to execute. For example, 100 msec.

3) In this example, MIPS required is 50.

You have to be careful when measuring code execution time. Ways that involve "more
code", such as printf(), JTAG-based debug methods, I/O protocols, etc. tend to be
inaccurate. One effective way (uses very small amount of code) is to toggle a GPIO
bit before and after the code and measure on a dig scope.

-Jeff
ya i know this is a group of TI's 6x processor.

But still somebody can give me the idea of how to calculate the MIPS right. So please help me in doing this. I just want to calculate the MIPS for a small C program written.

Regards,
Narendra

Bernhard Gustl Bauer wrote: Hi,

first of all this a group for TI's C6000 processors. I doubt someone can
give you an answer on PowerPC.

I would suggest to get a simulator for your processor.

Gustl

t...@yahoo.co.in schrieb:
> HI,
>
> I need to calculate the MIPS taken for a given C code. I have the
> formula for calculating Mips i.e., MIPS = (avg cycles per instruction)*
> processor frequency.
>
> but how to calculate the cycles and instruction for the C code.
>
> Now i am using Linux for C coding, also i am not using the TI processor,
> i am using PowerPC, so can anybody give me your ideas for doing this.
>
> Also can u send me a reply to this mail id nbabu(at)hcl(dot)in
>
> Regards
> Narendra

---------------------------------
Office firewalls, cyber cafes, college labs, don't allow you to download CHAT? Here's a solution!