summaryrefslogtreecommitdiff
path: root/src/mem/dram_ctrl.cc
diff options
context:
space:
mode:
authorRizwana Begum <rb639@drexel.edu>2015-04-29 22:35:22 -0500
committerRizwana Begum <rb639@drexel.edu>2015-04-29 22:35:22 -0500
commit52a3bc5e5c3cc694b3f8b29f38b0dd296b91350f (patch)
tree21b0d8677477623a3ae34f659175cba278e381e3 /src/mem/dram_ctrl.cc
parent3a2731fb8cb0bcb152979fb41ba23ce2b981444f (diff)
downloadgem5-52a3bc5e5c3cc694b3f8b29f38b0dd296b91350f.tar.xz
mem: Simplify page close checks for adaptive policies
Both open_adaptive and close_adaptive page polices keep the page open if a row hit is found. If a row hit is not found, close_adaptive page policy precharges the row, and open_adaptive policy precharges the row only if there is a bank conflict request waiting in the queue. This patch makes the checks for above conditions simpler. Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/mem/dram_ctrl.cc')
-rw-r--r--src/mem/dram_ctrl.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mem/dram_ctrl.cc b/src/mem/dram_ctrl.cc
index 23eba158d..733a7390f 100644
--- a/src/mem/dram_ctrl.cc
+++ b/src/mem/dram_ctrl.cc
@@ -1174,11 +1174,12 @@ DRAMCtrl::doDRAMAccess(DRAMPacket* dram_pkt)
// currently dealing with (which is the head of the queue)
++p;
- // keep on looking until we have found required condition or
- // reached the end
- while (!(got_more_hits &&
- (got_bank_conflict || pageMgmt == Enums::close_adaptive)) &&
- p != queue.end()) {
+ // keep on looking until we find a hit or reach the end of the queue
+ // 1) if a hit is found, then both open and close adaptive policies keep
+ // the page open
+ // 2) if no hit is found, got_bank_conflict is set to true if a bank
+ // conflict request is waiting in the queue
+ while (!got_more_hits && p != queue.end()) {
bool same_rank_bank = (dram_pkt->rank == (*p)->rank) &&
(dram_pkt->bank == (*p)->bank);
bool same_row = dram_pkt->row == (*p)->row;