32 lines
830 B
C++
32 lines
830 B
C++
/*
|
|
* CommandSequenceScheduler.cpp
|
|
*
|
|
* Created on: Mar 9, 2014
|
|
* Author: jonny
|
|
*/
|
|
|
|
#include "core/scheduling/CommandSequenceScheduler.h"
|
|
#include "core/Controller.h"
|
|
|
|
namespace controller {
|
|
|
|
CommandSchedule CommandSequenceScheduler::prepareSchedule(sc_time start,
|
|
tlm::tlm_generic_payload& transaction, CommandSequence commands)
|
|
{
|
|
CommandSchedule schedule(transaction);
|
|
for (unsigned int i = 0; i < commands.size(); ++i)
|
|
{
|
|
Command command = commands.at(i);
|
|
const ICommandChecker& checker = controller.getChecker(command);
|
|
|
|
if (i > 0)
|
|
start = schedule.getEnd();
|
|
sc_time executionTime(checker.getExecutionTime(transaction, command));
|
|
ScheduledCommand& scheduledCommand = schedule.add(command, start, executionTime);
|
|
checker.check(scheduledCommand);
|
|
}
|
|
return schedule;
|
|
}
|
|
|
|
} /* namespace controller */
|