Invalid commands are ignored.

The data structure that stores last commands is initialized with NOPs. So it
is possible to get a NOP as return of state.getLastScheduledCommand(bank).
This commit is contained in:
Éder F. Zulian
2016-02-02 17:01:54 -02:00
parent bf26adca22
commit 38e0829360

View File

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