summaryrefslogtreecommitdiff
path: root/src/mem/dram_ctrl.cc
diff options
context:
space:
mode:
authorMatthew Poremba <matthew.poremba@amd.com>2019-05-01 11:32:49 -0700
committerMatthew Poremba <matthew.poremba@amd.com>2019-06-06 19:55:38 +0000
commitf2be9f195c5aa226fa546e79c9acf95c8a800915 (patch)
treedcfe73963c796bb17001b1967f66474661ead9ce /src/mem/dram_ctrl.cc
parentf5cf6d5f5ef8df0fedcba9d3cf3c16d76a6dceae (diff)
downloadgem5-f2be9f195c5aa226fa546e79c9acf95c8a800915.tar.xz
mem: Option to toggle DRAM low-power states
Adding an option to enable DRAM low-power states. The low power states can have a significant impact on application performance (sim_ticks) on the order of 2-3x, especially for compute-gpu apps. The options allows for it to easily be enabled/disabled to compare performance numbers. The option is disabled by default. Change-Id: Ib9bddbb792a1a6a4afb5339003472ff8f00a5859 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18548 Reviewed-by: Wendy Elsasser <wendy.elsasser@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/mem/dram_ctrl.cc')
-rw-r--r--src/mem/dram_ctrl.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mem/dram_ctrl.cc b/src/mem/dram_ctrl.cc
index 08465aa70..06c540ba6 100644
--- a/src/mem/dram_ctrl.cc
+++ b/src/mem/dram_ctrl.cc
@@ -97,7 +97,7 @@ DRAMCtrl::DRAMCtrl(const DRAMCtrlParams* p) :
backendLatency(p->static_backend_latency),
nextBurstAt(0), prevArrival(0),
nextReqTime(0), activeRank(0), timeStampOffset(0),
- lastStatsResetTick(0)
+ lastStatsResetTick(0), enableDRAMPowerdown(p->enable_dram_powerdown)
{
// sanity check the ranks since we rely on bit slicing for the
// address decoding
@@ -705,7 +705,7 @@ DRAMCtrl::processRespondEvent()
// track if this is the last packet before idling
// and that there are no outstanding commands to this rank
if (dram_pkt->rankRef.isQueueEmpty() &&
- dram_pkt->rankRef.outstandingEvents == 0) {
+ dram_pkt->rankRef.outstandingEvents == 0 && enableDRAMPowerdown) {
// verify that there are no events scheduled
assert(!dram_pkt->rankRef.activateEvent.scheduled());
assert(!dram_pkt->rankRef.prechargeEvent.scheduled());
@@ -1856,7 +1856,8 @@ DRAMCtrl::Rank::processPrechargeEvent()
if (numBanksActive == 0) {
// no reads to this rank in the Q and no pending
// RD/WR or refresh commands
- if (isQueueEmpty() && outstandingEvents == 0) {
+ if (isQueueEmpty() && outstandingEvents == 0 &&
+ memory.enableDRAMPowerdown) {
// should still be in ACT state since bank still open
assert(pwrState == PWR_ACT);
@@ -2057,7 +2058,7 @@ DRAMCtrl::Rank::processRefreshEvent()
// Force PRE power-down if there are no outstanding commands
// in Q after refresh.
- } else if (isQueueEmpty()) {
+ } else if (isQueueEmpty() && memory.enableDRAMPowerdown) {
// still have refresh event outstanding but there should
// be no other events outstanding
assert(outstandingEvents == 1);
@@ -2328,7 +2329,8 @@ DRAMCtrl::Rank::processPowerEvent()
// will issue refresh immediately upon entry
if (pwrStatePostRefresh == PWR_PRE_PDN && isQueueEmpty() &&
(memory.drainState() != DrainState::Draining) &&
- (memory.drainState() != DrainState::Drained)) {
+ (memory.drainState() != DrainState::Drained) &&
+ memory.enableDRAMPowerdown) {
DPRINTF(DRAMState, "Rank %d bypassing refresh and transitioning "
"to self refresh at %11u tick\n", rank, curTick());
powerDownSleep(PWR_SREF, curTick());