gem5  v20.1.0.0
Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
DRAMInterface::Rank Class Reference

Rank class includes a vector of banks. More...

Inheritance diagram for DRAMInterface::Rank:
EventManager

Public Member Functions

 Rank (const DRAMInterfaceParams *_p, int _rank, DRAMInterface &_dram)
 
const std::string name () const
 
void startup (Tick ref_tick)
 Kick off accounting for power and refresh states and schedule initial refresh. More...
 
void suspend ()
 Stop the refresh events. More...
 
bool inRefIdleState () const
 Check if there is no refresh and no preparation of refresh ongoing i.e. More...
 
bool inPwrIdleState () const
 Check if the current rank has all banks closed and is not in a low power state. More...
 
bool forceSelfRefreshExit () const
 Trigger a self-refresh exit if there are entries enqueued Exit if there are any read entries regardless of the bus state. More...
 
bool isQueueEmpty () const
 Check if the command queue of current rank is idle. More...
 
void checkDrainDone ()
 Let the rank check if it was waiting for requests to drain to allow it to transition states. More...
 
void flushCmdList ()
 Push command out of cmdList queue that are scheduled at or before curTick() to DRAMPower library All commands before curTick are guaranteed to be complete and can safely be flushed. More...
 
void computeStats ()
 Computes stats just prior to dump event. More...
 
void resetStats ()
 Reset stats on a stats event. More...
 
void powerDownSleep (PowerState pwr_state, Tick tick)
 Schedule a transition to power-down (sleep) More...
 
void scheduleWakeUpEvent (Tick exit_delay)
 schedule and event to wake-up from power-down or self-refresh and update bank timing parameters More...
 
void processWriteDoneEvent ()
 
void processActivateEvent ()
 
void processPrechargeEvent ()
 
void processRefreshEvent ()
 
void processPowerEvent ()
 
void processWakeUpEvent ()
 
- Public Member Functions inherited from EventManager
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick) -1)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. More...
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue. More...
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 

Public Attributes

PowerState pwrState
 Current power state. More...
 
RefreshState refreshState
 current refresh state More...
 
bool inLowPowerState
 rank is in or transitioning to power-down or self-refresh More...
 
uint8_t rank
 Current Rank index. More...
 
uint32_t readEntries
 Track number of packets in read queue going to this rank. More...
 
uint32_t writeEntries
 Track number of packets in write queue going to this rank. More...
 
uint8_t outstandingEvents
 Number of ACT, RD, and WR events currently scheduled Incremented when a refresh event is started as well Used to determine when a low-power state can be entered. More...
 
Tick wakeUpAllowedAt
 delay low-power exit until this requirement is met More...
 
DRAMPower power
 One DRAMPower instance per rank. More...
 
std::vector< CommandcmdList
 List of commands issued, to be sent to DRAMPpower at refresh and stats dump. More...
 
std::vector< Bankbanks
 Vector of Banks. More...
 
unsigned int numBanksActive
 To track number of banks which are currently active for this rank. More...
 
std::deque< TickactTicks
 List to keep track of activate ticks. More...
 
Tick lastBurstTick
 Track when we issued the last read/write burst. More...
 
EventFunctionWrapper writeDoneEvent
 
EventFunctionWrapper activateEvent
 
EventFunctionWrapper prechargeEvent
 
EventFunctionWrapper refreshEvent
 
EventFunctionWrapper powerEvent
 
EventFunctionWrapper wakeUpEvent
 

Protected Attributes

RankStats stats
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Private Member Functions

void updatePowerStats ()
 Function to update Power Stats. More...
 
void schedulePowerEvent (PowerState pwr_state, Tick tick)
 Schedule a power state transition in the future, and potentially override an already scheduled transition. More...
 

Private Attributes

DRAMInterfacedram
 A reference to the parent DRAMInterface instance. More...
 
PowerState pwrStateTrans
 Since we are taking decisions out of order, we need to keep track of what power transition is happening at what time. More...
 
PowerState pwrStatePostRefresh
 Previous low-power state, which will be re-entered after refresh. More...
 
Tick pwrStateTick
 Track when we transitioned to the current power state. More...
 
Tick refreshDueAt
 Keep track of when a refresh is due. More...
 

Detailed Description

Rank class includes a vector of banks.

Refresh and Power state machines are defined per rank. Events required to change the state of the refresh and power state machine are scheduled per rank. This class allows the implementation of rank-wise refresh and rank-wise power-down.

Definition at line 465 of file mem_interface.hh.

Constructor & Destructor Documentation

◆ Rank()

DRAMInterface::Rank::Rank ( const DRAMInterfaceParams *  _p,
int  _rank,
DRAMInterface _dram 
)

Definition at line 1127 of file mem_interface.cc.

References processWriteDoneEvent().

Member Function Documentation

◆ checkDrainDone()

void DRAMInterface::Rank::checkDrainDone ( )

Let the rank check if it was waiting for requests to drain to allow it to transition states.

Definition at line 1201 of file mem_interface.cc.

References curTick(), DPRINTF, DRAMInterface::REF_DRAIN, DRAMInterface::REF_PD_EXIT, and EventManager::schedule().

◆ computeStats()

void DRAMInterface::Rank::computeStats ( )

Computes stats just prior to dump event.

Definition at line 1820 of file mem_interface.cc.

References curTick(), DPRINTF, and DRAMInterface::stats.

◆ flushCmdList()

void DRAMInterface::Rank::flushCmdList ( )

Push command out of cmdList queue that are scheduled at or before curTick() to DRAMPower library All commands before curTick are guaranteed to be complete and can safely be flushed.

Definition at line 1216 of file mem_interface.cc.

References DRAMInterface::Command::bank, curTick(), divCeil(), power(), DRAMInterface::sortTime(), DRAMInterface::Command::timeStamp, and DRAMInterface::Command::type.

◆ forceSelfRefreshExit()

bool DRAMInterface::Rank::forceSelfRefreshExit ( ) const

Trigger a self-refresh exit if there are entries enqueued Exit if there are any read entries regardless of the bus state.

If we are currently issuing write commands, exit if we have any write commands enqueued as well. Could expand this in the future to analyze state of entire queue if needed.

Returns
boolean indicating self-refresh exit should be scheduled

Definition at line 1843 of file mem_interface.cc.

◆ inPwrIdleState()

bool DRAMInterface::Rank::inPwrIdleState ( ) const
inline

Check if the current rank has all banks closed and is not in a low power state.

Parameters
Returntrue if the rank is idle from a bank and power point of view

Definition at line 619 of file mem_interface.hh.

References DRAMInterface::PWR_IDLE, and pwrState.

◆ inRefIdleState()

bool DRAMInterface::Rank::inRefIdleState ( ) const
inline

Check if there is no refresh and no preparation of refresh ongoing i.e.

the refresh state machine is in idle

Parameters
Returntrue if the rank is idle from a refresh point of view

Definition at line 610 of file mem_interface.hh.

References DRAMInterface::REF_IDLE, and refreshState.

Referenced by DRAMInterface::doBurstAccess(), and DRAMInterface::respondEvent().

◆ isQueueEmpty()

bool DRAMInterface::Rank::isQueueEmpty ( ) const

Check if the command queue of current rank is idle.

Parameters
Returntrue if the there are no commands in Q. Bus direction determines queue checked.

Definition at line 1190 of file mem_interface.cc.

Referenced by DRAMInterface::respondEvent().

◆ name()

const std::string DRAMInterface::Rank::name ( ) const
inline

Definition at line 589 of file mem_interface.hh.

References csprintf(), and rank.

◆ powerDownSleep()

void DRAMInterface::Rank::powerDownSleep ( PowerState  pwr_state,
Tick  tick 
)

Schedule a transition to power-down (sleep)

Parameters
pwr_statePower state to transition to
tickAbsolute tick when transition should take place

Definition at line 1523 of file mem_interface.cc.

References divCeil(), DPRINTF, DRAMInterface::PWR_ACT_PDN, DRAMInterface::PWR_PRE_PDN, DRAMInterface::PWR_REF, DRAMInterface::PWR_SREF, and Clocked::tick.

Referenced by DRAMInterface::respondEvent().

◆ processActivateEvent()

void DRAMInterface::Rank::processActivateEvent ( )

Definition at line 1244 of file mem_interface.cc.

References curTick(), and DRAMInterface::PWR_ACT.

◆ processPowerEvent()

void DRAMInterface::Rank::processPowerEvent ( )

◆ processPrechargeEvent()

void DRAMInterface::Rank::processPrechargeEvent ( )

◆ processRefreshEvent()

void DRAMInterface::Rank::processRefreshEvent ( )

◆ processWakeUpEvent()

void DRAMInterface::Rank::processWakeUpEvent ( )

◆ processWriteDoneEvent()

void DRAMInterface::Rank::processWriteDoneEvent ( )

Definition at line 1285 of file mem_interface.cc.

Referenced by Rank().

◆ resetStats()

void DRAMInterface::Rank::resetStats ( )

Reset stats on a stats event.

Definition at line 1833 of file mem_interface.cc.

References curTick(), divCeil(), and power().

◆ schedulePowerEvent()

void DRAMInterface::Rank::schedulePowerEvent ( PowerState  pwr_state,
Tick  tick 
)
private

Schedule a power state transition in the future, and potentially override an already scheduled transition.

Parameters
pwr_statePower state to transition to
tickTick when transition should take place

Definition at line 1502 of file mem_interface.cc.

References curTick(), DPRINTF, panic, EventManager::schedule(), and Clocked::tick.

◆ scheduleWakeUpEvent()

void DRAMInterface::Rank::scheduleWakeUpEvent ( Tick  exit_delay)

schedule and event to wake-up from power-down or self-refresh and update bank timing parameters

Parameters
exit_delayRelative tick defining the delay required between low-power exit and the next command

Definition at line 1574 of file mem_interface.cc.

References ArmISA::b, curTick(), divCeil(), DPRINTF, DRAMInterface::PWR_ACT_PDN, DRAMInterface::PWR_IDLE, DRAMInterface::PWR_PRE_PDN, DRAMInterface::PWR_SREF, DRAMInterface::REF_PD_EXIT, and EventManager::schedule().

Referenced by DRAMInterface::doBurstAccess().

◆ startup()

void DRAMInterface::Rank::startup ( Tick  ref_tick)

Kick off accounting for power and refresh states and schedule initial refresh.

Parameters
ref_tickTick for first refresh

Definition at line 1166 of file mem_interface.cc.

References curTick(), and EventManager::schedule().

◆ suspend()

void DRAMInterface::Rank::suspend ( )

Stop the refresh events.

Definition at line 1178 of file mem_interface.cc.

References EventManager::deschedule(), and DRAMInterface::PWR_IDLE.

◆ updatePowerStats()

void DRAMInterface::Rank::updatePowerStats ( )
private

Function to update Power Stats.

Definition at line 1777 of file mem_interface.cc.

References curTick(), divCeil(), SimClock::Frequency, power(), and DRAMInterface::stats.

Member Data Documentation

◆ activateEvent

EventFunctionWrapper DRAMInterface::Rank::activateEvent

Definition at line 686 of file mem_interface.hh.

Referenced by DRAMInterface::activateBank(), and DRAMInterface::respondEvent().

◆ actTicks

std::deque<Tick> DRAMInterface::Rank::actTicks

List to keep track of activate ticks.

Definition at line 579 of file mem_interface.hh.

Referenced by DRAMInterface::activateBank().

◆ banks

std::vector<Bank> DRAMInterface::Rank::banks

Vector of Banks.

Each rank is made of several devices which in term are made from several banks.

Definition at line 570 of file mem_interface.hh.

Referenced by DRAMInterface::activateBank(), DRAMInterface::doBurstAccess(), and DRAMInterface::prechargeBank().

◆ cmdList

std::vector<Command> DRAMInterface::Rank::cmdList

List of commands issued, to be sent to DRAMPpower at refresh and stats dump.

Keep commands here since commands to different banks are added out of order. Will only pass commands up to curTick() to DRAMPower after sorting.

Definition at line 564 of file mem_interface.hh.

Referenced by DRAMInterface::activateBank(), DRAMInterface::doBurstAccess(), and DRAMInterface::prechargeBank().

◆ dram

DRAMInterface& DRAMInterface::Rank::dram
private

A reference to the parent DRAMInterface instance.

Definition at line 472 of file mem_interface.hh.

◆ inLowPowerState

bool DRAMInterface::Rank::inLowPowerState

rank is in or transitioning to power-down or self-refresh

Definition at line 524 of file mem_interface.hh.

Referenced by DRAMInterface::doBurstAccess().

◆ lastBurstTick

Tick DRAMInterface::Rank::lastBurstTick

Track when we issued the last read/write burst.

Definition at line 584 of file mem_interface.hh.

Referenced by DRAMInterface::doBurstAccess().

◆ numBanksActive

unsigned int DRAMInterface::Rank::numBanksActive

To track number of banks which are currently active for this rank.

Definition at line 576 of file mem_interface.hh.

Referenced by DRAMInterface::activateBank(), and DRAMInterface::prechargeBank().

◆ outstandingEvents

uint8_t DRAMInterface::Rank::outstandingEvents

Number of ACT, RD, and WR events currently scheduled Incremented when a refresh event is started as well Used to determine when a low-power state can be entered.

Definition at line 546 of file mem_interface.hh.

Referenced by DRAMInterface::doBurstAccess(), DRAMInterface::prechargeBank(), and DRAMInterface::respondEvent().

◆ power

DRAMPower DRAMInterface::Rank::power

One DRAMPower instance per rank.

Definition at line 556 of file mem_interface.hh.

◆ powerEvent

EventFunctionWrapper DRAMInterface::Rank::powerEvent

Definition at line 695 of file mem_interface.hh.

◆ prechargeEvent

EventFunctionWrapper DRAMInterface::Rank::prechargeEvent

◆ pwrState

PowerState DRAMInterface::Rank::pwrState

Current power state.

Definition at line 514 of file mem_interface.hh.

Referenced by DRAMInterface::doBurstAccess(), inPwrIdleState(), and DRAMInterface::respondEvent().

◆ pwrStatePostRefresh

PowerState DRAMInterface::Rank::pwrStatePostRefresh
private

Previous low-power state, which will be re-entered after refresh.

Definition at line 483 of file mem_interface.hh.

◆ pwrStateTick

Tick DRAMInterface::Rank::pwrStateTick
private

Track when we transitioned to the current power state.

Definition at line 488 of file mem_interface.hh.

◆ pwrStateTrans

PowerState DRAMInterface::Rank::pwrStateTrans
private

Since we are taking decisions out of order, we need to keep track of what power transition is happening at what time.

Definition at line 478 of file mem_interface.hh.

◆ rank

uint8_t DRAMInterface::Rank::rank

Current Rank index.

Definition at line 529 of file mem_interface.hh.

Referenced by DRAMInterface::activateBank(), name(), and DRAMInterface::prechargeBank().

◆ readEntries

uint32_t DRAMInterface::Rank::readEntries

Track number of packets in read queue going to this rank.

Definition at line 534 of file mem_interface.hh.

Referenced by DRAMInterface::respondEvent().

◆ refreshDueAt

Tick DRAMInterface::Rank::refreshDueAt
private

Keep track of when a refresh is due.

Definition at line 493 of file mem_interface.hh.

◆ refreshEvent

EventFunctionWrapper DRAMInterface::Rank::refreshEvent

Definition at line 692 of file mem_interface.hh.

Referenced by DRAMInterface::checkRefreshState().

◆ refreshState

RefreshState DRAMInterface::Rank::refreshState

current refresh state

Definition at line 519 of file mem_interface.hh.

Referenced by DRAMInterface::checkRefreshState(), and inRefIdleState().

◆ stats

RankStats DRAMInterface::Rank::stats
protected

Definition at line 701 of file mem_interface.hh.

◆ wakeUpAllowedAt

Tick DRAMInterface::Rank::wakeUpAllowedAt

delay low-power exit until this requirement is met

Definition at line 551 of file mem_interface.hh.

◆ wakeUpEvent

EventFunctionWrapper DRAMInterface::Rank::wakeUpEvent

Definition at line 698 of file mem_interface.hh.

◆ writeDoneEvent

EventFunctionWrapper DRAMInterface::Rank::writeDoneEvent

Definition at line 683 of file mem_interface.hh.

Referenced by DRAMInterface::doBurstAccess().

◆ writeEntries

uint32_t DRAMInterface::Rank::writeEntries

Track number of packets in write queue going to this rank.

Definition at line 539 of file mem_interface.hh.

Referenced by DRAMInterface::doBurstAccess().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:23 for gem5 by doxygen 1.8.17