diff options
author | Omar Naji <Omar.Naji@arm.com> | 2014-10-20 18:03:55 -0400 |
---|---|---|
committer | Omar Naji <Omar.Naji@arm.com> | 2014-10-20 18:03:55 -0400 |
commit | a4a8568bd2e3300b5dc9d3deee5181a7db2a76c7 (patch) | |
tree | 9fc8a85d2a0ee2a9abf56767c1cb56f040623319 /src/mem | |
parent | 77f8f5d94cf9f2994f544dba14f4432ff4f3287f (diff) | |
download | gem5-a4a8568bd2e3300b5dc9d3deee5181a7db2a76c7.tar.xz |
mem: Fix DRAM activationlLimit bug
Ensure that we do the proper event scheduling also when the activation
limit is disabled.
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/dram_ctrl.cc | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/mem/dram_ctrl.cc b/src/mem/dram_ctrl.cc index c9d944faa..f65f7e1dd 100644 --- a/src/mem/dram_ctrl.cc +++ b/src/mem/dram_ctrl.cc @@ -917,35 +917,38 @@ DRAMCtrl::activateBank(Bank& bank, Tick act_tick, uint32_t row) } // next, we deal with tXAW, if the activation limit is disabled - // then we are done - if (actTicks[rank].empty()) - return; - - // sanity check - if (actTicks[rank].back() && (act_tick - actTicks[rank].back()) < tXAW) { - panic("Got %d activates in window %d (%llu - %llu) which is smaller " - "than %llu\n", activationLimit, act_tick - actTicks[rank].back(), - act_tick, actTicks[rank].back(), tXAW); - } - - // shift the times used for the book keeping, the last element - // (highest index) is the oldest one and hence the lowest value - actTicks[rank].pop_back(); - - // record an new activation (in the future) - actTicks[rank].push_front(act_tick); + // then we directly schedule an activate power event + if (!actTicks[rank].empty()) { + // sanity check + if (actTicks[rank].back() && + (act_tick - actTicks[rank].back()) < tXAW) { + panic("Got %d activates in window %d (%llu - %llu) which " + "is smaller than %llu\n", activationLimit, act_tick - + actTicks[rank].back(), act_tick, actTicks[rank].back(), + tXAW); + } - // cannot activate more than X times in time window tXAW, push the - // next one (the X + 1'st activate) to be tXAW away from the - // oldest in our window of X - if (actTicks[rank].back() && (act_tick - actTicks[rank].back()) < tXAW) { - DPRINTF(DRAM, "Enforcing tXAW with X = %d, next activate no earlier " - "than %llu\n", activationLimit, actTicks[rank].back() + tXAW); + // shift the times used for the book keeping, the last element + // (highest index) is the oldest one and hence the lowest value + actTicks[rank].pop_back(); + + // record an new activation (in the future) + actTicks[rank].push_front(act_tick); + + // cannot activate more than X times in time window tXAW, push the + // next one (the X + 1'st activate) to be tXAW away from the + // oldest in our window of X + if (actTicks[rank].back() && + (act_tick - actTicks[rank].back()) < tXAW) { + DPRINTF(DRAM, "Enforcing tXAW with X = %d, next activate " + "no earlier than %llu\n", activationLimit, + actTicks[rank].back() + tXAW); for(int j = 0; j < banksPerRank; j++) // next activate must not happen before end of window banks[rank][j].actAllowedAt = std::max(actTicks[rank].back() + tXAW, banks[rank][j].actAllowedAt); + } } // at the point when this activate takes place, make sure we |