gem5
v19.0.0.0
|
#include <AbstractController.hh>
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 |
![]() | |
typedef ClockedObjectParams | Params |
Parameters of ClockedObject. More... | |
![]() | |
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 Params * | params () 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 MessageBuffer * | getMandatoryQueue () const =0 |
virtual MessageBuffer * | getMemoryQueue () 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 |
Callback to reset stats. More... | |
virtual void | regStats () |
Callback to set stat parameters. More... | |
virtual void | recordCacheTrace (int cntrl, CacheRecorder *tr)=0 |
virtual Sequencer * | getCPUSequencer () const =0 |
virtual GPUCoalescer * | getGPUCoalescer () const =0 |
virtual Cycles | mandatoryQueueLatency (const RubyRequestType ¶m_type) |
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... | |
Port & | getPort (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) |
Tick | recvAtomic (PacketPtr pkt) |
const AddrRangeList & | getAddrRanges () const |
MachineID | getMachineID () const |
Stats::Histogram & | getDelayHist () |
Stats::Histogram & | getDelayVCHist (uint32_t index) |
MachineID | mapAddressToMachine (Addr addr, MachineType mtype) const |
Map an address to the correct MachineID. More... | |
![]() | |
ClockedObject (const ClockedObjectParams *p) | |
const Params * | params () 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) |
![]() | |
const Params * | params () 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... | |
ProbeManager * | getProbeManager () |
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... | |
![]() | |
EventManager (EventManager &em) | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
EventQueue * | eventQueue () 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) |
![]() | |
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) |
![]() | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
![]() | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
![]() | |
void | updateClockPeriod () |
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 |
![]() | |
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 () |
![]() | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
![]() | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. More... | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (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... | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. More... | |
![]() | |
void | scheduleEvent (Cycles timeDelta) |
Protected Attributes | |
const NodeID | m_version |
MachineID | m_machineID |
const NodeID | m_clusterID |
const MasterID | m_masterId |
Network * | m_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 |
const Cycles | m_mandatory_queue_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 |
![]() | |
Enums::PwrState | _currPwrState |
To keep track of the current power state. More... | |
Tick | prvEvalTick |
ClockedObject::ClockedObjectStats | stats |
![]() | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
![]() | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
Private Attributes | |
const AddrRangeList | addrRanges |
The address range to which the controller responds on the CPU side. More... | |
Additional Inherited Members | |
![]() | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
![]() | |
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 |
Definition at line 73 of file AbstractController.hh.
|
protected |
Definition at line 195 of file AbstractController.hh.
|
protected |
Definition at line 194 of file AbstractController.hh.
typedef RubyControllerParams AbstractController::Params |
Definition at line 76 of file AbstractController.hh.
|
protected |
Definition at line 196 of file AbstractController.hh.
AbstractController::AbstractController | ( | const Params * | p | ) |
Definition at line 51 of file AbstractController.cc.
References m_version, and Stats::registerDumpCallback().
void AbstractController::blockOnQueue | ( | Addr | addr, |
MessageBuffer * | port | ||
) |
Definition at line 206 of file AbstractController.cc.
References addr, m_block_map, and m_is_blocking.
Referenced by Sequencer::writeCallback(), and GPUCoalescer::writeCallback().
|
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 129 of file AbstractController.hh.
References fatal, and InvalidPortID.
Referenced by AbstractController::StatsCallback::process().
|
inlinevirtual |
Function for enqueuing a prefetch request.
Definition at line 123 of file AbstractController.hh.
References fatal.
Referenced by Prefetcher::initializeStream(), and Prefetcher::issueNextPrefetch().
void AbstractController::functionalMemoryRead | ( | PacketPtr | pkt | ) |
Definition at line 307 of file AbstractController.cc.
References memoryPort, and MasterPort::sendFunctional().
int AbstractController::functionalMemoryWrite | ( | PacketPtr | pkt | ) |
Definition at line 313 of file AbstractController.cc.
References memoryPort, MasterPort::sendFunctional(), and QueuedMasterPort::trySatisfyFunctional().
These functions are used by ruby system to read/write the data blocks that exist with in the controller.
|
pure virtual |
The return value indicates the number of messages written with the data from the packet.
|
pure virtual |
|
inline |
Definition at line 147 of file AbstractController.hh.
Referenced by Network::Network().
|
pure virtual |
Referenced by Profiler::collateStats().
|
inline |
Definition at line 152 of file AbstractController.hh.
Referenced by Profiler::collateStats().
|
inline |
Definition at line 153 of file AbstractController.hh.
References MipsISA::index.
Referenced by Profiler::collateStats().
|
pure virtual |
Referenced by Profiler::collateStats().
|
inline |
Definition at line 150 of file AbstractController.hh.
Referenced by Network::Network(), and RubySystem::registerAbstractController().
|
pure virtual |
Referenced by RubyPort::init().
|
pure virtual |
Referenced by recvTimingResp().
|
virtual |
A function used to return the port associated with this bus object.
Reimplemented from SimObject.
Definition at line 234 of file AbstractController.cc.
References memoryPort.
|
inline |
Definition at line 82 of file AbstractController.hh.
Referenced by Topology::Topology().
|
inline |
Definition at line 81 of file AbstractController.hh.
Referenced by Topology::Topology().
|
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 70 of file AbstractController.cc.
References Network::getNumberOfVirtualNetworks(), ArmISA::i, Stats::Histogram::init(), m_delayHistogram, m_delayVCHistogram, and params().
|
pure virtual |
Initialize the message buffers.
|
inline |
Definition at line 84 of file AbstractController.hh.
References addr.
Referenced by Network::Network().
bool AbstractController::isBlocked | ( | Addr | addr | ) | const |
Definition at line 213 of file AbstractController.cc.
References m_block_map, and m_is_blocking.
Referenced by GPUCoalescer::getRequestStatus(), and Sequencer::makeRequest().
bool AbstractController::isBlocked | ( | Addr | addr | ) |
Definition at line 228 of file AbstractController.cc.
References m_block_map.
|
inlinevirtual |
Definition at line 109 of file AbstractController.hh.
Referenced by VIPERCoalescer::invL1(), VIPERCoalescer::invwbL1(), Sequencer::issueRequest(), GPUCoalescer::issueRequest(), and VIPERCoalescer::wbL1().
Map an address to the correct MachineID.
This function querries the network for the NodeID of the destination for a given request using its address and the type of the destination. For example for a request with a given address to a directory it will return the MachineID of the authorative directory.
the | destination address |
the | type of the destination |
Definition at line 366 of file AbstractController.cc.
References Network::addressToNodeID(), and m_net_ptr.
Referenced by RubyPort::MemSlavePort::recvAtomic().
|
inline |
Definition at line 79 of file AbstractController.hh.
Referenced by init().
|
pure virtual |
Implements Consumer.
|
protected |
Profiles the delay associated with messages.
Definition at line 103 of file AbstractController.cc.
References m_delayHistogram, m_delayVCHistogram, and Stats::DistBase< Derived, Stor >::sample().
|
protected |
Profiles original cache requests including PUTs.
Definition at line 240 of file AbstractController.cc.
References addr, Clocked::clockEdge(), Packet::createRead(), RubySystem::getBlockSizeBytes(), RubySystem::getWarmupEnabled(), m_masterId, memoryPort, recvTimingResp(), ArmISA::s, QueuedMasterPort::schedTimingReq(), and MasterPort::sendFunctional().
void AbstractController::queueMemoryWrite | ( | const MachineID & | id, |
Addr | addr, | ||
Cycles | latency, | ||
const DataBlock & | block | ||
) |
Definition at line 264 of file AbstractController.cc.
References addr, Clocked::clockEdge(), Packet::createWrite(), RubySystem::getBlockSizeBytes(), DataBlock::getData(), RubySystem::getWarmupEnabled(), m_masterId, memoryPort, recvTimingResp(), ArmISA::s, QueuedMasterPort::schedTimingReq(), and MasterPort::sendFunctional().
void AbstractController::queueMemoryWritePartial | ( | const MachineID & | id, |
Addr | addr, | ||
Cycles | latency, | ||
const DataBlock & | block, | ||
int | size | ||
) |
Definition at line 289 of file AbstractController.cc.
References addr, Clocked::clockEdge(), Packet::createWrite(), DataBlock::getData(), getOffset(), m_masterId, memoryPort, ArmISA::s, and QueuedMasterPort::schedTimingReq().
|
pure virtual |
Definition at line 360 of file AbstractController.cc.
References memoryPort, MasterPort::sendAtomic(), and Clocked::ticksToCycles().
Referenced by RubyPort::MemSlavePort::recvAtomic().
void AbstractController::recvTimingResp | ( | PacketPtr | pkt | ) |
Definition at line 328 of file AbstractController.cc.
References Clocked::clockEdge(), Clocked::cyclesToTicks(), MessageBuffer::enqueue(), Packet::getAddr(), RubySystem::getBlockSizeBytes(), getMemoryQueue(), Packet::getPtr(), AbstractController::SenderState::id, Packet::isRead(), Packet::isResponse(), Packet::isWrite(), m_machineID, panic, ArmISA::s, and Packet::senderState.
Referenced by queueMemoryRead(), and queueMemoryWrite().
|
virtual |
Callback to set stat parameters.
This callback is typically used for complex stats (e.g., distributions) that need parameters in addition to a name and a description. Stat names and descriptions should typically be set from the constructor usingo from the constructor using the ADD_STAT macro.
Reimplemented from Stats::Group.
Definition at line 92 of file AbstractController.cc.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), Stats::DataWrap< Derived, InfoProxyType >::flags(), m_fully_busy_cycles, SimObject::name(), Stats::DataWrap< Derived, InfoProxyType >::name(), Stats::nozero, and Stats::Group::regStats().
|
pure virtual |
Callback to reset stats.
Reimplemented from Stats::Group.
Definition at line 82 of file AbstractController.cc.
References Network::getNumberOfVirtualNetworks(), ArmISA::i, m_delayHistogram, m_delayVCHistogram, and Stats::DistBase< Derived, Stor >::reset().
|
protected |
Definition at line 111 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 219 of file AbstractController.cc.
References m_block_map, and m_is_blocking.
Referenced by Sequencer::writeCallback(), and GPUCoalescer::writeCallback().
|
pure virtual |
Implements Consumer.
|
protected |
Definition at line 146 of file AbstractController.cc.
References addr, Clocked::clockEdge(), m_in_ports, and m_waiting_buffers.
|
protected |
Definition at line 167 of file AbstractController.cc.
References Clocked::clockEdge(), and m_waiting_buffers.
|
protected |
Definition at line 125 of file AbstractController.cc.
References addr, Clocked::clockEdge(), m_cur_in_port, and m_waiting_buffers.
|
private |
The address range to which the controller responds on the CPU side.
Definition at line 268 of file AbstractController.hh.
|
protected |
Definition at line 192 of file AbstractController.hh.
Referenced by blockOnQueue(), isBlocked(), and unblock().
|
protected |
Definition at line 203 of file AbstractController.hh.
|
protected |
Definition at line 185 of file AbstractController.hh.
|
protected |
Definition at line 200 of file AbstractController.hh.
Referenced by stallBuffer(), and wakeUpBuffers().
|
protected |
Histogram for profiling delay for the messages this controller cares for.
Definition at line 213 of file AbstractController.hh.
Referenced by init(), profileMsgDelay(), and resetStats().
|
protected |
Definition at line 214 of file AbstractController.hh.
Referenced by init(), profileMsgDelay(), and resetStats().
|
protected |
Counter for the number of cycles when the transitions carried out were equal to the maximum allowed.
Definition at line 209 of file AbstractController.hh.
Referenced by regStats().
|
protected |
Definition at line 199 of file AbstractController.hh.
Referenced by stallBuffer(), and wakeUpAllBuffers().
|
protected |
Definition at line 191 of file AbstractController.hh.
Referenced by blockOnQueue(), isBlocked(), and unblock().
|
protected |
Definition at line 184 of file AbstractController.hh.
Referenced by recvTimingResp().
|
protected |
Definition at line 205 of file AbstractController.hh.
|
protected |
Definition at line 188 of file AbstractController.hh.
Referenced by queueMemoryRead(), queueMemoryWrite(), and queueMemoryWritePartial().
|
protected |
Definition at line 190 of file AbstractController.hh.
Referenced by mapAddressToMachine().
|
protected |
Definition at line 201 of file AbstractController.hh.
|
protected |
Definition at line 204 of file AbstractController.hh.
|
protected |
Definition at line 202 of file AbstractController.hh.
|
protected |
Definition at line 183 of file AbstractController.hh.
Referenced by AbstractController().
|
protected |
Definition at line 197 of file AbstractController.hh.
Referenced by stallBuffer(), wakeUpAllBuffers(), and wakeUpBuffers().
|
protected |
Definition at line 254 of file AbstractController.hh.
Referenced by functionalMemoryRead(), functionalMemoryWrite(), getPort(), queueMemoryRead(), queueMemoryWrite(), queueMemoryWritePartial(), and recvAtomic().