46#ifndef __NVM_INTERFACE_HH__
47#define __NVM_INTERFACE_HH__
50#include "params/NVMInterface.hh"
85 Rank(
const NVMInterfaceParams &_p,
int _rank,
193 void init()
override;
201 void setupRank(
const uint8_t rank,
const bool is_read)
override;
204 unsigned int size,
bool is_read,
205 uint8_t pseudo_channel = 0)
override;
241 bool isBusy(
bool read_queue_empty,
bool all_writes_nvm)
override;
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint64_t size() const
Get the memory size.
General interface to memory device Includes functions and parameters shared across media types.
A memory packet stores packets along with the timestamp of when the packet entered the queue,...
NVM rank class simply includes a vector of banks.
Rank(const NVMInterfaceParams &_p, int _rank, NVMInterface &_nvm)
std::vector< Bank > banks
Vector of NVM banks.
uint8_t rank
Current Rank index.
Interface to NVM devices with media specific parameters, statistics, and functions.
void checkRefreshState(uint8_t rank) override
This function is DRAM specific.
std::pair< MemPacketQueue::iterator, Tick > chooseNextFRFCFS(MemPacketQueue &queue, Tick min_col_at) const override
For FR-FCFS policy, find first NVM command that can issue default to first command to prepped region.
void startup() override
startup() is the final initialization call before simulation.
void respondEvent(uint8_t rank) override
Following two functions are not required for nvm interface.
std::pair< Tick, Tick > doBurstAccess(MemPacket *pkt, Tick next_burst_at, const std::vector< MemPacketQueue > &queue) override
Actually do the burst and update stats.
void init() override
Initialize the NVM interface and verify parameters.
void setupRank(const uint8_t rank, const bool is_read) override
Setup the rank based on packet received.
void chooseRead(MemPacketQueue &queue) override
Select read command to issue asynchronously.
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.
bool readsWaitingToIssue() const override
This function is NVM specific.
Tick nextReadAt
Till when must we wait before issuing next read command?
void processReadReadyEvent()
void suspend() override
This function is DRAM specific.
NVMInterface(const NVMInterfaceParams &_p)
std::vector< Rank * > ranks
Vector of nvm ranks.
const uint32_t maxPendingReads
void addRankToRankDelay(Tick cmd_at) override
Add rank to rank delay to bus timing to all NVM banks in alli ranks when access to an alternate inter...
bool isBusy(bool read_queue_empty, bool all_writes_nvm) override
This function checks if ranks are busy.
std::list< Tick > writeRespQueue
Holding queue for non-deterministic write commands, which maintains writes that have been issued but ...
bool writeRespQueueFull() const override
Check if the write response queue has reached defined threshold.
void processWriteRespondEvent()
void drainRanks() override
The next three functions are DRAM-specific and will be ignored by NVM.
std::deque< Tick > readReadyQueue
bool burstReady(MemPacket *pkt) const override
Check if a burst operation can be issued to the NVM.
Tick commandOffset() const override
const Tick tREAD
NVM specific timing requirements.
uint16_t numReadDataReady
EventFunctionWrapper writeRespondEvent
bool writeRespQueueEmpty() const
Check if the write response queue is empty.
Tick accessLatency() const override
EventFunctionWrapper readReadyEvent
const uint32_t maxPendingWrites
NVM specific device and channel characteristics.
bool allRanksDrained() const override
Check drain state of NVM interface.
This is a simple scalar statistic, like a counter.
A vector of scalar stats.
MemInterface declaration.
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.
statistics::Scalar totBusLat
statistics::Scalar writeBursts
statistics::Histogram bytesPerBank
statistics::Vector perBankRdBursts
statistics::Formula avgRdBW
statistics::Scalar totMemAccLat
statistics::Formula busUtilRead
statistics::Scalar totQLat
void regStats() override
Callback to set stat parameters.
statistics::Formula avgWrBW
statistics::Formula avgMemAccLat
NVMStats(NVMInterface &nvm)
statistics::Formula avgBusLat
statistics::Histogram pendingReads
NVM stats.
statistics::Formula avgQLat
statistics::Scalar nvmBytesWritten
statistics::Scalar nvmBytesRead
statistics::Histogram pendingWrites
statistics::Formula busUtil
statistics::Formula busUtilWrite
statistics::Formula peakBW
statistics::Vector perBankWrBursts
statistics::Scalar readBursts
NVM stats.