14 typedef unsigned long long ClockOffset
;
19 * @brief Template clock class
21 * This class is used by SimulationClock and Bus to provide the
22 * timings for SimulationObjects and Hardware. It implements
23 * the basic clock functionality: stepping and breakpoints.
25 * TODO optimize, some methods have a lazy implementation
26 * TODO slist might be too slow (also has portability issues)
34 void setBreak(ClockOffset cycle
, Type
*obj
);
35 void setBreakDelta(ClockOffset delta
, Type
*obj
);
36 void setDividedBreak(ClockOffset prescaler
, ClockOffset delta
, Type
*obj
);
37 void clearBreak(Type
*obj
);
38 void clearBreak(ClockOffset cycle
);
39 void reassignBreak(ClockOffset oldCycle
, ClockOffset newCycle
, Type
*obj
);
40 void reassignBreak(Type
*obj
, ClockOffset newCycle
);
41 void reassignBreakDelta(ClockOffset delta
, Type
*obj
);
47 ClockOffset
ticks() const { return value
; }
48 bool isEmpty() const { return objects
.empty(); }
53 typedef std::pair
<ClockOffset
, Type
*> Break
;
55 typedef __gnu_cxx::slist
< Break
> ClockList
;
57 typedef std::slist
< Break
> ClockList
;
59 typedef typename
ClockList::iterator ClockListIt
;
64 inline void Clock
<Type
>::setBreakDelta(ClockOffset delta
, Type
*obj
) {
65 setBreak( value
+ delta
, obj
);
73 #endif /*SIM_CLOCK_H*/