avrora.sim
Class Simulator.ClockCycleTimeout

java.lang.Object
  extended byavrora.sim.Simulator.ClockCycleTimeout
All Implemented Interfaces:
Simulator.Event
Enclosing class:
Simulator

public class Simulator.ClockCycleTimeout
extends java.lang.Object
implements Simulator.Event

The InstructionCountTimeout class is a probe that simply counts down and throws an exception 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.


Field Summary
 long timeout
           
 
Constructor Summary
Simulator.ClockCycleTimeout(long t)
          The constructor for InstructionCountTimeout creates a timeout event with the specified initial value.
 
Method Summary
 void fire()
          The fire() method is called when the timeout is up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeout

public final long timeout
Constructor Detail

Simulator.ClockCycleTimeout

public Simulator.ClockCycleTimeout(long t)
The constructor for InstructionCountTimeout creates a timeout event with the specified initial value.

Parameters:
t - the number of cycles in the future
Method Detail

fire

public void fire()
The fire() method is called when the timeout is up. It gathers the state from the simulator and throws an instance of Simulator.TimeoutException that signals that the timeout has been reached. This exception then falls through the run() method of the caller of the simulator.

Specified by:
fire in interface Simulator.Event