OpenASIP
2.0
|
#include <Parameter.hh>
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 TCEString & | name () const |
const TCEString & | type () const |
const TCEString & | value () const |
const TCEString & | defaultValue () const |
bool | valueIsSymbol () const |
bool | valueIsConstant () const |
const std::string & | packageNameOfConstant () const |
Private Attributes | |
TCEString | name_ |
Name/identifier of the parameter. More... | |
TCEString | type_ |
Type of the parameter. More... | |
TCEString | value_ |
Assigned value to the parameter as actual value or as reference to another parameter or name of a constant. More... | |
TCEString | default_ |
Default value of the parameter if value_ is not set (empty). More... | |
TCEString | package_ |
Package reference by name. If non-empty the value_ is treated as name of a constant. More... | |
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.
ProGe::Parameter::Parameter | ( | ) |
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.
name | The name of the parameter |
type | The type of the parameter given as string |
assignedAndDefaultValue | The assigned and default value of the parameter. |
Definition at line 57 of file Parameter.cc.
ProGe::Parameter::Parameter | ( | const TCEString & | name, |
const TCEString & | type, | ||
const TCEString & | assignedValue, | ||
const TCEString & | defaultValue | ||
) |
Constructs a parameter with separate assigned and default value.
name | The name of the parameter |
type | The type of the parameter given as string |
assignedValue | The assigned value of the parameter. |
defaultValue | The default value of the parameter. |
Definition at line 71 of file Parameter.cc.
ProGe::Parameter::Parameter | ( | const TCEString & | name, |
const TCEString & | type, | ||
int | assignedValue, | ||
const TCEString & | defaultValue | ||
) |
Definition at line 79 of file Parameter.cc.
References Conversion::toString(), and value_.
ProGe::Parameter::Parameter | ( | const TCEString & | name, |
const TCEString & | type, | ||
const TCEString & | nameOfConstant, | ||
const TCEString & | defaultValue, | ||
const TCEString & | nameOfPackage | ||
) |
name | The name of the parameter |
type | The type of the parameter given as string |
nameOfConstant | The value of the parameter as name to a constant. |
defaultValue | The default value of the parameter. |
nameOfPackage | The name of a package where the constant is defined. |
Definition at line 97 of file Parameter.cc.
|
virtual |
Definition at line 107 of file Parameter.cc.
const TCEString & ProGe::Parameter::defaultValue | ( | ) | const |
Definition at line 148 of file Parameter.cc.
References default_.
Referenced by ProGe::VerilogNetlistWriter::writeGenericDeclaration(), and ProGe::VHDLNetlistWriter::writeGenericDeclaration().
const TCEString & ProGe::Parameter::name | ( | ) | const |
Definition at line 133 of file Parameter.cc.
References name_.
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), AlteraMemGenerator::addGenerics(), Stratix2SramGenerator::addMemory(), ProGe::BaseNetlistBlock::addParameter(), MemoryGenerator::addParameter(), PlatformIntegrator::copyProgeBlockToNetlist(), ProGe::BaseNetlistBlock::hasParameter(), ProGe::BaseNetlistBlock::parameter(), ProGe::NetlistVisualization::printParameter(), ProGe::NetlistPort::resolveRealWidth(), set(), setName(), ProGe::Netlist::setParameter(), ProGe::BaseNetlistBlock::setParameter(), ProGe::VHDLNetlistWriter::writeComponentDeclarations(), ProGe::VHDLNetlistWriter::writeGenericDeclaration(), ProGe::VerilogNetlistWriter::writeGenericDeclaration(), SOPCBuilderFileGenerator::writeGenerics(), ProGe::VerilogNetlistWriter::writeNetlistParameterPackage(), ProGe::VHDLNetlistWriter::writeNetlistParameterPackage(), ProGe::VerilogNetlistWriter::writePortMappings(), and ProGe::VHDLNetlistWriter::writePortMappings().
const std::string & ProGe::Parameter::packageNameOfConstant | ( | ) | const |
Definition at line 171 of file Parameter.cc.
References package_.
Referenced by ProGe::BaseNetlistBlock::addParameter().
void ProGe::Parameter::setName | ( | const TCEString & | name | ) |
Definition at line 118 of file Parameter.cc.
Referenced by IPXactModel::extractModelParam().
void ProGe::Parameter::setType | ( | const TCEString & | type | ) |
Definition at line 123 of file Parameter.cc.
Referenced by IPXactModel::extractModelParam().
void ProGe::Parameter::setValue | ( | const TCEString & | value | ) |
Definition at line 128 of file Parameter.cc.
References value(), and value_.
Referenced by IPXactModel::extractModelParam(), and XilinxBlockRamGenerator::XilinxBlockRamGenerator().
const TCEString & ProGe::Parameter::type | ( | ) | const |
Definition at line 138 of file Parameter.cc.
References type_.
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), Stratix2SramGenerator::addMemory(), MemoryGenerator::addParameter(), ProGe::NetlistVisualization::printParameter(), set(), ProGe::Netlist::setParameter(), setType(), ProGe::VHDLNetlistWriter::writeComponentDeclarations(), ProGe::VerilogNetlistWriter::writeGenericDeclaration(), ProGe::VHDLNetlistWriter::writeGenericDeclaration(), SOPCBuilderFileGenerator::writeGenerics(), ProGe::VHDLNetlistWriter::writeNetlistParameterPackage(), ProGe::VerilogNetlistWriter::writePortMappings(), and ProGe::VHDLNetlistWriter::writePortMappings().
const TCEString & ProGe::Parameter::value | ( | ) | const |
Definition at line 143 of file Parameter.cc.
References value_.
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), Stratix2SramGenerator::addMemory(), MemoryGenerator::addParameter(), ProGe::VHDLNetlistWriter::parameterWidthValue(), ProGe::NetlistVisualization::printParameter(), ProGe::NetlistPort::resolveRealWidth(), set(), ProGe::Netlist::setParameter(), setValue(), ProGe::VHDLNetlistWriter::writeGenericDeclaration(), SOPCBuilderFileGenerator::writeGenerics(), ProGe::VerilogNetlistWriter::writeNetlistParameterPackage(), ProGe::VHDLNetlistWriter::writeNetlistParameterPackage(), ProGe::VerilogNetlistWriter::writePortMappings(), and ProGe::VHDLNetlistWriter::writePortMappings().
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.
References package_, and valueIsSymbol().
Referenced by ProGe::BaseNetlistBlock::addParameter().
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.
References package_.
Referenced by valueIsConstant().
|
private |
Default value of the parameter if value_ is not set (empty).
Definition at line 115 of file Parameter.hh.
Referenced by defaultValue().
|
private |
Name/identifier of the parameter.
Definition at line 108 of file Parameter.hh.
|
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().
|
private |
Type of the parameter.
Definition at line 110 of file Parameter.hh.
|
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().