Merge branch '216-bug-in-powerdownchecker' into 'master'

Resolve "Bug in PowerDownChecker"

Closes #216

See merge request ems/astdm/dram.sys!221
This commit is contained in:
Matthias Jung
2019-02-08 11:03:06 +01:00

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