30 lines
542 B
C++
30 lines
542 B
C++
/*
|
|
* BusChecker.cpp
|
|
*
|
|
* Created on: Mar 21, 2014
|
|
* Author: jonny
|
|
*/
|
|
|
|
#include "BusChecker.h"
|
|
|
|
namespace core {
|
|
|
|
void BusChecker::findSlotOnBus(ScheduledCommand& command)
|
|
{
|
|
sc_time newStart = command.getStart();
|
|
|
|
sc_assert(isClkAligned(newStart, config.Timings.clk));
|
|
std::set<sc_time>::iterator it = state.pendingBusCommands.begin();
|
|
|
|
while (it != state.pendingBusCommands.end() && *it <= newStart)
|
|
{
|
|
if (*it == newStart)
|
|
newStart += config.Timings.clk;
|
|
++it;
|
|
}
|
|
command.setStart(newStart);
|
|
}
|
|
|
|
} /* namespace core */
|
|
|