48 #ifndef __SIM_TICKED_OBJECT_HH__ 49 #define __SIM_TICKED_OBJECT_HH__ 53 class TickedObjectParams;
109 object.schedule(event,
object.clockEdge(
Cycles(1)));
127 lastStopped =
object.curCycle();
136 object.deschedule(event);
Cycles is a wrapper class for representing cycle counts, i.e.
bool running
Have I been started? and am not stopped.
void resetLastStopped()
Reset stopped time to current time.
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
Stats::Scalar * numCyclesLocal
Locally allocated stats.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Ticked(ClockedObject &object_, Stats::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri)
virtual void regStats()
Callback to set stat parameters.
TickedObject attaches Ticked to ClockedObject and can be used as a base class where ticked operation...
This is a simple scalar statistic, like a counter.
void serialize(CheckpointOut &cp) const override
Checkpoint lastStopped.
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to...
void stop()
Cancel the next tick event and issue no more.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool scheduled() const
Determine if the current event is scheduled.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void serialize(CheckpointOut &cp) const override
Serialize an object.
ClockedObject declaration and implementation.
Cycles cyclesSinceLastStopped() const
How long have we been stopped for?
EventFunctionWrapper event
The wrapper for processClockEvent.
void start()
Start ticking.
Basic support for object serialization.
Stats::Scalar tickCycles
Number of cycles ticked.
void regStats()
Register {num,ticks}Cycles if necessary.
virtual void evaluate()=0
Action to call on the clock tick.
ClockedObject & object
ClockedObject who is responsible for this Ticked's actions/stats.
std::ostream CheckpointOut
void processClockEvent()
Evaluate and reschedule.
virtual void countCycles(Cycles delta)
Callback to handle cycle statistics and probes.
Cycles lastStopped
Time of last stop event to calculate run time.
Stats::Scalar & numCycles
Total number of cycles either ticked or spend stopped.
Stats::Formula idleCycles
Number of cycles stopped.