Timer8 now has a variable amount of output compare units.
[avr-sim.git] / src / SimulationClock.h
blob6467041a1f65566b6c7d7ea7c04148a3ac8b3c65
1 #ifndef AVR_SIMULATIONCLOCK_H
2 #define AVR_SIMULATIONCLOCK_H
4 #include "Clock.h"
6 namespace avr {
8 class SimulationObject;
10 /**
11 * @author Tom Haber
12 * @date Apr 27, 2008
13 * @brief Coordinates the timing between the components of the simulation.
15 * The SimulationClock class is used to coordinate the timing
16 * between the different peripherals within a processor and
17 * in some cases, the timing between several simulated
18 * processors and modules.
20 * Simulation objects can be notified at a specific
21 * instance in time by setting a break point.
23 class SimulationClock : public Clock<SimulationObject> {
24 public:
25 SimulationClock() : finished(false), maxTicks(0) {}
27 public:
28 void exec();
29 void finish() { finished = true; }
30 void setMaxTicks(ClockOffset ticks) { maxTicks = ticks; }
32 private:
33 bool finished;
34 ClockOffset maxTicks;
39 #endif /*AVR_SIMULATIONCLOCK_H*/