PowerDownChecker fixed

This commit is contained in:
Felipe S. Prado
2018-11-26 18:04:51 +01:00
parent 97a5b3e8d1
commit 4372084a59

View File

@@ -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) {