OpenASIP  2.0
Public Member Functions | Private Types | Private Attributes | List of all members
HDB::ExternalPort Class Reference

#include <ExternalPort.hh>

Inheritance diagram for HDB::ExternalPort:
Inheritance graph
Collaboration diagram for HDB::ExternalPort:
Collaboration graph

Public Member Functions

 ExternalPort (const std::string &name, Direction direction, const std::string &widthFormula, const std::string &description)
 
virtual ~ExternalPort ()
 
void setName (const std::string &name)
 
std::string name () const
 
void setDirection (Direction direction)
 
Direction direction () const
 
void setWidthFormula (const std::string &widthFormula)
 
std::string widthFormula () const
 
void setDescription (const std::string &description)
 
std::string description () const
 
bool setParameterDependency (const std::string &parameter)
 
bool unsetParameterDependency (const std::string &parameter)
 
int parameterDependencyCount () const
 
std::string parameterDependency (int index) const
 

Private Types

typedef std::vector< std::string > ParameterTable
 Typedef for string vector. More...
 

Private Attributes

std::string name_
 Name of the port. More...
 
Direction direction_
 Direction of the port. More...
 
std::string widthFormula_
 The formula for the width of the port. More...
 
std::string description_
 Description of the port. More...
 
ParameterTable parameterDeps_
 

Detailed Description

Represents base class for a non-architectural port of an implementation in HDB.

Definition at line 48 of file ExternalPort.hh.

Member Typedef Documentation

◆ ParameterTable

typedef std::vector<std::string> HDB::ExternalPort::ParameterTable
private

Typedef for string vector.

Definition at line 73 of file ExternalPort.hh.

Constructor & Destructor Documentation

◆ ExternalPort()

HDB::ExternalPort::ExternalPort ( const std::string &  name,
Direction  direction,
const std::string &  widthFormula,
const std::string &  description 
)

The constructor.

Registers the port automatically to the given FUImplementation instance.

Parameters
nameName of the port.
directionDirection of the port.
widthFormulaThe formula for the width of the port.
descriptionDescription of the port.
parentThe parent FUImplementation instance.

Definition at line 49 of file ExternalPort.cc.

◆ ~ExternalPort()

HDB::ExternalPort::~ExternalPort ( )
virtual

The destructor.

Definition at line 63 of file ExternalPort.cc.

63  {
64 }

Member Function Documentation

◆ description()

std::string HDB::ExternalPort::description ( ) const

Returns the description of the port.

Returns
The description.

Definition at line 150 of file ExternalPort.cc.

150  {
151  return description_;
152 }

References description_.

Referenced by HDB::HDBManager::addFUImplementation(), HDB::HDBManager::addRFImplementation(), HDBToHtml::fuImplToHtml(), HDBToHtml::rfImplToHtml(), and setDescription().

◆ direction()

Direction HDB::ExternalPort::direction ( ) const

◆ name()

std::string HDB::ExternalPort::name ( ) const

◆ parameterDependency()

std::string HDB::ExternalPort::parameterDependency ( int  index) const

Returns name of a parameter the port is dependent on.

Parameters
indexDetermines which parameter is returned.
Returns
The name of the parameter.
Exceptions
OutOfRangeIf the index is negative or not smaller than the number of parameters the port is dependent on.

Definition at line 203 of file ExternalPort.cc.

203  {
204  if (index < 0 || index >= parameterDependencyCount()) {
205  throw OutOfRange(__FILE__, __LINE__, __func__);
206  }
207  return parameterDeps_[index];
208 }

References __func__, parameterDependencyCount(), and parameterDeps_.

Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), HDB::HDBManager::addFUImplementation(), HDB::HDBManager::addRFImplementation(), HDBToHtml::fuImplToHtml(), and HDBToHtml::rfImplToHtml().

Here is the call graph for this function:

◆ parameterDependencyCount()

int HDB::ExternalPort::parameterDependencyCount ( ) const

Returns the number of parameters the port is dependent on.

Returns
The number of parameters.

Definition at line 189 of file ExternalPort.cc.

189  {
190  return parameterDeps_.size();
191 }

References parameterDeps_.

Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), HDB::HDBManager::addFUImplementation(), HDB::HDBManager::addRFImplementation(), HDBToHtml::fuImplToHtml(), parameterDependency(), and HDBToHtml::rfImplToHtml().

◆ setDescription()

void HDB::ExternalPort::setDescription ( const std::string &  description)

Sets description of the port.

Parameters
descriptionThe new description.

Definition at line 139 of file ExternalPort.cc.

139  {
141 }

References description(), and description_.

Here is the call graph for this function:

◆ setDirection()

void HDB::ExternalPort::setDirection ( Direction  direction)

Sets the direction of the port.

Parameters
directionThe new direction.

Definition at line 95 of file ExternalPort.cc.

95  {
97 }

References direction(), and direction_.

Here is the call graph for this function:

◆ setName()

void HDB::ExternalPort::setName ( const std::string &  name)

Sets the name of the port.

Parameters
nameName of the port.

Definition at line 73 of file ExternalPort.cc.

73  {
74  name_ = name;
75 }

References name(), and name_.

Here is the call graph for this function:

◆ setParameterDependency()

bool HDB::ExternalPort::setParameterDependency ( const std::string &  parameter)

Sets a parameter dependency for the port.

Parameters
parameterName of the parameter the port is dependent on.
Returns
True if parameter dependency was added, false if already existed.

Definition at line 162 of file ExternalPort.cc.

162  {
164  parameterDeps_.push_back(parameter);
165  return true;
166  }
167  return false;
168 }

References ContainerTools::containsValue(), and parameterDeps_.

Referenced by HDB::HDBManager::addFUExternalPortsToImplementation(), HDB::HDBManager::addRFExternalPortsToImplementation(), RFImplementationDialog::onEditParameter(), FUImplementationDialog::onEditParameter(), RFImplementationDialog::onParameterActivation(), and FUImplementationDialog::onParameterActivation().

Here is the call graph for this function:

◆ setWidthFormula()

void HDB::ExternalPort::setWidthFormula ( const std::string &  widthFormula)

Sets the width formula of the port.

Parameters
widthFormulaThe new width formula.

Definition at line 117 of file ExternalPort.cc.

117  {
119 }

References widthFormula(), and widthFormula_.

Here is the call graph for this function:

◆ unsetParameterDependency()

bool HDB::ExternalPort::unsetParameterDependency ( const std::string &  parameter)

Unsets the dependency of the given parameter.

Parameters
parameterThe parameter.
Returns
True if parameter dependency was removed, false if it didn't exist.

Definition at line 178 of file ExternalPort.cc.

178  {
180 }

References parameterDeps_, and ContainerTools::removeValueIfExists().

Referenced by RFImplementationDialog::onDeleteParameter(), FUImplementationDialog::onDeleteParameter(), RFImplementationDialog::onEditParameter(), FUImplementationDialog::onEditParameter(), RFImplementationDialog::onParameterActivation(), and FUImplementationDialog::onParameterActivation().

Here is the call graph for this function:

◆ widthFormula()

std::string HDB::ExternalPort::widthFormula ( ) const

Member Data Documentation

◆ description_

std::string HDB::ExternalPort::description_
private

Description of the port.

Definition at line 82 of file ExternalPort.hh.

Referenced by description(), and setDescription().

◆ direction_

Direction HDB::ExternalPort::direction_
private

Direction of the port.

Definition at line 78 of file ExternalPort.hh.

Referenced by direction(), and setDirection().

◆ name_

std::string HDB::ExternalPort::name_
private

Name of the port.

Definition at line 76 of file ExternalPort.hh.

Referenced by name(), and setName().

◆ parameterDeps_

ParameterTable HDB::ExternalPort::parameterDeps_
private

◆ widthFormula_

std::string HDB::ExternalPort::widthFormula_
private

The formula for the width of the port.

Definition at line 80 of file ExternalPort.hh.

Referenced by setWidthFormula(), and widthFormula().


The documentation for this class was generated from the following files:
HDB::ExternalPort::parameterDeps_
ParameterTable parameterDeps_
Definition: ExternalPort.hh:83
HDB::ExternalPort::widthFormula_
std::string widthFormula_
The formula for the width of the port.
Definition: ExternalPort.hh:80
OutOfRange
Definition: Exception.hh:320
HDB::ExternalPort::direction_
Direction direction_
Direction of the port.
Definition: ExternalPort.hh:78
ContainerTools::removeValueIfExists
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)
__func__
#define __func__
Definition: Application.hh:67
HDB::ExternalPort::name_
std::string name_
Name of the port.
Definition: ExternalPort.hh:76
HDB::ExternalPort::description_
std::string description_
Description of the port.
Definition: ExternalPort.hh:82
ContainerTools::containsValue
static bool containsValue(const ContainerType &aContainer, const ElementType &aKey)
HDB::ExternalPort::description
std::string description() const
Definition: ExternalPort.cc:150
HDB::ExternalPort::name
std::string name() const
Definition: ExternalPort.cc:84
HDB::ExternalPort::direction
Direction direction() const
Definition: ExternalPort.cc:106
HDB::ExternalPort::widthFormula
std::string widthFormula() const
Definition: ExternalPort.cc:128
HDB::ExternalPort::parameterDependencyCount
int parameterDependencyCount() const
Definition: ExternalPort.cc:189