checker refactoring

This commit is contained in:
robert
2014-03-30 15:26:18 +02:00
parent 75a5dca81e
commit 9f97e77db4
18 changed files with 201 additions and 172 deletions

View File

@@ -0,0 +1,81 @@
/*
* ScheduledCommand.cpp
*
* Created on: Mar 30, 2014
* Author: robert
*/
#include "ScheduledCommand.h"
#include "../utils/Utils.h"
namespace core {
bool ScheduledCommand::isNoCommand() const
{
return (command == Command::NOP && start == SC_ZERO_TIME && executionTime == SC_ZERO_TIME && end == SC_ZERO_TIME);
}
bool ScheduledCommand::isValidCommand() const
{
return !isNoCommand();
}
const sc_time ScheduledCommand::getStart() const
{
return start;
}
void ScheduledCommand::setStart(sc_time newStart)
{
start = newStart;
end = newStart + executionTime;
}
void ScheduledCommand::delayStart(sc_time delay)
{
setStart(start+delay);
}
void ScheduledCommand::delayToMeetConstraint(sc_time previous, sc_time constraint)
{
delayStart(getDelayToMeetConstraint(previous, start, constraint));
}
const sc_time ScheduledCommand::getEnd() const
{
return end;
}
const Command ScheduledCommand::getCommand() const
{
return command;
}
const sc_time ScheduledCommand::getExecutionTime() const
{
return executionTime;
}
Bank ScheduledCommand::getBank() const
{
return extension.getBank();
}
Row ScheduledCommand::getRow() const
{
return extension.getRow();
}
unsigned int ScheduledCommand::getBurstLength()
{
return burstLength;
}
bool ScheduledCommand::operator ==(const ScheduledCommand& b) const
{
return b.command == command && b.start == start && b.executionTime == executionTime && b.end == end;
}
}