42 #include "params/TickedObject.hh"
49 event(*this, priority),
53 numCyclesLocal((imported_num_cycles ? NULL : new Stats::Scalar)),
54 numCycles((imported_num_cycles ? *imported_num_cycles :
64 .
desc(
"Number of cycles that the object ticked or was stopped");
69 .
desc(
"Number of cycles that the object actually ticked");
73 .
desc(
"Total number of cycles that the object has spent stopped");
82 paramOut(cp,
"lastStopped", lastStoppedUint);
88 uint64_t lastStoppedUint = 0;
96 optParamIn(cp,
"lastStopped", lastStoppedUint);
105 Ticked(*this, NULL, priority)
Cycles is a wrapper class for representing cycle counts, i.e.
const std::string & name()
Stats::Scalar * numCyclesLocal
Locally allocated stats.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool optParamIn(CheckpointIn &cp, const string &name, T ¶m, bool warn)
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.
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.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
TickedObject(TickedObjectParams *params, Event::Priority priority=Event::CPU_Tick_Pri)
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.
Base classes for ClockedObjects which have evaluate functions to look like clock ticking operations...
std::ostream CheckpointOut
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
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.