I want to calculate MIPs of a function on a microcontroller. Here is how I do it.
1. keil setting. Use Simulator and Xtal = 25MHz
\$\begingroup\$
\$\endgroup\$
1
-
1\$\begingroup\$ Where is the code to review? Please stick to the topic of this forum/choose the right forum. \$\endgroup\$– greybeardCommented Oct 26, 2017 at 10:44
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
4
As you may know, MIPS means Mega Instructions Per Second. So the formula would be
CHIP_MIPS = number_of_mega_instructions / number_of_seconds
.
If your chip is running at 25 MHz, it means that it performs 25 mega instructions per seconds, so knowing the number of seconds and the CHIP_MIPS, the formula would be
number_of_seconds * CHIP_MIPS = number_of_mega_instructions
So fun
needs 5 Mega Intructions
-
1\$\begingroup\$ After reading this and your answer, I think you are correct.
fun
needs 5 Mega Instructions not 5 MIPs. \$\endgroup\$ Commented Oct 26, 2017 at 9:47 -
\$\begingroup\$ That right, sometimes even I say (improperly) I use 5 MIPS on my 25 budget, but it's not correct... and thanks for the link :-) \$\endgroup\$– BebsCommented Oct 26, 2017 at 9:51
-
\$\begingroup\$ The question is blatantly off-topic: Please don't answer off-topic questions. \$\endgroup\$ Commented Oct 26, 2017 at 10:42
-
\$\begingroup\$ Sorry @greybeard, it was my first answering attempt. I though questions about good practices were on-topic. I'll be more careful next time. \$\endgroup\$– BebsCommented Oct 26, 2017 at 10:50