EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

LPC2148 find program time execution

Started by koutote October 27, 2011
Hi guys,

If I want to find the time execution of a program (or part of it)
can I use the figure of 60MIPS that wiki gives for ARM7TDMI in60MHz?

Using the ARM simulator (Crossworks) I am viewing the total number
of program instructions and I would like to translate them in time
units....

An Engineer's Guide to the LPC2100 Series

It is not that simple,

Instructions take different numbers of cycles even with zero wait state
memory, but in reality the performance will be affected by the speed of the
memory and the data on the bus.

This again gets complicated depending on the type of memory and the traffic
on the bus.

Since the ARM7TDMI is a von-neumann architecture there will be conflicts
between instruction fetches and data accesses, so it also depends on the
nature of the data accesses and any penalty in the system for non-sequential
accesses.

So I'm sorry it sounds complicated, and in reality it depends on how
accurately you want to know it.

Regards

Phil.

From: l... [mailto:l...] On Behalf Of
koutote
Sent: 27 October 2011 17:25
To: l...
Subject: [lpc2000] LPC2148 find program time execution

Hi guys,

If I want to find the time execution of a program (or part of it)
can I use the figure of 60MIPS that wiki gives for ARM7TDMI in60MHz?

Using the ARM simulator (Crossworks) I am viewing the total number
of program instructions and I would like to translate them in time
units....



You could set up one of the timers to run at a high clock rate, say
1MHz, and read the timer at the start and end of the routine to get
its execution time. This is how I have done it, and it works very well.
There is some overhead using this method, but it is pretty accurate.

Mike
-----Original Message-----
From: l... [mailto:l...]On Behalf
Of koutote
Sent: Thursday, October 27, 2011 10:25 AM
To: l...
Subject: [lpc2000] LPC2148 find program time execution
Hi guys,

If I want to find the time execution of a program (or part of it)
can I use the figure of 60MIPS that wiki gives for ARM7TDMI in60MHz?

Using the ARM simulator (Crossworks) I am viewing the total number
of program instructions and I would like to translate them in time
units....

--- In l..., "Michael Anton" wrote:
>
> You could set up one of the timers to run at a high clock rate, say
> 1MHz, and read the timer at the start and end of the routine to get
> its execution time. This is how I have done it, and it works very well.
> There is some overhead using this method, but it is pretty accurate.
>
> Mike
>
This is exactly what to do. Let the hardware timer do the work.

boB

>
> -----Original Message-----
> From: l... [mailto:l...]On Behalf
> Of koutote
> Sent: Thursday, October 27, 2011 10:25 AM
> To: l...
> Subject: [lpc2000] LPC2148 find program time execution
> Hi guys,
>
> If I want to find the time execution of a program (or part of it)
> can I use the figure of 60MIPS that wiki gives for ARM7TDMI in60MHz?
>
> Using the ARM simulator (Crossworks) I am viewing the total number
> of program instructions and I would like to translate them in time
> units....
>
>
Just wanted a very rough first estimation, but it seems that
only the timer will tell the truth.

Thank you all for your help!
--- In l..., "boB G" wrote:
>
> --- In l..., "Michael Anton" wrote:
> >
> > You could set up one of the timers to run at a high clock rate, say
> > 1MHz, and read the timer at the start and end of the routine to get
> > its execution time. This is how I have done it, and it works very well.
> > There is some overhead using this method, but it is pretty accurate.
> >
> > Mike
> >
> This is exactly what to do. Let the hardware timer do the work.
>
> boB
>
> >
> > -----Original Message-----
> > From: l... [mailto:l...]On Behalf
> > Of koutote
> > Sent: Thursday, October 27, 2011 10:25 AM
> > To: l...
> > Subject: [lpc2000] LPC2148 find program time execution
> >
> >
> > Hi guys,
> >
> > If I want to find the time execution of a program (or part of it)
> > can I use the figure of 60MIPS that wiki gives for ARM7TDMI in60MHz?
> >
> > Using the ARM simulator (Crossworks) I am viewing the total number
> > of program instructions and I would like to translate them in time
> > units....
> >
> >
> >
> >
> >
> >
> >
> >
--- In l..., "koutote" wrote:
>
> If I want to find the time execution of a program (or part of it)
> can I use the figure of 60MIPS that wiki gives for ARM7TDMI in60MHz?
>
> Using the ARM simulator (Crossworks) I am viewing the total number
> of program instructions and I would like to translate them in time
> units....

The 60 MIPS refer to the ideal case where you only execute 1-clock instructions. Some instructions take more than one clock, see http://tech.groups.yahoo.com/group/lpc2000/message/7808 .

Karl Olsen


The 2024 Embedded Online Conference