OpenASIP
2.0
|
#include <ResourceVector.hh>
Public Types | |
typedef std::set< std::string > | ResourceSet |
Resources are stored in a set as strings. Normal pipeline resource usages are prefixed with "res:", port usages with "port:". More... | |
Public Member Functions | |
ResourceVector () | |
ResourceVector (const TTAMachine::ExecutionPipeline &pipeline) | |
virtual | ~ResourceVector () |
const ResourceSet & | resourcesUsedAtCycle (unsigned cycle) const |
std::size_t | width () const |
std::string | toString () const |
virtual bool | conflictsWith (const ResourceVector &other, unsigned cycle) const |
virtual void | mergeWith (const ResourceVector &other, unsigned cycle) |
virtual void | shiftLeft () |
virtual void | clear () |
virtual bool | operator== (const ResourceVector &rightHand) const |
Private Types | |
typedef std::deque< ResourceSet > | ResourceUsageIndex |
Each resource usage is stored as a string. More... | |
Private Attributes | |
ResourceUsageIndex | resources_ |
The storage for the resource usages. More... | |
Represents a resource vector used in building the states in case of an function unit FSA.
Definition at line 53 of file ResourceVector.hh.
typedef std::set<std::string> TTAMachine::ResourceVector::ResourceSet |
Resources are stored in a set as strings. Normal pipeline resource usages are prefixed with "res:", port usages with "port:".
Definition at line 57 of file ResourceVector.hh.
|
private |
Each resource usage is stored as a string.
Definition at line 82 of file ResourceVector.hh.
|
inline |
Definition at line 59 of file ResourceVector.hh.
TTAMachine::ResourceVector::ResourceVector | ( | const TTAMachine::ExecutionPipeline & | pipeline | ) |
Constructor.
Builds the resource vector out of MOM ExecutionPipeline.
pipeline | The ExecutionPipeline to build the resource vector for. |
Definition at line 52 of file ResourceVector.cc.
References TTAMachine::FUPort::bindingString(), TTAMachine::ExecutionPipeline::latency(), TTAMachine::ExecutionPipeline::parentOperation(), TTAMachine::HWOperation::port(), TTAMachine::ExecutionPipeline::readOperands(), resources_, TTAMachine::ExecutionPipeline::resourceUsages(), and TTAMachine::ExecutionPipeline::writtenOperands().
|
virtual |
|
virtual |
Clears the resource vector.
Result is an empty resource vector with no columns
Definition at line 220 of file ResourceVector.cc.
References resources_.
Referenced by ResourceVectorFUResourceConflictDetector::reset().
|
virtual |
Returns true if the given resource vector has conflicting resource usages when issued after given count of cycles.
other | The another resource vector. |
cycle | The count of cycles after which the operation is issued. |
Definition at line 154 of file ResourceVector.cc.
References resources_, resourcesUsedAtCycle(), and width().
Referenced by ResourceVectorFUResourceConflictDetector::issueOperation().
|
virtual |
Merges the resource vector with the given resource vector starting from the given cycle.
This method is used for producing the composite vector for simulation. The resulting resource vector is "stretched" in case there are no enough cycle elements in to contain the merged elements.
other | The another resource vector. |
cycle | The count of cycles after which the operation is issued. |
Definition at line 194 of file ResourceVector.cc.
References resources_, resourcesUsedAtCycle(), and width().
Referenced by ResourceVectorFUResourceConflictDetector::issueOperation().
|
virtual |
Compares two ResourceVectors.
rightHand | Right hand operand. |
Definition at line 232 of file ResourceVector.cc.
References toString().
const ResourceVector::ResourceSet & TTAMachine::ResourceVector::resourcesUsedAtCycle | ( | unsigned | cycle | ) | const |
Returns the set that contains the resources used at the given cycle.
cycle | The cycle. |
OutOfRange | If the cycle is out of range. |
Definition at line 104 of file ResourceVector.cc.
References __func__, and resources_.
Referenced by conflictsWith(), and mergeWith().
|
virtual |
Shifts the resource vector one step left, i.e., deletes the first column.
Definition at line 209 of file ResourceVector.cc.
References resources_.
Referenced by ResourceVectorFUResourceConflictDetector::advanceCycle().
std::string TTAMachine::ResourceVector::toString | ( | ) | const |
Returns a textual description of the resource vector.
Definition at line 116 of file ResourceVector.cc.
References resources_, and Conversion::toString().
Referenced by operator==().
std::size_t TTAMachine::ResourceVector::width | ( | ) | const |
Returns the width of the resource vector.
Definition at line 141 of file ResourceVector.cc.
References resources_.
Referenced by conflictsWith(), mergeWith(), and TTAMachine::ResourceVectorSet::ResourceVectorSet().
|
private |
The storage for the resource usages.
Definition at line 84 of file ResourceVector.hh.
Referenced by clear(), conflictsWith(), mergeWith(), resourcesUsedAtCycle(), ResourceVector(), shiftLeft(), toString(), and width().