gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
DRAMCtrl Class Reference

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

#include <dram_ctrl.hh>

Inheritance diagram for DRAMCtrl:
QoS::MemCtrl AbstractMemory ClockedObject SimObject Clocked EventManager Serializable Drainable Stats::Group

Classes

class  Bank
 A basic class to track the bank state, i.e. More...
 
class  BurstHelper
 A burst helper helps organize and manage a packet that is larger than the DRAM burst size. More...
 
struct  Command
 Simple structure to hold the values needed to keep track of commands for DRAMPower. More...
 
class  DRAMPacket
 A DRAM packet stores packets along with the timestamp of when the packet entered the queue, and also the decoded address. More...
 
struct  DRAMStats
 All statistics that the model needs to capture. More...
 
class  MemoryPort
 
class  Rank
 Rank class includes a vector of banks. More...
 
struct  RankStats
 

Public Member Functions

 DRAMCtrl (const DRAMCtrlParams *p)
 
DrainState drain () override
 Notify an object that it needs to drain its state. 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
 Initialise this memory. 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...
 
bool allRanksDrained () const
 Return true once refresh is complete for all ranks and there are no additional commands enqueued. More...
 
- Public Member Functions inherited from QoS::MemCtrl
 MemCtrl (const QoSMemCtrlParams *)
 QoS Memory base class. More...
 
virtual ~MemCtrl ()
 
void init () override
 Initializes this object. More...
 
BusState getBusState () const
 Gets the current bus state. More...
 
BusState getBusStateNext () const
 Gets the next bus state. More...
 
bool hasMaster (MasterID m_id) const
 hasMaster returns true if the selected master(ID) has been registered in the memory controller, which happens if the memory controller has received at least a packet from that master. 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...
 
- Public Member Functions inherited from AbstractMemory
 AbstractMemory (const Params *p)
 
virtual ~AbstractMemory ()
 
bool isNull () const
 See if this is a null memory that should never store data and always return zero. More...
 
void setBackingStore (uint8_t *pmem_addr)
 Set the host memory backing store to be used by this memory controller. More...
 
const std::list< LockedAddr > & getLockedAddrList () const
 Get the list of locked addresses to allow checkpointing. More...
 
void addLockedAddr (LockedAddr addr)
 Add a locked address to allow for checkpointing. More...
 
Systemsystem () const
 read the system pointer Implemented for completeness with the setter More...
 
void system (System *sys)
 Set the system pointer on this memory This can't be done via a python parameter because the system needs pointers to all the memories and the reverse would create a cycle in the object graph. More...
 
const Paramsparams () const
 
AddrRange getAddrRange () const
 Get the address range. More...
 
uint8_t * toHostAddr (Addr addr) const
 Transform a gem5 address space address into its physical counterpart in the host address space. More...
 
uint64_t size () const
 Get the memory size. More...
 
Addr start () const
 Get the start address. More...
 
bool isConfReported () const
 Should this memory be passed to the kernel and part of the OS physical memory layout. More...
 
bool isInAddrMap () const
 Some memories are used as shadow memories or should for other reasons not be part of the global address map. More...
 
bool isKvmMap () const
 When shadow memories are in use, KVM may want to make one or the other, but cannot map both into the guest address space. More...
 
void access (PacketPtr pkt)
 Perform an untimed memory access and update all the state (e.g. More...
 
void functionalAccess (PacketPtr pkt)
 Perform an untimed memory read or write without changing anything but the memory itself. More...
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
- Public Member Functions inherited from SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from EventManager
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick) -1)
 
void setCurTick (Tick newVal)
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 
- Public Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 
- Public Member Functions inherited from Stats::Group
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
 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 (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...
 
- 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
 

Protected Member Functions

Tick recvAtomic (PacketPtr pkt)
 
void recvFunctional (PacketPtr pkt)
 
bool recvTimingReq (PacketPtr pkt)
 
- Protected Member Functions inherited from QoS::MemCtrl
void addMaster (const MasterID m_id)
 Initializes dynamically counters and statistics for a given Master. More...
 
void logRequest (BusState dir, MasterID m_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, MasterID m_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 (MasterID m_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, MasterID m_id, uint8_t tgt_prio)
 Escalates/demotes priority of all packets belonging to the passed master to given priority value. More...
 
template<typename Queues >
void escalateQueues (Queues &queues, uint64_t queue_entry_size, MasterID m_id, uint8_t curr_prio, uint8_t tgt_prio)
 Escalates/demotes priority of all packets belonging to the passed master to given priority value in a specified cluster of queues (e.g. More...
 
- Protected Member Functions inherited from AbstractMemory
bool checkLockedAddrList (PacketPtr pkt)
 
void trackLoadLocked (PacketPtr pkt)
 
bool writeOK (PacketPtr pkt)
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Member Functions inherited from Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters. More...
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance. More...
 
void resetClock () const
 Reset the object's clock using the current global tick value. More...
 
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...
 

Private Types

enum  PowerState {
  PWR_IDLE = 0, PWR_REF, PWR_SREF, PWR_PRE_PDN,
  PWR_ACT, PWR_ACT_PDN
}
 The power state captures the different operational states of the DRAM and interacts with the bus read/write state machine, and the refresh state machine. More...
 
enum  RefreshState {
  REF_IDLE = 0, REF_DRAIN, REF_PD_EXIT, REF_SREF_EXIT,
  REF_PRE, REF_START, REF_RUN
}
 The refresh state is used to control the progress of the refresh scheduling. More...
 
typedef std::deque< DRAMPacket * > DRAMPacketQueue
 

Private Member Functions

void processNextReqEvent ()
 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...
 
void processRespondEvent ()
 
bool readQueueFull (unsigned int pktCount) const
 Check if the read queue has room for more entries. More...
 
bool writeQueueFull (unsigned int pktCount) const
 Check if the write queue has room for more entries. More...
 
void addToReadQueue (PacketPtr pkt, unsigned int pktCount)
 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 "dram_pkt", and push them to the back of the read queue. More...
 
void addToWriteQueue (PacketPtr pkt, unsigned int pktCount)
 Decode the incoming pkt, create a dram_pkt and push to the back of the write queue. More...
 
void doDRAMAccess (DRAMPacket *dram_pkt)
 Actually do the DRAM access - figure out the latency it will take to service the req based on bank state, channel state etc and then update those states to account for this request. Based on this, update the packet's "readyTime" and move it to the response q from where it will eventually go back to the outside world. More...
 
void accessAndRespond (PacketPtr pkt, Tick static_latency)
 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...
 
DRAMPacketdecodeAddr (const PacketPtr pkt, Addr dramPktAddr, unsigned int size, bool isRead) const
 Address decoder to figure out physical mapping onto ranks, banks, and rows. More...
 
Addr getCtrlAddr (Addr addr)
 Get an address in a dense range which starts from 0. More...
 
DRAMPacketQueue::iterator chooseNext (DRAMPacketQueue &queue, Tick extra_col_delay)
 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...
 
DRAMPacketQueue::iterator chooseNextFRFCFS (DRAMPacketQueue &queue, Tick extra_col_delay)
 For FR-FCFS policy reorder the read/write queue depending on row buffer hits and earliest bursts available in DRAM. More...
 
std::pair< std::vector< uint32_t >, bool > minBankPrep (const DRAMPacketQueue &queue, Tick min_col_at) const
 Find which are the earliest banks ready to issue an activate for the enqueued requests. More...
 
void activateBank (Rank &rank_ref, Bank &bank_ref, Tick act_tick, uint32_t row)
 Keep track of when row activations happen, in order to enforce the maximum number of activations in the activation window. More...
 
void prechargeBank (Rank &rank_ref, Bank &bank_ref, Tick pre_at, bool trace=true)
 Precharge a given bank and also update when the precharge is done. More...
 
void printQs () const
 Used for debugging to observe the contents of the queues. More...
 
Addr burstAlign (Addr addr) const
 Burst-align an address. More...
 
void updatePowerStats (Rank &rank_ref)
 This function increments the energy when called. More...
 

Static Private Member Functions

static bool sortTime (const Command &cmd, const Command &cmd_next)
 Function for sorting Command structures based on timeStamp. More...
 

Private 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< DRAMPacketQueuereadQueue
 The controller's main read and write queues, with support for QoS reordering. More...
 
std::vector< DRAMPacketQueuewriteQueue
 
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< DRAMPacket * > 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::vector< Rank * > ranks
 Vector of ranks. More...
 
const uint32_t deviceSize
 The following are basic design parameters of the memory controller, and are initialized based on parameter values. More...
 
const uint32_t deviceBusWidth
 
const uint32_t burstLength
 
const uint32_t deviceRowBufferSize
 
const uint32_t devicesPerRank
 
const uint32_t burstSize
 
const uint32_t rowBufferSize
 
const uint32_t columnsPerRowBuffer
 
const uint32_t columnsPerStripe
 
const uint32_t ranksPerChannel
 
const uint32_t bankGroupsPerRank
 
const bool bankGroupArch
 
const uint32_t banksPerRank
 
uint32_t rowsPerBank
 
const uint32_t readBufferSize
 
const uint32_t writeBufferSize
 
const uint32_t writeHighThreshold
 
const uint32_t writeLowThreshold
 
const uint32_t minWritesPerSwitch
 
uint32_t writesThisTime
 
uint32_t readsThisTime
 
const Tick M5_CLASS_VAR_USED tCK
 Basic memory timing parameters initialized based on parameter values. More...
 
const Tick tRTW
 
const Tick tCS
 
const Tick tBURST
 
const Tick tCCD_L_WR
 
const Tick tCCD_L
 
const Tick tRCD
 
const Tick tCL
 
const Tick tRP
 
const Tick tRAS
 
const Tick tWR
 
const Tick tRTP
 
const Tick tRFC
 
const Tick tREFI
 
const Tick tRRD
 
const Tick tRRD_L
 
const Tick tXAW
 
const Tick tXP
 
const Tick tXS
 
const uint32_t activationLimit
 
const Tick rankToRankDly
 
const Tick wrToRdDly
 
const Tick rdToWrDly
 
Enums::MemSched memSchedPolicy
 Memory controller configuration initialized based on parameter values. More...
 
Enums::AddrMap addrMapping
 
Enums::PageManage pageMgmt
 
const uint32_t maxAccessesPerRow
 Max column accesses (read and write) per row, before forcefully closing it. More...
 
const Tick frontendLatency
 Pipeline latency of the controller frontend. More...
 
const Tick backendLatency
 Pipeline latency of the backend and PHY. 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...
 
DRAMStats stats
 
uint8_t activeRank
 
uint64_t timeStampOffset
 
Tick lastStatsResetTick
 The time when stats were last reset used to calculate average power. More...
 
bool enableDRAMPowerdown
 Enable or disable DRAM powerdown states. More...
 
std::unique_ptr< PacketpendingDelete
 Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent call. More...
 

Additional Inherited Members

- Public Types inherited from QoS::MemCtrl
enum  BusState { READ, WRITE }
 Bus Direction. More...
 
- Public Types inherited from AbstractMemory
typedef AbstractMemoryParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 
- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 
- Protected Attributes inherited from 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 masters, at every packet arrival. More...
 
std::unordered_map< MasterID, const std::string > masters
 Hash of master ID - master name. More...
 
std::unordered_map< MasterID, std::vector< uint64_t > > packetPriorities
 Hash of masters - number of packets queued per priority. More...
 
std::unordered_map< MasterID, std::unordered_map< uint64_t, std::deque< uint64_t > > > requestTimes
 Hash of masters - 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...
 
QoS::MemCtrl::MemCtrlStats stats
 
- Protected Attributes inherited from AbstractMemory
AddrRange range
 
uint8_t * pmemAddr
 
MemBackdoor backdoor
 
const bool confTableReported
 
const bool inAddrMap
 
const bool kvmMap
 
std::list< LockedAddrlockedAddrList
 
System_system
 Pointer to the System object. More...
 
AbstractMemory::MemStats stats
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
ClockedObject::ClockedObjectStats stats
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

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

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. 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, such as DDR3/4, LPDDR2/3/4, WideIO1/2, HBM and HMC.

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.

The low-power functionality implements a staggered powerdown similar to that described in "Optimized Active and Power-Down Mode Refresh Control in 3D-DRAMs" by Jung et al, VLSI-SoC, 2014.

Definition at line 98 of file dram_ctrl.hh.

Member Typedef Documentation

◆ DRAMPacketQueue

Definition at line 724 of file dram_ctrl.hh.

Member Enumeration Documentation

◆ PowerState

enum DRAMCtrl::PowerState
private

The power state captures the different operational states of the DRAM and interacts with the bus read/write state machine, and the refresh state machine.

PWR_IDLE : The idle state in which all banks are closed From here can transition to: PWR_REF, PWR_ACT, PWR_PRE_PDN

PWR_REF : Auto-refresh state. Will transition when refresh is complete based on power state prior to PWR_REF From here can transition to: PWR_IDLE, PWR_PRE_PDN, PWR_SREF

PWR_SREF : Self-refresh state. Entered after refresh if previous state was PWR_PRE_PDN From here can transition to: PWR_IDLE

PWR_PRE_PDN : Precharge power down state From here can transition to: PWR_REF, PWR_IDLE

PWR_ACT : Activate state in which one or more banks are open From here can transition to: PWR_IDLE, PWR_ACT_PDN

PWR_ACT_PDN : Activate power down state From here can transition to: PWR_ACT

Enumerator
PWR_IDLE 
PWR_REF 
PWR_SREF 
PWR_PRE_PDN 
PWR_ACT 
PWR_ACT_PDN 

Definition at line 224 of file dram_ctrl.hh.

◆ RefreshState

enum DRAMCtrl::RefreshState
private

The refresh state is used to control the progress of the refresh scheduling.

When normal operation is in progress the refresh state is idle. Once tREFI has elasped, a refresh event is triggered to start the following STM transitions which are used to issue a refresh and return back to normal operation

REF_IDLE : IDLE state used during normal operation From here can transition to: REF_DRAIN

REF_SREF_EXIT : Exiting a self-refresh; refresh event scheduled after self-refresh exit completes From here can transition to: REF_DRAIN

REF_DRAIN : Drain state in which on going accesses complete. From here can transition to: REF_PD_EXIT

REF_PD_EXIT : Evaluate pwrState and issue wakeup if needed Next state dependent on whether banks are open From here can transition to: REF_PRE, REF_START

REF_PRE : Close (precharge) all open banks From here can transition to: REF_START

REF_START : Issue refresh command and update DRAMPower stats From here can transition to: REF_RUN

REF_RUN : Refresh running, waiting for tRFC to expire From here can transition to: REF_IDLE, REF_SREF_EXIT

Enumerator
REF_IDLE 
REF_DRAIN 
REF_PD_EXIT 
REF_SREF_EXIT 
REF_PRE 
REF_START 
REF_RUN 

Definition at line 263 of file dram_ctrl.hh.

Constructor & Destructor Documentation

◆ DRAMCtrl()

DRAMCtrl::DRAMCtrl ( const DRAMCtrlParams *  p)

Member Function Documentation

◆ accessAndRespond()

void DRAMCtrl::accessAndRespond ( PacketPtr  pkt,
Tick  static_latency 
)
private

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

Definition at line 887 of file dram_ctrl.cc.

References AbstractMemory::access(), curTick(), DPRINTF, Packet::getAddr(), Packet::headerDelay, Packet::isResponse(), Packet::needsResponse(), Packet::payloadDelay, pendingDelete, port, and QueuedSlavePort::schedTimingResp().

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

◆ activateBank()

void DRAMCtrl::activateBank ( Rank rank_ref,
Bank bank_ref,
Tick  act_tick,
uint32_t  row 
)
private

Keep track of when row activations happen, in order to enforce the maximum number of activations in the activation window.

The method updates the time that the banks become available based on the current limits.

Parameters
rank_refReference to the rank
bank_refReference to the bank
act_tickTime when the activation takes place
rowIndex of the row

Definition at line 924 of file dram_ctrl.cc.

References DRAMCtrl::Rank::activateEvent, activationLimit, DRAMCtrl::Rank::actTicks, DRAMCtrl::Bank::bank, DRAMCtrl::Bank::bankgr, bankGroupArch, DRAMCtrl::Rank::banks, banksPerRank, DRAMCtrl::Bank::bytesAccessed, DRAMCtrl::Rank::cmdList, divCeil(), DPRINTF, ArmISA::i, ArmISA::j, DRAMCtrl::Bank::NO_ROW, DRAMCtrl::Rank::numBanksActive, DRAMCtrl::Bank::openRow, panic, DRAMCtrl::Bank::preAllowedAt, DRAMCtrl::Rank::rank, ranks, DRAMCtrl::Bank::rdAllowedAt, EventManager::reschedule(), DRAMCtrl::Bank::rowAccesses, QoS::MemCtrl::schedule(), Event::scheduled(), tCK, timeStampOffset, tRAS, tRCD, tRRD, tRRD_L, tXAW, Event::when(), and DRAMCtrl::Bank::wrAllowedAt.

Referenced by doDRAMAccess(), and getCtrlAddr().

◆ addToReadQueue()

void DRAMCtrl::addToReadQueue ( PacketPtr  pkt,
unsigned int  pktCount 
)
private

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 "dram_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
pktCountThe number of DRAM bursts the pkt translate to. If pkt size is larger then one full burst, then pktCount is greater than one.

Definition at line 380 of file dram_ctrl.cc.

References accessAndRespond(), addr, DRAMCtrl::DRAMPacket::addr, DRAMCtrl::DRAMStats::avgRdQLen, burstAlign(), DRAMCtrl::DRAMPacket::burstHelper, burstSize, DRAMCtrl::BurstHelper::burstsServiced, DRAMCtrl::DRAMStats::bytesReadWrQ, ceilLog2(), curTick(), decodeAddr(), DPRINTF, frontendLatency, Packet::getAddr(), getCtrlAddr(), Packet::getSize(), isInWriteQueue, Packet::isWrite(), QoS::MemCtrl::logRequest(), Packet::masterId(), DRAMCtrl::DRAMStats::masterReadAccesses, nextReqEvent, MipsISA::p, DRAMCtrl::DRAMPacket::qosValue(), Packet::qosValue(), DRAMCtrl::DRAMPacket::rankRef, DRAMCtrl::DRAMStats::rdQLenPdf, DRAMCtrl::DRAMStats::readBursts, DRAMCtrl::Rank::readEntries, DRAMCtrl::DRAMStats::readPktSize, readQueue, readQueueFull(), respQueue, QoS::MemCtrl::schedule(), Event::scheduled(), DRAMCtrl::DRAMStats::servicedByWrQ, AbstractMemory::size(), stats, QoS::MemCtrl::totalReadQueueSize, and writeQueue.

Referenced by recvTimingReq().

◆ addToWriteQueue()

void DRAMCtrl::addToWriteQueue ( PacketPtr  pkt,
unsigned int  pktCount 
)
private

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

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
pktCountThe number of DRAM bursts the pkt translate to. If pkt size is larger then one full burst, then pktCount is greater than one.

Definition at line 487 of file dram_ctrl.cc.

References accessAndRespond(), addr, DRAMCtrl::DRAMPacket::addr, DRAMCtrl::DRAMStats::avgWrQLen, burstAlign(), burstSize, ceilLog2(), curTick(), decodeAddr(), DPRINTF, frontendLatency, Packet::getAddr(), getCtrlAddr(), Packet::getSize(), isInWriteQueue, Packet::isWrite(), QoS::MemCtrl::logRequest(), Packet::masterId(), DRAMCtrl::DRAMStats::masterWriteAccesses, DRAMCtrl::DRAMStats::mergedWrBursts, nextReqEvent, DRAMCtrl::DRAMPacket::qosValue(), Packet::qosValue(), DRAMCtrl::DRAMPacket::rankRef, QoS::MemCtrl::schedule(), Event::scheduled(), AbstractMemory::size(), stats, QoS::MemCtrl::totalWriteQueueSize, writeBufferSize, DRAMCtrl::DRAMStats::writeBursts, DRAMCtrl::Rank::writeEntries, DRAMCtrl::DRAMStats::writePktSize, writeQueue, and DRAMCtrl::DRAMStats::wrQLenPdf.

Referenced by recvTimingReq().

◆ allRanksDrained()

bool DRAMCtrl::allRanksDrained ( ) const

Return true once refresh is complete for all ranks and there are no additional commands enqueued.

(only evaluated when draining) This will ensure that all banks are closed, power state is IDLE, and power stats have been updated

Returns
true if all ranks have refreshed, with no commands enqueued

Definition at line 2753 of file dram_ctrl.cc.

References MipsISA::r, and ranks.

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

◆ burstAlign()

Addr DRAMCtrl::burstAlign ( Addr  addr) const
inlineprivate

Burst-align an address.

Parameters
addrThe potentially unaligned address
Returns
An address aligned to a DRAM burst

Definition at line 912 of file dram_ctrl.hh.

References burstSize.

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

◆ chooseNext()

DRAMCtrl::DRAMPacketQueue::iterator DRAMCtrl::chooseNext ( DRAMPacketQueue queue,
Tick  extra_col_delay 
)
private

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
Returns
an iterator to the selected packet, else queue.end()

Definition at line 742 of file dram_ctrl.cc.

References chooseNextFRFCFS(), DPRINTF, ArmISA::i, memSchedPolicy, panic, DRAMCtrl::DRAMPacket::rank, and ranks.

Referenced by getCtrlAddr(), and processNextReqEvent().

◆ chooseNextFRFCFS()

DRAMCtrl::DRAMPacketQueue::iterator DRAMCtrl::chooseNextFRFCFS ( DRAMPacketQueue queue,
Tick  extra_col_delay 
)
private

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

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()

Definition at line 777 of file dram_ctrl.cc.

References DRAMCtrl::Bank::bank, DRAMCtrl::DRAMPacket::bank, DRAMCtrl::DRAMPacket::bankRef, bits(), curTick(), DPRINTF, ArmISA::i, DRAMCtrl::Rank::inRefIdleState(), DRAMCtrl::DRAMPacket::isRead(), minBankPrep(), nextBurstAt, DRAMCtrl::Bank::openRow, DRAMCtrl::Rank::rank, DRAMCtrl::DRAMPacket::rank, DRAMCtrl::DRAMPacket::rankRef, ranksPerChannel, DRAMCtrl::Bank::rdAllowedAt, DRAMCtrl::DRAMPacket::row, and DRAMCtrl::Bank::wrAllowedAt.

Referenced by chooseNext(), and getCtrlAddr().

◆ decodeAddr()

DRAMCtrl::DRAMPacket * DRAMCtrl::decodeAddr ( const PacketPtr  pkt,
Addr  dramPktAddr,
unsigned int  size,
bool  isRead 
) const
private

Address decoder to figure out physical mapping onto ranks, banks, and rows.

This function is called multiple times on the same system packet if the pakcet is larger than burst of the memory. The dramPktAddr is used for the offset within the packet.

Parameters
pktThe packet from the outside world
dramPktAddrThe starting address of the DRAM packet
sizeThe size of the DRAM packet in bytes
isReadIs the request for a read or a write to DRAM
Returns
A DRAMPacket pointer with the decoded information

Definition at line 304 of file dram_ctrl.cc.

References addr, addrMapping, banksPerRank, burstSize, columnsPerRowBuffer, columnsPerStripe, DPRINTF, DRAMCtrl::Bank::NO_ROW, panic, ranks, ranksPerChannel, and rowsPerBank.

Referenced by addToReadQueue(), and addToWriteQueue().

◆ doDRAMAccess()

void DRAMCtrl::doDRAMAccess ( DRAMPacket dram_pkt)
private

Actually do the DRAM access - figure out the latency it will take to service the req based on bank state, channel state etc and then update those states to account for this request. Based on this, update the packet's "readyTime" and move it to the response q from where it will eventually go back to the outside world.

Parameters
pktThe DRAM packet created from the outside world pkt

Definition at line 1073 of file dram_ctrl.cc.

References DRAMCtrl::Bank::actAllowedAt, activateBank(), activeRank, DRAMCtrl::DRAMPacket::addr, DRAMCtrl::DRAMPacket::bank, DRAMCtrl::Bank::bankgr, bankGroupArch, DRAMCtrl::DRAMPacket::bankId, DRAMCtrl::DRAMPacket::bankRef, banksPerRank, burstSize, DRAMCtrl::Bank::bytesAccessed, DRAMCtrl::DRAMStats::bytesReadDRAM, DRAMCtrl::DRAMStats::bytesWritten, DRAMCtrl::Rank::cmdList, curTick(), divCeil(), DPRINTF, DRAMCtrl::DRAMPacket::entryTime, ArmISA::i, DRAMCtrl::Rank::inLowPowerState, DRAMCtrl::DRAMPacket::isRead(), ArmISA::j, DRAMCtrl::DRAMPacket::masterId(), DRAMCtrl::DRAMStats::masterReadBytes, DRAMCtrl::DRAMStats::masterReadTotalLat, DRAMCtrl::DRAMStats::masterWriteBytes, DRAMCtrl::DRAMStats::masterWriteTotalLat, maxAccessesPerRow, nextBurstAt, nextReqTime, DRAMCtrl::Bank::NO_ROW, QoS::MemCtrl::numPriorities(), DRAMCtrl::Bank::openRow, MipsISA::p, pageMgmt, DRAMCtrl::DRAMStats::perBankRdBursts, DRAMCtrl::DRAMStats::perBankWrBursts, DRAMCtrl::Bank::preAllowedAt, prechargeBank(), PWR_SREF, DRAMCtrl::Rank::pwrState, DRAMCtrl::DRAMPacket::rank, DRAMCtrl::DRAMPacket::rankRef, ranks, ranksPerChannel, rankToRankDly, RD, DRAMCtrl::Bank::rdAllowedAt, rdToWrDly, readQueue, DRAMCtrl::DRAMStats::readRowHits, readsThisTime, DRAMCtrl::DRAMPacket::readyTime, DRAMCtrl::DRAMPacket::row, DRAMCtrl::Bank::rowAccesses, DRAMCtrl::Rank::scheduleWakeUpEvent(), DRAMCtrl::DRAMPacket::size, stats, tBURST, tCCD_L, tCCD_L_WR, tCK, tCL, timeStampOffset, DRAMCtrl::DRAMStats::totBusLat, DRAMCtrl::DRAMStats::totMemAccLat, DRAMCtrl::DRAMStats::totQLat, tRCD, tRP, tRTP, tWR, tXP, DRAMCtrl::Bank::wrAllowedAt, writeQueue, DRAMCtrl::DRAMStats::writeRowHits, writesThisTime, and wrToRdDly.

Referenced by processNextReqEvent().

◆ drain()

DrainState DRAMCtrl::drain ( )
overridevirtual

Notify 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 Drainable.

Definition at line 2719 of file dram_ctrl.cc.

References allRanksDrained(), curTick(), DPRINTF, Drained, Draining, nextReqEvent, PWR_SREF, MipsISA::r, ranks, respQueue, QoS::MemCtrl::schedule(), Event::scheduled(), QoS::MemCtrl::totalReadQueueSize, QoS::MemCtrl::totalWriteQueueSize, and tXS.

Referenced by sortTime().

◆ drainResume()

void DRAMCtrl::drainResume ( )
overridevirtual

Resume execution after a successful drain.

Reimplemented from Drainable.

Definition at line 2768 of file dram_ctrl.cc.

References isTimingMode, System::isTimingMode(), MipsISA::r, ranks, startup(), and AbstractMemory::system().

Referenced by sortTime().

◆ getCtrlAddr()

Addr DRAMCtrl::getCtrlAddr ( Addr  addr)
inlineprivate

Get an address in a dense range which starts from 0.

The input address is the physical address of the request in an address space that contains other SimObjects apart from this controller.

Parameters
addrThe intput address which should be in the addrRange
Returns
An address in the continues range [0, max)

Definition at line 830 of file dram_ctrl.hh.

References activateBank(), chooseNext(), chooseNextFRFCFS(), AddrRange::getOffset(), minBankPrep(), prechargeBank(), printQs(), DRAMCtrl::MemoryPort::queue, and AbstractMemory::range.

Referenced by addToReadQueue(), and addToWriteQueue().

◆ getPort()

Port & DRAMCtrl::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.

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

Reimplemented from SimObject.

Definition at line 2709 of file dram_ctrl.cc.

References SimObject::getPort(), and port.

Referenced by sortTime().

◆ init()

void DRAMCtrl::init ( )
overridevirtual

◆ minBankPrep()

pair< vector< uint32_t >, bool > DRAMCtrl::minBankPrep ( const DRAMPacketQueue queue,
Tick  min_col_at 
) const
private

Find which are the earliest banks ready to issue an activate for the enqueued requests.

Assumes maximum of 32 banks per rank Also checks if the bank is already prepped.

Parameters
queueQueued requests to consider
min_col_attime of seamless burst command
Returns
One-hot encoded mask of bank indices
boolean indicating burst can issue seamlessly, with no gaps

Definition at line 1608 of file dram_ctrl.cc.

References banksPerRank, QoS::MemCtrl::busState, curTick(), MipsISA::fill, ArmISA::i, ArmISA::j, MaxTick, DRAMCtrl::Bank::NO_ROW, MipsISA::p, ranks, ranksPerChannel, QoS::MemCtrl::READ, replaceBits(), tRCD, and tRP.

Referenced by chooseNextFRFCFS(), and getCtrlAddr().

◆ prechargeBank()

void DRAMCtrl::prechargeBank ( Rank rank_ref,
Bank bank_ref,
Tick  pre_at,
bool  trace = true 
)
private

Precharge a given bank and also update when the precharge is done.

This will also deal with any stats related to the accesses to the open page.

Parameters
rank_refThe rank to precharge
bank_refThe bank to precharge
pre_atTime when the precharge takes place
traceIs this an auto precharge then do not add to trace

Definition at line 1025 of file dram_ctrl.cc.

References DRAMCtrl::Bank::actAllowedAt, DRAMCtrl::Bank::bank, DRAMCtrl::Bank::bytesAccessed, DRAMCtrl::DRAMStats::bytesPerActivate, DRAMCtrl::Rank::cmdList, divCeil(), DPRINTF, DRAMCtrl::Bank::NO_ROW, DRAMCtrl::Rank::numBanksActive, DRAMCtrl::Bank::openRow, DRAMCtrl::Rank::outstandingEvents, DRAMCtrl::Bank::preAllowedAt, DRAMCtrl::Rank::prechargeEvent, DRAMCtrl::Rank::rank, EventManager::reschedule(), Stats::DistBase< Derived, Stor >::sample(), QoS::MemCtrl::schedule(), Event::scheduled(), stats, tCK, timeStampOffset, tRP, and Event::when().

Referenced by doDRAMAccess(), and getCtrlAddr().

◆ printQs()

void DRAMCtrl::printQs ( ) const
private

Used for debugging to observe the contents of the queues.

Definition at line 561 of file dram_ctrl.cc.

References DPRINTF, readQueue, respQueue, and writeQueue.

Referenced by getCtrlAddr().

◆ processNextReqEvent()

void DRAMCtrl::processNextReqEvent ( )
private

◆ processRespondEvent()

void DRAMCtrl::processRespondEvent ( )
private

◆ readQueueFull()

bool DRAMCtrl::readQueueFull ( unsigned int  pktCount) const
private

Check if the read queue has room for more entries.

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

Definition at line 283 of file dram_ctrl.cc.

References DPRINTF, readBufferSize, respQueue, and QoS::MemCtrl::totalReadQueueSize.

Referenced by addToReadQueue(), and recvTimingReq().

◆ recvAtomic()

Tick DRAMCtrl::recvAtomic ( PacketPtr  pkt)
protected

◆ recvFunctional()

void DRAMCtrl::recvFunctional ( PacketPtr  pkt)
protected

Definition at line 2702 of file dram_ctrl.cc.

References AbstractMemory::functionalAccess().

◆ recvTimingReq()

bool DRAMCtrl::recvTimingReq ( PacketPtr  pkt)
protected

◆ sortTime()

static bool DRAMCtrl::sortTime ( const Command cmd,
const Command cmd_next 
)
inlinestaticprivate

Function for sorting Command structures based on timeStamp.

Parameters
aMemory Command
nextMemory Command
Returns
true if timeStamp of Command 1 < timeStamp of Command 2

Definition at line 1175 of file dram_ctrl.hh.

References allRanksDrained(), drain(), drainResume(), DRAMCtrl(), getPort(), init(), InvalidPortID, MipsISA::p, DRAMCtrl::MemoryPort::recvAtomic(), DRAMCtrl::MemoryPort::recvFunctional(), DRAMCtrl::MemoryPort::recvTimingReq(), startup(), and DRAMCtrl::Command::timeStamp.

Referenced by DRAMCtrl::Rank::flushCmdList().

◆ startup()

void DRAMCtrl::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 SimObject.

Definition at line 239 of file dram_ctrl.cc.

References curTick(), divCeil(), isTimingMode, System::isTimingMode(), nextBurstAt, MipsISA::r, ranks, AbstractMemory::system(), tCK, timeStampOffset, tRCD, tREFI, and tRP.

Referenced by drainResume(), DRAMCtrl::Rank::name(), and sortTime().

◆ updatePowerStats()

void DRAMCtrl::updatePowerStats ( Rank rank_ref)
private

This function increments the energy when called.

If stats are dumped periodically, note accumulated energy values will appear in the stats (even if the stats are reset). This is a result of the energy values coming from DRAMPower, and there is currently no support for resetting the state.

Parameters
rankCurrent rank

◆ writeQueueFull()

bool DRAMCtrl::writeQueueFull ( unsigned int  pktCount) const
private

Check if the write queue has room for more entries.

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

Definition at line 294 of file dram_ctrl.cc.

References DPRINTF, QoS::MemCtrl::totalWriteQueueSize, and writeBufferSize.

Referenced by recvTimingReq().

Member Data Documentation

◆ activationLimit

const uint32_t DRAMCtrl::activationLimit
private

Definition at line 995 of file dram_ctrl.hh.

Referenced by activateBank(), and DRAMCtrl().

◆ activeRank

uint8_t DRAMCtrl::activeRank
private

Definition at line 1140 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ addrMapping

Enums::AddrMap DRAMCtrl::addrMapping
private

Definition at line 1005 of file dram_ctrl.hh.

Referenced by decodeAddr(), DRAMCtrl(), and init().

◆ backendLatency

const Tick DRAMCtrl::backendLatency
private

Pipeline latency of the backend and PHY.

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

Definition at line 1026 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and processRespondEvent().

◆ bankGroupArch

const bool DRAMCtrl::bankGroupArch
private

Definition at line 961 of file dram_ctrl.hh.

Referenced by activateBank(), doDRAMAccess(), and DRAMCtrl().

◆ bankGroupsPerRank

const uint32_t DRAMCtrl::bankGroupsPerRank
private

Definition at line 960 of file dram_ctrl.hh.

Referenced by DRAMCtrl().

◆ banksPerRank

const uint32_t DRAMCtrl::banksPerRank
private

◆ burstLength

const uint32_t DRAMCtrl::burstLength
private

Definition at line 952 of file dram_ctrl.hh.

Referenced by DRAMCtrl().

◆ burstSize

const uint32_t DRAMCtrl::burstSize
private

◆ columnsPerRowBuffer

const uint32_t DRAMCtrl::columnsPerRowBuffer
private

Definition at line 957 of file dram_ctrl.hh.

Referenced by decodeAddr(), DRAMCtrl(), and init().

◆ columnsPerStripe

const uint32_t DRAMCtrl::columnsPerStripe
private

Definition at line 958 of file dram_ctrl.hh.

Referenced by decodeAddr(), DRAMCtrl(), and init().

◆ deviceBusWidth

const uint32_t DRAMCtrl::deviceBusWidth
private

Definition at line 951 of file dram_ctrl.hh.

Referenced by DRAMCtrl().

◆ deviceRowBufferSize

const uint32_t DRAMCtrl::deviceRowBufferSize
private

Definition at line 953 of file dram_ctrl.hh.

Referenced by DRAMCtrl().

◆ deviceSize

const uint32_t DRAMCtrl::deviceSize
private

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 950 of file dram_ctrl.hh.

Referenced by DRAMCtrl().

◆ devicesPerRank

const uint32_t DRAMCtrl::devicesPerRank
private

Definition at line 954 of file dram_ctrl.hh.

Referenced by DRAMCtrl().

◆ enableDRAMPowerdown

bool DRAMCtrl::enableDRAMPowerdown
private

Enable or disable DRAM powerdown states.

Definition at line 1149 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and processRespondEvent().

◆ frontendLatency

const Tick DRAMCtrl::frontendLatency
private

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 1019 of file dram_ctrl.hh.

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

◆ isInWriteQueue

std::unordered_set<Addr> DRAMCtrl::isInWriteQueue
private

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 927 of file dram_ctrl.hh.

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

◆ isTimingMode

bool DRAMCtrl::isTimingMode
private

Remember if the memory system is in timing mode.

Definition at line 136 of file dram_ctrl.hh.

Referenced by drainResume(), and startup().

◆ lastStatsResetTick

Tick DRAMCtrl::lastStatsResetTick
private

The time when stats were last reset used to calculate average power.

Definition at line 1146 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and DRAMCtrl::DRAMStats::resetStats().

◆ maxAccessesPerRow

const uint32_t DRAMCtrl::maxAccessesPerRow
private

Max column accesses (read and write) per row, before forcefully closing it.

Definition at line 1012 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), DRAMCtrl(), and DRAMCtrl::DRAMStats::regStats().

◆ memSchedPolicy

Enums::MemSched DRAMCtrl::memSchedPolicy
private

Memory controller configuration initialized based on parameter values.

Definition at line 1004 of file dram_ctrl.hh.

Referenced by chooseNext(), and DRAMCtrl().

◆ minWritesPerSwitch

const uint32_t DRAMCtrl::minWritesPerSwitch
private

Definition at line 968 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and processNextReqEvent().

◆ nextBurstAt

Tick DRAMCtrl::nextBurstAt
private

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

Definition at line 1031 of file dram_ctrl.hh.

Referenced by chooseNextFRFCFS(), doDRAMAccess(), DRAMCtrl(), and startup().

◆ nextReqEvent

EventFunctionWrapper DRAMCtrl::nextReqEvent
private

Definition at line 733 of file dram_ctrl.hh.

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

◆ nextReqTime

Tick DRAMCtrl::nextReqTime
private

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 1041 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), DRAMCtrl(), and processNextReqEvent().

◆ pageMgmt

Enums::PageManage DRAMCtrl::pageMgmt
private

Definition at line 1006 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ pendingDelete

std::unique_ptr<Packet> DRAMCtrl::pendingDelete
private

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

Definition at line 1155 of file dram_ctrl.hh.

Referenced by accessAndRespond().

◆ port

MemoryPort DRAMCtrl::port
private

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

Definition at line 131 of file dram_ctrl.hh.

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

◆ prevArrival

Tick DRAMCtrl::prevArrival
private

Definition at line 1033 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and recvTimingReq().

◆ ranks

std::vector<Rank*> DRAMCtrl::ranks
private

◆ ranksPerChannel

const uint32_t DRAMCtrl::ranksPerChannel
private

◆ rankToRankDly

const Tick DRAMCtrl::rankToRankDly
private

Definition at line 996 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ rdToWrDly

const Tick DRAMCtrl::rdToWrDly
private

Definition at line 998 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ readBufferSize

const uint32_t DRAMCtrl::readBufferSize
private

Definition at line 964 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), readQueueFull(), and DRAMCtrl::DRAMStats::regStats().

◆ readQueue

std::vector<DRAMPacketQueue> DRAMCtrl::readQueue
private

The controller's main read and write queues, with support for QoS reordering.

Definition at line 917 of file dram_ctrl.hh.

Referenced by addToReadQueue(), doDRAMAccess(), DRAMCtrl(), printQs(), processNextReqEvent(), and recvTimingReq().

◆ readsThisTime

uint32_t DRAMCtrl::readsThisTime
private

Definition at line 970 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), DRAMCtrl(), and processNextReqEvent().

◆ respondEvent

EventFunctionWrapper DRAMCtrl::respondEvent
private

Definition at line 736 of file dram_ctrl.hh.

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

◆ respQueue

std::deque<DRAMPacket*> DRAMCtrl::respQueue
private

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 937 of file dram_ctrl.hh.

Referenced by addToReadQueue(), drain(), printQs(), processNextReqEvent(), processRespondEvent(), and readQueueFull().

◆ retryRdReq

bool DRAMCtrl::retryRdReq
private

Remember if we have to retry a request when available.

Definition at line 141 of file dram_ctrl.hh.

Referenced by processRespondEvent(), and recvTimingReq().

◆ retryWrReq

bool DRAMCtrl::retryWrReq
private

Definition at line 142 of file dram_ctrl.hh.

Referenced by processNextReqEvent(), and recvTimingReq().

◆ rowBufferSize

const uint32_t DRAMCtrl::rowBufferSize
private

Definition at line 956 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), init(), and DRAMCtrl::DRAMStats::regStats().

◆ rowsPerBank

uint32_t DRAMCtrl::rowsPerBank
private

Definition at line 963 of file dram_ctrl.hh.

Referenced by decodeAddr(), and DRAMCtrl().

◆ stats

DRAMStats DRAMCtrl::stats
private

◆ tBURST

const Tick DRAMCtrl::tBURST
private

Definition at line 979 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), DRAMCtrl(), and DRAMCtrl::DRAMStats::regStats().

◆ tCCD_L

const Tick DRAMCtrl::tCCD_L
private

Definition at line 981 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ tCCD_L_WR

const Tick DRAMCtrl::tCCD_L_WR
private

Definition at line 980 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ tCK

const Tick M5_CLASS_VAR_USED DRAMCtrl::tCK
private

Basic memory timing parameters initialized based on parameter values.

Definition at line 976 of file dram_ctrl.hh.

Referenced by activateBank(), doDRAMAccess(), DRAMCtrl(), prechargeBank(), and startup().

◆ tCL

const Tick DRAMCtrl::tCL
private

Definition at line 983 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), DRAMCtrl(), and recvAtomic().

◆ tCS

const Tick DRAMCtrl::tCS
private

Definition at line 978 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and processNextReqEvent().

◆ timeStampOffset

uint64_t DRAMCtrl::timeStampOffset
private

Definition at line 1143 of file dram_ctrl.hh.

Referenced by activateBank(), doDRAMAccess(), DRAMCtrl(), prechargeBank(), and startup().

◆ tRAS

const Tick DRAMCtrl::tRAS
private

Definition at line 985 of file dram_ctrl.hh.

Referenced by activateBank(), and DRAMCtrl().

◆ tRCD

const Tick DRAMCtrl::tRCD
private

Definition at line 982 of file dram_ctrl.hh.

Referenced by activateBank(), doDRAMAccess(), DRAMCtrl(), minBankPrep(), recvAtomic(), and startup().

◆ tREFI

const Tick DRAMCtrl::tREFI
private

Definition at line 989 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and startup().

◆ tRFC

const Tick DRAMCtrl::tRFC
private

Definition at line 988 of file dram_ctrl.hh.

Referenced by DRAMCtrl().

◆ tRP

const Tick DRAMCtrl::tRP
private

Definition at line 984 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), DRAMCtrl(), minBankPrep(), prechargeBank(), recvAtomic(), and startup().

◆ tRRD

const Tick DRAMCtrl::tRRD
private

Definition at line 990 of file dram_ctrl.hh.

Referenced by activateBank(), and DRAMCtrl().

◆ tRRD_L

const Tick DRAMCtrl::tRRD_L
private

Definition at line 991 of file dram_ctrl.hh.

Referenced by activateBank(), and DRAMCtrl().

◆ tRTP

const Tick DRAMCtrl::tRTP
private

Definition at line 987 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ tRTW

const Tick DRAMCtrl::tRTW
private

Definition at line 977 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and processNextReqEvent().

◆ tWR

const Tick DRAMCtrl::tWR
private

Definition at line 986 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ tXAW

const Tick DRAMCtrl::tXAW
private

Definition at line 992 of file dram_ctrl.hh.

Referenced by activateBank(), and DRAMCtrl().

◆ tXP

const Tick DRAMCtrl::tXP
private

Definition at line 993 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().

◆ tXS

const Tick DRAMCtrl::tXS
private

Definition at line 994 of file dram_ctrl.hh.

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

◆ writeBufferSize

const uint32_t DRAMCtrl::writeBufferSize
private

◆ writeHighThreshold

const uint32_t DRAMCtrl::writeHighThreshold
private

Definition at line 966 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and processNextReqEvent().

◆ writeLowThreshold

const uint32_t DRAMCtrl::writeLowThreshold
private

Definition at line 967 of file dram_ctrl.hh.

Referenced by DRAMCtrl(), and processNextReqEvent().

◆ writeQueue

std::vector<DRAMPacketQueue> DRAMCtrl::writeQueue
private

◆ writesThisTime

uint32_t DRAMCtrl::writesThisTime
private

Definition at line 969 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), DRAMCtrl(), and processNextReqEvent().

◆ wrToRdDly

const Tick DRAMCtrl::wrToRdDly
private

Definition at line 997 of file dram_ctrl.hh.

Referenced by doDRAMAccess(), and DRAMCtrl().


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

Generated on Fri Feb 28 2020 16:27:10 for gem5 by doxygen 1.8.13