OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 

Private Attributes

std::string name_
 Name of the port.
 
Direction direction_
 Direction of the port.
 
std::string widthFormula_
 The formula for the width of the port.
 
std::string description_
 Description of the port.
 
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.

53 :
56
57}
std::string widthFormula() const
std::string name_
Name of the port.
std::string description_
Description of the port.
std::string widthFormula_
The formula for the width of the port.
Direction direction_
Direction of the port.
std::string name() const
std::string description() const
Direction direction() const

◆ ~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

◆ 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}
#define __func__
int parameterDependencyCount() const
ParameterTable parameterDeps_

References __func__, parameterDependencyCount(), and parameterDeps_.

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

Here is the call graph for this function:

◆ parameterDependencyCount()

int HDB::ExternalPort::parameterDependencyCount ( ) const

◆ 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_.

Referenced by FUExternalPortDialog::onOK(), and RFExternalPortDialog::onOK().

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_.

Referenced by FUExternalPortDialog::onOK(), and RFExternalPortDialog::onOK().

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_.

Referenced by FUExternalPortDialog::onOK(), and RFExternalPortDialog::onOK().

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}
static bool containsValue(const ContainerType &aContainer, const ElementType &aKey)

References ContainerTools::containsValue(), and parameterDeps_.

Referenced by HDB::HDBManager::addFUExternalPortsToImplementation(), HDB::HDBManager::addRFExternalPortsToImplementation(), FUImplementationDialog::onEditParameter(), RFImplementationDialog::onEditParameter(), FUExternalPortDialog::onOK(), RFExternalPortDialog::onOK(), FUImplementationDialog::onParameterActivation(), and RFImplementationDialog::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_.

Referenced by FUExternalPortDialog::onOK(), and RFExternalPortDialog::onOK().

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}
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)

References parameterDeps_, and ContainerTools::removeValueIfExists().

Referenced by FUImplementationDialog::onDeleteParameter(), RFImplementationDialog::onDeleteParameter(), FUImplementationDialog::onEditParameter(), RFImplementationDialog::onEditParameter(), FUExternalPortDialog::onOK(), RFExternalPortDialog::onOK(), FUImplementationDialog::onParameterActivation(), and RFImplementationDialog::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: