Go to the documentation of this file.
46 #ifndef __MEM_CTRL_HH__
47 #define __MEM_CTRL_HH__
51 #include <unordered_set>
57 #include "enums/MemSched.hh"
60 #include "params/MemCtrl.hh"
197 uint8_t _bank, uint32_t _row, uint16_t bank_id,
Addr _addr,
392 Tick extra_col_delay);
403 Tick extra_col_delay);
653 Tick max_multi_cmd_split = 0);
697 virtual void init()
override;
698 virtual void startup()
override;
709 #endif //__MEM_CTRL_HH__
const unsigned int burstCount
Number of bursts requred for a system packet.
const uint8_t rank
Will be populated by address decoder.
Stats::Formula requestorReadAvgLat
unsigned int burstsServiced
Number of bursts serviced so far for a system packet.
RequestorID requestorId() const
Get the packet RequestorID (interface compatibility with Packet)
void processNextReqEvent()
Bunch of things requires to setup "events" in gem5 When event "respondEvent" occurs for example,...
bool scheduled() const
Determine if the current event is scheduled.
EventFunctionWrapper nextReqEvent
BurstHelper * burstHelper
A pointer to the BurstHelper if this MemPacket is a split packet If not a split packet (common case),...
The QoS::MemCtrl is a base class for Memory objects which support QoS - it provides access to a set o...
Stats::Vector writePktSize
virtual void startup() override
startup() is the final initialization call before simulation.
bool writeQueueFull(unsigned int pkt_count) const
Check if the write queue has room for more entries.
Stats::Formula avgRdBWSys
const uint32_t writeLowThreshold
bool isDram() const
Return true if its a DRAM access.
MemPacket(PacketPtr _pkt, bool is_read, bool is_dram, uint8_t _rank, uint8_t _bank, uint32_t _row, uint16_t bank_id, Addr _addr, unsigned int _size)
Stats::Vector requestorWriteBytes
uint8_t schedule(RequestorID id, uint64_t data)
Tick readyTime
When will request leave the controller.
const PortID InvalidPortID
Stats::Scalar bytesReadSys
void restartScheduler(Tick tick)
restart the controller This can be used by interfaces to restart the scheduler after maintainence com...
Stats::Vector requestorReadAccesses
void doBurstAccess(MemPacket *mem_pkt)
Actually do the burst based on media specific access function.
Stats::Scalar writeBursts
std::vector< MemPacketQueue > writeQueue
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Interface to DRAM devices with media specific parameters, statistics, and functions.
uint64_t Tick
Tick count type.
Stats::Formula avgWrBWSys
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
std::unordered_set< Addr > isInWriteQueue
To avoid iterating over the write queue to check for overlapping transactions, maintain a set of burs...
unsigned int getSize() const
Get the packet size (interface compatibility with Packet)
virtual void drainResume() override
Resume execution after a successful drain.
Addr burstAlign(Addr addr, bool is_dram) const
Burst-align an address.
Stats::Scalar servicedByWrQ
Stats::Vector readPktSize
A vector of scalar stats.
bool isWrite() const
Return true if its a write packet (interface compatibility with Packet)
void regStats() override
Callback to set stat parameters.
const uint32_t readBufferSize
The following are basic design parameters of the memory controller, and are initialized based on para...
std::vector< MemPacketQueue > & selQueue(bool is_read)
Select either the read or write queue.
const Tick entryTime
When did request enter the controller.
bool allIntfDrained() const
Ensure that all interfaced have drained commands.
Addr getAddr() const
Get the packet address (interface compatibility with Packet)
Stats::Vector requestorWriteAccesses
DrainState
Object drain/handover states.
This is a simple scalar statistic, like a counter.
std::deque< MemPacket * > MemPacketQueue
void recvFunctional(PacketPtr pkt)
Receive a functional request packet from the peer.
Stats::Scalar bytesWrittenSys
Stats::Scalar mergedWrBursts
Interface to NVM devices with media specific parameters, statistics, and functions.
Tick minReadToWriteDataGap()
Calculate the minimum delay used when scheduling a read-to-write transision.
Stats::Vector requestorReadTotalLat
Tick minWriteToReadDataGap()
Calculate the minimum delay used when scheduling a write-to-read transision.
Stats::Formula requestorReadRate
const Tick frontendLatency
Pipeline latency of the controller frontend.
bool inWriteBusState(bool next_state) const
Check the current direction of the memory channel.
EventFunctionWrapper respondEvent
Enums::MemSched memSchedPolicy
Memory controller configuration initialized based on parameter values.
Tick nextBurstAt
Till when must we wait before issuing next RD/WR burst?
Ports are used to interface objects to each other.
void pruneBurstTick()
Remove commands that have already issued from burstTicks.
unsigned int size
The size of this dram packet in bytes It is always equal or smaller than the burst size.
Stats::Histogram rdPerTurnAround
virtual AddrRangeList getAddrRanges() const
Get a list of the non-overlapping address ranges the owner is responsible for.
void printQs() const
Used for debugging to observe the contents of the queues.
DRAMInterface *const dram
Create pointer to interface of the actual dram media when connected.
void processRespondEvent()
A memory packet stores packets along with the timestamp of when the packet entered the queue,...
A queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
bool recvTimingReq(PacketPtr)
Receive a timing request from the peer.
const uint32_t writeHighThreshold
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const std::string name() const
Return port name (for DPRINTF).
NVMInterface *const nvm
Create pointer to interface of the actual nvm media when connected.
bool respondEventScheduled() const
Is there a respondEvent scheduled?
bool packetReady(MemPacket *pkt)
Determine if there is a packet that can issue.
virtual void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
bool retryRdReq
Remember if we have to retry a request when available.
bool requestEventScheduled() const
Is there a read/write burst Event scheduled?
const Tick commandWindow
Length of a command window, used to check command bandwidth.
bool isTimingMode
Remember if the memory system is in timing mode.
std::deque< MemPacket * > respQueue
Response queue where read packets wait after we're done working with them, but it's not time to send ...
A stat that calculates the per tick average of a value.
uint8_t _qosValue
QoS value of the encapsulated packet read at queuing time.
Tick verifySingleCmd(Tick cmd_tick, Tick max_cmds_per_burst)
Check for command bus contention for single cycle command.
Stats::Formula requestorWriteRate
const uint32_t writeBufferSize
std::unique_ptr< Packet > pendingDelete
Upstream caches need this packet until true is returned, so hold it for deletion until a subsequent c...
Stats::Scalar bytesReadWrQ
void addToWriteQueue(PacketPtr pkt, unsigned int pkt_count, bool is_dram)
Decode the incoming pkt, create a mem_pkt and push to the back of the write queue.
void accessAndRespond(PacketPtr pkt, Tick static_latency)
When a packet reaches its "readyTime" in the response Q, use the "access()" method in AbstractMemory ...
const PacketPtr pkt
This comes from the outside world.
The memory controller is a single-channel memory controller capturing the most important timing const...
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.
const uint32_t minWritesPerSwitch
const RequestorID _requestorId
RequestorID associated with the packet.
void qosValue(const uint8_t qv)
Set the packet QoS value (interface compatibility with Packet)
bool recvTimingReq(PacketPtr pkt)
Stats::Formula requestorWriteAvgLat
MemoryPort port
Our incoming port, for a multi-ported controller add a crossbar in front of it.
MemCtrl(const MemCtrlParams *p)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool inReadBusState(bool next_state) const
Check the current direction of the memory channel.
void addToReadQueue(PacketPtr pkt, unsigned int pkt_count, bool is_dram)
When a new read comes in, first check if the write q has a pending request to the same address....
std::vector< MemPacketQueue > readQueue
The controller's main read and write queues, with support for QoS reordering.
Addr addr
The starting address of the packet.
const uint16_t bankId
Bank id is calculated considering banks in all the ranks eg: 2 ranks each with 8 banks,...
Stats::Vector requestorReadBytes
Stats::Histogram wrPerTurnAround
std::unordered_multiset< Tick > burstTicks
Holds count of commands issued in burst window starting at defined Tick.
Tick getBurstWindow(Tick cmd_tick)
Calculate burst window aligned tick.
void recvFunctional(PacketPtr pkt)
MemPacketQueue::iterator chooseNextFRFCFS(MemPacketQueue &queue, Tick extra_col_delay)
For FR-FCFS policy reorder the read/write queue depending on row buffer hits and earliest bursts avai...
MemoryPort(const std::string &name, MemCtrl &_ctrl)
const Tick backendLatency
Pipeline latency of the backend and PHY.
Stats::Vector requestorWriteTotalLat
MemPacketQueue::iterator chooseNext(MemPacketQueue &queue, Tick extra_col_delay)
The memory schduler/arbiter - picks which request needs to go next, based on the specified policy suc...
const bool dram
Does this packet access DRAM?
Tick recvAtomic(PacketPtr pkt)
Stats::Scalar neitherReadNorWriteReqs
Tick recvAtomic(PacketPtr pkt)
Receive an atomic request packet from the peer.
uint8_t qosValue() const
Get the packet QoS value (interface compatibility with Packet)
bool isRead() const
Return true if its a read packet (interface compatibility with Packet)
BurstHelper(unsigned int _burstCount)
bool readQueueFull(unsigned int pkt_count) const
Check if the read queue has room for more entries.
Tick nextReqTime
The soonest you have to start thinking about the next request is the longest access time that can occ...
A burst helper helps organize and manage a packet that is larger than the memory burst size.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17