gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
Ticked Class Referenceabstract

Ticked attaches gem5's event queue/scheduler to evaluate calls and provides a start/stop interface to ticking. More...

#include <ticked_object.hh>

Inheritance diagram for Ticked:
Serializable Minor::Pipeline TickedObject

Classes

class  ClockEvent
 An event to call process periodically. More...
 

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...
 
- Public Member Functions inherited from Serializable
 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 Attributes

ClockedObjectobject
 ClockedObject who is responsible for this Ticked's actions/stats. More...
 
ClockEvent event
 The single instance of ClockEvent used. 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::ScalarnumCycles
 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::ScalarnumCyclesLocal
 Locally allocated stats. More...
 

Friends

class ClockEvent
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
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 Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

virtual Ticked::~Ticked ( )
inlinevirtual

Definition at line 122 of file ticked_object.hh.

Member Function Documentation

virtual void Ticked::countCycles ( Cycles  delta)
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.

Parameters
deltaNumber of cycles since the previous call.

Reimplemented in Minor::Pipeline.

Definition at line 185 of file ticked_object.hh.

Referenced by Ticked::ClockEvent::process(), and start().

Cycles Ticked::cyclesSinceLastStopped ( ) const
inline

How long have we been stopped for?

Definition at line 143 of file ticked_object.hh.

References lastStopped.

Referenced by MinorCPU::activateContext(), and start().

virtual void Ticked::evaluate ( )
pure virtual

Action to call on the clock tick.

Implemented in Minor::Pipeline.

Referenced by Ticked::ClockEvent::process().

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 59 of file ticked_object.cc.

References Stats::DataWrap< Derived, InfoProxyType >::desc(), idleCycles, name(), Stats::DataWrap< Derived, InfoProxyType >::name(), numCycles, numCyclesLocal, and tickCycles.

Referenced by MinorCPU::regStats(), and TickedObject::regStats().

void Ticked::resetLastStopped ( )
inline

Reset stopped time to current time.

Definition at line 150 of file ticked_object.hh.

References lastStopped.

Referenced by MinorCPU::activateContext(), MinorCPU::drainResume(), and stop().

void Ticked::serialize ( CheckpointOut cp) const
overridevirtual

Checkpoint lastStopped.

Implements Serializable.

Reimplemented in TickedObject.

Definition at line 78 of file ticked_object.cc.

References lastStopped, and paramOut().

Referenced by MinorCPU::serialize(), and TickedObject::serialize().

void Ticked::start ( )
inline

Start ticking.

Definition at line 130 of file ticked_object.hh.

References countCycles(), cyclesSinceLastStopped(), event, numCycles, running, and Event::scheduled().

Referenced by MinorCPU::wakeupOnEvent().

void Ticked::stop ( )
inline

Cancel the next tick event and issue no more.

Definition at line 157 of file ticked_object.hh.

References event, resetLastStopped(), running, and Event::scheduled().

Referenced by Minor::Pipeline::evaluate().

void Ticked::unserialize ( CheckpointIn cp)
overridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Reimplemented in TickedObject.

Definition at line 86 of file ticked_object.cc.

References lastStopped, and optParamIn().

Referenced by MinorCPU::unserialize(), and TickedObject::unserialize().

Friends And Related Function Documentation

friend class ClockEvent
friend

Definition at line 89 of file ticked_object.hh.

Member Data Documentation

ClockEvent Ticked::event
protected

The single instance of ClockEvent used.

Definition at line 95 of file ticked_object.hh.

Referenced by start(), and stop().

Stats::Formula Ticked::idleCycles
protected

Number of cycles stopped.

Definition at line 115 of file ticked_object.hh.

Referenced by regStats().

Cycles Ticked::lastStopped
protected

Time of last stop event to calculate run time.

Definition at line 101 of file ticked_object.hh.

Referenced by cyclesSinceLastStopped(), resetLastStopped(), serialize(), and unserialize().

Stats::Scalar& Ticked::numCycles
protected

Total number of cycles either ticked or spend stopped.

Definition at line 109 of file ticked_object.hh.

Referenced by Ticked::ClockEvent::process(), regStats(), and start().

Stats::Scalar* Ticked::numCyclesLocal
private

Locally allocated stats.

Definition at line 105 of file ticked_object.hh.

Referenced by regStats().

ClockedObject& Ticked::object
protected

ClockedObject who is responsible for this Ticked's actions/stats.

Definition at line 92 of file ticked_object.hh.

Referenced by Ticked::ClockEvent::process().

bool Ticked::running
protected

Have I been started? and am not stopped.

Definition at line 98 of file ticked_object.hh.

Referenced by Ticked::ClockEvent::process(), start(), and stop().

Stats::Scalar Ticked::tickCycles
protected

Number of cycles ticked.

Definition at line 112 of file ticked_object.hh.

Referenced by Ticked::ClockEvent::process(), and regStats().


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:21 for gem5 by doxygen 1.8.6