gem5
v20.1.0.0
|
Rank class includes a vector of banks. More...
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 | |
EventQueue * | eventQueue () 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< Command > | cmdList |
List of commands issued, to be sent to DRAMPpower at refresh and stats dump. More... | |
std::vector< Bank > | banks |
Vector of Banks. More... | |
unsigned int | numBanksActive |
To track number of banks which are currently active for this rank. More... | |
std::deque< Tick > | actTicks |
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 | |
EventQueue * | eventq |
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 | |
DRAMInterface & | dram |
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... | |
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.
DRAMInterface::Rank::Rank | ( | const DRAMInterfaceParams * | _p, |
int | _rank, | ||
DRAMInterface & | _dram | ||
) |
Definition at line 1127 of file mem_interface.cc.
References processWriteDoneEvent().
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().
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.
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.
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.
Definition at line 1843 of file mem_interface.cc.
|
inline |
Check if the current rank has all banks closed and is not in a low power state.
Return | true 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.
|
inline |
Check if there is no refresh and no preparation of refresh ongoing i.e.
the refresh state machine is in idle
Return | true 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().
bool DRAMInterface::Rank::isQueueEmpty | ( | ) | const |
Check if the command queue of current rank is idle.
Return | true 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().
|
inline |
Definition at line 589 of file mem_interface.hh.
References csprintf(), and rank.
void DRAMInterface::Rank::powerDownSleep | ( | PowerState | pwr_state, |
Tick | tick | ||
) |
Schedule a transition to power-down (sleep)
pwr_state | Power state to transition to |
tick | Absolute 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().
void DRAMInterface::Rank::processActivateEvent | ( | ) |
Definition at line 1244 of file mem_interface.cc.
References curTick(), and DRAMInterface::PWR_ACT.
void DRAMInterface::Rank::processPowerEvent | ( | ) |
Definition at line 1644 of file mem_interface.cc.
References curTick(), DPRINTF, Drained, Draining, DRAMInterface::PWR_ACT, DRAMInterface::PWR_ACT_PDN, DRAMInterface::PWR_IDLE, DRAMInterface::PWR_PRE_PDN, DRAMInterface::PWR_REF, DRAMInterface::PWR_SREF, DRAMInterface::REF_IDLE, DRAMInterface::REF_PD_EXIT, DRAMInterface::REF_PRE, DRAMInterface::REF_SREF_EXIT, DRAMInterface::REF_START, EventManager::schedule(), and DRAMInterface::stats.
void DRAMInterface::Rank::processPrechargeEvent | ( | ) |
Definition at line 1254 of file mem_interface.cc.
References curTick(), DPRINTF, DRAMInterface::PWR_ACT, DRAMInterface::PWR_IDLE, and DRAMInterface::PWR_PRE_PDN.
void DRAMInterface::Rank::processRefreshEvent | ( | ) |
Definition at line 1296 of file mem_interface.cc.
References ArmISA::b, curTick(), divCeil(), DPRINTF, Drained, Draining, fatal, MemInterface::Bank::NO_ROW, DRAMInterface::PWR_IDLE, DRAMInterface::PWR_PRE_PDN, DRAMInterface::PWR_REF, DRAMInterface::REF_DRAIN, DRAMInterface::REF_IDLE, DRAMInterface::REF_PD_EXIT, DRAMInterface::REF_PRE, DRAMInterface::REF_RUN, DRAMInterface::REF_SREF_EXIT, DRAMInterface::REF_START, and EventManager::schedule().
void DRAMInterface::Rank::processWakeUpEvent | ( | ) |
Definition at line 1626 of file mem_interface.cc.
References curTick(), DRAMInterface::PWR_ACT, DRAMInterface::PWR_ACT_PDN, DRAMInterface::PWR_IDLE, DRAMInterface::PWR_PRE_PDN, and DRAMInterface::PWR_SREF.
void DRAMInterface::Rank::processWriteDoneEvent | ( | ) |
Definition at line 1285 of file mem_interface.cc.
Referenced by Rank().
void DRAMInterface::Rank::resetStats | ( | ) |
Reset stats on a stats event.
Definition at line 1833 of file mem_interface.cc.
|
private |
Schedule a power state transition in the future, and potentially override an already scheduled transition.
pwr_state | Power state to transition to |
tick | Tick when transition should take place |
Definition at line 1502 of file mem_interface.cc.
References curTick(), DPRINTF, panic, EventManager::schedule(), and Clocked::tick.
void DRAMInterface::Rank::scheduleWakeUpEvent | ( | Tick | exit_delay | ) |
schedule and event to wake-up from power-down or self-refresh and update bank timing parameters
exit_delay | Relative 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().
void DRAMInterface::Rank::startup | ( | Tick | ref_tick | ) |
Kick off accounting for power and refresh states and schedule initial refresh.
ref_tick | Tick for first refresh |
Definition at line 1166 of file mem_interface.cc.
References curTick(), and EventManager::schedule().
void DRAMInterface::Rank::suspend | ( | ) |
Stop the refresh events.
Definition at line 1178 of file mem_interface.cc.
References EventManager::deschedule(), and DRAMInterface::PWR_IDLE.
|
private |
Function to update Power Stats.
Definition at line 1777 of file mem_interface.cc.
References curTick(), divCeil(), SimClock::Frequency, power(), and DRAMInterface::stats.
EventFunctionWrapper DRAMInterface::Rank::activateEvent |
Definition at line 686 of file mem_interface.hh.
Referenced by DRAMInterface::activateBank(), and DRAMInterface::respondEvent().
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().
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().
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().
|
private |
A reference to the parent DRAMInterface instance.
Definition at line 472 of file mem_interface.hh.
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().
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().
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().
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().
DRAMPower DRAMInterface::Rank::power |
One DRAMPower instance per rank.
Definition at line 556 of file mem_interface.hh.
EventFunctionWrapper DRAMInterface::Rank::powerEvent |
Definition at line 695 of file mem_interface.hh.
EventFunctionWrapper DRAMInterface::Rank::prechargeEvent |
Definition at line 689 of file mem_interface.hh.
Referenced by DRAMInterface::checkRefreshState(), DRAMInterface::prechargeBank(), and DRAMInterface::respondEvent().
PowerState DRAMInterface::Rank::pwrState |
Current power state.
Definition at line 514 of file mem_interface.hh.
Referenced by DRAMInterface::doBurstAccess(), inPwrIdleState(), and DRAMInterface::respondEvent().
|
private |
Previous low-power state, which will be re-entered after refresh.
Definition at line 483 of file mem_interface.hh.
|
private |
Track when we transitioned to the current power state.
Definition at line 488 of file mem_interface.hh.
|
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.
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().
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().
|
private |
Keep track of when a refresh is due.
Definition at line 493 of file mem_interface.hh.
EventFunctionWrapper DRAMInterface::Rank::refreshEvent |
Definition at line 692 of file mem_interface.hh.
Referenced by DRAMInterface::checkRefreshState().
RefreshState DRAMInterface::Rank::refreshState |
current refresh state
Definition at line 519 of file mem_interface.hh.
Referenced by DRAMInterface::checkRefreshState(), and inRefIdleState().
|
protected |
Definition at line 701 of file mem_interface.hh.
Tick DRAMInterface::Rank::wakeUpAllowedAt |
delay low-power exit until this requirement is met
Definition at line 551 of file mem_interface.hh.
EventFunctionWrapper DRAMInterface::Rank::wakeUpEvent |
Definition at line 698 of file mem_interface.hh.
EventFunctionWrapper DRAMInterface::Rank::writeDoneEvent |
Definition at line 683 of file mem_interface.hh.
Referenced by DRAMInterface::doBurstAccess().
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().