gem5 v24.0.0.0
|
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to ticking. More...
#include <ticked_object.hh>
Public Member Functions | |
Ticked (ClockedObject &object_, statistics::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri) | |
virtual | ~Ticked () |
void | regStats () |
Register {num,ticks}Cycles if necessary. | |
void | start () |
Start ticking. | |
Cycles | cyclesSinceLastStopped () const |
How long have we been stopped for? | |
void | resetLastStopped () |
Reset stopped time to current time. | |
void | stop () |
Cancel the next tick event and issue no more. | |
void | serialize (CheckpointOut &cp) const override |
Checkpoint lastStopped. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
virtual void | evaluate ()=0 |
Action to call on the clock tick. | |
virtual void | countCycles (Cycles delta) |
Callback to handle cycle statistics and probes. | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Protected Member Functions | |
void | processClockEvent () |
Evaluate and reschedule. | |
Protected Attributes | |
ClockedObject & | object |
ClockedObject who is responsible for this Ticked's actions/stats. | |
EventFunctionWrapper | event |
The wrapper for processClockEvent. | |
bool | running |
Have I been started? and am not stopped. | |
Cycles | lastStopped |
Time of last stop event to calculate run time. | |
statistics::Scalar & | numCycles |
Total number of cycles either ticked or spend stopped. | |
statistics::Scalar | tickCycles |
Number of cycles ticked. | |
statistics::Formula | idleCycles |
Number of cycles stopped. | |
Private Attributes | |
statistics::Scalar * | numCyclesLocal |
Locally allocated stats. | |
Additional Inherited Members | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to ticking.
Ticked is not a ClockedObject but can be attached to one by inheritance and by calling regStats, serialize/unserialize
Definition at line 61 of file ticked_object.hh.
gem5::Ticked::Ticked | ( | ClockedObject & | object_, |
statistics::Scalar * | imported_num_cycles = NULL, | ||
Event::Priority | priority = Event::CPU_Tick_Pri ) |
Definition at line 47 of file ticked_object.cc.
References processClockEvent().
|
inlinevirtual |
Definition at line 98 of file ticked_object.hh.
|
inlinevirtual |
Callback to handle cycle statistics and probes.
This callback is called at the beginning of a new cycle active cycle and when restarting the ticked object. The delta parameter indicates the number of cycles elapsed since the previous call is normally '1' unless the object has been stopped and restarted.
delta | Number of cycles since the previous call. |
Definition at line 161 of file ticked_object.hh.
Referenced by processClockEvent(), and start().
|
inline |
How long have we been stopped for?
Definition at line 119 of file ticked_object.hh.
References lastStopped.
Referenced by start().
|
pure virtual |
Action to call on the clock tick.
Implemented in gem5::minor::Pipeline.
Referenced by processClockEvent().
|
protected |
Evaluate and reschedule.
Definition at line 61 of file ticked_object.cc.
References countCycles(), evaluate(), event, numCycles, running, and tickCycles.
Referenced by Ticked().
void gem5::Ticked::regStats | ( | ) |
Register {num,ticks}Cycles if necessary.
If numCycles is imported, be sure to register it before calling this regStats
Definition at line 71 of file ticked_object.cc.
References gem5::statistics::DataWrap< Derived, InfoProxyType >::desc(), idleCycles, gem5::statistics::DataWrap< Derived, InfoProxyType >::name(), name(), numCycles, numCyclesLocal, and tickCycles.
Referenced by gem5::TickedObject::regStats().
|
inline |
Reset stopped time to current time.
Definition at line 126 of file ticked_object.hh.
References lastStopped.
Referenced by stop().
|
overridevirtual |
Checkpoint lastStopped.
Implements gem5::Serializable.
Reimplemented in gem5::TickedObject.
Definition at line 90 of file ticked_object.cc.
References lastStopped, and gem5::paramOut().
Referenced by gem5::TickedObject::serialize().
|
inline |
Start ticking.
Definition at line 106 of file ticked_object.hh.
References countCycles(), cyclesSinceLastStopped(), event, numCycles, running, and gem5::Event::scheduled().
|
inline |
Cancel the next tick event and issue no more.
Definition at line 133 of file ticked_object.hh.
References event, resetLastStopped(), running, and gem5::Event::scheduled().
Referenced by gem5::minor::Pipeline::evaluate().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements gem5::Serializable.
Reimplemented in gem5::TickedObject.
Definition at line 98 of file ticked_object.cc.
References lastStopped, and gem5::optParamIn().
Referenced by gem5::TickedObject::unserialize().
|
protected |
The wrapper for processClockEvent.
Definition at line 68 of file ticked_object.hh.
Referenced by processClockEvent(), start(), and stop().
|
protected |
|
protected |
Time of last stop event to calculate run time.
Definition at line 77 of file ticked_object.hh.
Referenced by cyclesSinceLastStopped(), resetLastStopped(), serialize(), and unserialize().
|
protected |
Total number of cycles either ticked or spend stopped.
Definition at line 85 of file ticked_object.hh.
Referenced by processClockEvent(), regStats(), and start().
|
private |
|
protected |
ClockedObject who is responsible for this Ticked's actions/stats.
Definition at line 65 of file ticked_object.hh.
|
protected |
Have I been started? and am not stopped.
Definition at line 74 of file ticked_object.hh.
Referenced by processClockEvent(), start(), and stop().
|
protected |
Number of cycles ticked.
Definition at line 88 of file ticked_object.hh.
Referenced by processClockEvent(), and regStats().