Go to the documentation of this file.
46 #ifndef __MEM_INTERFACE_HH__
47 #define __MEM_INTERFACE_HH__
51 #include <unordered_set>
57 #include "enums/AddrMap.hh"
58 #include "enums/PageManage.hh"
61 #include "params/MemInterface.hh"
227 uint8_t pseudo_channel = 0);
246 virtual void setupRank(
const uint8_t rank,
const bool is_read) = 0;
325 unsigned int size,
bool is_read,
326 uint8_t pseudo_channel = 0)
328 panic(
"MemInterface decodePacket should not be executed from here.\n");
344 virtual bool isBusy(
bool read_queue_empty,
bool all_writes_nvm) = 0;
358 panic(
"MemInterface respondEvent should not be executed from here.\n");
366 panic(
"MemInterface checkRefreshState (DRAM) should "
367 "not be executed from here.\n");
375 panic(
"MemInterface drainRanks (DRAM) should "
376 "not be executed from here.\n");
384 panic(
"MemInterface suspend (DRAM) should "
385 "not be executed from here.\n");
393 panic(
"MemInterface readsWaitingToIssue (NVM) "
394 "should not be executed from here.\n");
402 panic(
"MemInterface chooseRead (NVM) should "
403 "not be executed from here.\n");
411 panic(
"MemInterface writeRespQueueFull (NVM) "
412 "should not be executed from here.\n");
423 #endif //__MEM_INTERFACE_HH__
virtual void respondEvent(uint8_t rank)
This function is DRAM specific.
uint32_t readQueueSize
Read/write packets in the read/write queue for this interface qos/mem_ctrl.hh has similar counters,...
MemCtrl::BusState busState
Tick readToWriteDelay() const
virtual bool readsWaitingToIssue() const
This function is NVM specific.
uint32_t numWritesQueued
NVM specific variable, but declaring it here allows treating different interfaces in a more genral wa...
virtual void suspend()
This function is DRAM specific.
virtual bool allRanksDrained() const =0
Check drain state of interface.
const uint32_t deviceSize
A basic class to track the bank state, i.e.
The memory controller is a single-channel memory controller capturing the most important timing const...
const uint32_t burstsPerStripe
virtual void addRankToRankDelay(Tick cmd_at)=0
Add rank to rank delay to bus timing to all banks in all ranks when access to an alternate interface ...
#define GEM5_CLASS_VAR_USED
const uint32_t burstsPerRowBuffer
virtual void chooseRead(MemPacketQueue &queue)
This function is NVM specific.
const uint32_t readBufferSize
Buffer sizes for read and write queues in the controller These are passed to the controller on instan...
MemCtrl::BusState busStateNext
bus state for next request event triggered
MemInterface(const Params &_p)
Tick minWriteToReadDataGap() const
enums::AddrMap addrMapping
Memory controller configuration initialized based on parameter values.
virtual void drainRanks()
This function is DRAM specific.
virtual std::pair< Tick, Tick > doBurstAccess(MemPacket *mem_pkt, Tick next_burst_at, const std::vector< MemPacketQueue > &queue)=0
This function performs the burst and update stats.
const uint32_t deviceRowBufferSize
General interface to memory device Includes functions and parameters shared across media types.
virtual bool isBusy(bool read_queue_empty, bool all_writes_nvm)=0
This function checks if ranks are busy.
virtual void setupRank(const uint8_t rank, const bool is_read)=0
Setup the rank based on packet received.
const uint32_t banksPerRank
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
An abstract memory represents a contiguous block of physical memory, with an associated address range...
uint64_t Tick
Tick count type.
A memory packet stores packets along with the timestamp of when the packet entered the queue,...
virtual Tick commandOffset() const =0
virtual bool burstReady(MemPacket *pkt) const =0
Check if a burst operation can be issued to the interface.
Tick rankDelay() const
Determine the required delay for an access to a different rank.
virtual void checkRefreshState(uint8_t rank)
This function is DRAM specific.
const uint32_t writeBufferSize
const uint32_t devicesPerRank
Tick minReadToWriteDataGap() const
MemCtrl * ctrl
A pointer to the parent memory controller instance.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
MemInterfaceParams Params
Tick rankToRankDelay() const
uint32_t readsThisTime
Reads/writes performed by the controller for this interface before bus direction is switched.
virtual Tick writeToReadDelay() const
Tick nextBurstAt
Till when the controller must wait before issuing next RD/WR burst?
uint64_t size() const
Get the memory size.
const uint32_t ranksPerChannel
void setCtrl(MemCtrl *_ctrl, unsigned int command_window, uint8_t pseudo_channel=0)
Set a pointer to the controller and initialize interface based on controller parameters.
Addr getOffset(const Addr &a) const
Determine the offset of an address within the range.
virtual std::pair< MemPacketQueue::iterator, Tick > chooseNextFRFCFS(MemPacketQueue &queue, Tick min_col_at) const =0
For FR-FCFS policy, find first command that can issue Function will be overriden by interface to sele...
const uint32_t rowBufferSize
Addr getCtrlAddr(Addr addr)
Get an address in a dense range which starts from 0.
uint8_t pseudoChannel
pseudo channel number used for HBM modeling
static const uint32_t NO_ROW
uint32_t bytesPerBurst() const
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
virtual bool writeRespQueueFull() const
This function is NVM specific.
unsigned int maxCommandsPerWindow
Number of commands that can issue in the defined controller command window, used to verify command ba...
virtual Tick accessLatency() const =0
const uint32_t burstSize
General device and channel characteristics The rowsPerBank is determined based on the capacity,...
const GEM5_CLASS_VAR_USED Tick tCK
General timing requirements.
virtual MemPacket * decodePacket(const PacketPtr pkt, Addr pkt_addr, unsigned int size, bool is_read, uint8_t pseudo_channel=0)
Address decoder to figure out physical mapping onto ranks, banks, and rows.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:58 for gem5 by doxygen 1.8.17