gem5
v19.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_, Stats::Scalar *imported_num_cycles=NULL, Event::Priority priority=Event::CPU_Tick_Pri) | |
virtual | ~Ticked () |
void | regStats () |
Register {num,ticks}Cycles if necessary. More... | |
void | start () |
Start ticking. More... | |
Cycles | cyclesSinceLastStopped () const |
How long have we been stopped for? More... | |
void | resetLastStopped () |
Reset stopped time to current time. More... | |
void | stop () |
Cancel the next tick event and issue no more. More... | |
void | serialize (CheckpointOut &cp) const override |
Checkpoint lastStopped. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
virtual void | evaluate ()=0 |
Action to call on the clock tick. More... | |
virtual void | countCycles (Cycles delta) |
Callback to handle cycle statistics and probes. More... | |
![]() | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Protected Member Functions | |
void | processClockEvent () |
Evaluate and reschedule. More... | |
Protected Attributes | |
ClockedObject & | object |
ClockedObject who is responsible for this Ticked's actions/stats. More... | |
EventFunctionWrapper | event |
The wrapper for processClockEvent. More... | |
bool | running |
Have I been started? and am not stopped. More... | |
Cycles | lastStopped |
Time of last stop event to calculate run time. More... | |
Stats::Scalar & | numCycles |
Total number of cycles either ticked or spend stopped. More... | |
Stats::Scalar | tickCycles |
Number of cycles ticked. More... | |
Stats::Formula | idleCycles |
Number of cycles stopped. More... | |
Private Attributes | |
Stats::Scalar * | numCyclesLocal |
Locally allocated stats. More... | |
Additional Inherited Members | |
![]() | |
static const std::string & | currentSection () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
![]() | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
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 60 of file ticked_object.hh.
Ticked::Ticked | ( | ClockedObject & | object_, |
Stats::Scalar * | imported_num_cycles = NULL , |
||
Event::Priority | priority = Event::CPU_Tick_Pri |
||
) |
Definition at line 45 of file ticked_object.cc.
References lastStopped, name(), numCycles, numCyclesLocal, processClockEvent(), and running.
|
inlinevirtual |
Definition at line 97 of file ticked_object.hh.
References regStats().
|
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 160 of file ticked_object.hh.
Referenced by processClockEvent(), and start().
|
inline |
How long have we been stopped for?
Definition at line 118 of file ticked_object.hh.
References lastStopped.
Referenced by start().
|
pure virtual |
Action to call on the clock tick.
Implemented in Minor::Pipeline.
Referenced by processClockEvent(), and stop().
|
protected |
Evaluate and reschedule.
Definition at line 59 of file ticked_object.cc.
References countCycles(), evaluate(), event, numCycles, running, and tickCycles.
Referenced by Ticked().
void Ticked::regStats | ( | ) |
Register {num,ticks}Cycles if necessary.
If numCycles is imported, be sure to register it before calling this regStats
Definition at line 69 of file ticked_object.cc.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), idleCycles, name(), Stats::DataWrap< Derived, InfoProxyType >::name(), numCycles, numCyclesLocal, and tickCycles.
Referenced by Minor::Pipeline::regStats(), TickedObject::regStats(), and ~Ticked().
|
inline |
Reset stopped time to current time.
Definition at line 125 of file ticked_object.hh.
Referenced by stop().
|
overridevirtual |
Checkpoint lastStopped.
Implements Serializable.
Reimplemented in TickedObject.
Definition at line 88 of file ticked_object.cc.
References lastStopped, and paramOut().
Referenced by TickedObject::serialize(), and stop().
|
inline |
Start ticking.
Definition at line 105 of file ticked_object.hh.
References countCycles(), cyclesSinceLastStopped(), and Event::scheduled().
|
inline |
Cancel the next tick event and issue no more.
Definition at line 132 of file ticked_object.hh.
References evaluate(), resetLastStopped(), Event::scheduled(), serialize(), and unserialize().
Referenced by Minor::Pipeline::evaluate().
|
overridevirtual |
Unserialize an object.
Read an object's state from the current checkpoint section.
cp | Checkpoint state |
Implements Serializable.
Reimplemented in TickedObject.
Definition at line 96 of file ticked_object.cc.
References lastStopped, and optParamIn().
Referenced by stop(), and TickedObject::unserialize().
|
protected |
The wrapper for processClockEvent.
Definition at line 67 of file ticked_object.hh.
Referenced by processClockEvent().
|
protected |
|
protected |
Time of last stop event to calculate run time.
Definition at line 76 of file ticked_object.hh.
Referenced by cyclesSinceLastStopped(), serialize(), Ticked(), and unserialize().
|
protected |
Total number of cycles either ticked or spend stopped.
Definition at line 84 of file ticked_object.hh.
Referenced by processClockEvent(), regStats(), and Ticked().
|
private |
Locally allocated stats.
Definition at line 80 of file ticked_object.hh.
Referenced by regStats(), and Ticked().
|
protected |
ClockedObject who is responsible for this Ticked's actions/stats.
Definition at line 64 of file ticked_object.hh.
|
protected |
Have I been started? and am not stopped.
Definition at line 73 of file ticked_object.hh.
Referenced by processClockEvent(), and Ticked().
|
protected |
Number of cycles ticked.
Definition at line 87 of file ticked_object.hh.
Referenced by processClockEvent(), and regStats().