From 52a3bc5e5c3cc694b3f8b29f38b0dd296b91350f Mon Sep 17 00:00:00 2001 From: Rizwana Begum Date: Wed, 29 Apr 2015 22:35:22 -0500 Subject: [PATCH] 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 --- src/mem/dram_ctrl.cc | 11 ++++++----- 1 file 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; -- 2.30.2