From 4372084a59dc50ba62ec0bef184872fb5e071c4f Mon Sep 17 00:00:00 2001 From: "Felipe S. Prado" Date: Mon, 26 Nov 2018 18:04:51 +0100 Subject: [PATCH] PowerDownChecker fixed --- .../scheduling/checker/PowerDownChecker.cpp | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/DRAMSys/library/src/controller/core/scheduling/checker/PowerDownChecker.cpp b/DRAMSys/library/src/controller/core/scheduling/checker/PowerDownChecker.cpp index 6e066b61..6b92cd96 100644 --- a/DRAMSys/library/src/controller/core/scheduling/checker/PowerDownChecker.cpp +++ b/DRAMSys/library/src/controller/core/scheduling/checker/PowerDownChecker.cpp @@ -93,18 +93,26 @@ const // PDNP - Precharge Power Down // SREF - Self Refresh - // Get the last scheduled command on this bank - ScheduledCommand lastSchedCmdOnBank = state.getLastScheduledCommand(bank); + // Get the last scheduled command + ScheduledCommand lastSchedCmd; + if(Configuration::getInstance().BankwiseLogic) + { + lastSchedCmd = state.getLastScheduledCommand(bank); + } + else + { + lastSchedCmd = state.getLastScheduledCommand(); + } - if (lastSchedCmdOnBank.isValidCommand()) { - // Get the start time for the last scheduled command on this bank - sc_time lastSchedCmdOnBankStart = lastSchedCmdOnBank.getStart(); - // Get the last command on this bank itself - Command lastCmdBank = lastSchedCmdOnBank.getCommand(); + if (lastSchedCmd.isValidCommand()) { + // Get the start time for the last scheduled command + sc_time lastSchedCmdStart = lastSchedCmd.getStart(); + // Get the last command + Command lastCmd = lastSchedCmd.getCommand(); - timeConstraint = getTimeConstraintToEnterPowerDown(lastCmdBank, pdnCmd); + timeConstraint = getTimeConstraintToEnterPowerDown(lastCmd, pdnCmd); - command.establishMinDistanceFromStart(lastSchedCmdOnBankStart, timeConstraint); + command.establishMinDistanceFromStart(lastSchedCmdStart, timeConstraint); } } else if (pdnCmd == Command::PDNAX) {