gem5  v22.1.0.0
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gem5::memory::MemCtrl Class Reference

The memory controller is a single-channel memory controller capturing the most important timing constraints associated with a contemporary controller. More...

#include <mem_ctrl.hh>

Inheritance diagram for gem5::memory::MemCtrl:
gem5::memory::qos::MemCtrl gem5::ClockedObject gem5::SimObject gem5::Clocked gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named gem5::memory::HBMCtrl gem5::memory::HeteroMemCtrl

Classes

struct  CtrlStats
 
class  MemoryPort
 

Public Member Functions

 MemCtrl (const MemCtrlParams &p)
 
virtual bool allIntfDrained () const
 Ensure that all interfaced have drained commands. More...
 
DrainState drain () override
 Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are partially executed or are partially in flight. More...
 
virtual Tick verifySingleCmd (Tick cmd_tick, Tick max_cmds_per_burst, bool row_cmd)
 Check for command bus contention for single cycle command. More...
 
virtual Tick verifyMultiCmd (Tick cmd_tick, Tick max_cmds_per_burst, Tick max_multi_cmd_split=0)
 Check for command bus contention for multi-cycle (2 currently) command. More...
 
virtual bool respondEventScheduled (uint8_t pseudo_channel=0) const
 Is there a respondEvent scheduled? More...
 
virtual bool requestEventScheduled (uint8_t pseudo_channel=0) const
 Is there a read/write burst Event scheduled? More...
 
virtual void restartScheduler (Tick tick, uint8_t pseudo_channel=0)
 restart the controller This can be used by interfaces to restart the scheduler after maintainence commands complete More...
 
bool inReadBusState (bool next_state) const
 Check the current direction of the memory channel. More...
 
bool inWriteBusState (bool next_state) const
 Check the current direction of the memory channel. More...
 
PortgetPort (const std::string &if_name, PortID idx=InvalidPortID) override
 Get a port with a given name and index. More...
 
virtual void init () override
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
virtual void startup () override
 startup() is the final initialization call before simulation. More...
 
virtual void drainResume () override
 Resume execution after a successful drain. More...
 
- Public Member Functions inherited from gem5::memory::qos::MemCtrl
 MemCtrl (const QoSMemCtrlParams &)
 QoS Memory base class. More...
 
virtual ~MemCtrl ()
 
BusState getBusState () const
 Gets the current bus state. More...
 
BusState getBusStateNext () const
 Gets the next bus state. More...
 
bool hasRequestor (RequestorID id) const
 hasRequestor returns true if the selected requestor(ID) has been registered in the memory controller, which happens if the memory controller has received at least a packet from that requestor. More...
 
uint64_t getReadQueueSize (const uint8_t prio) const
 Gets a READ queue size. More...
 
uint64_t getWriteQueueSize (const uint8_t prio) const
 Gets a WRITE queue size. More...
 
uint64_t getTotalReadQueueSize () const
 Gets the total combined READ queues size. More...
 
uint64_t getTotalWriteQueueSize () const
 Gets the total combined WRITE queues size. More...
 
Tick getServiceTick (const uint8_t prio) const
 Gets the last service tick related to a QoS Priority. More...
 
uint8_t numPriorities () const
 Gets the total number of priority levels in the QoS memory controller. More...
 
Systemsystem () const
 read the system pointer More...
 
- Public Member Functions inherited from gem5::ClockedObject
 ClockedObject (const ClockedObjectParams &p)
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from gem5::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
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...
 
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 gem5::EventManager
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)
 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 gem5::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 gem5::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 gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group. More...
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters. More...
 
virtual void resetStats ()
 Callback to reset stats. More...
 
virtual void preDumpStats ()
 Callback before stats are dumped. More...
 
void addStat (statistics::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 InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 
- Public Member Functions inherited from gem5::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
 

Protected Member Functions

virtual void processNextReqEvent (MemInterface *mem_intr, MemPacketQueue &resp_queue, EventFunctionWrapper &resp_event, EventFunctionWrapper &next_req_event, bool &retry_wr_req)
 Bunch of things requires to setup "events" in gem5 When event "respondEvent" occurs for example, the method processRespondEvent is called; no parameters are allowed in these methods. More...
 
virtual void processRespondEvent (MemInterface *mem_intr, MemPacketQueue &queue, EventFunctionWrapper &resp_event, bool &retry_rd_req)
 
bool readQueueFull (unsigned int pkt_count) const
 Check if the read queue has room for more entries. More...
 
bool writeQueueFull (unsigned int pkt_count) const
 Check if the write queue has room for more entries. More...
 
bool addToReadQueue (PacketPtr pkt, unsigned int pkt_count, MemInterface *mem_intr)
 When a new read comes in, first check if the write q has a pending request to the same address. If not, decode the address to populate rank/bank/row, create one or mutliple "mem_pkt", and push them to the back of the read queue. More...
 
void addToWriteQueue (PacketPtr pkt, unsigned int pkt_count, MemInterface *mem_intr)
 Decode the incoming pkt, create a mem_pkt and push to the back of the write queue. More...
 
virtual Tick doBurstAccess (MemPacket *mem_pkt, MemInterface *mem_intr)
 Actually do the burst based on media specific access function. More...
 
virtual void accessAndRespond (PacketPtr pkt, Tick static_latency, MemInterface *mem_intr)
 When a packet reaches its "readyTime" in the response Q, use the "access()" method in AbstractMemory to actually create the response packet, and send it back to the outside world requestor. More...
 
virtual bool packetReady (MemPacket *pkt, MemInterface *mem_intr)
 Determine if there is a packet that can issue. More...
 
virtual Tick minReadToWriteDataGap ()
 Calculate the minimum delay used when scheduling a read-to-write transision. More...
 
virtual Tick minWriteToReadDataGap ()
 Calculate the minimum delay used when scheduling a write-to-read transision. More...
 
virtual MemPacketQueue::iterator chooseNext (MemPacketQueue &queue, Tick extra_col_delay, MemInterface *mem_intr)
 The memory schduler/arbiter - picks which request needs to go next, based on the specified policy such as FCFS or FR-FCFS and moves it to the head of the queue. More...
 
virtual std::pair< MemPacketQueue::iterator, TickchooseNextFRFCFS (MemPacketQueue &queue, Tick extra_col_delay, MemInterface *mem_intr)
 For FR-FCFS policy reorder the read/write queue depending on row buffer hits and earliest bursts available in memory. More...
 
Tick getBurstWindow (Tick cmd_tick)
 Calculate burst window aligned tick. More...
 
void printQs () const
 Used for debugging to observe the contents of the queues. More...
 
virtual Addr burstAlign (Addr addr, MemInterface *mem_intr) const
 Burst-align an address. More...
 
virtual bool pktSizeCheck (MemPacket *mem_pkt, MemInterface *mem_intr) const
 Check if mem pkt's size is sane. More...
 
virtual AddrRangeList getAddrRanges ()
 
std::vector< MemPacketQueue > & selQueue (bool is_read)
 Select either the read or write queue. More...
 
virtual bool respQEmpty ()
 
virtual bool memBusy (MemInterface *mem_intr)
 Checks if the memory interface is already busy. More...
 
virtual void nonDetermReads (MemInterface *mem_intr)
 Will access memory interface and select non-deterministic reads to issue. More...
 
virtual bool nvmWriteBlock (MemInterface *mem_intr)
 Will check if all writes are for nvm interface and nvm's write resp queue is full. More...
 
virtual void pruneBurstTick ()
 Remove commands that have already issued from burstTicks. More...
 
virtual Tick recvAtomic (PacketPtr pkt)
 
virtual Tick recvAtomicBackdoor (PacketPtr pkt, MemBackdoorPtr &backdoor)
 
virtual void recvFunctional (PacketPtr pkt)
 
virtual bool recvTimingReq (PacketPtr pkt)
 
bool recvFunctionalLogic (PacketPtr pkt, MemInterface *mem_intr)
 
Tick recvAtomicLogic (PacketPtr pkt, MemInterface *mem_intr)
 
- Protected Member Functions inherited from gem5::memory::qos::MemCtrl
void addRequestor (const RequestorID id)
 Initializes dynamically counters and statistics for a given Requestor. More...
 
void logRequest (BusState dir, RequestorID id, uint8_t _qos, Addr addr, uint64_t entries)
 Called upon receiving a request or updates statistics and updates queues status. More...
 
void logResponse (BusState dir, RequestorID id, uint8_t _qos, Addr addr, uint64_t entries, double delay)
 Called upon receiving a response, updates statistics and updates queues status. More...
 
template<typename Queues >
uint8_t qosSchedule (std::initializer_list< Queues * > queues_ptr, uint64_t queue_entry_size, const PacketPtr pkt)
 Assign priority to a packet by executing the configured QoS policy. More...
 
uint8_t schedule (RequestorID id, uint64_t data)
 
uint8_t schedule (const PacketPtr pkt)
 
BusState selectNextBusState ()
 Returns next bus direction (READ or WRITE) based on configured policy. More...
 
void setCurrentBusState ()
 Set current bus direction (READ or WRITE) from next selected one. More...
 
void recordTurnaroundStats ()
 Record statistics on turnarounds based on busStateNext and busState values. More...
 
template<typename Queues >
void escalate (std::initializer_list< Queues * > queues, uint64_t queue_entry_size, RequestorID id, uint8_t tgt_prio)
 Escalates/demotes priority of all packets belonging to the passed requestor to given priority value. More...
 
template<typename Queues >
void escalateQueues (Queues &queues, uint64_t queue_entry_size, RequestorID id, uint8_t curr_prio, uint8_t tgt_prio)
 Escalates/demotes priority of all packets belonging to the passed requestor to given priority value in a specified cluster of queues (e.g. More...
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from gem5::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...
 
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

MemoryPort port
 Our incoming port, for a multi-ported controller add a crossbar in front of it. More...
 
bool isTimingMode
 Remember if the memory system is in timing mode. More...
 
bool retryRdReq
 Remember if we have to retry a request when available. More...
 
bool retryWrReq
 
EventFunctionWrapper nextReqEvent
 
EventFunctionWrapper respondEvent
 
std::vector< MemPacketQueuereadQueue
 The controller's main read and write queues, with support for QoS reordering. More...
 
std::vector< MemPacketQueuewriteQueue
 
std::unordered_set< AddrisInWriteQueue
 To avoid iterating over the write queue to check for overlapping transactions, maintain a set of burst addresses that are currently queued. More...
 
std::deque< MemPacket * > respQueue
 Response queue where read packets wait after we're done working with them, but it's not time to send the response yet. More...
 
std::unordered_multiset< TickburstTicks
 Holds count of commands issued in burst window starting at defined Tick. More...
 
MemInterfacedram
 
uint32_t readBufferSize
 The following are basic design parameters of the memory controller, and are initialized based on parameter values. More...
 
uint32_t writeBufferSize
 
uint32_t writeHighThreshold
 
uint32_t writeLowThreshold
 
const uint32_t minWritesPerSwitch
 
const uint32_t minReadsPerSwitch
 
uint32_t writesThisTime
 
uint32_t readsThisTime
 
enums::MemSched memSchedPolicy
 Memory controller configuration initialized based on parameter values. More...
 
const Tick frontendLatency
 Pipeline latency of the controller frontend. More...
 
const Tick backendLatency
 Pipeline latency of the backend and PHY. More...
 
const Tick commandWindow
 Length of a command window, used to check command bandwidth. More...
 
Tick nextBurstAt
 Till when must we wait before issuing next RD/WR burst? More...
 
Tick prevArrival
 
Tick nextReqTime
 The soonest you have to start thinking about the next request is the longest access time that can occur before nextBurstAt. More...
 
CtrlStats stats
 
std::unique_ptr< PacketpendingDelete
 Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent call. More...
 
- Protected Attributes inherited from gem5::memory::qos::MemCtrl
const std::unique_ptr< Policypolicy
 QoS Policy, assigns QoS priority to the incoming packets. More...
 
const std::unique_ptr< TurnaroundPolicyturnPolicy
 QoS Bus Turnaround Policy: selects the bus direction (READ/WRITE) More...
 
const std::unique_ptr< QueuePolicyqueuePolicy
 QoS Queue Policy: selects packet among same-priority queue. More...
 
const uint8_t _numPriorities
 Number of configured QoS priorities. More...
 
const bool qosPriorityEscalation
 Enables QoS priority escalation. More...
 
const bool qosSyncroScheduler
 Enables QoS synchronized scheduling invokes the QoS scheduler on all requestors, at every packet arrival. More...
 
std::unordered_map< RequestorID, const std::string > requestors
 Hash of requestor ID - requestor name. More...
 
std::unordered_map< RequestorID, std::vector< uint64_t > > packetPriorities
 Hash of requestors - number of packets queued per priority. More...
 
std::unordered_map< RequestorID, std::unordered_map< uint64_t, std::deque< uint64_t > > > requestTimes
 Hash of requestors - address of request - queue of times of request. More...
 
std::vector< TickserviceTick
 Vector of QoS priorities/last service time. More...
 
std::vector< uint64_t > readQueueSizes
 Read request packets queue length in #packets, per QoS priority. More...
 
std::vector< uint64_t > writeQueueSizes
 Write request packets queue length in #packets, per QoS priority. More...
 
uint64_t totalReadQueueSize
 Total read request packets queue length in #packets. More...
 
uint64_t totalWriteQueueSize
 Total write request packets queue length in #packets. More...
 
BusState busState
 Bus state used to control the read/write switching and drive the scheduling of the next request. More...
 
BusState busStateNext
 bus state for next request event triggered More...
 
gem5::memory::qos::MemCtrl::MemCtrlStats stats
 
System_system
 Pointer to the System object. More...
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Additional Inherited Members

- Public Types inherited from gem5::memory::qos::MemCtrl
enum  BusState { READ , WRITE }
 Bus Direction. More...
 
- Public Types inherited from gem5::ClockedObject
using Params = ClockedObjectParams
 Parameters of ClockedObject. More...
 
- Public Types inherited from gem5::SimObject
typedef SimObjectParams Params
 
- Static Public Member Functions inherited from gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing 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 void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. More...
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section. More...
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 
- Public Attributes inherited from gem5::ClockedObject
PowerStatepowerState
 

Detailed Description

The memory controller is a single-channel memory controller capturing the most important timing constraints associated with a contemporary controller.

For multi-channel memory systems, the controller is combined with a crossbar model, with the channel address interleaving taking part in the crossbar.

As a basic design principle, this controller model is not cycle callable, but instead uses events to: 1) decide when new decisions can be made, 2) when resources become available, 3) when things are to be considered done, and 4) when to send things back. The controller interfaces to media specific interfaces to enable flexible topoloties. Through these simple principles, the model delivers high performance, and lots of flexibility, allowing users to evaluate the system impact of a wide range of memory technologies.

For more details, please see Hansson et al, "Simulating DRAM controllers for future system architecture exploration", Proc. ISPASS, 2014. If you use this model as part of your research please cite the paper.

Definition at line 246 of file mem_ctrl.hh.

Constructor & Destructor Documentation

◆ MemCtrl()

gem5::memory::MemCtrl::MemCtrl ( const MemCtrlParams &  p)

Definition at line 60 of file mem_ctrl.cc.

References dram, nextReqEvent, processNextReqEvent(), respondEvent, respQueue, and retryWrReq.

Member Function Documentation

◆ accessAndRespond()

void gem5::memory::MemCtrl::accessAndRespond ( PacketPtr  pkt,
Tick  static_latency,
MemInterface mem_intr 
)
protectedvirtual

When a packet reaches its "readyTime" in the response Q, use the "access()" method in AbstractMemory to actually create the response packet, and send it back to the outside world requestor.

Parameters
pktThe packet from the outside world
static_latencyStatic latency to add before sending the packet
mem_intrthe memory interface to access

Definition at line 616 of file mem_ctrl.cc.

References gem5::memory::AbstractMemory::access(), gem5::AddrRange::contains(), gem5::curTick(), DPRINTF, gem5::Packet::getAddr(), gem5::memory::AbstractMemory::getAddrRange(), gem5::Packet::headerDelay, gem5::Packet::isResponse(), gem5::Packet::needsResponse(), panic_if, gem5::Packet::payloadDelay, pendingDelete, port, gem5::Packet::print(), and gem5::QueuedResponsePort::schedTimingResp().

Referenced by addToReadQueue(), addToWriteQueue(), and processRespondEvent().

◆ addToReadQueue()

bool gem5::memory::MemCtrl::addToReadQueue ( PacketPtr  pkt,
unsigned int  pkt_count,
MemInterface mem_intr 
)
protected

When a new read comes in, first check if the write q has a pending request to the same address. If not, decode the address to populate rank/bank/row, create one or mutliple "mem_pkt", and push them to the back of the read queue.

\ If this is the only read request in the system, schedule an event to start servicing it.

Parameters
pktThe request packet from the outside world
pkt_countThe number of memory bursts the pkt
mem_intrThe memory interface this pkt will eventually go to
Returns
if all the read pkts are already serviced by wrQ

Definition at line 190 of file mem_ctrl.cc.

References accessAndRespond(), gem5::X86ISA::addr, gem5::memory::MemPacket::addr, gem5::memory::MemCtrl::CtrlStats::avgRdQLen, burstAlign(), gem5::memory::MemPacket::burstHelper, gem5::memory::BurstHelper::burstsServiced, gem5::memory::MemInterface::bytesPerBurst(), gem5::memory::MemCtrl::CtrlStats::bytesReadWrQ, gem5::ceilLog2(), gem5::memory::MemInterface::decodePacket(), DPRINTF, frontendLatency, gem5::Packet::getAddr(), gem5::Packet::getSize(), isInWriteQueue, gem5::Packet::isWrite(), gem5::memory::qos::MemCtrl::logRequest(), gem5::MaxTick, gem5::VegaISA::p, gem5::memory::MemInterface::pseudoChannel, gem5::Packet::qosValue(), gem5::memory::MemPacket::qosValue(), gem5::memory::MemPacket::rank, gem5::memory::MemCtrl::CtrlStats::rdQLenPdf, gem5::memory::qos::MemCtrl::READ, gem5::memory::MemCtrl::CtrlStats::readBursts, gem5::memory::MemCtrl::CtrlStats::readPktSize, readQueue, readQueueFull(), gem5::memory::MemPacket::readyTime, gem5::Packet::requestorId(), gem5::memory::MemCtrl::CtrlStats::requestorReadAccesses, respQueue, gem5::memory::MemCtrl::CtrlStats::servicedByWrQ, gem5::memory::MemInterface::setupRank(), stats, gem5::memory::qos::MemCtrl::totalReadQueueSize, gem5::PowerISA::vec, and writeQueue.

Referenced by recvTimingReq(), gem5::memory::HBMCtrl::recvTimingReq(), and gem5::memory::HeteroMemCtrl::recvTimingReq().

◆ addToWriteQueue()

void gem5::memory::MemCtrl::addToWriteQueue ( PacketPtr  pkt,
unsigned int  pkt_count,
MemInterface mem_intr 
)
protected

Decode the incoming pkt, create a mem_pkt and push to the back of the write queue.

\If the write q length is more than the threshold specified by the user, ie the queue is beginning to get full, stop reads, and start draining writes.

Parameters
pktThe request packet from the outside world
pkt_countThe number of memory bursts the pkt
mem_intrThe memory interface this pkt will eventually go to

Definition at line 303 of file mem_ctrl.cc.

References accessAndRespond(), gem5::X86ISA::addr, gem5::memory::MemPacket::addr, gem5::memory::MemCtrl::CtrlStats::avgWrQLen, burstAlign(), gem5::memory::MemInterface::bytesPerBurst(), gem5::ceilLog2(), gem5::memory::MemInterface::decodePacket(), DPRINTF, frontendLatency, gem5::Packet::getAddr(), gem5::Packet::getSize(), isInWriteQueue, gem5::Packet::isWrite(), gem5::memory::qos::MemCtrl::logRequest(), gem5::MaxTick, gem5::memory::MemCtrl::CtrlStats::mergedWrBursts, gem5::memory::MemInterface::pseudoChannel, gem5::Packet::qosValue(), gem5::memory::MemPacket::qosValue(), gem5::memory::MemPacket::rank, gem5::memory::MemPacket::readyTime, gem5::Packet::requestorId(), gem5::memory::MemCtrl::CtrlStats::requestorWriteAccesses, gem5::memory::MemInterface::setupRank(), stats, gem5::memory::qos::MemCtrl::totalWriteQueueSize, gem5::memory::qos::MemCtrl::WRITE, writeBufferSize, gem5::memory::MemCtrl::CtrlStats::writeBursts, gem5::memory::MemCtrl::CtrlStats::writePktSize, writeQueue, and gem5::memory::MemCtrl::CtrlStats::wrQLenPdf.

Referenced by recvTimingReq(), gem5::memory::HBMCtrl::recvTimingReq(), and gem5::memory::HeteroMemCtrl::recvTimingReq().

◆ allIntfDrained()

bool gem5::memory::MemCtrl::allIntfDrained ( ) const
virtual

Ensure that all interfaced have drained commands.

Returns
bool flag, set once drain complete

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 1390 of file mem_ctrl.cc.

References gem5::memory::MemInterface::allRanksDrained(), and dram.

Referenced by drain(), processNextReqEvent(), and processRespondEvent().

◆ burstAlign()

Addr gem5::memory::MemCtrl::burstAlign ( Addr  addr,
MemInterface mem_intr 
) const
protectedvirtual

Burst-align an address.

Parameters
addrThe potentially unaligned address
mem_intrThe DRAM interface this pkt belongs to
Returns
An address aligned to a memory burst

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 1154 of file mem_ctrl.cc.

References gem5::X86ISA::addr, and gem5::memory::MemInterface::bytesPerBurst().

Referenced by addToReadQueue(), addToWriteQueue(), and processNextReqEvent().

◆ chooseNext()

MemPacketQueue::iterator gem5::memory::MemCtrl::chooseNext ( MemPacketQueue queue,
Tick  extra_col_delay,
MemInterface mem_intr 
)
protectedvirtual

The memory schduler/arbiter - picks which request needs to go next, based on the specified policy such as FCFS or FR-FCFS and moves it to the head of the queue.

Prioritizes accesses to the same rank as previous burst unless controller is switching command type.

Parameters
queueQueued requests to consider
extra_col_delayAny extra delay due to a read/write switch
mem_intrthe memory interface to choose from
Returns
an iterator to the selected packet, else queue.end()

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 554 of file mem_ctrl.cc.

References chooseNextFRFCFS(), DPRINTF, gem5::ArmISA::i, memSchedPolicy, packetReady(), panic, gem5::memory::MemPacket::pseudoChannel, and gem5::memory::MemInterface::pseudoChannel.

Referenced by processNextReqEvent().

◆ chooseNextFRFCFS()

std::pair< MemPacketQueue::iterator, Tick > gem5::memory::MemCtrl::chooseNextFRFCFS ( MemPacketQueue queue,
Tick  extra_col_delay,
MemInterface mem_intr 
)
protectedvirtual

For FR-FCFS policy reorder the read/write queue depending on row buffer hits and earliest bursts available in memory.

Parameters
queueQueued requests to consider
extra_col_delayAny extra delay due to a read/write switch
Returns
an iterator to the selected packet, else queue.end()

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 595 of file mem_ctrl.cc.

References gem5::memory::MemInterface::chooseNextFRFCFS(), gem5::curTick(), DPRINTF, gem5::MaxTick, and gem5::memory::MemInterface::nextBurstAt.

Referenced by chooseNext(), and gem5::memory::HeteroMemCtrl::chooseNextFRFCFS().

◆ doBurstAccess()

Tick gem5::memory::MemCtrl::doBurstAccess ( MemPacket mem_pkt,
MemInterface mem_intr 
)
protectedvirtual

◆ drain()

DrainState gem5::memory::MemCtrl::drain ( )
overridevirtual

Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are partially executed or are partially in flight.

Draining is mostly used before forking and creating a check point.

This function notifies an object that it needs to drain its state.

If the object does not need further simulation to drain internal buffers, it returns DrainState::Drained and automatically switches to the Drained state. If the object needs more simulation, it returns DrainState::Draining and automatically enters the Draining state. Other return values are invalid.

Note
An object that has entered the Drained state can be disturbed by other objects in the system and consequently stop being drained. These perturbations are not visible in the drain state. The simulator therefore repeats the draining process until all objects return DrainState::Drained on the first call to drain().
Returns
DrainState::Drained if the object is drained at this point in time, DrainState::Draining if it needs further simulation.

Implements gem5::Drainable.

Definition at line 1399 of file mem_ctrl.cc.

References allIntfDrained(), gem5::curTick(), DPRINTF, gem5::Drained, gem5::Draining, gem5::memory::MemInterface::drainRanks(), dram, nextReqEvent, respQueue, gem5::memory::qos::MemCtrl::schedule(), gem5::Event::scheduled(), gem5::memory::qos::MemCtrl::totalReadQueueSize, and gem5::memory::qos::MemCtrl::totalWriteQueueSize.

◆ drainResume()

void gem5::memory::MemCtrl::drainResume ( )
overridevirtual

◆ getAddrRanges()

AddrRangeList gem5::memory::MemCtrl::getAddrRanges ( )
protectedvirtual

Reimplemented in gem5::memory::HeteroMemCtrl, and gem5::memory::HBMCtrl.

Definition at line 1443 of file mem_ctrl.cc.

References dram, and gem5::memory::AbstractMemory::getAddrRange().

◆ getBurstWindow()

Tick gem5::memory::MemCtrl::getBurstWindow ( Tick  cmd_tick)
protected

Calculate burst window aligned tick.

Parameters
cmd_tickInitial tick of command
Returns
burst window aligned tick

Definition at line 669 of file mem_ctrl.cc.

References commandWindow.

Referenced by gem5::memory::HBMCtrl::pruneColBurstTick(), gem5::memory::HBMCtrl::pruneRowBurstTick(), verifyMultiCmd(), gem5::memory::HBMCtrl::verifyMultiCmd(), verifySingleCmd(), and gem5::memory::HBMCtrl::verifySingleCmd().

◆ getPort()

Port & gem5::memory::MemCtrl::getPort ( const std::string &  if_name,
PortID  idx = InvalidPortID 
)
overridevirtual

Get a port with a given name and index.

This is used at binding time and returns a reference to a protocol-agnostic port.

gem5 has a request and response port interface. All memory objects are connected together via ports. These ports provide a rigid interface between these memory objects. These ports implement three different memory system modes: timing, atomic, and functional. The most important mode is the timing mode and here timing mode is used for conducting cycle-level timing experiments. The other modes are only used in special circumstances and should not be used to conduct cycle-level timing experiments. The other modes are only used in special circumstances. These ports allow SimObjects to communicate with each other.

Parameters
if_namePort name
idxIndex in the case of a VectorPort
Returns
A reference to the given port

Reimplemented from gem5::SimObject.

Definition at line 1380 of file mem_ctrl.cc.

References gem5::SimObject::getPort(), and port.

◆ init()

void gem5::memory::MemCtrl::init ( )
overridevirtual

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 gem5::SimObject.

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 101 of file mem_ctrl.cc.

References fatal, gem5::Port::isConnected(), gem5::Named::name(), port, and gem5::ResponsePort::sendRangeChange().

Referenced by gem5::memory::HBMCtrl::init().

◆ inReadBusState()

bool gem5::memory::MemCtrl::inReadBusState ( bool  next_state) const

Check the current direction of the memory channel.

Parameters
next_stateCheck either the current or next bus state
Returns
True when bus is currently in a read state

Definition at line 764 of file mem_ctrl.cc.

References gem5::memory::qos::MemCtrl::busState, gem5::memory::qos::MemCtrl::busStateNext, and gem5::memory::qos::MemCtrl::READ.

Referenced by gem5::memory::NVMInterface::burstReady(), gem5::memory::NVMInterface::isBusy(), and gem5::memory::DRAMInterface::minBankPrep().

◆ inWriteBusState()

bool gem5::memory::MemCtrl::inWriteBusState ( bool  next_state) const

Check the current direction of the memory channel.

Parameters
next_stateCheck either the current or next bus state
Returns
True when bus is currently in a write state

Definition at line 777 of file mem_ctrl.cc.

References gem5::memory::qos::MemCtrl::busState, gem5::memory::qos::MemCtrl::busStateNext, and gem5::memory::qos::MemCtrl::WRITE.

◆ memBusy()

bool gem5::memory::MemCtrl::memBusy ( MemInterface mem_intr)
protectedvirtual

Checks if the memory interface is already busy.

Parameters
mem_intrmemory interface to check
Returns
a boolean indicating if memory is busy

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 832 of file mem_ctrl.cc.

References gem5::memory::MemInterface::isBusy(), gem5::memory::MemInterface::numWritesQueued, gem5::memory::qos::MemCtrl::totalReadQueueSize, and gem5::memory::qos::MemCtrl::totalWriteQueueSize.

Referenced by processNextReqEvent().

◆ minReadToWriteDataGap()

Tick gem5::memory::MemCtrl::minReadToWriteDataGap ( )
protectedvirtual

Calculate the minimum delay used when scheduling a read-to-write transision.

Parameters
returnminimum delay

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 1142 of file mem_ctrl.cc.

References dram, and gem5::memory::MemInterface::minReadToWriteDataGap().

Referenced by processNextReqEvent().

◆ minWriteToReadDataGap()

Tick gem5::memory::MemCtrl::minWriteToReadDataGap ( )
protectedvirtual

Calculate the minimum delay used when scheduling a write-to-read transision.

Parameters
returnminimum delay

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 1148 of file mem_ctrl.cc.

References dram, and gem5::memory::MemInterface::minWriteToReadDataGap().

Referenced by processNextReqEvent().

◆ nonDetermReads()

void gem5::memory::MemCtrl::nonDetermReads ( MemInterface mem_intr)
protectedvirtual

Will access memory interface and select non-deterministic reads to issue.

Parameters
mem_intrmemory interface to use

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 860 of file mem_ctrl.cc.

References gem5::memory::MemInterface::chooseRead(), readQueue, and gem5::memory::MemInterface::readsWaitingToIssue().

Referenced by gem5::memory::HeteroMemCtrl::nonDetermReads(), and processNextReqEvent().

◆ nvmWriteBlock()

bool gem5::memory::MemCtrl::nvmWriteBlock ( MemInterface mem_intr)
protectedvirtual

Will check if all writes are for nvm interface and nvm's write resp queue is full.

The generic mem_intr is used as the same function can be called for a dram interface, in which case dram functions will eventually return false

Parameters
mem_intrmemory interface to use
Returns
a boolean showing if nvm is blocked with writes

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 853 of file mem_ctrl.cc.

References gem5::memory::MemInterface::numWritesQueued, gem5::memory::qos::MemCtrl::totalWriteQueueSize, and gem5::memory::MemInterface::writeRespQueueFull().

Referenced by gem5::memory::HeteroMemCtrl::nvmWriteBlock(), and processNextReqEvent().

◆ packetReady()

bool gem5::memory::MemCtrl::packetReady ( MemPacket pkt,
MemInterface mem_intr 
)
protectedvirtual

Determine if there is a packet that can issue.

Parameters
pktThe packet to evaluate

Definition at line 1136 of file mem_ctrl.cc.

References gem5::memory::MemInterface::burstReady().

Referenced by gem5::memory::HeteroMemCtrl::chooseNext(), and chooseNext().

◆ pktSizeCheck()

bool gem5::memory::MemCtrl::pktSizeCheck ( MemPacket mem_pkt,
MemInterface mem_intr 
) const
protectedvirtual

Check if mem pkt's size is sane.

Parameters
mem_pktmemory packet
mem_intrmemory interface
Returns
An address aligned to a memory burst

Reimplemented in gem5::memory::HeteroMemCtrl.

Definition at line 1160 of file mem_ctrl.cc.

References gem5::memory::MemInterface::bytesPerBurst(), and gem5::memory::MemPacket::size.

Referenced by processNextReqEvent().

◆ printQs()

void gem5::memory::MemCtrl::printQs ( ) const
protected

Used for debugging to observe the contents of the queues.

Definition at line 379 of file mem_ctrl.cc.

References DPRINTF, readQueue, respQueue, and writeQueue.

◆ processNextReqEvent()

void gem5::memory::MemCtrl::processNextReqEvent ( MemInterface mem_intr,
MemPacketQueue resp_queue,
EventFunctionWrapper resp_event,
EventFunctionWrapper next_req_event,
bool &  retry_wr_req 
)
protectedvirtual

Bunch of things requires to setup "events" in gem5 When event "respondEvent" occurs for example, the method processRespondEvent is called; no parameters are allowed in these methods.

Definition at line 875 of file mem_ctrl.cc.

References allIntfDrained(), burstAlign(), gem5::memory::qos::MemCtrl::busState, gem5::memory::qos::MemCtrl::busStateNext, chooseNext(), gem5::curTick(), doBurstAccess(), DPRINTF, gem5::Draining, gem5::Drainable::drainState(), isInWriteQueue, gem5::memory::qos::MemCtrl::logResponse(), memBusy(), minReadsPerSwitch, minReadToWriteDataGap(), minWritesPerSwitch, minWriteToReadDataGap(), gem5::memory::MemInterface::nextReqTime, nonDetermReads(), gem5::memory::qos::MemCtrl::numPriorities(), nvmWriteBlock(), pktSizeCheck(), port, gem5::memory::MemCtrl::CtrlStats::rdPerTurnAround, gem5::memory::qos::MemCtrl::READ, readQueue, readsThisTime, gem5::memory::qos::MemCtrl::recordTurnaroundStats(), respQEmpty(), gem5::statistics::DistBase< Derived, Stor >::sample(), gem5::memory::qos::MemCtrl::schedule(), gem5::Event::scheduled(), gem5::memory::qos::MemCtrl::selectNextBusState(), gem5::ResponsePort::sendRetryReq(), gem5::Drainable::signalDrainDone(), stats, gem5::memory::qos::MemCtrl::totalReadQueueSize, gem5::memory::qos::MemCtrl::totalWriteQueueSize, gem5::memory::qos::MemCtrl::turnPolicy, gem5::memory::qos::MemCtrl::WRITE, writeBufferSize, writeHighThreshold, writeLowThreshold, writeQueue, writesThisTime, and gem5::memory::MemCtrl::CtrlStats::wrPerTurnAround.

Referenced by gem5::memory::HBMCtrl::HBMCtrl(), and MemCtrl().

◆ processRespondEvent()

void gem5::memory::MemCtrl::processRespondEvent ( MemInterface mem_intr,
MemPacketQueue queue,
EventFunctionWrapper resp_event,
bool &  retry_rd_req 
)
protectedvirtual

◆ pruneBurstTick()

void gem5::memory::MemCtrl::pruneBurstTick ( )
protectedvirtual

Remove commands that have already issued from burstTicks.

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 656 of file mem_ctrl.cc.

References burstTicks, gem5::curTick(), and DPRINTF.

Referenced by doBurstAccess().

◆ readQueueFull()

bool gem5::memory::MemCtrl::readQueueFull ( unsigned int  pkt_count) const
protected

Check if the read queue has room for more entries.

Parameters
pkt_countThe number of entries needed in the read queue
Returns
true if read queue is full, false otherwise

Definition at line 167 of file mem_ctrl.cc.

References DPRINTF, readBufferSize, respQueue, and gem5::memory::qos::MemCtrl::totalReadQueueSize.

Referenced by addToReadQueue(), recvTimingReq(), and gem5::memory::HeteroMemCtrl::recvTimingReq().

◆ recvAtomic()

Tick gem5::memory::MemCtrl::recvAtomic ( PacketPtr  pkt)
protectedvirtual

◆ recvAtomicBackdoor()

Tick gem5::memory::MemCtrl::recvAtomicBackdoor ( PacketPtr  pkt,
MemBackdoorPtr backdoor 
)
protectedvirtual

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 159 of file mem_ctrl.cc.

References dram, gem5::memory::AbstractMemory::getBackdoor(), and recvAtomic().

◆ recvAtomicLogic()

Tick gem5::memory::MemCtrl::recvAtomicLogic ( PacketPtr  pkt,
MemInterface mem_intr 
)
protected

◆ recvFunctional()

void gem5::memory::MemCtrl::recvFunctional ( PacketPtr  pkt)
protectedvirtual

Reimplemented in gem5::memory::HeteroMemCtrl, and gem5::memory::HBMCtrl.

Definition at line 1359 of file mem_ctrl.cc.

References dram, panic_if, gem5::Packet::print(), and recvFunctionalLogic().

◆ recvFunctionalLogic()

bool gem5::memory::MemCtrl::recvFunctionalLogic ( PacketPtr  pkt,
MemInterface mem_intr 
)
protected

◆ recvTimingReq()

bool gem5::memory::MemCtrl::recvTimingReq ( PacketPtr  pkt)
protectedvirtual

◆ requestEventScheduled()

virtual bool gem5::memory::MemCtrl::requestEventScheduled ( uint8_t  pseudo_channel = 0) const
inlinevirtual

Is there a read/write burst Event scheduled?

Returns
true if event is scheduled

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 738 of file mem_ctrl.hh.

References nextReqEvent, and gem5::Event::scheduled().

Referenced by gem5::memory::NVMInterface::processReadReadyEvent(), gem5::memory::NVMInterface::processWriteRespondEvent(), and gem5::memory::HBMCtrl::requestEventScheduled().

◆ respondEventScheduled()

virtual bool gem5::memory::MemCtrl::respondEventScheduled ( uint8_t  pseudo_channel = 0) const
inlinevirtual

Is there a respondEvent scheduled?

Returns
true if event is scheduled

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 727 of file mem_ctrl.hh.

References respondEvent, and gem5::Event::scheduled().

Referenced by gem5::memory::HBMCtrl::respondEventScheduled().

◆ respQEmpty()

virtual bool gem5::memory::MemCtrl::respQEmpty ( )
inlineprotectedvirtual

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 641 of file mem_ctrl.hh.

References respQueue.

Referenced by processNextReqEvent().

◆ restartScheduler()

virtual void gem5::memory::MemCtrl::restartScheduler ( Tick  tick,
uint8_t  pseudo_channel = 0 
)
inlinevirtual

restart the controller This can be used by interfaces to restart the scheduler after maintainence commands complete

Parameters
Tickto schedule next event
pseudo_channelpseudo channel number for which scheduler needs to restart, will always be 0 for controllers which control only a single channel

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 753 of file mem_ctrl.hh.

References nextReqEvent, gem5::memory::qos::MemCtrl::schedule(), and gem5::Clocked::tick.

Referenced by gem5::memory::NVMInterface::processReadReadyEvent(), gem5::memory::NVMInterface::processWriteRespondEvent(), and gem5::memory::HBMCtrl::restartScheduler().

◆ selQueue()

std::vector<MemPacketQueue>& gem5::memory::MemCtrl::selQueue ( bool  is_read)
inlineprotected

Select either the read or write queue.

Parameters
is_readThe current burst is a read, select read queue
Returns
a reference to the appropriate queue

Definition at line 636 of file mem_ctrl.hh.

References readQueue, and writeQueue.

Referenced by doBurstAccess().

◆ startup()

void gem5::memory::MemCtrl::startup ( )
overridevirtual

startup() is the final initialization call before simulation.

All state is initialized (including unserialized state, if any, such as the curTick() value), so this is the appropriate place to schedule initial event(s) for objects that need them.

Reimplemented from gem5::SimObject.

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 111 of file mem_ctrl.cc.

References gem5::memory::MemInterface::commandOffset(), gem5::curTick(), dram, isTimingMode, gem5::System::isTimingMode(), gem5::memory::MemInterface::nextBurstAt, and gem5::memory::qos::MemCtrl::system().

Referenced by gem5::memory::HeteroMemCtrl::drainResume(), drainResume(), and gem5::memory::HBMCtrl::startup().

◆ verifyMultiCmd()

Tick gem5::memory::MemCtrl::verifyMultiCmd ( Tick  cmd_tick,
Tick  max_cmds_per_burst,
Tick  max_multi_cmd_split = 0 
)
virtual

Check for command bus contention for multi-cycle (2 currently) command.

If there is contention, shift command(s) to next burst. Check verifies that the commands issued per burst is less than a defined max number, maxCommandsPerWindow. Therefore, contention per cycle is not verified and instead is done based on a burst window.

Parameters
cmd_tickInitial tick of command, to be verified
max_multi_cmd_splitMaximum delay between commands
max_cmds_per_burstNumber of commands that can issue in a burst window
Returns
tick for command issue without contention

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 700 of file mem_ctrl.cc.

References burstTicks, commandWindow, DPRINTF, and getBurstWindow().

Referenced by gem5::memory::NVMInterface::chooseRead(), and gem5::memory::NVMInterface::doBurstAccess().

◆ verifySingleCmd()

Tick gem5::memory::MemCtrl::verifySingleCmd ( Tick  cmd_tick,
Tick  max_cmds_per_burst,
bool  row_cmd 
)
virtual

Check for command bus contention for single cycle command.

If there is contention, shift command to next burst. Check verifies that the commands issued per burst is less than a defined max number, maxCommandsPerWindow. Therefore, contention per cycle is not verified and instead is done based on a burst window.

Parameters
cmd_tickInitial tick of command, to be verified
max_cmds_per_burstNumber of commands that can issue in a burst window
Returns
tick for command issue without contention

Reimplemented in gem5::memory::HBMCtrl.

Definition at line 677 of file mem_ctrl.cc.

References burstTicks, commandWindow, DPRINTF, and getBurstWindow().

Referenced by gem5::memory::NVMInterface::chooseRead(), and gem5::memory::NVMInterface::doBurstAccess().

◆ writeQueueFull()

bool gem5::memory::MemCtrl::writeQueueFull ( unsigned int  pkt_count) const
protected

Check if the write queue has room for more entries.

Parameters
pkt_countThe number of entries needed in the write queue
Returns
true if write queue is full, false otherwise

Definition at line 179 of file mem_ctrl.cc.

References DPRINTF, gem5::memory::qos::MemCtrl::totalWriteQueueSize, and writeBufferSize.

Referenced by recvTimingReq(), gem5::memory::HBMCtrl::recvTimingReq(), and gem5::memory::HeteroMemCtrl::recvTimingReq().

Member Data Documentation

◆ backendLatency

const Tick gem5::memory::MemCtrl::backendLatency
protected

Pipeline latency of the backend and PHY.

Along with the frontend contribution, this latency is added to reads serviced by the memory.

Definition at line 539 of file mem_ctrl.hh.

Referenced by processRespondEvent().

◆ burstTicks

std::unordered_multiset<Tick> gem5::memory::MemCtrl::burstTicks
protected

Holds count of commands issued in burst window starting at defined Tick.

This is used to ensure that the command bandwidth does not exceed the allowable media constraints.

Definition at line 497 of file mem_ctrl.hh.

Referenced by pruneBurstTick(), verifyMultiCmd(), and verifySingleCmd().

◆ commandWindow

const Tick gem5::memory::MemCtrl::commandWindow
protected

◆ dram

MemInterface* gem5::memory::MemCtrl::dram
protected

◆ frontendLatency

const Tick gem5::memory::MemCtrl::frontendLatency
protected

Pipeline latency of the controller frontend.

The frontend contribution is added to writes (that complete when they are in the write buffer) and reads that are serviced the write buffer.

Definition at line 532 of file mem_ctrl.hh.

Referenced by addToReadQueue(), addToWriteQueue(), and processRespondEvent().

◆ isInWriteQueue

std::unordered_set<Addr> gem5::memory::MemCtrl::isInWriteQueue
protected

To avoid iterating over the write queue to check for overlapping transactions, maintain a set of burst addresses that are currently queued.

Since we merge writes to the same location we never have more than one address to the same burst address.

Definition at line 480 of file mem_ctrl.hh.

Referenced by addToReadQueue(), addToWriteQueue(), and processNextReqEvent().

◆ isTimingMode

bool gem5::memory::MemCtrl::isTimingMode
protected

Remember if the memory system is in timing mode.

Definition at line 286 of file mem_ctrl.hh.

Referenced by gem5::memory::HBMCtrl::drainResume(), gem5::memory::HeteroMemCtrl::drainResume(), drainResume(), gem5::memory::HBMCtrl::startup(), and startup().

◆ memSchedPolicy

enums::MemSched gem5::memory::MemCtrl::memSchedPolicy
protected

Memory controller configuration initialized based on parameter values.

Definition at line 525 of file mem_ctrl.hh.

Referenced by gem5::memory::HeteroMemCtrl::chooseNext(), and chooseNext().

◆ minReadsPerSwitch

const uint32_t gem5::memory::MemCtrl::minReadsPerSwitch
protected

Definition at line 517 of file mem_ctrl.hh.

Referenced by processNextReqEvent().

◆ minWritesPerSwitch

const uint32_t gem5::memory::MemCtrl::minWritesPerSwitch
protected

Definition at line 516 of file mem_ctrl.hh.

Referenced by processNextReqEvent().

◆ nextBurstAt

Tick gem5::memory::MemCtrl::nextBurstAt
protected

Till when must we wait before issuing next RD/WR burst?

Definition at line 550 of file mem_ctrl.hh.

◆ nextReqEvent

EventFunctionWrapper gem5::memory::MemCtrl::nextReqEvent
protected

◆ nextReqTime

Tick gem5::memory::MemCtrl::nextReqTime
protected

The soonest you have to start thinking about the next request is the longest access time that can occur before nextBurstAt.

Assuming you need to precharge, open a new row, and access, it is tRP + tRCD + tCL.

Definition at line 560 of file mem_ctrl.hh.

◆ pendingDelete

std::unique_ptr<Packet> gem5::memory::MemCtrl::pendingDelete
protected

Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent call.

Definition at line 628 of file mem_ctrl.hh.

Referenced by accessAndRespond().

◆ port

MemoryPort gem5::memory::MemCtrl::port
protected

Our incoming port, for a multi-ported controller add a crossbar in front of it.

Definition at line 281 of file mem_ctrl.hh.

Referenced by accessAndRespond(), getPort(), init(), processNextReqEvent(), and processRespondEvent().

◆ prevArrival

Tick gem5::memory::MemCtrl::prevArrival
protected

◆ readBufferSize

uint32_t gem5::memory::MemCtrl::readBufferSize
protected

The following are basic design parameters of the memory controller, and are initialized based on parameter values.

The rowsPerBank is determined based on the capacity, number of ranks and banks, the burst size, and the row buffer size.

Definition at line 512 of file mem_ctrl.hh.

Referenced by gem5::memory::HeteroMemCtrl::HeteroMemCtrl(), gem5::memory::HBMCtrl::readQueueFull(), readQueueFull(), gem5::memory::HBMCtrl::readQueueFullPC0(), and gem5::memory::HBMCtrl::readQueueFullPC1().

◆ readQueue

std::vector<MemPacketQueue> gem5::memory::MemCtrl::readQueue
protected

◆ readsThisTime

uint32_t gem5::memory::MemCtrl::readsThisTime
protected

Definition at line 519 of file mem_ctrl.hh.

Referenced by doBurstAccess(), and processNextReqEvent().

◆ respondEvent

EventFunctionWrapper gem5::memory::MemCtrl::respondEvent
protected

Definition at line 311 of file mem_ctrl.hh.

Referenced by MemCtrl(), and respondEventScheduled().

◆ respQueue

std::deque<MemPacket*> gem5::memory::MemCtrl::respQueue
protected

Response queue where read packets wait after we're done working with them, but it's not time to send the response yet.

The responses are stored separately mostly to keep the code clean and help with events scheduling. For all logical purposes such as sizing the read queue, this and the main read queue need to be added together.

Definition at line 490 of file mem_ctrl.hh.

Referenced by addToReadQueue(), gem5::memory::HeteroMemCtrl::drain(), drain(), MemCtrl(), printQs(), gem5::memory::HBMCtrl::readQueueFull(), readQueueFull(), gem5::memory::HBMCtrl::readQueueFullPC0(), respQEmpty(), and gem5::memory::HBMCtrl::respQEmpty().

◆ retryRdReq

bool gem5::memory::MemCtrl::retryRdReq
protected

Remember if we have to retry a request when available.

Definition at line 291 of file mem_ctrl.hh.

Referenced by recvTimingReq(), and gem5::memory::HeteroMemCtrl::recvTimingReq().

◆ retryWrReq

bool gem5::memory::MemCtrl::retryWrReq
protected

◆ stats

CtrlStats gem5::memory::MemCtrl::stats
protected

◆ writeBufferSize

uint32_t gem5::memory::MemCtrl::writeBufferSize
protected

◆ writeHighThreshold

uint32_t gem5::memory::MemCtrl::writeHighThreshold
protected

Definition at line 514 of file mem_ctrl.hh.

Referenced by gem5::memory::HeteroMemCtrl::HeteroMemCtrl(), and processNextReqEvent().

◆ writeLowThreshold

uint32_t gem5::memory::MemCtrl::writeLowThreshold
protected

Definition at line 515 of file mem_ctrl.hh.

Referenced by gem5::memory::HeteroMemCtrl::HeteroMemCtrl(), and processNextReqEvent().

◆ writeQueue

std::vector<MemPacketQueue> gem5::memory::MemCtrl::writeQueue
protected

◆ writesThisTime

uint32_t gem5::memory::MemCtrl::writesThisTime
protected

Definition at line 518 of file mem_ctrl.hh.

Referenced by doBurstAccess(), and processNextReqEvent().


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

Generated on Wed Dec 21 2022 10:24:15 for gem5 by doxygen 1.9.1