48 #ifndef __SIM_TICKED_OBJECT_HH__
49 #define __SIM_TICKED_OBJECT_HH__
53 class TickedObjectParams;
134 object.schedule(
event,
object.clockEdge(
Cycles(1)));
161 object.deschedule(
event);
Cycles is a wrapper class for representing cycle counts, i.e.
void process()
Evaluate and reschedule.
bool running
Have I been started? and am not stopped.
void resetLastStopped()
Reset stopped time to current time.
const Params * params() const
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.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool scheduled() const
Determine if the current event is scheduled.
Ticked(ClockedObject &object_, Stats::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri)
TickedObject attaches Ticked to ClockedObject and can be used as a base class where ticked operation...
ClockEvent event
The single instance of ClockEvent used.
This is a simple scalar statistic, like a counter.
Priority priority() const
Get the event priority.
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...
An event to call process periodically.
void stop()
Cancel the next tick event and issue no more.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Cycles cyclesSinceLastStopped() const
How long have we been stopped for?
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
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.
void start()
Start ticking.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
TickedObject(TickedObjectParams *params, Event::Priority priority=Event::CPU_Tick_Pri)
Basic support for object serialization.
Stats::Scalar tickCycles
Number of cycles ticked.
ClockEvent(Ticked &owner_, Priority priority)
void regStats() override
Pass on regStats, serialize etc.
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 schedule(Event &event, Tick when)
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.
void regStats() override
Register statistics for this object.
Stats::Formula idleCycles
Number of cycles stopped.