Bug fix: check if vm exists
[avr-sim.git] / SimulationClock.h
blobc1b48a9c12ead8f46d81a9c9d43612909cf77601
1 #ifndef AVR_SIMULATIONCLOCK_H
2 #define AVR_SIMULATIONCLOCK_H
4 #include "Clock.h"
6 namespace avr {
8 class SimulationObject;
10 /**
11 * The SimulationClock class is used to coordinate the timing
12 * between the different peripherals within a processor and
13 * in some cases, the timing between several simulated
14 * processors and modules.
16 * Simulation objects can be notified at a specific
17 * instance in time by setting a break point.
19 class SimulationClock : public Clock<SimulationObject> {
20 public:
21 SimulationClock() : finished(false), maxTicks(0) {}
23 public:
24 void exec();
25 void finish() { finished = true; }
26 void setMaxTicks(ClockOffset ticks) { maxTicks = ticks; }
28 private:
29 bool finished;
30 ClockOffset maxTicks;
35 #endif /*AVR_SIMULATIONCLOCK_H*/