mem: Fix DRAM activationlLimit bug

Ensure that we do the proper event scheduling also when the activation
limit is disabled.
This commit is contained in:
Omar Naji 2014-10-20 18:03:55 -04:00
parent 77f8f5d94c
commit a4a8568bd2

View file

@ -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 // next, we deal with tXAW, if the activation limit is disabled
// then we are done // then we directly schedule an activate power event
if (actTicks[rank].empty()) 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);
}
// sanity check // shift the times used for the book keeping, the last element
if (actTicks[rank].back() && (act_tick - actTicks[rank].back()) < tXAW) { // (highest index) is the oldest one and hence the lowest value
panic("Got %d activates in window %d (%llu - %llu) which is smaller " actTicks[rank].pop_back();
"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 // record an new activation (in the future)
// (highest index) is the oldest one and hence the lowest value actTicks[rank].push_front(act_tick);
actTicks[rank].pop_back();
// record an new activation (in the future) // cannot activate more than X times in time window tXAW, push the
actTicks[rank].push_front(act_tick); // next one (the X + 1'st activate) to be tXAW away from the
// oldest in our window of X
// cannot activate more than X times in time window tXAW, push the if (actTicks[rank].back() &&
// next one (the X + 1'st activate) to be tXAW away from the (act_tick - actTicks[rank].back()) < tXAW) {
// oldest in our window of X DPRINTF(DRAM, "Enforcing tXAW with X = %d, next activate "
if (actTicks[rank].back() && (act_tick - actTicks[rank].back()) < tXAW) { "no earlier than %llu\n", activationLimit,
DPRINTF(DRAM, "Enforcing tXAW with X = %d, next activate no earlier " actTicks[rank].back() + tXAW);
"than %llu\n", activationLimit, actTicks[rank].back() + tXAW);
for(int j = 0; j < banksPerRank; j++) for(int j = 0; j < banksPerRank; j++)
// next activate must not happen before end of window // next activate must not happen before end of window
banks[rank][j].actAllowedAt = banks[rank][j].actAllowedAt =
std::max(actTicks[rank].back() + tXAW, std::max(actTicks[rank].back() + tXAW,
banks[rank][j].actAllowedAt); banks[rank][j].actAllowedAt);
}
} }
// at the point when this activate takes place, make sure we // at the point when this activate takes place, make sure we