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

#include <AbstractController.hh>

Inheritance diagram for AbstractController:
MemObject Consumer ClockedObject SimObject Clocked EventManager Serializable Drainable

Classes

class  MemoryPort
 Port that forwards requests and receives responses from the memory controller. More...
 
struct  SenderState
 
class  StatsCallback
 Callback class used for collating statistics from all the controller of this type. More...
 

Public Types

typedef RubyControllerParams Params
 
- Public Types inherited from MemObject
typedef MemObjectParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

 AbstractController (const Params *p)
 
void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
const Paramsparams () const
 
NodeID getVersion () const
 
MachineType getType () const
 
void initNetworkPtr (Network *net_ptr)
 
void blockOnQueue (Addr, MessageBuffer *)
 
bool isBlocked (Addr) const
 
void unblock (Addr)
 
bool isBlocked (Addr)
 
virtual MessageBuffergetMandatoryQueue () const =0
 
virtual MessageBuffergetMemoryQueue () const =0
 
virtual AccessPermission getAccessPermission (const Addr &addr)=0
 
virtual void print (std::ostream &out) const =0
 
virtual void wakeup ()=0
 
virtual void resetStats ()=0
 Reset statistics associated with this object. More...
 
virtual void regStats ()
 Register statistics for this object. More...
 
virtual void recordCacheTrace (int cntrl, CacheRecorder *tr)=0
 
virtual SequencergetCPUSequencer () const =0
 
virtual GPUCoalescergetGPUCoalescer () const =0
 
virtual void functionalRead (const Addr &addr, PacketPtr)=0
 These functions are used by ruby system to read/write the data blocks that exist with in the controller. More...
 
void functionalMemoryRead (PacketPtr)
 
virtual int functionalWriteBuffers (PacketPtr &)=0
 The return value indicates the number of messages written with the data from the packet. More...
 
virtual int functionalWrite (const Addr &addr, PacketPtr)=0
 
int functionalMemoryWrite (PacketPtr)
 
virtual void enqueuePrefetch (const Addr &, const RubyRequestType &)
 Function for enqueuing a prefetch request. More...
 
virtual void collateStats ()
 Function for collating statistics from all the controllers of this particular type. More...
 
virtual void initNetQueues ()=0
 Initialize the message buffers. More...
 
BaseMasterPortgetMasterPort (const std::string &if_name, PortID idx=InvalidPortID)
 A function used to return the port associated with this bus object. More...
 
void queueMemoryRead (const MachineID &id, Addr addr, Cycles latency)
 
void queueMemoryWrite (const MachineID &id, Addr addr, Cycles latency, const DataBlock &block)
 
void queueMemoryWritePartial (const MachineID &id, Addr addr, Cycles latency, const DataBlock &block, int size)
 
void recvTimingResp (PacketPtr pkt)
 
MachineID getMachineID () const
 
Stats::HistogramgetDelayHist ()
 
Stats::HistogramgetDelayVCHist (uint32_t index)
 
- Public Member Functions inherited from MemObject
const Paramsparams () const
 
 MemObject (const Params *params)
 
virtual BaseSlavePortgetSlavePort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a slave port with a given name and index. More...
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
void regStats () override
 Register statistics for this object. More...
 
- Public Member Functions inherited from SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual void startup ()
 startup() is the final initialization call before simulation. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from EventManager
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick)-1)
 
void setCurTick (Tick newVal)
 
- 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)
 
- Public Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from Clocked
void updateClockPeriod () const
 Update the tick to the current tick. More...
 
Tick clockEdge (Cycles cycles=Cycles(0)) const
 Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More...
 
Cycles curCycle () const
 Determine the current cycle, corresponding to a tick aligned to a clock edge. More...
 
Tick nextCycle () const
 Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More...
 
uint64_t frequency () const
 
Tick clockPeriod () const
 
double voltage () const
 
Cycles ticksToCycles (Tick t) const
 
Tick cyclesToTicks (Cycles c) const
 
- Public Member Functions inherited from Consumer
 Consumer (ClockedObject *_em)
 
virtual ~Consumer ()
 
virtual void storeEventInfo (int info)
 
bool alreadyScheduled (Tick time)
 
void insertScheduledWakeupTime (Tick time)
 
void scheduleEventAbsolute (Tick timeAbs)
 

Protected Types

typedef std::vector
< MessageBuffer * > 
MsgVecType
 
typedef std::set< MessageBuffer * > MsgBufType
 
typedef std::map< Addr,
MsgVecType * > 
WaitingBufType
 

Protected Member Functions

void profileRequest (const std::string &request)
 Profiles original cache requests including PUTs. More...
 
void profileMsgDelay (uint32_t virtualNetwork, Cycles delay)
 Profiles the delay associated with messages. More...
 
void stallBuffer (MessageBuffer *buf, Addr addr)
 
void wakeUpBuffers (Addr addr)
 
void wakeUpAllBuffers (Addr addr)
 
void wakeUpAllBuffers ()
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters. More...
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance. More...
 
void resetClock () const
 Reset the object's clock using the current global tick value. More...
 
- Protected Member Functions inherited from Consumer
void scheduleEvent (Cycles timeDelta)
 

Protected Attributes

const NodeID m_version
 
MachineID m_machineID
 
const NodeID m_clusterID
 
const MasterID m_masterId
 
Networkm_net_ptr
 
bool m_is_blocking
 
std::map< Addr, MessageBuffer * > m_block_map
 
WaitingBufType m_waiting_buffers
 
unsigned int m_in_ports
 
unsigned int m_cur_in_port
 
const int m_number_of_TBEs
 
const int m_transitions_per_cycle
 
const unsigned int m_buffer_size
 
Cycles m_recycle_latency
 
Stats::Scalar m_fully_busy_cycles
 Counter for the number of cycles when the transitions carried out were equal to the maximum allowed. More...
 
Stats::Histogram m_delayHistogram
 Histogram for profiling delay for the messages this controller cares for. More...
 
std::vector< Stats::Histogram * > m_delayVCHistogram
 
MemoryPort memoryPort
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
Stats::Scalar numPwrStateTransitions
 
Stats::Distribution pwrStateClkGateDist
 
Stats::Vector pwrStateResidencyTicks
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- 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

Definition at line 60 of file AbstractController.hh.

Member Typedef Documentation

typedef std::set<MessageBuffer*> AbstractController::MsgBufType
protected

Definition at line 157 of file AbstractController.hh.

Definition at line 156 of file AbstractController.hh.

typedef RubyControllerParams AbstractController::Params

Definition at line 63 of file AbstractController.hh.

typedef std::map<Addr, MsgVecType* > AbstractController::WaitingBufType
protected

Definition at line 158 of file AbstractController.hh.

Constructor & Destructor Documentation

AbstractController::AbstractController ( const Params p)

Definition at line 39 of file AbstractController.cc.

References m_version, and Stats::registerDumpCallback().

Member Function Documentation

void AbstractController::blockOnQueue ( Addr  addr,
MessageBuffer port 
)

Definition at line 192 of file AbstractController.cc.

References addr, m_block_map, and m_is_blocking.

Referenced by Sequencer::writeCallback(), and GPUCoalescer::writeCallback().

virtual void AbstractController::collateStats ( )
inlinevirtual

Function for collating statistics from all the controllers of this particular type.

This function should only be called from the version 0 of this controller type.

Definition at line 109 of file AbstractController.hh.

References fatal.

Referenced by AbstractController::StatsCallback::process().

virtual void AbstractController::enqueuePrefetch ( const Addr ,
const RubyRequestType &   
)
inlinevirtual

Function for enqueuing a prefetch request.

Definition at line 103 of file AbstractController.hh.

References fatal.

Referenced by Prefetcher::initializeStream(), and Prefetcher::issueNextPrefetch().

void AbstractController::functionalMemoryRead ( PacketPtr  pkt)

Definition at line 297 of file AbstractController.cc.

References memoryPort, and MasterPort::sendFunctional().

int AbstractController::functionalMemoryWrite ( PacketPtr  pkt)
virtual void AbstractController::functionalRead ( const Addr addr,
PacketPtr   
)
pure virtual

These functions are used by ruby system to read/write the data blocks that exist with in the controller.

virtual int AbstractController::functionalWrite ( const Addr addr,
PacketPtr   
)
pure virtual
virtual int AbstractController::functionalWriteBuffers ( PacketPtr )
pure virtual

The return value indicates the number of messages written with the data from the packet.

virtual AccessPermission AbstractController::getAccessPermission ( const Addr addr)
pure virtual
virtual Sequencer* AbstractController::getCPUSequencer ( ) const
pure virtual

Referenced by Profiler::collateStats().

Stats::Histogram& AbstractController::getDelayHist ( )
inline

Definition at line 129 of file AbstractController.hh.

References m_delayHistogram.

Referenced by Profiler::collateStats().

Stats::Histogram& AbstractController::getDelayVCHist ( uint32_t  index)
inline

Definition at line 130 of file AbstractController.hh.

References MipsISA::index, and m_delayVCHistogram.

Referenced by Profiler::collateStats().

virtual GPUCoalescer* AbstractController::getGPUCoalescer ( ) const
pure virtual

Referenced by Profiler::collateStats().

MachineID AbstractController::getMachineID ( ) const
inline

Definition at line 127 of file AbstractController.hh.

References m_machineID.

Referenced by RubySystem::registerAbstractController().

virtual MessageBuffer* AbstractController::getMandatoryQueue ( ) const
pure virtual

Referenced by RubyPort::init().

BaseMasterPort & AbstractController::getMasterPort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
virtual

A function used to return the port associated with this bus object.

Reimplemented from MemObject.

Definition at line 220 of file AbstractController.cc.

References memoryPort.

virtual MessageBuffer* AbstractController::getMemoryQueue ( ) const
pure virtual

Referenced by recvTimingResp().

MachineType AbstractController::getType ( ) const
inline

Definition at line 69 of file AbstractController.hh.

References MachineID::getType(), and m_machineID.

Referenced by Topology::Topology().

NodeID AbstractController::getVersion ( ) const
inline

Definition at line 68 of file AbstractController.hh.

References MachineID::getNum(), and m_machineID.

Referenced by Topology::Topology().

void AbstractController::init ( )
virtual

init() is called after all C++ SimObjects have been created and all ports are connected.

Initializations that are independent of unserialization but rely on a fully instantiated and connected SimObject graph should be done here.

Reimplemented from SimObject.

Definition at line 56 of file AbstractController.cc.

References Network::getNumberOfVirtualNetworks(), ArmISA::i, Stats::Histogram::init(), m_delayHistogram, m_delayVCHistogram, params(), and X86ISA::size().

virtual void AbstractController::initNetQueues ( )
pure virtual

Initialize the message buffers.

void AbstractController::initNetworkPtr ( Network net_ptr)
inline

Definition at line 71 of file AbstractController.hh.

References m_net_ptr.

Referenced by Network::Network().

bool AbstractController::isBlocked ( Addr  addr) const

Definition at line 199 of file AbstractController.cc.

References m_block_map, and m_is_blocking.

Referenced by GPUCoalescer::getRequestStatus(), and Sequencer::insertRequest().

bool AbstractController::isBlocked ( Addr  addr)

Definition at line 214 of file AbstractController.cc.

References m_block_map.

const Params* AbstractController::params ( ) const
inline

Definition at line 66 of file AbstractController.hh.

References SimObject::_params.

Referenced by init().

virtual void AbstractController::print ( std::ostream &  out) const
pure virtual

Implements Consumer.

void AbstractController::profileMsgDelay ( uint32_t  virtualNetwork,
Cycles  delay 
)
protected

Profiles the delay associated with messages.

Definition at line 89 of file AbstractController.cc.

References m_delayHistogram, m_delayVCHistogram, and Stats::DistBase< Derived, Stor >::sample().

void AbstractController::profileRequest ( const std::string &  request)
protected

Profiles original cache requests including PUTs.

void AbstractController::queueMemoryRead ( const MachineID id,
Addr  addr,
Cycles  latency 
)
void AbstractController::queueMemoryWrite ( const MachineID id,
Addr  addr,
Cycles  latency,
const DataBlock block 
)
void AbstractController::queueMemoryWritePartial ( const MachineID id,
Addr  addr,
Cycles  latency,
const DataBlock block,
int  size 
)
virtual void AbstractController::recordCacheTrace ( int  cntrl,
CacheRecorder tr 
)
pure virtual
void AbstractController::recvTimingResp ( PacketPtr  pkt)
void AbstractController::regStats ( )
virtual
void AbstractController::resetStats ( )
pure virtual

Reset statistics associated with this object.

Reimplemented from SimObject.

Definition at line 68 of file AbstractController.cc.

References Network::getNumberOfVirtualNetworks(), ArmISA::i, m_delayHistogram, m_delayVCHistogram, Stats::DistBase< Derived, Stor >::reset(), and X86ISA::size().

void AbstractController::stallBuffer ( MessageBuffer buf,
Addr  addr 
)
protected

Definition at line 97 of file AbstractController.cc.

References addr, DPRINTF, m_cur_in_port, m_in_ports, and m_waiting_buffers.

void AbstractController::unblock ( Addr  addr)

Definition at line 205 of file AbstractController.cc.

References m_block_map, and m_is_blocking.

Referenced by Sequencer::writeCallback(), and GPUCoalescer::writeCallback().

virtual void AbstractController::wakeup ( )
pure virtual

Implements Consumer.

void AbstractController::wakeUpAllBuffers ( Addr  addr)
protected

Definition at line 132 of file AbstractController.cc.

References addr, Clocked::clockEdge(), m_in_ports, and m_waiting_buffers.

void AbstractController::wakeUpAllBuffers ( )
protected

Definition at line 153 of file AbstractController.cc.

References Clocked::clockEdge(), and m_waiting_buffers.

void AbstractController::wakeUpBuffers ( Addr  addr)
protected

Definition at line 111 of file AbstractController.cc.

References addr, Clocked::clockEdge(), m_cur_in_port, and m_waiting_buffers.

Member Data Documentation

std::map<Addr, MessageBuffer*> AbstractController::m_block_map
protected

Definition at line 154 of file AbstractController.hh.

Referenced by blockOnQueue(), isBlocked(), and unblock().

const unsigned int AbstractController::m_buffer_size
protected

Definition at line 165 of file AbstractController.hh.

const NodeID AbstractController::m_clusterID
protected

Definition at line 147 of file AbstractController.hh.

unsigned int AbstractController::m_cur_in_port
protected

Definition at line 162 of file AbstractController.hh.

Referenced by stallBuffer(), and wakeUpBuffers().

Stats::Histogram AbstractController::m_delayHistogram
protected

Histogram for profiling delay for the messages this controller cares for.

Definition at line 174 of file AbstractController.hh.

Referenced by getDelayHist(), init(), profileMsgDelay(), and resetStats().

std::vector<Stats::Histogram *> AbstractController::m_delayVCHistogram
protected

Definition at line 175 of file AbstractController.hh.

Referenced by getDelayVCHist(), init(), profileMsgDelay(), and resetStats().

Stats::Scalar AbstractController::m_fully_busy_cycles
protected

Counter for the number of cycles when the transitions carried out were equal to the maximum allowed.

Definition at line 170 of file AbstractController.hh.

Referenced by regStats().

unsigned int AbstractController::m_in_ports
protected

Definition at line 161 of file AbstractController.hh.

Referenced by stallBuffer(), and wakeUpAllBuffers().

bool AbstractController::m_is_blocking
protected

Definition at line 153 of file AbstractController.hh.

Referenced by blockOnQueue(), isBlocked(), and unblock().

MachineID AbstractController::m_machineID
protected

Definition at line 146 of file AbstractController.hh.

Referenced by getMachineID(), getType(), getVersion(), and recvTimingResp().

const MasterID AbstractController::m_masterId
protected
Network* AbstractController::m_net_ptr
protected

Definition at line 152 of file AbstractController.hh.

Referenced by initNetworkPtr().

const int AbstractController::m_number_of_TBEs
protected

Definition at line 163 of file AbstractController.hh.

Cycles AbstractController::m_recycle_latency
protected

Definition at line 166 of file AbstractController.hh.

const int AbstractController::m_transitions_per_cycle
protected

Definition at line 164 of file AbstractController.hh.

const NodeID AbstractController::m_version
protected

Definition at line 145 of file AbstractController.hh.

Referenced by AbstractController().

WaitingBufType AbstractController::m_waiting_buffers
protected

Definition at line 159 of file AbstractController.hh.

Referenced by stallBuffer(), wakeUpAllBuffers(), and wakeUpBuffers().

MemoryPort AbstractController::memoryPort
protected

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

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