precharge all checker, redesign of powerndown manager

This commit is contained in:
robert
2014-04-04 01:16:44 +02:00
47 changed files with 1179 additions and 213 deletions

View File

@@ -19,7 +19,7 @@ const ScheduledCommand ControllerState::getLastCommand(Command command)
{
ScheduledCommand max;
for (unsigned int i = 0; i < bankStates.getNumberOfBanks(); ++i)
for (unsigned int i = 0; i < config->NumberOfBanks; ++i)
{
ScheduledCommand current = getLastCommand(command, Bank(i));
if (current.getStart() > max.getStart())
@@ -31,18 +31,20 @@ const ScheduledCommand ControllerState::getLastCommand(Command command)
const ScheduledCommand ControllerState::getLastScheduledCommand(Bank bank)
{
ScheduledCommand lastCommand;
for (std::map<Command, std::map<Bank, ScheduledCommand> >::iterator it =
lastCommandsOnBus.begin(); it != lastCommandsOnBus.end(); ++it)
for(Command cmd : getAllCommands())
{
ScheduledCommand& current = lastCommandsOnBus[it->first][bank];
ScheduledCommand& current = lastCommandsOnBus[cmd][bank];
if (current.getStart() > lastCommand.getStart())
lastCommand = current;
lastCommand = current;
}
return lastCommand;
}
void ControllerState::change(const ScheduledCommand& scheduledCommand)
{
//TODO double check if slot free?
bus.blockSlot(scheduledCommand.getStart());
lastCommandsOnBus[scheduledCommand.getCommand()][scheduledCommand.getBank()] = scheduledCommand;