Go to the documentation of this file.
67 :
Unit(name), addressSpace_(NULL), orderNumber_(0) {}
80 :
Unit(state), addressSpace_(NULL), orderNumber_(0) {
124 if (
machine()->functionUnitNavigator().hasItem(
name) ||
125 (
machine()->controlUnit() != NULL &&
127 string procName =
"FunctionUnit::setName";
147 string procName =
"FunctionUnit::port";
227 if (fuPort == NULL) {
228 const string procName =
"FunctionUnit::operationPort";
253 if (current == index) {
259 const string procName =
"FunctionUnit::operandPort";
260 throw OutOfRange(__FILE__, __LINE__, procName);
269 for (
int i = 0; i < portc; i++) {
270 if (
port(i)->isTriggering()) {
294 string procName =
"FunctionUnit::addOperation";
316 string procName =
"FunctionUnit::deleteOperation";
342 OperationTable::const_iterator iter =
operations_.begin();
344 if ((*iter)->name() ==
name) {
379 OperationTable::const_iterator iter =
operations_.begin();
381 if ((*iter)->name() ==
name) {
387 string procName =
"FunctionUnit::operation";
389 __FILE__, __LINE__, procName,
"Operation not found:" +
name );
407 string procName =
"FunctionUnit::operation";
408 throw OutOfRange(__FILE__, __LINE__, procName);
429 OperationTable::const_iterator iter =
operations_.begin();
431 opNames.insert((*iter)->name());
473 string procName =
"FunctionUnit::addPipelineElement";
525 string procName =
"FunctionUnit::pipelineElement";
526 throw OutOfRange(__FILE__, __LINE__, procName);
543 if ((*iter)->name() ==
name) {
565 if ((*iter)->name() ==
name) {
631 for (
int cycle = 0; cycle < pLine->
latency(); cycle++) {
707 const string procName =
"FunctionUnit::loadState";
721 TXT_FU_REF_LOAD_ERR_AS);
722 errorMsg % asName %
name();
724 __FILE__, __LINE__, procName, errorMsg.str());
748 const FunctionUnit* fu,
const bool checkPortWidths)
const {
768 for (
int i = 0; i < fuPipelineElementCount; i++) {
774 for (
int i = 0; i < fuPortCount; i++) {
775 if (checkPortWidths) {
838 for (
int busIndex = 0; busIndex < navi.
count(); busIndex++) {
839 Bus* bus = navi.
item(busIndex);
841 while (guardIndex < bus->guardCount()) {
845 if (portGuard != NULL) {
848 if (referenced ==
this) {
882 for (
int i = 0; i < fuState->
childCount(); i++) {
889 const string procName =
"FunctionUnit::loadStateWithoutReferences";
virtual void removeFunctionUnit(FunctionUnit &unit)
static const std::string OSNAME_OPERATION
ObjectState name for HWOperation.
bool hasAttribute(const std::string &name) const
virtual void setName(const std::string &name)
virtual TCEString name() const
std::string stringAttribute(const std::string &name) const
static const std::string OSNAME_FU
ObjectState name for function unit.
virtual bool isRegistered() const
virtual bool hasAddressSpace() const
FunctionUnit(const std::string &name)
virtual bool isOpcodeSetting() const
static const std::string OSKEY_ORDER_NUMBER
ObjectState attribute key for FU order number name.
FunctionUnit * parentUnit() const
virtual void cleanup(const std::string &resource)
virtual void ensureRegistration(const Component &component) const
virtual BaseFUPort * triggerPort() const
virtual void addPipelineElement(PipelineElement &element)
void loadStateWithoutReferences(const ObjectState *fuState)
virtual ObjectState * saveState() const
virtual HWOperation * operationLowercase(const std::string &name) const
virtual void unsetMachine()
virtual void loadState(const ObjectState *state)
virtual BaseFUPort * port(const std::string &name) const
virtual AddressSpace * addressSpace() const
const std::string & name() const
virtual boost::format text(int textId)
void setName(const std::string &name)
virtual bool isTriggering() const
virtual int maxLatency() const
void deleteAllOperations()
#define assert(condition)
virtual ObjectState * saveState() const
void cleanupGuards() const
const std::string & name() const
virtual PipelineElement * pipelineElement(int index) const
bool hasItem(const std::string &name) const
virtual Port * port(const std::string &name) const
virtual int operationCount() const
ObjectState * child(int index) const
void addChild(ObjectState *child)
virtual bool hasPort(const std::string &name) const
virtual bool hasOperation(const std::string &name) const
virtual void setAddressSpace(AddressSpace *as)
virtual AddressSpaceNavigator addressSpaceNavigator() const
virtual int operationPortCount() const
virtual ObjectState * saveState() const
Guard * guard(int index) const
virtual int portCount() const
std::string errorMessage() const
OperationTable operations_
Contains all the operations of the function unit.
virtual int pipelineElementCount() const
virtual int orderNumber() const
virtual bool hasOperationPort(const std::string &name) const
FunctionUnit * parentUnit() const
PipelineElementTable pipelineElements_
Contains all the pipeline elements of the function unit.
virtual void addOperation(HWOperation &operation)
virtual bool hasOperationLowercase(const std::string &name) const
virtual Machine * machine() const
FunctionUnit * parentUnit() const
virtual BusNavigator busNavigator() const
bool needsConflictDetection() const
virtual void loadState(const ObjectState *state)
int intAttribute(const std::string &name) const
ExecutionPipeline * pipeline() const
virtual void deletePipelineElement(PipelineElement &element)
void unsetMachineDerived()
AddressSpace * addressSpace_
Address space used by the function unit.
ComponentType * item(int index) const
virtual HWOperation * operation(const std::string &name) const
virtual FUPort * operationPort(const std::string &name) const
int orderNumber_
Number indicating possition of the FU in the ADF file. Alows putting the FU into the order in the ins...
virtual bool hasPipelineElement(const std::string &name) const
virtual void setOrderNumber(int)
virtual FunctionUnit * copy() const
virtual void setName(const std::string &name)
virtual void unsetMachine()
virtual void deleteOperation(HWOperation &operation)
static const std::string OSKEY_AS
ObjectState attribute key for name of the address space.
virtual bool isArchitectureEqual(const FunctionUnit *fu, const bool checkPortWidths=true) const
void setAttribute(const std::string &name, const std::string &value)
bool isResourceUsed(const std::string &name, int cycle) const
virtual void operationNames(TCETools::CIStringSet &opNames) const