[Avrora] Interrupt Service Routine Latency

John Regehr regehr at cs.utah.edu
Thu Mar 2 10:20:02 PST 2006


Typically interrupt latency is defined to be amount of time between when 
the interrupt becomes pending and the time at which the first instruction 
of the handler begins to execute.  So instrumenting RETI would give you 
something other that interrupt latency.

Of course all TinyOS apps permit nested interrupts (often for no clear 
reason).

Ram, inserting a probe on the current instruction is not correct for any 
definition of interrupt latency.  The instruction could be in a function 
that is called from inside the interrupt handler.

John




--
John Regehr, regehr at cs.utah.edu
Assistant Professor, School of Computing, University of Utah

On Mon, 27 Feb 2006, Benjamin Titzer wrote:

> 
> On Feb 25, 2006, at 8:57 PM, Ram Kumar Rengaswamy wrote:
> 
> > Hi,
> >     I am modifying the current InterruptMonitor to also measure ISR
> > latency. Please let me know if the following approach is correct (as I am
> > not familiar with the internal implementation of the the simulator)
> > 
> > Pseudo Code:
> > ------------------
> > Interrupt.fireBeforeInvoke(State s, int inum){
> > Insert a probe for the current instruction.
> > Store the invocation timestamp.
> > }
> > 
> > Instruction.fireBefore(State s, int pc){
> > ISR_latency = current_time - invocation_timestamp;
> > Remove the probe for the current instruction.
> > }
> > 
> > I am assuming that there are no nested interrupts in the program being
> > profiled.
> > 
> 
> Ram, I think the easiest implementation is just to instrument all the RETI
> instructions in the program when the monitor is attached to the program
> (before simulation begins). The probe for the interrupt (fireBeforeInvoke) can
> then record the start time, and then when the probe on the RETI instruction
> fires, it records the end time. You can implement nested handlers with a stack
> of cycle counts, with the most recently entered interrupt at the top.
> 
> -B
> 
> > Thanks,
> > -Ram
> > 
> > On Feb 25, 2006, at 8:11 PM, Ram Kumar Rengaswamy wrote:
> > 
> > > Hi,
> > > 
> > >     Has anybody written a monitor for determining the Interrupt
> > > Service Routine Latency for any given interrupt ? The only way I can
> > > see of doing it right now is to attach a trip-time monitor for the
> > > start-end pair of every ISR.
> > > 
> > > -Ram
> > > _______________________________________________
> > > Avrora mailing list
> > > Avrora at lists.ucla.edu
> > > http://lists.ucla.edu/cgi-bin/mailman/listinfo/avrora
> > > 
> > 
> > _______________________________________________
> > Avrora mailing list
> > Avrora at lists.ucla.edu
> > http://lists.ucla.edu/cgi-bin/mailman/listinfo/avrora
> 
> _______________________________________________
> Avrora mailing list
> Avrora at lists.ucla.edu
> http://lists.ucla.edu/cgi-bin/mailman/listinfo/avrora
> 


More information about the Avrora mailing list