Go to the documentation of this file.
46 #ifndef __DRAM_INTERFACE_HH__
47 #define __DRAM_INTERFACE_HH__
51 #include "params/DRAMInterface.hh"
74 Data::MemCommand::cmds
type;
78 constexpr
Command(Data::MemCommand::cmds _type, uint8_t _bank,
350 Rank(
const DRAMInterfaceParams &_p,
int _rank,
576 Tick pre_tick,
bool auto_or_preall =
false,
665 void init()
override;
678 void setupRank(
const uint8_t rank,
const bool is_read)
override;
681 unsigned int size,
bool is_read,
682 uint8_t pseudo_channel = 0)
override;
757 return ranks[pkt->
rank]->inRefIdleState();
768 bool isBusy(
bool read_queue_empty,
bool all_writes_nvm)
override;
809 #endif //__DRAM_INTERFACE_HH__
void suspend()
Stop the refresh events.
This is a simple scalar statistic, like a counter.
statistics::Formula avgWrBW
bool enableDRAMPowerdown
Enable or disable DRAM powerdown states.
statistics::Vector perBankRdBursts
DRAM per bank stats.
bool burstReady(MemPacket *pkt) const override
Check if a burst operation can be issued to the DRAM.
void computeStats()
Computes stats just prior to dump event.
void processPrechargeEvent()
uint32_t writeEntries
Track number of packets in write queue going to this rank.
PowerState
The power state captures the different operational states of the DRAM and interacts with the bus read...
RefreshState
The refresh state is used to control the progress of the refresh scheduling.
statistics::Scalar writeRowHits
statistics::Scalar writeBursts
statistics::Formula avgQLat
PowerState pwrStateTrans
Since we are taking decisions out of order, we need to keep track of what power transition is happeni...
statistics::Scalar totQLat
EventFunctionWrapper writeDoneEvent
statistics::Scalar readEnergy
statistics::Scalar preBackEnergy
statistics::Scalar readBursts
total number of DRAM bursts serviced
void addRankToRankDelay(Tick cmd_at) override
Add rank to rank delay to bus timing to all DRAM banks in alli ranks when access to an alternate inte...
void processWakeUpEvent()
statistics::Scalar totBusLat
statistics::Scalar refreshEnergy
EventFunctionWrapper prechargeEvent
bool inLowPowerState
rank is in or transitioning to power-down or self-refresh
void scheduleWakeUpEvent(Tick exit_delay)
schedule and event to wake-up from power-down or self-refresh and update bank timing parameters
void checkRefreshState(uint8_t rank) override
Check the refresh state to determine if refresh needs to be kicked back into action after a read resp...
Simple structure to hold the values needed to keep track of commands for DRAMPower.
std::pair< MemPacketQueue::iterator, Tick > chooseNextFRFCFS(MemPacketQueue &queue, Tick min_col_at) const override
For FR-FCFS policy, find first DRAM command that can issue.
std::vector< Rank * > ranks
Vector of dram ranks.
A basic class to track the bank state, i.e.
statistics::Vector pwrStateTime
Track time spent in each power state.
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 t...
bool allRanksDrained() const override
Return true once refresh is complete for all ranks and there are no additional commands enqueued.
void processWriteDoneEvent()
DRAMPower is a standalone tool which calculates the power consumed by a DRAM in the system.
void resetStats()
Reset stats on a stats event.
const uint32_t maxAccessesPerRow
Max column accesses (read and write) per row, before forefully closing it.
statistics::Formula avgBusLat
A vector of scalar stats.
void drainRanks() override
Iterate through dram ranks to exit self-refresh in order to drain.
EventFunctionWrapper refreshEvent
statistics::Histogram bytesPerActivate
uint8_t outstandingEvents
Number of ACT, RD, and WR events currently scheduled Incremented when a refresh event is started as w...
EventFunctionWrapper activateEvent
std::string csprintf(const char *format, const Args &...args)
Rank(const DRAMInterfaceParams &_p, int _rank, DRAMInterface &_dram)
statistics::Scalar prePowerDownEnergy
void checkDrainDone()
Let the rank check if it was waiting for requests to drain to allow it to transition states.
const Tick rdToWrDlySameBG
void powerDownSleep(PowerState pwr_state, Tick tick)
Schedule a transition to power-down (sleep)
Tick pwrStateTick
Track when we transitioned to the current power state.
constexpr Command(Data::MemCommand::cmds _type, uint8_t _bank, Tick time_stamp)
statistics::Scalar totalEnergy
Tick accessLatency() const override
uint32_t readEntries
Track number of packets in read queue going to this rank.
void regStats() override
Callback to set stat parameters.
void processRefreshEvent()
const uint32_t bankGroupsPerRank
DRAM specific device characteristics.
statistics::Scalar actEnergy
void setupRank(const uint8_t rank, const bool is_read) override
Setup the rank based on packet received.
void processActivateEvent()
Interface to DRAM devices with media specific parameters, statistics, and functions.
Data::MemCommand::cmds type
Tick lastStatsResetTick
The time when stats were last reset used to calculate average power.
statistics::Scalar averagePower
uint8_t rank
Current Rank index.
statistics::Formula peakBW
const std::string name() const
DRAMInterface(const DRAMInterfaceParams &_p)
statistics::Formula avgMemAccLat
void regStats() override
Callback to set stat parameters.
DRAMStats(DRAMInterface &dram)
General interface to memory device Includes functions and parameters shared across media types.
const Tick tRL
DRAM specific timing requirements.
statistics::Formula busUtil
DRAMInterface & dram
A reference to the parent DRAMInterface instance.
statistics::Formula busUtilWrite
statistics::Formula avgRdBW
std::vector< Bank > banks
Vector of Banks.
bool inPwrIdleState() const
Check if the current rank has all banks closed and is not in a low power state.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
RefreshState refreshState
current refresh state
std::pair< std::vector< uint32_t >, bool > minBankPrep(const MemPacketQueue &queue, Tick min_col_at) const
Find which are the earliest banks ready to issue an activate for the enqueued requests.
statistics::Formula pageHitRate
const uint32_t activationLimit
uint64_t Tick
Tick count type.
Tick commandOffset() const override
statistics::Scalar actBackEnergy
bool isBusy(bool read_queue_empty, bool all_writes_nvm) override
This function checks if ranks are actively refreshing and therefore busy.
void flushCmdList()
Push command out of cmdList queue that are scheduled at or before curTick() to DRAMPower library All ...
A memory packet stores packets along with the timestamp of when the packet entered the queue,...
DRAMPower power
One DRAMPower instance per rank.
std::deque< Tick > actTicks
List to keep track of activate ticks.
bool isQueueEmpty() const
Check if the command queue of current rank is idle.
statistics::Scalar readRowHits
statistics::Scalar writeEnergy
Tick writeToReadDelay() const override
EventFunctionWrapper wakeUpEvent
statistics::Scalar selfRefreshEnergy
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void updatePowerStats()
Function to update Power Stats.
const Tick wrToRdDlySameBG
bool readsWaitingToIssue() const override
The next three functions are NVM-specific and will be ignored by DRAM.
statistics::Scalar totMemAccLat
Tick lastBurstTick
Track when we issued the last read/write burst.
uint64_t size() const
Get the memory size.
const uint8_t twoCycleActivate
bool inRefIdleState() const
Check if there is no refresh and no preparation of refresh ongoing i.e.
void respondEvent(uint8_t rank) override
Complete response process for DRAM when read burst is complete This will update the counters and chec...
unsigned int numBanksActive
To track number of banks which are currently active for this rank.
void init() override
Initialize the DRAM interface and verify parameters.
void suspend() override
Iterate through DRAM ranks and suspend them.
const uint8_t rank
Will be populated by address decoder.
MemPacket * decodePacket(const PacketPtr pkt, Addr pkt_addr, unsigned int size, bool is_read, uint8_t pseudo_channel=0) override
Address decoder to figure out physical mapping onto ranks, banks, and rows.
statistics::Vector perBankWrBursts
Tick refreshDueAt
Keep track of when a refresh is due.
const bool burstInterleave
bool writeRespQueueFull() const override
This function is NVM specific.
statistics::Scalar bytesRead
const Tick clkResyncDelay
void prechargeBank(Rank &rank_ref, Bank &bank_ref, Tick pre_tick, bool auto_or_preall=false, bool trace=true)
Precharge a given bank and also update when the precharge is done.
statistics::Scalar actPowerDownEnergy
statistics::Scalar bytesWritten
statistics::Scalar preEnergy
statistics::Formula writeRowHitRate
EventFunctionWrapper powerEvent
std::vector< Command > cmdList
List of commands issued, to be sent to DRAMPpower at refresh and stats dump.
void chooseRead(MemPacketQueue &queue) override
This function is NVM specific.
Tick wakeUpAllowedAt
delay low-power exit until this requirement is met
Rank class includes a vector of banks.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
statistics::Formula readRowHitRate
statistics::Scalar totalIdleTime
Stat to track total DRAM idle time.
enums::PageManage pageMgmt
void schedulePowerEvent(PowerState pwr_state, Tick tick)
Schedule a power state transition in the future, and potentially override an already scheduled transi...
void resetStats() override
Callback to reset stats.
void startup(Tick ref_tick)
Kick off accounting for power and refresh states and schedule initial refresh.
void preDumpStats() override
Callback before stats are dumped.
PowerState pwrStatePostRefresh
Previous low-power state, which will be re-entered after refresh.
static bool sortTime(const Command &cmd, const Command &cmd_next)
Function for sorting Command structures based on timeStamp.
std::pair< Tick, Tick > doBurstAccess(MemPacket *mem_pkt, Tick next_burst_at, const std::vector< MemPacketQueue > &queue) override
Actually do the burst - figure out the latency it will take to service the req based on bank state,...
PowerState pwrState
Current power state.
void startup() override
Iterate through dram ranks and instantiate per rank startup routine.
statistics::Formula busUtilRead
RankStats(DRAMInterface &dram, Rank &rank)
void resetStats() override
Callback to reset stats.
bool forceSelfRefreshExit() const
Trigger a self-refresh exit if there are entries enqueued Exit if there are any read entries regardle...
Generated on Sun Jul 30 2023 01:56:58 for gem5 by doxygen 1.8.17