checker refactoring
This commit is contained in:
@@ -12,27 +12,26 @@ namespace core {
|
||||
|
||||
void WriteChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
|
||||
{
|
||||
if(command.getStart() >= sc_time(62885689,SC_NS))
|
||||
{
|
||||
int i = 5;
|
||||
i++;
|
||||
}
|
||||
assert(command.getCommand() == Command::Write || command.getCommand() == Command::WriteA);
|
||||
|
||||
ScheduledCommand lastCommandOnBank = state.getLastScheduledCommand(command.getBank());
|
||||
ScheduledCommand lastCommand = state.getLastScheduledCommand(command.getBank());
|
||||
|
||||
if (lastCommandOnBank.isValidCommand())
|
||||
if (lastCommand.isValidCommand())
|
||||
{
|
||||
if (lastCommandOnBank.getCommand() == Command::Activate)
|
||||
if (lastCommand.getCommand() == Command::Activate)
|
||||
{
|
||||
command.delayStart(getDelayToMeetConstraint(lastCommandOnBank.getEnd(),command.getStart(), SC_ZERO_TIME));
|
||||
if (command.getStart() < lastCommand.getEnd())
|
||||
{
|
||||
command.setStart(lastCommand.getEnd());
|
||||
}
|
||||
}
|
||||
else if (lastCommandOnBank.getCommand() == Command::Read
|
||||
|| lastCommandOnBank.getCommand() == Command::Write)
|
||||
else if (lastCommand.getCommand() == Command::Read
|
||||
|| lastCommand.getCommand() == Command::Write)
|
||||
{
|
||||
}
|
||||
else
|
||||
reportFatal("Write Checker", "Write can not follow " + commandToString(lastCommandOnBank.getCommand()));
|
||||
reportFatal("Write Checker",
|
||||
"Write can not follow " + commandToString(lastCommand.getCommand()));
|
||||
}
|
||||
|
||||
while (!state.bus.isFree(command.getStart()) || collidesOnDataStrobe(command))
|
||||
@@ -47,11 +46,12 @@ sc_time WriteChecker::getExecutionTime(const tlm::tlm_generic_payload& payload,
|
||||
assert(command == Command::Write || command == Command::WriteA);
|
||||
if (command == Command::Write)
|
||||
{
|
||||
return config.Timings.tWL + config.Timings.clk * (payload.get_streaming_width()-1);
|
||||
return config.Timings.tWL + config.Timings.clk * (payload.get_streaming_width() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return config.Timings.tWL + config.Timings.clk * (payload.get_streaming_width()-1) + config.Timings.tRP;
|
||||
return config.Timings.tWL + config.Timings.clk * (payload.get_streaming_width() - 1)
|
||||
+ config.Timings.tRP;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,8 @@ bool WriteChecker::collidesOnDataStrobe(ScheduledCommand& write) const
|
||||
bool WriteChecker::collidesWithStrobeCommand(ScheduledCommand& write,
|
||||
ScheduledCommand& strobeCommand) const
|
||||
{
|
||||
if (strobeCommand.getCommand() == Command::Write || strobeCommand.getCommand() == Command::WriteA)
|
||||
if (strobeCommand.getCommand() == Command::Write
|
||||
|| strobeCommand.getCommand() == Command::WriteA)
|
||||
{
|
||||
//write to write (implicitly checked by checking the command bus first)
|
||||
return false;
|
||||
@@ -80,7 +81,8 @@ bool WriteChecker::collidesWithStrobeCommand(ScheduledCommand& write,
|
||||
//write to read
|
||||
if (strobeCommand.getStart() >= write.getStart())
|
||||
{
|
||||
return !(strobeCommand.getStart()>= getIntervalOnDataStrobe(write, config.Timings).end + config.Timings.tWTR);
|
||||
return !(strobeCommand.getStart()
|
||||
>= getIntervalOnDataStrobe(write, config.Timings).end + config.Timings.tWTR);
|
||||
}
|
||||
|
||||
//read to write
|
||||
|
||||
Reference in New Issue
Block a user