40 #include "params/TickedObject.hh" 52 numCycles((imported_num_cycles ? *imported_num_cycles :
63 object.schedule(
event,
object.clockEdge(
Cycles(1)));
71 .
name(
object.
name() +
".totalTickCycles")
72 .
desc(
"Number of cycles that the object ticked or was stopped");
77 .
desc(
"Number of cycles that the object actually ticked");
81 .
desc(
"Total number of cycles that the object has spent stopped");
90 paramOut(cp,
"lastStopped", lastStoppedUint);
96 uint64_t lastStoppedUint = 0;
104 optParamIn(cp,
"lastStopped", lastStoppedUint);
113 Ticked(*this, NULL, priority)
Cycles is a wrapper class for representing cycle counts, i.e.
bool running
Have I been started? and am not stopped.
const std::string & name()
Stats::Scalar * numCyclesLocal
Locally allocated stats.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Ticked(ClockedObject &object_, Stats::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri)
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 unserialize(CheckpointIn &cp) override
Unserialize an object.
bool optParamIn(CheckpointIn &cp, const std::string &name, T ¶m, bool warn=true)
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
void serialize(CheckpointOut &cp) const override
Serialize an object.
ClockedObject declaration and implementation.
EventFunctionWrapper event
The wrapper for processClockEvent.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
Stats::Scalar tickCycles
Number of cycles ticked.
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.
Base classes for ClockedObjects which have evaluate functions to look like clock ticking operations...
std::ostream CheckpointOut
void processClockEvent()
Evaluate and reschedule.
TickedObject(const TickedObjectParams *params, Event::Priority priority=Event::CPU_Tick_Pri)
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
virtual void regStats()
Callback to set stat parameters.
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.