Go to the documentation of this file.
40 #include "params/TickedObject.hh"
51 numCyclesLocal((imported_num_cycles ? NULL :
new Stats::Scalar)),
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");
96 uint64_t lastStoppedUint = 0;
113 Ticked(*this, NULL, priority)
virtual void regStats()
Callback to set stat parameters.
Ticked(ClockedObject &object_, Stats::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void regStats() override
Pass on regStats, serialize etc.
bool running
Have I been started? and am not stopped.
void processClockEvent()
Evaluate and reschedule.
Stats::Scalar tickCycles
Number of cycles ticked.
TickedObject(const TickedObjectParams *params, Event::Priority priority=Event::CPU_Tick_Pri)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
This is a simple scalar statistic, like a counter.
Cycles lastStopped
Time of last stop event to calculate run time.
Stats::Formula idleCycles
Number of cycles stopped.
bool optParamIn(CheckpointIn &cp, const std::string &name, T ¶m, bool warn=true)
This function is used for restoring optional parameters from the checkpoint.
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to...
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
const std::string & name()
Stats::Scalar * numCyclesLocal
Locally allocated stats.
EventFunctionWrapper event
The wrapper for processClockEvent.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void serialize(CheckpointOut &cp) const override
Checkpoint lastStopped.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Cycles is a wrapper class for representing cycle counts, i.e.
void regStats()
Register {num,ticks}Cycles if necessary.
virtual void evaluate()=0
Action to call on the clock tick.
std::ostream CheckpointOut
virtual void countCycles(Cycles delta)
Callback to handle cycle statistics and probes.
Stats::Scalar & numCycles
Total number of cycles either ticked or spend stopped.
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17