avrora.sim
Class Simulator.InstructionCountTimeout
java.lang.Object
avrora.sim.Simulator.InstructionCountTimeout
- All Implemented Interfaces:
- Simulator.Probe
- Enclosing class:
- Simulator
- public static class Simulator.InstructionCountTimeout
- extends java.lang.Object
- implements Simulator.Probe
The InstructionCountTimeout
class is a probe that simply counts down and throws a
TimeoutException
when the count reaches zero. It is useful for ensuring termination of the
simulator, for performance testing, or for profiling and stopping after a specified number of
invocations.
Method Summary |
void |
fireAfter(Instr i,
int address,
State state)
The fireAfter() method is called after the probed instruction executes. |
void |
fireBefore(Instr i,
int address,
State state)
The fireBefore() method is called before the probed instruction executes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
timeout
public final long timeout
left
protected long left
Simulator.InstructionCountTimeout
public Simulator.InstructionCountTimeout(long t)
- The constructor for
InstructionCountTimeout
creates with the specified initial value.
- Parameters:
t
- the number of clock cycles before timeout should occur
fireBefore
public void fireBefore(Instr i,
int address,
State state)
- The
fireBefore()
method is called before the probed instruction executes. In the
implementation of the timeout, it does nothing.
- Specified by:
fireBefore
in interface Simulator.Probe
- Parameters:
i
- the instruction being probedaddress
- the address at which this instruction residesstate
- the state of the simulation
fireAfter
public void fireAfter(Instr i,
int address,
State state)
- The
fireAfter()
method is called after the probed instruction executes. In the
implementation of the timeout, it simply decrements the timeout and and throws a TimeoutException
when the count reaches zero.
- Specified by:
fireAfter
in interface Simulator.Probe
- Parameters:
i
- the instruction being probedaddress
- the address at which this instruction residesstate
- the state of the simulation