OpenASIP
2.0
|
#include <ExecutionPipeline.hh>
Public Types | |
typedef std::set< int > | OperandSet |
Set for operand indexes. More... | |
typedef std::set< PipelineElement *, PipelineElement::Comparator > | ResourceSet |
Set for pipeline elements. More... | |
Public Member Functions | |
ExecutionPipeline (HWOperation &parentOperation) | |
virtual | ~ExecutionPipeline () |
const HWOperation * | parentOperation () const |
void | addResourceUse (const std::string &name, int start, int duration) |
void | addPortRead (int operand, int start, int duration) |
void | addPortWrite (int operand, int start, int duration) |
void | removeResourceUse (const std::string &name) |
void | removeResourceUse (const std::string &name, int cycle) |
void | removeAllResourceUses () |
void | removeOperandUse (int operand, int cycle) |
bool | isResourceUsed (const std::string &name, int cycle) const |
ResourceSet | resourceUsages (int cycle) const |
bool | isPortUsed (const FUPort &port, int cycle) const |
bool | isPortRead (const FUPort &port, int cycle) const |
bool | isPortWritten (const FUPort &port, int cycle) const |
OperandSet | readOperands (int cycle) const |
OperandSet | writtenOperands (int cycle) const |
OperandSet | readOperands () const |
OperandSet | writtenOperands () const |
int | latency () const |
int | latency (int output) const |
int | slack (int input) const |
ObjectState * | saveState () const |
void | loadState (const ObjectState *state) |
bool | isArchitectureEqual (const ExecutionPipeline *pipeline) const |
Public Member Functions inherited from Serializable | |
virtual | ~Serializable () |
Static Public Attributes | |
static const std::string | OSNAME_PIPELINE = "pipeline" |
ObjectState name for ExecutionPipeline. More... | |
static const std::string | OSNAME_RESOURCE_USAGE = "resource_usage" |
ObjectState name for pipeline resource usage. More... | |
static const std::string | OSNAME_OPERAND_READ = "op_read" |
ObjectState name for operand read. More... | |
static const std::string | OSNAME_OPERAND_WRITE = "op_write" |
ObjectState name for operand write. More... | |
static const std::string | OSKEY_RESOURCE_NAME = "res_name" |
ObjectState attribute key for name of resource. More... | |
static const std::string | OSKEY_OPERAND = "operand" |
ObjectState attribute key for operand number. More... | |
static const std::string | OSKEY_START_CYCLE = "start_cycle" |
ObjectState attribute key for start cycle of a resource usage. More... | |
static const std::string | OSKEY_CYCLES = "cycles" |
ObjectState attribute key for duration of a resource usage. More... | |
Private Types | |
typedef std::vector< const ObjectState * > | ObjectStateTable |
Vector for ObjectState pointers. More... | |
typedef std::vector< ResourceSet > | ResourceUsage |
Vector for resource sets. More... | |
typedef std::vector< OperandSet > | IOUsage |
Vector for operand sets. More... | |
Private Member Functions | |
void | checkStartCycle (int startCycle) const |
void | checkInputOperand (int operand) const |
void | checkOutputOperand (int operand) const |
void | checkResourceAvailability (const std::string &resource, int start, int duration) const |
void | checkOperandAvailability (int operand, int start, int duration) const |
void | internalAddResourceUse (const std::string &name, int start, int duration) |
void | internalAddPortUse (int operand, int start, int duration, IOUsage &toModify) |
void | internalRemoveResourceUse (const std::string &name, int start, int duration) |
void | internalRemoveOperandUse (int operand, int start, int duration) |
void | adjustLatency (int newLatency) |
bool | isOperandBound (const FUPort &port, const OperandSet &operands) const |
bool | isOperandWritten (int operand) const |
bool | isOperandRead (int operand) const |
int | firstCycle () const |
int | firstCycleWithoutResource (const std::string &resource) const |
int | firstCycleWithoutResource (const std::string &resource, int cycle) const |
int | firstCycleWithoutOperandUse (int operand, int cycle) const |
ResourceSet | usedResources () const |
PipelineElement * | pipelineElement (const std::string &name) const |
PipelineElement * | addPipelineElement (const std::string &name) const |
ObjectStateTable | sortResourceUsages (const ObjectState *pipelineState) const |
void | addResourceUsage (ObjectStateTable &usages, const ObjectState *usageState) const |
Static Private Member Functions | |
static void | checkDuration (int duration) |
static void | checkResourceName (const std::string &name) |
static void | saveResourceUse (const PipelineElement *element, int cycleToSave, ObjectState *pipelineState) |
static void | saveOperandUse (int operand, int cycleToSave, ObjectState *pipelineState, const std::string &osName) |
Private Attributes | |
ResourceUsage | resourceUsage_ |
Resource usage. More... | |
IOUsage | opReads_ |
Operand reads. More... | |
IOUsage | opWrites_ |
Operand writes. More... | |
HWOperation * | parent_ |
The parent operation. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from TTAMachine::SubComponent | |
SubComponent () | |
virtual | ~SubComponent () |
Protected Member Functions inherited from TTAMachine::MachinePart | |
MachinePart () | |
virtual | ~MachinePart () |
Represents an execution pipeline in function unit.
Definition at line 55 of file ExecutionPipeline.hh.
|
private |
Vector for operand sets.
Definition at line 120 of file ExecutionPipeline.hh.
|
private |
Vector for ObjectState pointers.
Definition at line 115 of file ExecutionPipeline.hh.
typedef std::set<int> TTAMachine::ExecutionPipeline::OperandSet |
Set for operand indexes.
Definition at line 58 of file ExecutionPipeline.hh.
typedef std::set<PipelineElement*,PipelineElement::Comparator> TTAMachine::ExecutionPipeline::ResourceSet |
Set for pipeline elements.
Definition at line 60 of file ExecutionPipeline.hh.
|
private |
Vector for resource sets.
Definition at line 118 of file ExecutionPipeline.hh.
TTAMachine::ExecutionPipeline::ExecutionPipeline | ( | HWOperation & | parentOperation | ) |
Constructor.
parentOperation | The parent operation which uses the pipeline. |
Definition at line 68 of file ExecutionPipeline.cc.
References assert, parentOperation(), and TTAMachine::HWOperation::pipeline().
|
virtual |
Destructor.
Definition at line 79 of file ExecutionPipeline.cc.
References removeAllResourceUses().
|
private |
Creates a pipeline element by the given name.
name | The name of the pipeline element. |
Definition at line 1272 of file ExecutionPipeline.cc.
References TTAMachine::FunctionUnit::hasPipelineElement(), parent_, TTAMachine::HWOperation::parentUnit(), and TTAMachine::FunctionUnit::pipelineElement().
Referenced by internalAddResourceUse().
void TTAMachine::ExecutionPipeline::addPortRead | ( | int | operand, |
int | start, | ||
int | duration | ||
) |
Adds read usage of an operand.
operand | The operand to be read. |
start | Start cycle of the usage. |
duration | Duration of the usage. |
OutOfRange | If the given cycle is less than 0 or if duration or operand is less than 1. |
WrongOperandType | If the given operand is not an input operand, that is, if a port write is already added with the given operand. |
StartTooLate | If the pipeline does not start by resource usage or operand read at cycle 0 or 1. |
NotAvailable | If the given operand is already read at a cycle in the given time interval. |
Definition at line 141 of file ExecutionPipeline.cc.
References checkDuration(), checkInputOperand(), checkOperandAvailability(), checkStartCycle(), internalAddPortUse(), and opReads_.
Referenced by VectorLSGenerator::addOperation(), HDB::HDBManager::addOperationPipelinesToFUArchitecture(), BlocksMUL::ConfigurePipeline(), BlocksALU::ConfigurePipeline(), BlocksLSU::ConfigurePipeline(), BlocksGCU::ConfigurePipeline(), UniversalMachine::construct(), OpsetDialog::createOperation(), AddGCUCmd::Do(), CostEstimator::ICDecoderEstimatorPlugin::generateControlUnit(), loadState(), OperationDialog::onOperandLClick(), and SmartHWOperation::SmartHWOperation().
void TTAMachine::ExecutionPipeline::addPortWrite | ( | int | operand, |
int | start, | ||
int | duration | ||
) |
Adds write usage of an operand.
operand | The operand to be written. |
start | Start cycle of the usage. |
duration | Duration of the usage. |
OutOfRange | If the given cycle is less than 0 or if duration or operand is less than 1. |
WrongOperandType | If the given operand is not an output operand, that is, if a port read is already added with the given operand. |
NotAvailable | If the given operand is already written at a cycle in the given time interval. |
Definition at line 167 of file ExecutionPipeline.cc.
References checkDuration(), checkOperandAvailability(), checkOutputOperand(), internalAddPortUse(), and opWrites_.
Referenced by VectorLSGenerator::addOperation(), HDB::HDBManager::addOperationPipelinesToFUArchitecture(), BlocksALU::ConfigurePipeline(), BlocksMUL::ConfigurePipeline(), BlocksLSU::ConfigurePipeline(), OpsetDialog::createOperation(), loadState(), OperationDialog::onOperandLClick(), and SmartHWOperation::SmartHWOperation().
|
private |
Adds the given ObjectState instance representing a resource usage to the given set of usages to correct position.
The correct position is determined by the start cycle of the resource usage.
usages | The set of resource usages where to add the given usage. |
usageState | The usageState to add. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 1401 of file ExecutionPipeline.cc.
References Exception::errorMessage(), ObjectState::intAttribute(), and OSKEY_START_CYCLE.
Referenced by sortResourceUsages().
void TTAMachine::ExecutionPipeline::addResourceUse | ( | const std::string & | name, |
int | start, | ||
int | duration | ||
) |
Adds use for the given pipeline element.
If the function unit does not have a pipeline element by the given name the pipeline element is added to the function unit. Pipeline is valid only if it starts at cycle 0 or 1.
name | Name of the pipeline element. |
start | First cycle in which the element is used relative to operation start cycle. |
duration | Number of cycles the element is used. |
OutOfRange | If given start cycle or duration is out of range. |
InvalidName | If the given name is not a valid component name. |
StartTooLate | If the pipeline does not start by resource usage or operand read at cycle 0 or 1. |
NotAvailable | If the given resource is already in use at a cycle in the given time interval. |
Definition at line 112 of file ExecutionPipeline.cc.
References checkDuration(), checkResourceAvailability(), checkResourceName(), checkStartCycle(), and internalAddResourceUse().
Referenced by HDB::HDBManager::addOperationPipelinesToFUArchitecture(), loadState(), and OperationDialog::onResourceLClick().
|
private |
Adjusts the size of usage vectors for the given latency.
If the given latency is greater than the current latency, sizes of the usage vectors are increased. If the given latency is smaller than the current latency (vector size), sizes of the vectors are tried to decrease to match with the given latency. However, if there are non-empty elements in the usage vectors, they are not removed.
newLatency | The new latency. |
Definition at line 1003 of file ExecutionPipeline.cc.
References latency(), opReads_, opWrites_, and resourceUsage_.
Referenced by internalAddPortUse(), internalAddResourceUse(), internalRemoveOperandUse(), and internalRemoveResourceUse().
|
staticprivate |
Checks whether the given value is valid for duration of resource usage.
duration | The duration value. |
OutOfRange | If the value is not in a valid range. |
Definition at line 751 of file ExecutionPipeline.cc.
Referenced by addPortRead(), addPortWrite(), and addResourceUse().
|
private |
Checks whether the given operand is an input operand.
The operand is an input operand if it is read by the pipeline already.
operand | The operand. |
OutOfRange | If the given operand is smaller than 1. |
WrongOperandType | If the operand is written by the pipeline. |
Definition at line 782 of file ExecutionPipeline.cc.
References isOperandWritten().
Referenced by addPortRead().
|
private |
Checks whether the given operand is not read or written at the given time interval.
operand | The operand. |
start | The start cycle. |
duration | Duration of the usage. |
NotAvailable | If the given operand is used at the given time interval. |
Definition at line 858 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), latency(), opReads_, and opWrites_.
Referenced by addPortRead(), and addPortWrite().
|
private |
Checks whether the given operand is an output operand.
The operand is an output operand if it is written by the pipeline already.
operand | The operand. |
OutOfRange | If the given operand is smaller than 1. |
WrongOperandType | If the operand is read by the pipeline. |
Definition at line 804 of file ExecutionPipeline.cc.
References isOperandRead().
Referenced by addPortWrite().
|
private |
Checks whether the given resource is available all the time of the given time interval.
resource | Name of the pipeline resource. |
start | The start cycle. |
duration | Duration of the usage. |
NotAvailable | If the given resource is not available. |
Definition at line 826 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), latency(), pipelineElement(), and resourceUsage_.
Referenced by addResourceUse().
|
staticprivate |
Checks whether the given name is valid for pipeline resource.
name | The name. |
InvalidName | If the name is not valid for pipeline resource. |
Definition at line 765 of file ExecutionPipeline.cc.
References MachineTester::isValidComponentName().
Referenced by addResourceUse().
|
private |
Checks whether the pipeline would start too late if a new resource usage or operand read was added starting at given cycle.
startCycle | The start cycle. |
OutOfRange | If the given cycle is negative. |
StartTooLate | If the pipeline would start too late. |
Definition at line 723 of file ExecutionPipeline.cc.
References latency(), opReads_, and resourceUsage_.
Referenced by addPortRead(), and addResourceUse().
|
private |
Returns the first cycle when a resource is used or a port read by this pipeline.
Returns -1 if no resource is used or port read by this pipeline.
Definition at line 1097 of file ExecutionPipeline.cc.
References latency(), opReads_, and resourceUsage_.
Referenced by firstCycleWithoutOperandUse(), and firstCycleWithoutResource().
|
private |
Returns the first cycle when a resource is used or port read if usage of the given operand is removed from the given cycle.
Returns -1 if no resource is used.
operand | The operand. |
cycle | The cycle. |
Definition at line 1201 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), firstCycle(), latency(), opReads_, and resourceUsage_.
Referenced by removeOperandUse().
|
private |
Returns the first cycle when a resource is used or port read by this pipeline if the given pipeline resource is not used.
Returns -1 if no resource is used or port read.
resource | Name of the pipeline resource. |
Definition at line 1121 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), firstCycle(), latency(), opReads_, pipelineElement(), and resourceUsage_.
Referenced by removeResourceUse().
|
private |
Returns the first cycle when a resource is used or port read if usage of the given resource is removed from the given cycle.
Returns -1 if no resource is used or port read.
resource | Name of the pipeline resource. |
cycle | The cycle when the pipeline resource is not used. |
Definition at line 1156 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), firstCycle(), latency(), opReads_, pipelineElement(), and resourceUsage_.
|
private |
Internally adds use of the given operand.
operand | The operand to add the usage for. |
start | The start cycle of the operand usage. |
duration | Duration of the operand usage. |
toModify | The IOUsage to modify. |
Definition at line 911 of file ExecutionPipeline.cc.
References adjustLatency(), and latency().
Referenced by addPortRead(), and addPortWrite().
|
private |
Internally adds the resource usage of the given resource at the given time interval.
name | Name of the resource. |
start | The start cycle. |
duration | The duration of the usage. |
Definition at line 884 of file ExecutionPipeline.cc.
References addPipelineElement(), adjustLatency(), pipelineElement(), and resourceUsage_.
Referenced by addResourceUse().
|
private |
Internally removes the operand usage of the given operand at the given time interval.
operand | The operand. |
start | The start cycle. |
duration | The duration of the usage to be removed. |
Definition at line 971 of file ExecutionPipeline.cc.
References adjustLatency(), latency(), opReads_, opWrites_, and ContainerTools::removeValueIfExists().
Referenced by removeOperandUse().
|
private |
Internally removes the resource usage of the given resource at the given time interval.
name | Name of the resource. |
start | The start cycle. |
duration | The duration of the usage to be removed. |
Definition at line 936 of file ExecutionPipeline.cc.
References adjustLatency(), TTAMachine::FunctionUnit::cleanup(), latency(), parent_, TTAMachine::HWOperation::parentUnit(), pipelineElement(), ContainerTools::removeValueIfExists(), and resourceUsage_.
Referenced by removeResourceUse().
bool TTAMachine::ExecutionPipeline::isArchitectureEqual | ( | const ExecutionPipeline * | pipeline | ) | const |
Compares two ExecutionPipeline architectures.
pipeline | ExecutionPipeline to compare with. |
Definition at line 693 of file ExecutionPipeline.cc.
References isResourceUsed(), readOperands(), resourceUsage_, and writtenOperands().
|
private |
Checks whether the given port is bound to one of the operands in the given operand set.
port | The port. |
operands | The operands. |
Definition at line 1035 of file ExecutionPipeline.cc.
References parent_, and TTAMachine::HWOperation::port().
Referenced by isPortRead(), and isPortWritten().
|
private |
Checks whether the given operand is read by the pipeline.
operand | The operand. |
Definition at line 1076 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), latency(), and opReads_.
Referenced by checkOutputOperand().
|
private |
Checks whether the given operand is written by the pipeline.
operand | The operand. |
Definition at line 1057 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), latency(), and opWrites_.
Referenced by checkInputOperand().
bool TTAMachine::ExecutionPipeline::isPortRead | ( | const FUPort & | port, |
int | cycle | ||
) | const |
Checks whether the given port is read at the given cycle by the pipeline.
port | The port. |
cycle | The cycle. |
OutOfRange | If the given cycle is negative. |
Definition at line 362 of file ExecutionPipeline.cc.
References isOperandBound(), latency(), opReads_, and readOperands().
Referenced by MachineStateBuilder::addPortToFU(), FullyConnectedCheck::connectFUPort(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), isPortUsed(), AddFUFromHDBDialog::onAdd(), HDB::FUArchitecture::portDirection(), and FUPortImplementationDialog::TransferDataToWindow().
bool TTAMachine::ExecutionPipeline::isPortUsed | ( | const FUPort & | port, |
int | cycle | ||
) | const |
Checks whether the given port is used at the given cycle by the pipeline.
port | The port. |
cycle | The cycle. |
OutOfRange | If the given cycle is negative. |
Definition at line 349 of file ExecutionPipeline.cc.
References isPortRead(), and isPortWritten().
Referenced by ReservationTable::ReservationTable().
bool TTAMachine::ExecutionPipeline::isPortWritten | ( | const FUPort & | port, |
int | cycle | ||
) | const |
Checks whether the given port is written at the given cycle by the pipeline.
port | The port. |
cycle | The cycle. |
OutOfRange | If the given cycle is negative. |
Definition at line 386 of file ExecutionPipeline.cc.
References isOperandBound(), latency(), opWrites_, and writtenOperands().
Referenced by MachineStateBuilder::addPortToFU(), FullyConnectedCheck::connectFUPort(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), isPortUsed(), AddFUFromHDBDialog::onAdd(), HDB::FUArchitecture::portDirection(), and FUPortImplementationDialog::TransferDataToWindow().
bool TTAMachine::ExecutionPipeline::isResourceUsed | ( | const std::string & | name, |
int | cycle | ||
) | const |
Tells whether a given pipeline element is used in the given cycle by this pipeline.
name | Name of the pipeline element. |
cycle | Cycle in which element use is to be tested. |
OutOfRange | If the given cycle is negative. |
Definition at line 300 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), latency(), pipelineElement(), resourceUsage_, and usedResources().
Referenced by HDB::HDBManager::addFUArchitecture(), TTAMachine::FunctionUnit::cleanup(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), HDBToHtml::fuArchToHtml(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), HDB::FUArchitecture::operator==(), ReservationTable::ReservationTable(), OperationDialog::updateResourceGrid(), and OperationDialog::warnOnResourcesWithoutUsages().
int TTAMachine::ExecutionPipeline::latency | ( | ) | const |
Returns the latency of the pipeline.
If the pipeline is totally empty, returns 0.
Definition at line 482 of file ExecutionPipeline.cc.
References assert, opReads_, opWrites_, and resourceUsage_.
Referenced by HDB::HDBManager::addFUArchitecture(), MachineStateBuilder::addPortToFU(), adjustLatency(), checkOperandAvailability(), FUValidator::checkOperandBindings(), FUValidator::checkOperations(), checkResourceAvailability(), checkStartCycle(), TTAMachine::FunctionUnit::cleanup(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), firstCycle(), firstCycleWithoutOperandUse(), firstCycleWithoutResource(), internalAddPortUse(), internalRemoveOperandUse(), internalRemoveResourceUse(), isOperandRead(), isOperandWritten(), isPortRead(), isPortWritten(), isResourceUsed(), TTAMachine::HWOperation::latency(), latency(), OperationDialog::onDeleteOperand(), readOperands(), removeOperandUse(), removeResourceUse(), resourceUsages(), TTAMachine::ResourceVector::ResourceVector(), OperationDialog::updateOperandList(), OperationDialog::updateResourceGrid(), OperationDialog::updateUsageGrid(), usedResources(), OperationDialog::warnOnResourcesWithoutUsages(), and writtenOperands().
int TTAMachine::ExecutionPipeline::latency | ( | int | output | ) | const |
Returns the latency for the given output.
output | The number of the output. |
IllegalParameters | If the given output is not written in the pipeline. |
Definition at line 498 of file ExecutionPipeline.cc.
References __func__, AssocTools::containsKey(), latency(), TTAMachine::HWOperation::name(), TTAMachine::Component::name(), opWrites_, parent_, and TTAMachine::HWOperation::parentUnit().
|
virtual |
Loads the state of pipeline from the given ObjectState tree.
pipelineState | An ObjectState tree representing state of a pipeline. |
ObjectStateLoadingException | If an error occurs while loading state. |
Implements Serializable.
Definition at line 611 of file ExecutionPipeline.cc.
References addPortRead(), addPortWrite(), addResourceUse(), Exception::errorMessage(), ObjectState::intAttribute(), TTAMachine::HWOperation::name(), ObjectState::name(), TTAMachine::Component::name(), OSKEY_CYCLES, OSKEY_OPERAND, OSKEY_RESOURCE_NAME, OSKEY_START_CYCLE, OSNAME_OPERAND_READ, OSNAME_OPERAND_WRITE, OSNAME_PIPELINE, OSNAME_RESOURCE_USAGE, parent_, TTAMachine::HWOperation::parentUnit(), removeAllResourceUses(), sortResourceUsages(), ObjectState::stringAttribute(), Texts::TextGenerator::text(), MOMTextGenerator::TXT_INVALID_NAME, MOMTextGenerator::TXT_PIPELINE_NOT_CANONICAL, MOMTextGenerator::TXT_PIPELINE_START_TOO_LATE, and MOMTextGenerator::TXT_PORT_READ_AND_WRITTEN_BY_PIPELINE.
Referenced by TTAMachine::HWOperation::loadState().
const HWOperation * TTAMachine::ExecutionPipeline::parentOperation | ( | ) | const |
Returns the parent HWOperation.
Definition at line 89 of file ExecutionPipeline.cc.
References parent_.
Referenced by ExecutionPipeline(), and TTAMachine::ResourceVector::ResourceVector().
|
private |
Returns the pipeline element by the given name.
name | The name. |
Definition at line 1259 of file ExecutionPipeline.cc.
References parent_, TTAMachine::HWOperation::parentUnit(), and TTAMachine::FunctionUnit::pipelineElement().
Referenced by checkResourceAvailability(), firstCycleWithoutResource(), internalAddResourceUse(), internalRemoveResourceUse(), isResourceUsed(), and removeResourceUse().
ExecutionPipeline::OperandSet TTAMachine::ExecutionPipeline::readOperands | ( | ) | const |
Returns a set of operands that are read by this pipeline.
Definition at line 448 of file ExecutionPipeline.cc.
References latency().
Referenced by isArchitectureEqual(), and isPortRead().
ExecutionPipeline::OperandSet TTAMachine::ExecutionPipeline::readOperands | ( | int | cycle | ) | const |
Returns the operands that are read at the given cycle.
cycle | The cycle. |
OutOfRange | If the cycle is smaller than 0. |
Definition at line 408 of file ExecutionPipeline.cc.
References latency(), and opReads_.
Referenced by HDB::HDBManager::addFUArchitecture(), OperationBindingCheck::check(), FUValidator::checkOperandBindings(), FUValidator::checkOperations(), ADFCombiner::connectVectorLSU(), llvm::LLVMTCEBuilder::emitOperationMacro(), HDBToHtml::fuArchToHtml(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), OperationDialog::onDeleteOperand(), OperationDialog::onOperandLClick(), HDB::FUArchitecture::operator==(), TTAMachine::ResourceVector::ResourceVector(), OperationDialog::updateOperandList(), and OperationDialog::updateUsageGrid().
void TTAMachine::ExecutionPipeline::removeAllResourceUses | ( | ) |
Removes the all the usages of resources.
Definition at line 243 of file ExecutionPipeline.cc.
References TTAMachine::FunctionUnit::cleanup(), opReads_, opWrites_, parent_, TTAMachine::HWOperation::parentUnit(), resourceUsage_, and usedResources().
Referenced by loadState(), and ~ExecutionPipeline().
void TTAMachine::ExecutionPipeline::removeOperandUse | ( | int | operand, |
int | cycle | ||
) |
Removes reads and writes of the given operand at the given cycle.
operand | The operand. |
cycle | The cycle. |
OutOfRange | If the given cycle is less than 0 or the given operand is smaller than 1. |
StartTooLate | If the pipeline does not start by resource usage or operand read at cycle 0 or 1. |
Definition at line 272 of file ExecutionPipeline.cc.
References firstCycleWithoutOperandUse(), internalRemoveOperandUse(), and latency().
Referenced by OperationDialog::onDeleteOperand(), and OperationDialog::onOperandLClick().
void TTAMachine::ExecutionPipeline::removeResourceUse | ( | const std::string & | name | ) |
Removes any usage of given pipeline element in the pipeline.
name | Name of the pipeline element. |
StartTooLate | If the pipeline does not start by resource usage or operand read at cycle 0 or 1. |
Definition at line 189 of file ExecutionPipeline.cc.
References firstCycleWithoutResource(), TTAMachine::FunctionUnit::hasPipelineElement(), internalRemoveResourceUse(), latency(), parent_, and TTAMachine::HWOperation::parentUnit().
Referenced by OperationDialog::onResourceLClick(), and TTAMachine::PipelineElement::~PipelineElement().
void TTAMachine::ExecutionPipeline::removeResourceUse | ( | const std::string & | name, |
int | cycle | ||
) |
Removes any usage of given pipeline element in given cycle from the pipeline.
name | Name of the pipeline element. |
cycle | Cycle in which element use is to be removed. |
OutOfRange | If the given cycle is negative. |
StartTooLate | If the pipeline does not start by resource usage or operand read at cycle 0 or 1. |
Definition at line 215 of file ExecutionPipeline.cc.
References firstCycleWithoutResource(), internalRemoveResourceUse(), latency(), and pipelineElement().
ExecutionPipeline::ResourceSet TTAMachine::ExecutionPipeline::resourceUsages | ( | int | cycle | ) | const |
Returns the resource usages in the given cycle.
cycle | Cycle of which resource usages to return. |
OutOfRange | If the given cycle is negative. |
Definition at line 327 of file ExecutionPipeline.cc.
References latency(), and resourceUsage_.
Referenced by TTAMachine::ResourceVector::ResourceVector().
|
staticprivate |
Saves use of an operand to ObjectState tree.
operand | The operand. |
cycleToSave | The cycle to save. |
pipelineState | ObjectState instance representing the state of the pipeline. |
osName | Name of the ObjectState instance in which to save the operand use. |
Definition at line 1334 of file ExecutionPipeline.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childCount(), ObjectState::intAttribute(), ObjectState::name(), OSKEY_CYCLES, OSKEY_OPERAND, OSKEY_START_CYCLE, and ObjectState::setAttribute().
Referenced by saveState().
|
staticprivate |
Saves usage of a pipeline element to ObjectState tree.
element | The pipelineElement used. |
cycleToSave | The cycle to save. |
pipelineState | ObjectState instance representing the state of the pipeline. |
Definition at line 1290 of file ExecutionPipeline.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childCount(), ObjectState::intAttribute(), TTAMachine::PipelineElement::name(), ObjectState::name(), OSKEY_CYCLES, OSKEY_RESOURCE_NAME, OSKEY_START_CYCLE, OSNAME_RESOURCE_USAGE, ObjectState::setAttribute(), and ObjectState::stringAttribute().
Referenced by saveState().
|
virtual |
Saves the pipeline to ObjectState tree.
Implements Serializable.
Definition at line 551 of file ExecutionPipeline.cc.
References opReads_, opWrites_, OSNAME_OPERAND_READ, OSNAME_OPERAND_WRITE, OSNAME_PIPELINE, resourceUsage_, saveOperandUse(), and saveResourceUse().
Referenced by TTAMachine::HWOperation::saveState().
int TTAMachine::ExecutionPipeline::slack | ( | int | input | ) | const |
Returns the slack of the given input.
The slack tells how many cycles AFTER the trigger, opcode-setting move is scheduled, can the operand be scheduled (and still affect correctly the result of the operation).
input | The number of the input. |
IllegalParameters | If the given input is not read in the pipeline. |
Definition at line 528 of file ExecutionPipeline.cc.
References AssocTools::containsKey(), TTAMachine::HWOperation::name(), TTAMachine::Component::name(), opReads_, parent_, and TTAMachine::HWOperation::parentUnit().
Referenced by TTAMachine::HWOperation::slack().
|
private |
Sorts the resource and operand usages by the start cycle of the usage.
pipelineState | An ObjectState instance representing an execution pipeline. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 1378 of file ExecutionPipeline.cc.
References addResourceUsage(), ObjectState::child(), and ObjectState::childCount().
Referenced by loadState().
|
private |
Returns the pipeline resources used by this pipeline.
Definition at line 1238 of file ExecutionPipeline.cc.
References latency(), and resourceUsage_.
Referenced by isResourceUsed(), and removeAllResourceUses().
ExecutionPipeline::OperandSet TTAMachine::ExecutionPipeline::writtenOperands | ( | ) | const |
Returns a set of operands that are written by this pipeline.
Definition at line 464 of file ExecutionPipeline.cc.
References latency().
Referenced by isArchitectureEqual(), and isPortWritten().
ExecutionPipeline::OperandSet TTAMachine::ExecutionPipeline::writtenOperands | ( | int | cycle | ) | const |
Returns the operands that are written at the given cycle.
cycle | The cycle. |
OutOfRange | If the given cycle is smaller than 0. |
Definition at line 429 of file ExecutionPipeline.cc.
References latency(), and opWrites_.
Referenced by HDB::HDBManager::addFUArchitecture(), OperationBindingCheck::check(), FUValidator::checkOperandBindings(), ADFCombiner::connectVectorLSU(), llvm::LLVMTCEBuilder::emitOperationMacro(), ExecutionPipelineResourceTable::ExecutionPipelineResourceTable(), HDBToHtml::fuArchToHtml(), isArchitectureEqual(), HDB::HDBManager::isMatchingArchitecture(), OperationDialog::onDeleteOperand(), OperationDialog::onOperandLClick(), HDB::FUArchitecture::operator==(), TTAMachine::ResourceVector::ResourceVector(), OperationDialog::updateOperandList(), and OperationDialog::updateUsageGrid().
|
private |
Operand reads.
Definition at line 176 of file ExecutionPipeline.hh.
Referenced by addPortRead(), adjustLatency(), checkOperandAvailability(), checkStartCycle(), firstCycle(), firstCycleWithoutOperandUse(), firstCycleWithoutResource(), internalRemoveOperandUse(), isOperandRead(), isPortRead(), latency(), readOperands(), removeAllResourceUses(), saveState(), and slack().
|
private |
Operand writes.
Definition at line 178 of file ExecutionPipeline.hh.
Referenced by addPortWrite(), adjustLatency(), checkOperandAvailability(), internalRemoveOperandUse(), isOperandWritten(), isPortWritten(), latency(), removeAllResourceUses(), saveState(), and writtenOperands().
|
static |
ObjectState attribute key for duration of a resource usage.
Definition at line 111 of file ExecutionPipeline.hh.
Referenced by loadState(), saveOperandUse(), and saveResourceUse().
|
static |
ObjectState attribute key for operand number.
Definition at line 107 of file ExecutionPipeline.hh.
Referenced by loadState(), and saveOperandUse().
|
static |
ObjectState attribute key for name of resource.
Definition at line 105 of file ExecutionPipeline.hh.
Referenced by loadState(), and saveResourceUse().
|
static |
ObjectState attribute key for start cycle of a resource usage.
Definition at line 109 of file ExecutionPipeline.hh.
Referenced by addResourceUsage(), loadState(), saveOperandUse(), and saveResourceUse().
|
static |
ObjectState name for operand read.
Definition at line 101 of file ExecutionPipeline.hh.
Referenced by loadState(), and saveState().
|
static |
ObjectState name for operand write.
Definition at line 103 of file ExecutionPipeline.hh.
Referenced by loadState(), and saveState().
|
static |
ObjectState name for ExecutionPipeline.
Definition at line 97 of file ExecutionPipeline.hh.
Referenced by TTAMachine::HWOperation::loadState(), loadState(), and saveState().
|
static |
ObjectState name for pipeline resource usage.
Definition at line 99 of file ExecutionPipeline.hh.
Referenced by loadState(), and saveResourceUse().
|
private |
The parent operation.
Definition at line 180 of file ExecutionPipeline.hh.
Referenced by addPipelineElement(), internalRemoveResourceUse(), isOperandBound(), latency(), loadState(), parentOperation(), pipelineElement(), removeAllResourceUses(), removeResourceUse(), and slack().
|
private |
Resource usage.
Definition at line 174 of file ExecutionPipeline.hh.
Referenced by adjustLatency(), checkResourceAvailability(), checkStartCycle(), firstCycle(), firstCycleWithoutOperandUse(), firstCycleWithoutResource(), internalAddResourceUse(), internalRemoveResourceUse(), isArchitectureEqual(), isResourceUsed(), latency(), removeAllResourceUses(), resourceUsages(), saveState(), and usedResources().