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");
AbstractMemory declaration.
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 size() const
Get the memory size.
The memory controller is a single-channel memory controller capturing the most important timing const...
A basic class to track the bank state, i.e.
static const uint32_t NO_ROW
General interface to memory device Includes functions and parameters shared across media types.
const uint32_t burstsPerStripe
enums::AddrMap addrMapping
Memory controller configuration initialized based on parameter values.
MemCtrl::BusState busState
virtual void setupRank(const uint8_t rank, const bool is_read)=0
Setup the rank based on packet received.
const uint32_t devicesPerRank
virtual Tick writeToReadDelay() const
MemCtrl * ctrl
A pointer to the parent memory controller instance.
const uint32_t writeBufferSize
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.
virtual void suspend()
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.
Tick rankDelay() const
Determine the required delay for an access to a different rank.
const uint32_t ranksPerChannel
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 ...
Addr getCtrlAddr(Addr addr)
Get an address in a dense range which starts from 0.
virtual Tick commandOffset() const =0
uint8_t pseudoChannel
pseudo channel number used for HBM modeling
virtual bool burstReady(MemPacket *pkt) const =0
Check if a burst operation can be issued to the interface.
virtual void checkRefreshState(uint8_t rank)
This function is DRAM specific.
virtual bool isBusy(bool read_queue_empty, bool all_writes_nvm)=0
This function checks if ranks are busy.
Tick rankToRankDelay() const
uint32_t readsThisTime
Reads/writes performed by the controller for this interface before bus direction is switched.
uint32_t readQueueSize
Read/write packets in the read/write queue for this interface qos/mem_ctrl.hh has similar counters,...
virtual void respondEvent(uint8_t rank)
This function is DRAM specific.
const uint32_t burstSize
General device and channel characteristics The rowsPerBank is determined based on the capacity,...
const uint32_t deviceSize
MemInterfaceParams Params
virtual Tick accessLatency() const =0
const uint32_t banksPerRank
unsigned int maxCommandsPerWindow
Number of commands that can issue in the defined controller command window, used to verify command ba...
virtual bool writeRespQueueFull() const
This function is NVM specific.
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.
const uint32_t burstsPerRowBuffer
virtual void chooseRead(MemPacketQueue &queue)
This function is NVM specific.
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...
MemCtrl::BusState busStateNext
bus state for next request event triggered
const uint32_t readBufferSize
Buffer sizes for read and write queues in the controller These are passed to the controller on instan...
GEM5_CLASS_VAR_USED const Tick tCK
General timing requirements.
Tick nextBurstAt
Till when the controller must wait before issuing next RD/WR burst?
Tick minWriteToReadDataGap() const
virtual bool readsWaitingToIssue() const
This function is NVM specific.
const uint32_t rowBufferSize
MemInterface(const Params &_p)
Tick readToWriteDelay() const
uint32_t numWritesQueued
NVM specific variable, but declaring it here allows treating different interfaces in a more genral wa...
Tick minReadToWriteDataGap() const
virtual bool allRanksDrained() const =0
Check drain state of interface.
virtual void drainRanks()
This function is DRAM specific.
uint32_t bytesPerBurst() const
const uint32_t deviceRowBufferSize
A memory packet stores packets along with the timestamp of when the packet entered the queue,...
#define GEM5_CLASS_VAR_USED
Addr getOffset(const Addr &a) const
Determine the offset of an address within the range.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
Declaration of Statistics objects.