OpenASIP  2.0
Classes | Public Member Functions | Private Attributes | List of all members
TTAMachine::PipelineElement Class Reference

#include <PipelineElement.hh>

Collaboration diagram for TTAMachine::PipelineElement:
Collaboration graph

Classes

struct  Comparator
 

Public Member Functions

 PipelineElement (const std::string &name, FunctionUnit &parentUnit)
 
virtual ~PipelineElement ()
 
const std::string & name () const
 
void setName (const std::string &name)
 
FunctionUnitparentUnit () const
 

Private Attributes

std::string name_
 Name of the pipeline element. More...
 
FunctionUnitparent_
 The parent unit. More...
 

Detailed Description

Represents an resource inside pipeline in function unit.

Definition at line 46 of file PipelineElement.hh.

Constructor & Destructor Documentation

◆ PipelineElement()

TTAMachine::PipelineElement::PipelineElement ( const std::string &  name,
FunctionUnit parentUnit 
)

Constructor.

Pipeline elements are created automatically when pipeline of operation is created. Clients should not create pipeline elements.

Parameters
nameName of the pipeline element.
parentUnitThe parent unit.
Exceptions
ComponentAlreadyExistsIf there exists another pipeline element by the same name in the function unit.
InvalidNameIf the given name is not a valid component name.

Definition at line 54 of file PipelineElement.cc.

56  : name_(""), parent_(&parentUnit) {
57  setName(name);
58 
59  // clear parent pointer to pass the assert in addPipelineElement
60  parent_ = NULL;
61 
64 }

References TTAMachine::FunctionUnit::addPipelineElement(), name(), parent_, parentUnit(), and setName().

Here is the call graph for this function:

◆ ~PipelineElement()

TTAMachine::PipelineElement::~PipelineElement ( )
virtual

Destructor.

Definition at line 69 of file PipelineElement.cc.

69  {
70 
71  FunctionUnit* parent = parent_;
72  parent_ = NULL;
73  parent->deletePipelineElement(*this);
74 
75  // remove usages of this resource
76  for (int i = 0; i < parent->operationCount(); i++) {
77  HWOperation* operation = parent->operation(i);
78  ExecutionPipeline* pLine = operation->pipeline();
79  pLine->removeResourceUse(name());
80  }
81 }

References TTAMachine::FunctionUnit::deletePipelineElement(), name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), parent_, TTAMachine::HWOperation::pipeline(), and TTAMachine::ExecutionPipeline::removeResourceUse().

Here is the call graph for this function:

Member Function Documentation

◆ name()

const std::string& TTAMachine::PipelineElement::name ( ) const

◆ parentUnit()

FunctionUnit* TTAMachine::PipelineElement::parentUnit ( ) const

◆ setName()

void TTAMachine::PipelineElement::setName ( const std::string &  name)

Sets the name of the pipeline element.

Parameters
nameThe new name.
Exceptions
ComponentAlreadyExistsIf another pipeline element exists by the same name in the same function unit.
InvalidNameIf the given name is not a valid component name.

Definition at line 93 of file PipelineElement.cc.

93  {
94  const string procName = "PipelineElement::setName";
95 
97  throw InvalidName(__FILE__, __LINE__, procName);
98  }
99 
100  if (name == this->name()) {
101  return;
102  }
103 
104  if (parentUnit()->hasPipelineElement(name)) {
105  throw ComponentAlreadyExists(__FILE__, __LINE__, procName);
106  }
107 
108  name_ = name;
109 }

References MachineTester::isValidComponentName(), name(), name_, and parentUnit().

Referenced by PipelineElement().

Here is the call graph for this function:

Member Data Documentation

◆ name_

std::string TTAMachine::PipelineElement::name_
private

Name of the pipeline element.

Definition at line 62 of file PipelineElement.hh.

Referenced by setName().

◆ parent_

FunctionUnit* TTAMachine::PipelineElement::parent_
private

The parent unit.

Definition at line 64 of file PipelineElement.hh.

Referenced by PipelineElement(), and ~PipelineElement().


The documentation for this class was generated from the following files:
TTAMachine::FunctionUnit::addPipelineElement
virtual void addPipelineElement(PipelineElement &element)
Definition: FunctionUnit.cc:466
TTAMachine::PipelineElement::setName
void setName(const std::string &name)
Definition: PipelineElement.cc:93
TTAMachine::PipelineElement::name
const std::string & name() const
TTAMachine::PipelineElement::name_
std::string name_
Name of the pipeline element.
Definition: PipelineElement.hh:62
TTAMachine::PipelineElement::parent_
FunctionUnit * parent_
The parent unit.
Definition: PipelineElement.hh:64
InvalidName
Definition: Exception.hh:827
MachineTester::isValidComponentName
static bool isValidComponentName(const std::string &name)
Definition: MachineTester.cc:312
TTAMachine::PipelineElement::parentUnit
FunctionUnit * parentUnit() const
ComponentAlreadyExists
Definition: Exception.hh:510
TTAMachine::FunctionUnit::deletePipelineElement
virtual void deletePipelineElement(PipelineElement &element)
Definition: FunctionUnit.cc:489