OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ProGe::Parameter Class Reference

#include <Parameter.hh>

Collaboration diagram for ProGe::Parameter:
Collaboration graph

Public Member Functions

 Parameter ()
 
 Parameter (const TCEString &name, const TCEString &type, const TCEString &assignedAndDefaultValue)
 
 Parameter (const TCEString &name, const TCEString &type, const TCEString &assignedValue, const TCEString &defaultValue)
 
 Parameter (const TCEString &name, const TCEString &type, int assignedValue, const TCEString &defaultValue)
 
 Parameter (const TCEString &name, const TCEString &type, const TCEString &nameOfConstant, const TCEString &defaultValue, const TCEString &nameOfPackage)
 
virtual ~Parameter ()
 
void set (const TCEString &name, const TCEString &type, const TCEString &value)
 
void setName (const TCEString &name)
 
void setType (const TCEString &type)
 
void setValue (const TCEString &value)
 
const TCEStringname () const
 
const TCEStringtype () const
 
const TCEStringvalue () const
 
const TCEStringdefaultValue () const
 
bool valueIsSymbol () const
 
bool valueIsConstant () const
 
const std::string & packageNameOfConstant () const
 

Private Attributes

TCEString name_
 Name/identifier of the parameter.
 
TCEString type_
 Type of the parameter.
 
TCEString value_
 Assigned value to the parameter as actual value or as reference to another parameter or name of a constant.
 
TCEString default_
 Default value of the parameter if value_ is not set (empty).
 
TCEString package_
 Package reference by name. If non-empty the value_ is treated as name of a constant.
 

Detailed Description

Class that represents a parameter for netlist objects such as netlist port and netlist block and is used to define port widths and enable/disable properties of blocks. Parameters are may have two different values: assigned and default where assigned value is real value assigned for the parameter and default value is fallback value in case the assigned have is not defined..

From HDL point of view (VHDL, verilog) the assigned value corresponds to the value set for module/entity instantiation's parameter/generic and the default value corresponds to default value for a module's/entity's parameter/generic.

Empty value means that the value is not defined.

Definition at line 62 of file Parameter.hh.

Constructor & Destructor Documentation

◆ Parameter() [1/5]

ProGe::Parameter::Parameter ( )

Empty parameter with undefined members.

Definition at line 45 of file Parameter.cc.

46 : name_(""), type_(""), value_(""), default_(""), package_("") {}
TCEString value_
Assigned value to the parameter as actual value or as reference to another parameter or name of a con...
Definition Parameter.hh:113
TCEString name_
Name/identifier of the parameter.
Definition Parameter.hh:108
TCEString package_
Package reference by name. If non-empty the value_ is treated as name of a constant.
Definition Parameter.hh:118
TCEString default_
Default value of the parameter if value_ is not set (empty).
Definition Parameter.hh:115
TCEString type_
Type of the parameter.
Definition Parameter.hh:110

◆ Parameter() [2/5]

ProGe::Parameter::Parameter ( const TCEString name,
const TCEString type,
const TCEString assignedAndDefaultValue 
)

Constructs a parameter with both the assigned and default value having the same value.

Parameters
nameThe name of the parameter
typeThe type of the parameter given as string
assignedAndDefaultValueThe assigned and default value of the parameter.

Definition at line 57 of file Parameter.cc.

60 : Parameter(
61 name, type, assignedAndDefaultValue, assignedAndDefaultValue) {}
const TCEString & type() const
Definition Parameter.cc:138
const TCEString & name() const
Definition Parameter.cc:133

◆ Parameter() [3/5]

ProGe::Parameter::Parameter ( const TCEString name,
const TCEString type,
const TCEString assignedValue,
const TCEString defaultValue 
)

Constructs a parameter with separate assigned and default value.

Parameters
nameThe name of the parameter
typeThe type of the parameter given as string
assignedValueThe assigned value of the parameter.
defaultValueThe default value of the parameter.

Definition at line 71 of file Parameter.cc.

74 : name_(name),
75 type_(type),
76 value_(assignedValue),
78 package_("") {}
const TCEString & defaultValue() const
Definition Parameter.cc:148

◆ Parameter() [4/5]

ProGe::Parameter::Parameter ( const TCEString name,
const TCEString type,
int  assignedValue,
const TCEString defaultValue 
)

Definition at line 79 of file Parameter.cc.

82 : name_(name),
83 type_(type),
84 value_(""),
86 package_("") {
87 value_ = Conversion::toString(assignedValue);
88}
static std::string toString(const T &source)

References Conversion::toString(), and value_.

Here is the call graph for this function:

◆ Parameter() [5/5]

ProGe::Parameter::Parameter ( const TCEString name,
const TCEString type,
const TCEString nameOfConstant,
const TCEString defaultValue,
const TCEString nameOfPackage 
)
Parameters
nameThe name of the parameter
typeThe type of the parameter given as string
nameOfConstantThe value of the parameter as name to a constant.
defaultValueThe default value of the parameter.
nameOfPackageThe name of a package where the constant is defined.

Definition at line 97 of file Parameter.cc.

101 : name_(name),
102 type_(type),
103 value_(nameOfConstant),
105 package_(nameOfPackage) {}

◆ ~Parameter()

ProGe::Parameter::~Parameter ( )
virtual

Definition at line 107 of file Parameter.cc.

107{}

Member Function Documentation

◆ defaultValue()

const TCEString & ProGe::Parameter::defaultValue ( ) const

◆ name()

const TCEString & ProGe::Parameter::name ( ) const

◆ packageNameOfConstant()

const std::string & ProGe::Parameter::packageNameOfConstant ( ) const

Definition at line 171 of file Parameter.cc.

171 {
172 return package_;
173}

References package_.

Referenced by ProGe::BaseNetlistBlock::addParameter().

◆ set()

void ProGe::Parameter::set ( const TCEString name,
const TCEString type,
const TCEString value 
)

Definition at line 110 of file Parameter.cc.

111 {
112 name_ = name;
113 type_ = type;
114 value_ = value;
115}
const TCEString & value() const
Definition Parameter.cc:143

References name(), name_, type(), type_, value(), and value_.

Here is the call graph for this function:

◆ setName()

void ProGe::Parameter::setName ( const TCEString name)

Definition at line 118 of file Parameter.cc.

118 {
119 name_ = name;
120}

References name(), and name_.

Referenced by IPXactModel::extractModelParam().

Here is the call graph for this function:

◆ setType()

void ProGe::Parameter::setType ( const TCEString type)

Definition at line 123 of file Parameter.cc.

123 {
124 type_ = type;
125}

References type(), and type_.

Referenced by IPXactModel::extractModelParam().

Here is the call graph for this function:

◆ setValue()

void ProGe::Parameter::setValue ( const TCEString value)

Definition at line 128 of file Parameter.cc.

128 {
129 value_ = value;
130}

References value(), and value_.

Referenced by IPXactModel::extractModelParam(), and XilinxBlockRamGenerator::XilinxBlockRamGenerator().

Here is the call graph for this function:

◆ type()

const TCEString & ProGe::Parameter::type ( ) const

◆ value()

const TCEString & ProGe::Parameter::value ( ) const

◆ valueIsConstant()

bool ProGe::Parameter::valueIsConstant ( ) const

Return true is the value is a symbol to a constant that are stored in packages.

Definition at line 166 of file Parameter.cc.

166 {
167 return valueIsSymbol() && !package_.empty();
168}
bool valueIsSymbol() const
Definition Parameter.cc:157

References package_, and valueIsSymbol().

Referenced by ProGe::BaseNetlistBlock::addParameter().

Here is the call graph for this function:

◆ valueIsSymbol()

bool ProGe::Parameter::valueIsSymbol ( ) const

Return true is the value is a symbol therefore the actual value is defined elsewhere. Otherwise, the value is literal.

Definition at line 157 of file Parameter.cc.

157 {
158 return !package_.empty(); // note: placeholder
159}

References package_.

Referenced by valueIsConstant().

Member Data Documentation

◆ default_

TCEString ProGe::Parameter::default_
private

Default value of the parameter if value_ is not set (empty).

Definition at line 115 of file Parameter.hh.

Referenced by defaultValue().

◆ name_

TCEString ProGe::Parameter::name_
private

Name/identifier of the parameter.

Definition at line 108 of file Parameter.hh.

Referenced by name(), set(), and setName().

◆ package_

TCEString ProGe::Parameter::package_
private

Package reference by name. If non-empty the value_ is treated as name of a constant.

Definition at line 118 of file Parameter.hh.

Referenced by packageNameOfConstant(), valueIsConstant(), and valueIsSymbol().

◆ type_

TCEString ProGe::Parameter::type_
private

Type of the parameter.

Definition at line 110 of file Parameter.hh.

Referenced by set(), setType(), and type().

◆ value_

TCEString ProGe::Parameter::value_
private

Assigned value to the parameter as actual value or as reference to another parameter or name of a constant.

Definition at line 113 of file Parameter.hh.

Referenced by Parameter(), set(), setValue(), and value().


The documentation for this class was generated from the following files: