Instrumenting Finite State MachinesMany hardware devices, both on-chip and off-chip, can be represented as finite state machines where the device is in a particular state until it transitions to another state after some time elapses or in response to an external event. For example, the microcontroller itself can be thought to be either in the active mode executing instructions, or in one of the many different sleep modes. The microcontroller is put to sleep by executing the sleep instruction and is awakened by external interrupts.
Several device implementations contain an explicit finite state machine model in the simulation. These finite state machines are represented by the avrora.sim.FiniteStateMachine, which, like a Simulator, allows probes to add instrumentation to the simulation without altering the behavior. The FiniteStateMachine exposes an interface FiniteStateMachine.Probe that allows users to add behavior to the transitions between states that happen during simulation.