checker refactoring
This commit is contained in:
81
dram/src/core/scheduling/ScheduledCommand.cpp
Normal file
81
dram/src/core/scheduling/ScheduledCommand.cpp
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user