Go to the documentation of this file.
68 SubComponent(), name_(name), pipeline_(NULL), parent_(NULL) {
73 const string procName =
"HWOperation::HWOperation";
77 throw InvalidName(__FILE__, __LINE__, procName, errorMsg.str());
96 SubComponent(), name_(
""), pipeline_(NULL), parent_(&parent) {
98 const string procName =
"HWOperation::HWOperation";
105 __FILE__, __LINE__, procName, exception.
errorMessage());
159 if (lowerName == this->
name()) {
163 const string procName =
"HWOperation::setName";
167 format text = textGenerator.
text(
171 __FILE__, __LINE__, procName, text.str());
177 errorMsg % lowerName;
178 throw InvalidName(__FILE__, __LINE__, procName, errorMsg.str());
271 const string procName =
"HWOperation::bindPort";
274 throw OutOfRange(__FILE__, __LINE__, procName);
321 OperandBindingMap::const_iterator iter =
operandBinding_.find(operand);
323 return const_cast<FUPort*
>((*iter).second);
367 const string procName =
"HWOperation::operand";
368 const string msg = string(
"The port '") +
port.
name()
369 +
"' is not bound to the operation '"
432 pair<int, const FUPort*> binding = *iter;
456 const string procName =
"HWOperation::loadState";
468 __FILE__, __LINE__, procName, exception.
errorMessage());
474 for (
int i = 0; i < state->
childCount(); i++) {
480 if (
parentUnit()->hasOperationPort(portName)) {
483 format text = textGenerator.
text(
487 __FILE__, __LINE__, procName, text.str());
488 }
else if (this->
port(operand) != NULL) {
489 format text = textGenerator.
text(
491 text % operand % portName %
name() %
495 __FILE__, __LINE__, procName, text.str());
500 format text = textGenerator.
text(
504 __FILE__, __LINE__, procName, text.str());
static const std::string OSKEY_OPERAND
ObjectState attribute key for operand index.
static const std::string OSNAME_OPERATION
ObjectState name for HWOperation.
ObjectState * saveState() const
virtual void loadState(const ObjectState *state)
virtual TCEString name() const
std::string stringAttribute(const std::string &name) const
static const std::string OSKEY_NAME
ObjectState attribute key for name of the operation.
FunctionUnit * parentUnit() const
virtual void bindPort(int operand, const FUPort &port)
virtual ObjectState * saveState() const
static const std::string OSNAME_PIPELINE
ObjectState name for ExecutionPipeline.
virtual boost::format text(int textId)
void updateBindingString() const
ObjectState * childByName(const std::string &name) const
virtual FUPort * port(int operand) const
static const std::string OSKEY_PORT
ObjectState attribute key for port name.
int slack(int input) const
int io(const FUPort &port) const
const std::string & name() const
@ TXT_OPERATION_REF_LOAD_ERR_PORT
#define THROW_EXCEPTION(exceptionType, message)
Exception wrapper macro that automatically includes file name, line number and function name where th...
std::string name_
Name of the operation.
virtual void unbindPort(const FUPort &port)
bool isBound(const FUPort &port) const
int numberOfInputs() const
ObjectState * child(int index) const
void addChild(ObjectState *child)
int slack(int input) const
static const std::string OSNAME_OPERAND_BINDING
ObjectState name for an operand binding.
static bool isValidComponentName(const std::string &name)
virtual bool isOutput() const
std::string errorMessage() const
ExecutionPipeline * pipeline_
Pipeline of the operation.
@ TXT_OPERAND_ALREADY_BOUND
virtual void addOperation(HWOperation &operation)
virtual std::string name() const
FunctionUnit * parentUnit() const
HWOperation(const std::string &name, FunctionUnit &parent)
FunctionUnit * parent_
The parent unit.
virtual bool isInput() const
int intAttribute(const std::string &name) const
ExecutionPipeline * pipeline() const
int numberOfOutputs() const
virtual FUPort * operationPort(const std::string &name) const
@ TXT_OPERAND_BOUND_TO_PORT
OperandBindingMap operandBinding_
Maps operands of operation to particular ports of the parent unit.
virtual void deleteOperation(HWOperation &operation)
void loadState(const ObjectState *state)
void setAttribute(const std::string &name, const std::string &value)
virtual void setName(const std::string &name)
@ TXT_OPERATION_EXISTS_BY_SAME_NAME