diff --git a/DRAMSys/simulator/src/controller/core/scheduling/checker/PowerDownChecker.cpp b/DRAMSys/simulator/src/controller/core/scheduling/checker/PowerDownChecker.cpp index 5d95cad2..c9a8a988 100644 --- a/DRAMSys/simulator/src/controller/core/scheduling/checker/PowerDownChecker.cpp +++ b/DRAMSys/simulator/src/controller/core/scheduling/checker/PowerDownChecker.cpp @@ -80,14 +80,17 @@ void PowerDownChecker::delayToSatisfyConstraints(ScheduledCommand &command) cons // Get the last scheduled command on this bank ScheduledCommand lastSchedCmdOnBank = state.getLastScheduledCommand(bank); - // 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(); - timeConstraint = getTimeConstraintToEnterPowerDown(lastCmdBank, pdnCmd); + 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(); - command.establishMinDistanceFromStart(lastSchedCmdOnBankStart, timeConstraint); + timeConstraint = getTimeConstraintToEnterPowerDown(lastCmdBank, pdnCmd); + + command.establishMinDistanceFromStart(lastSchedCmdOnBankStart, timeConstraint); + } } else if (pdnCmd == Command::PDNAX) { // Leaving Active Power Down