gem5
v20.1.0.0
|
#include <AbstractController.hh>
Classes | |
class | MemoryPort |
Port that forwards requests and receives responses from the memory controller. More... | |
struct | SenderState |
Public Types | |
typedef RubyControllerParams | 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 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 * | getMemReqQueue () const =0 |
virtual MessageBuffer * | getMemRespQueue () 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 DMASequencer * | getDMASequencer () const =0 |
virtual GPUCoalescer * | getGPUCoalescer () const =0 |
virtual Cycles | mandatoryQueueLatency (const RubyRequestType ¶m_type) |
virtual bool | functionalReadBuffers (PacketPtr &)=0 |
These functions are used by ruby system to read/write the data blocks that exist with in the controller. More... | |
virtual void | functionalRead (const Addr &addr, PacketPtr)=0 |
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 | recvTimingResp (PacketPtr pkt) |
Tick | recvAtomic (PacketPtr pkt) |
const AddrRangeList & | getAddrRanges () const |
MachineID | getMachineID () const |
RequestorID | getRequestorId () 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... | |
Public Member Functions inherited from ClockedObject | |
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... | |
Public Member Functions inherited from SimObject | |
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... | |
Public Member Functions inherited from EventManager | |
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) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
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 Stats::Group | |
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... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from Clocked | |
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 |
Public Member Functions inherited from Consumer | |
Consumer (ClockedObject *_em) | |
virtual | ~Consumer () |
virtual void | storeEventInfo (int info) |
bool | alreadyScheduled (Tick time) |
void | insertScheduledWakeupTime (Tick time) |
ClockedObject * | getObject () |
void | scheduleEventAbsolute (Tick timeAbs) |
void | scheduleEvent (Cycles timeDelta) |
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 () |
bool | serviceMemoryQueue () |
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 | |
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... | |
Protected Attributes | |
const NodeID | m_version |
MachineID | m_machineID |
const NodeID | m_clusterID |
const RequestorID | m_id |
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 |
Protected Attributes inherited from SimObject | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
Protected Attributes inherited from EventManager | |
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 Public Member Functions inherited from SimObject | |
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 Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Public Attributes inherited from ClockedObject | |
PowerState * | powerState |
Definition at line 74 of file AbstractController.hh.
|
protected |
Definition at line 196 of file AbstractController.hh.
|
protected |
Definition at line 195 of file AbstractController.hh.
typedef RubyControllerParams AbstractController::Params |
Definition at line 77 of file AbstractController.hh.
|
protected |
Definition at line 197 of file AbstractController.hh.
AbstractController::AbstractController | ( | const Params * | p | ) |
Definition at line 50 of file AbstractController.cc.
References collateStats(), m_version, and Stats::registerDumpCallback().
void AbstractController::blockOnQueue | ( | Addr | addr, |
MessageBuffer * | port | ||
) |
Definition at line 265 of file AbstractController.cc.
References addr, m_block_map, and m_is_blocking.
Referenced by Sequencer::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 133 of file AbstractController.hh.
References fatal.
Referenced by AbstractController().
|
inlinevirtual |
Function for enqueuing a prefetch request.
Definition at line 127 of file AbstractController.hh.
References fatal.
Referenced by RubyPrefetcher::initializeStream(), and RubyPrefetcher::issueNextPrefetch().
void AbstractController::functionalMemoryRead | ( | PacketPtr | pkt | ) |
Definition at line 299 of file AbstractController.cc.
References memoryPort, and RequestPort::sendFunctional().
int AbstractController::functionalMemoryWrite | ( | PacketPtr | pkt | ) |
Definition at line 305 of file AbstractController.cc.
References memoryPort, and RequestPort::sendFunctional().
Referenced by RubySystem::functionalRead().
|
pure virtual |
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 146 of file AbstractController.hh.
References addrRanges.
Referenced by Network::Network().
|
pure virtual |
Referenced by Profiler::collateStats().
|
inline |
Definition at line 152 of file AbstractController.hh.
References m_delayHistogram.
Referenced by Profiler::collateStats().
|
inline |
Definition at line 153 of file AbstractController.hh.
References MipsISA::index, and m_delayVCHistogram.
Referenced by Profiler::collateStats().
|
pure virtual |
|
pure virtual |
Referenced by Profiler::collateStats().
|
inline |
Definition at line 149 of file AbstractController.hh.
References m_machineID.
Referenced by Network::Network(), and RubySystem::registerAbstractController().
|
pure virtual |
Referenced by RubyPort::init().
|
pure virtual |
Referenced by init(), and serviceMemoryQueue().
|
pure virtual |
Referenced by recvTimingResp().
|
virtual |
A function used to return the port associated with this bus object.
Reimplemented from SimObject.
Definition at line 293 of file AbstractController.cc.
References memoryPort.
|
inline |
Definition at line 150 of file AbstractController.hh.
References m_id.
|
inline |
Definition at line 83 of file AbstractController.hh.
References MachineID::getType(), and m_machineID.
Referenced by Network::Network(), and Topology::Topology().
|
inline |
Definition at line 82 of file AbstractController.hh.
References MachineID::getNum(), and m_machineID.
Referenced by Network::Network(), and 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 69 of file AbstractController.cc.
References getMemReqQueue(), Network::getNumberOfVirtualNetworks(), ArmISA::i, Stats::Histogram::init(), m_delayHistogram, m_delayVCHistogram, and MessageBuffer::setConsumer().
|
pure virtual |
Initialize the message buffers.
|
inline |
Definition at line 85 of file AbstractController.hh.
References m_net_ptr.
Referenced by Network::Network().
bool AbstractController::isBlocked | ( | Addr | addr | ) |
Definition at line 287 of file AbstractController.cc.
References addr, and m_block_map.
bool AbstractController::isBlocked | ( | Addr | addr | ) | const |
Definition at line 272 of file AbstractController.cc.
References addr, m_block_map, and m_is_blocking.
Referenced by Sequencer::makeRequest().
|
inlinevirtual |
Definition at line 112 of file AbstractController.hh.
References m_mandatory_queue_latency.
Referenced by VIPERCoalescer::invTCP(), VIPERCoalescer::issueRequest(), and Sequencer::issueRequest().
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 353 of file AbstractController.cc.
References addr, Network::addressToNodeID(), and m_net_ptr.
Referenced by RubyPort::MemResponsePort::recvAtomic().
|
inline |
Definition at line 80 of file AbstractController.hh.
References SimObject::_params.
Referenced by Network::Network().
|
pure virtual |
Implements Consumer.
|
protected |
Profiles the delay associated with messages.
Definition at line 105 of file AbstractController.cc.
References m_delayHistogram, m_delayVCHistogram, and Stats::DistBase< Derived, Stor >::sample().
|
protected |
Profiles original cache requests including PUTs.
|
pure virtual |
Definition at line 347 of file AbstractController.cc.
References memoryPort, RequestPort::sendAtomic(), and Clocked::ticksToCycles().
Referenced by RubyPort::MemResponsePort::recvAtomic().
void AbstractController::recvTimingResp | ( | PacketPtr | pkt | ) |
Definition at line 315 of file AbstractController.cc.
References Clocked::clockEdge(), Clocked::cyclesToTicks(), MessageBuffer::enqueue(), Packet::getAddr(), RubySystem::getBlockSizeBytes(), getMemRespQueue(), Packet::getPtr(), Packet::isRead(), Packet::isResponse(), Packet::isWrite(), m_machineID, panic, ArmISA::s, and Packet::senderState.
Referenced by AbstractController::MemoryPort::recvTimingResp(), and serviceMemoryQueue().
|
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 94 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 84 of file AbstractController.cc.
References Network::getNumberOfVirtualNetworks(), ArmISA::i, m_delayHistogram, m_delayVCHistogram, and Stats::DistBase< Derived, Stor >::reset().
|
protected |
Definition at line 207 of file AbstractController.cc.
References Packet::allocate(), Clocked::clockEdge(), Packet::createRead(), Packet::createWrite(), Packet::dataDynamic(), RubySystem::getBlockSizeBytes(), getMemReqQueue(), getOffset(), RubySystem::getWarmupEnabled(), m_id, memoryPort, panic, Packet::pushSenderState(), recvTimingResp(), ArmISA::s, Consumer::scheduleEvent(), RequestPort::sendFunctional(), RequestPort::sendTimingReq(), and Packet::setData().
|
protected |
Definition at line 113 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 278 of file AbstractController.cc.
References addr, m_block_map, and m_is_blocking.
Referenced by Sequencer::writeCallback().
|
pure virtual |
Implements Consumer.
|
protected |
Definition at line 168 of file AbstractController.cc.
References Clocked::clockEdge(), and m_waiting_buffers.
|
protected |
Definition at line 148 of file AbstractController.cc.
References addr, Clocked::clockEdge(), m_in_ports, and m_waiting_buffers.
|
protected |
Definition at line 127 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 255 of file AbstractController.hh.
Referenced by getAddrRanges().
|
protected |
Definition at line 193 of file AbstractController.hh.
Referenced by blockOnQueue(), isBlocked(), and unblock().
|
protected |
Definition at line 204 of file AbstractController.hh.
|
protected |
Definition at line 186 of file AbstractController.hh.
|
protected |
Definition at line 201 of file AbstractController.hh.
Referenced by stallBuffer(), and wakeUpBuffers().
|
protected |
Histogram for profiling delay for the messages this controller cares for.
Definition at line 214 of file AbstractController.hh.
Referenced by getDelayHist(), init(), profileMsgDelay(), and resetStats().
|
protected |
Definition at line 215 of file AbstractController.hh.
Referenced by getDelayVCHist(), 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 210 of file AbstractController.hh.
Referenced by regStats().
|
protected |
Definition at line 189 of file AbstractController.hh.
Referenced by getRequestorId(), and serviceMemoryQueue().
|
protected |
Definition at line 200 of file AbstractController.hh.
Referenced by stallBuffer(), and wakeUpAllBuffers().
|
protected |
Definition at line 192 of file AbstractController.hh.
Referenced by blockOnQueue(), isBlocked(), and unblock().
|
protected |
Definition at line 185 of file AbstractController.hh.
Referenced by getMachineID(), getType(), getVersion(), and recvTimingResp().
|
protected |
Definition at line 206 of file AbstractController.hh.
Referenced by mandatoryQueueLatency().
|
protected |
Definition at line 191 of file AbstractController.hh.
Referenced by initNetworkPtr(), and mapAddressToMachine().
|
protected |
Definition at line 202 of file AbstractController.hh.
|
protected |
Definition at line 205 of file AbstractController.hh.
|
protected |
Definition at line 203 of file AbstractController.hh.
|
protected |
Definition at line 184 of file AbstractController.hh.
Referenced by AbstractController().
|
protected |
Definition at line 198 of file AbstractController.hh.
Referenced by stallBuffer(), wakeUpAllBuffers(), and wakeUpBuffers().
|
protected |
Definition at line 241 of file AbstractController.hh.
Referenced by functionalMemoryRead(), functionalMemoryWrite(), getPort(), recvAtomic(), and serviceMemoryQueue().