OpenASIP
2.0
|
#include <NetlistPort.hh>
Private Member Functions | |
void | setParent (BaseNetlistBlock *parent) |
NetlistPort (const NetlistPort &other, bool asMirrored=false) | |
Private Attributes | |
std::string | name_ |
Name of the port. More... | |
std::string | widthFormula_ |
Formula for the width of the port. More... | |
int | realWidth_ |
Real width of the port. More... | |
DataType | dataType_ |
Data type of the port. More... | |
Direction | direction_ |
Direction of the port. More... | |
BaseNetlistBlock * | parentBlock_ |
The parent netlist block. More... | |
bool | hasStaticValue_ |
Indicates if port is connected to vcc or gnd. More... | |
StaticSignal | staticValue_ |
Static signal value. More... | |
Signal | signal_ |
Assigned port usage. More... | |
Friends | |
class | BaseNetlistBlock |
Represents a port in the netlist. Ports are the vertices of the graph that represents the netlist. From the ports, it is possible to reach the parent netlist blocks.
Definition at line 70 of file NetlistPort.hh.
ProGe::NetlistPort::NetlistPort | ( | const std::string & | name, |
const std::string & | widthFormula, | ||
int | realWidth, | ||
DataType | dataType, | ||
Direction | direction, | ||
BaseNetlistBlock & | parent, | ||
Signal | signal = Signal() |
||
) |
Constructor. Creates a netlist port with a defined bit width.
Creates a port that has a known bit width. Adds the port automatically to the parent block. If a formula for calculating the bit width is given, it should match the actual bit width (an integer number). No check is performed, however, to make sure that the formula is compatible with the actual width. In case of mismatch, the error can be detected only after generation (for example, in a logic synthesis tool).
name | Name of the port. |
widthFormula | Formula for calculating the width. |
realWidth | Actual width of the port. |
dataType | Type of the data. |
direction | Direction of the port. |
parent | The parent netlist block. |
OutOfRange | If the actual width is not positive ( <0 ). |
Definition at line 64 of file NetlistPort.cc.
References __func__, ProGe::BaseNetlistBlock::addPort(), name(), and realWidth_.
Referenced by clone(), and copyTo().
ProGe::NetlistPort::NetlistPort | ( | const std::string & | name, |
int | realWidth, | ||
DataType | dataType, | ||
Direction | direction, | ||
BaseNetlistBlock & | parent, | ||
Signal | signal = Signal() |
||
) |
Constructor. Creates a netlist port with a defined bit width, and derive formula from the integer value
name | Name of the port. |
realWidth | Actual width of the port. |
dataType | Type of the data. |
direction | Direction of the port. |
parent | The parent netlist block. |
OutOfRange | If the actual width is not positive ( <0 ). |
Definition at line 105 of file NetlistPort.cc.
References __func__, ProGe::BaseNetlistBlock::addPort(), name(), and realWidth_.
ProGe::NetlistPort::NetlistPort | ( | const std::string & | name, |
const std::string & | widthFormula, | ||
DataType | dataType, | ||
Direction | direction, | ||
BaseNetlistBlock & | parent, | ||
Signal | signal = Signal() |
||
) |
Constructor. Creates a new netlist port.
Creates a port that has its bit width defined symbolically, by an expression (formula). Adds the port automatically to the parent block.
name | Name of the port. |
widthFormula | Formula for calculating the width. |
dataType | Type of the data. |
direction | Direction of the port. |
parent | The parent netlist block. |
Definition at line 146 of file NetlistPort.cc.
References ProGe::BaseNetlistBlock::addPort().
ProGe::NetlistPort::NetlistPort | ( | const std::string & | name, |
const std::string & | widthFormula, | ||
DataType | dataType, | ||
Direction | direction, | ||
Signal | signal = Signal() |
||
) |
Definition at line 186 of file NetlistPort.cc.
|
virtual |
Destructor.
Removes itself from the parent netlist block.
Definition at line 270 of file NetlistPort.cc.
References hasParentBlock(), parentBlock_, and ProGe::BaseNetlistBlock::removePort().
|
private |
Copy constructor. Copies everything except parent block reference since one NetlistBlock may not have ports with identical names.
Definition at line 170 of file NetlistPort.cc.
References direction_, and ProGe::NetlistTools::mirror().
Signal ProGe::NetlistPort::assignedSignal | ( | ) | const |
Return signal assigned to the port.
Definition at line 455 of file NetlistPort.cc.
References signal_.
Referenced by ProGe::NetlistPortGroup::clone(), clone(), ProGe::Netlist::connect(), copyTo(), ProGe::NetlistPortGroup::hasPortBySignal(), ProGe::BaseNetlistBlock::hasPortsBy(), ProGe::NetlistPortGroup::portBySignal(), ProGe::BaseNetlistBlock::portsBy(), and ProGe::PortFactory::registerPort().
void ProGe::NetlistPort::assignSignal | ( | Signal | signal | ) |
Assign signal to signify usage of the port.
Definition at line 447 of file NetlistPort.cc.
References signal_.
|
virtual |
Definition at line 258 of file NetlistPort.cc.
References assert, assignedSignal(), NetlistPort(), and ProGe::Signal::type().
Referenced by ProGe::PortFactory::clockPort(), ProGe::ProcessorWrapperBlock::handleUnconnectedPorts(), ProGe::NetlistPortGroup::NetlistPortGroup(), and ProGe::PortFactory::resetPort().
NetlistPort * ProGe::NetlistPort::copyTo | ( | BaseNetlistBlock & | newParent, |
std::string | newName = "" |
||
) | const |
DEPRECATED
Definition at line 231 of file NetlistPort.cc.
References assignedSignal(), dataType(), direction(), name(), NetlistPort(), realWidth(), realWidthAvailable(), resolveRealWidth(), and widthFormula().
Referenced by ProGe::NetlistBlock::shallowCopy(), and ProGe::BaseNetlistBlock::shallowCopy().
DataType ProGe::NetlistPort::dataType | ( | ) | const |
Returns the data type of the port.
Definition at line 362 of file NetlistPort.cc.
References dataType_.
Referenced by ProGe::Netlist::connect(), MemoryGenerator::connectPorts(), PlatformIntegrator::connectToplevelPort(), copyTo(), ProGe::VHDLNetlistWriter::portSignalName(), ProGe::VHDLNetlistWriter::portSignalType(), ProGe::VerilogNetlistWriter::portSignalType(), ProGe::NetlistVisualization::portWidthToString(), ProGe::VHDLNetlistWriter::signalAssignment(), ProGe::VHDLNetlistWriter::writeComponentDeclarations(), ProGe::VHDLNetlistWriter::writeConnection(), ProGe::VerilogNetlistWriter::writePortDeclaration(), ProGe::VHDLNetlistWriter::writePortDeclaration(), ProGe::VerilogNetlistWriter::writePortMappings(), ProGe::VHDLNetlistWriter::writePortMappings(), ProGe::VerilogNetlistWriter::writeSignalAssignments(), and ProGe::VHDLNetlistWriter::writeSignalAssignments().
Direction ProGe::NetlistPort::direction | ( | ) | const |
Returns the direction of the port.
Definition at line 373 of file NetlistPort.cc.
References direction_.
Referenced by AvalonMMMasterInterface::addPort(), DefaultDecoderGenerator::completeDecoderBlock(), ProGe::BaseNetlistBlock::connectClocks(), ProGe::BaseNetlistBlock::connectResets(), PlatformIntegrator::connectToplevelPort(), copyTo(), SOPCBuilderFileGenerator::countAvalonMMMasters(), ProGe::PortFactory::createPort(), SOPCBuilderFileGenerator::exportSignal(), AvalonMMMasterInterface::isValidPort(), ProGe::NetlistGenerator::mapNetlistPort(), ProGe::NetlistTools::mirror(), ProGe::NetlistVisualization::printPort(), setDirection(), ProGe::VHDLNetlistWriter::writeComponentDeclarations(), ProGe::VHDLNetlistWriter::writeConnection(), ProGe::VHDLNetlistWriter::writePortDeclaration(), ProGe::VerilogNetlistWriter::writePortDeclaration(), ProGe::VHDLNetlistWriter::writePortMappings(), ProGe::VHDLNetlistWriter::writeSignalAssignments(), and ProGe::VerilogNetlistWriter::writeSignalAssignments().
bool ProGe::NetlistPort::hasParentBlock | ( | ) | const |
Returns true if ports is attached to some netlist block. Otherwise, returns false.
Definition at line 390 of file NetlistPort.cc.
References parentBlock_.
Referenced by ProGe::BaseNetlistBlock::addPort(), rename(), and ~NetlistPort().
bool ProGe::NetlistPort::hasStaticValue | ( | ) | const |
Definition at line 423 of file NetlistPort.cc.
References hasStaticValue_.
Referenced by ProGe::ProcessorWrapperBlock::handleUnconnectedPorts(), ProGe::VHDLNetlistWriter::portSignalName(), ProGe::VerilogNetlistWriter::portSignalName(), ProGe::VHDLNetlistWriter::writeSignalDeclarations(), and ProGe::VerilogNetlistWriter::writeSignalDeclarations().
std::string ProGe::NetlistPort::name | ( | ) | const |
Returns the name of the port.
Definition at line 283 of file NetlistPort.cc.
References name_.
Referenced by ProGe::GeneratableFUNetlistBlock::addInOperand(), AvalonMMMasterInterface::addIrqInterface(), ProGe::GeneratableFUNetlistBlock::addOutOperand(), AvalonMMMasterInterface::addPort(), ProGe::BaseNetlistBlock::addPort(), ProGe::NetlistTools::addPrefixToPortName(), AlteraHibiDpRamGenerator::connectPorts(), PlatformIntegrator::connectToplevelPort(), copyTo(), MemoryGenerator::corePortName(), SOPCBuilderFileGenerator::countAvalonMMMasters(), SOPCBuilderFileGenerator::createInterfaces(), SOPCBuilderFileGenerator::exportSignal(), ProGe::NetlistGenerator::fuGuardPort(), SOPCBuilderFileGenerator::handleAvalonSignal(), AlmaIFIntegrator::integrateCore(), AvalonMMMasterInterface::isValidPort(), ProGe::NetlistVisualization::listConnections(), ProGe::NetlistVisualization::listNetlistDescriptors(), ProGe::NetlistGenerator::loadPort(), IPXactClkInterface::mapPortsToInterface(), IPXactResetInterface::mapPortsToInterface(), IPXactHibiInterface::mapPortsToInterface(), Stratix3DevKitIntegrator::mapToplevelPorts(), Stratix2DSPBoardIntegrator::mapToplevelPorts(), NetlistPort(), ProGe::VHDLNetlistWriter::portSignalName(), ProGe::VerilogNetlistWriter::portSignalName(), ProGe::NetlistVisualization::printPort(), realWidth(), rename(), ProGe::NetlistGenerator::rfOpcodePort(), ProGe::NetlistBlock::shallowCopy(), ProGe::BaseNetlistBlock::shallowCopy(), ProGe::VHDLNetlistWriter::writeComponentDeclarations(), ProGe::VHDLNetlistWriter::writeConnection(), ProGe::VHDLNetlistWriter::writePortDeclaration(), ProGe::VerilogNetlistWriter::writePortDeclaration(), ProGe::VerilogNetlistWriter::writePortMappings(), and ProGe::VHDLNetlistWriter::writePortMappings().
BaseNetlistBlock& ProGe::NetlistPort::parentBlock | ( | ) |
BaseNetlistBlock & ProGe::NetlistPort::parentBlock | ( | ) | const |
Returns the parent netlist block.
Definition at line 400 of file NetlistPort.cc.
References parentBlock_.
Referenced by ProGe::BaseNetlistBlock::addPort(), ProGe::NetlistGenerator::fuGuardPort(), ProGe::NetlistVisualization::listConnections(), ProGe::NetlistVisualization::listNetlistDescriptors(), ProGe::NetlistGenerator::loadPort(), ProGe::VHDLNetlistWriter::parameterWidthValue(), ProGe::VHDLNetlistWriter::portSignalName(), ProGe::VerilogNetlistWriter::portSignalName(), ProGe::BaseNetlistBlock::removePort(), resolveRealWidth(), ProGe::NetlistGenerator::rfOpcodePort(), ProGe::VHDLNetlistWriter::usesParameterWidth(), ProGe::VHDLNetlistWriter::writeConnection(), ProGe::VerilogNetlistWriter::writePortMappings(), ProGe::VHDLNetlistWriter::writePortMappings(), ProGe::VHDLNetlistWriter::writeSignalAssignments(), ProGe::VerilogNetlistWriter::writeSignalAssignments(), ProGe::VerilogNetlistWriter::writeSignalDeclarations(), and ProGe::VHDLNetlistWriter::writeSignalDeclarations().
int ProGe::NetlistPort::realWidth | ( | ) | const |
Returns the actual bit width of the port.
NotAvailable | If the actual width is not known. |
Definition at line 348 of file NetlistPort.cc.
References __func__, name(), realWidth_, and realWidthAvailable().
Referenced by AvalonMMMasterInterface::addIrqInterface(), XilinxBlockRamGenerator::addMemory(), AvalonMMMasterInterface::addPort(), PlatformIntegrator::connectToplevelPort(), copyTo(), SOPCBuilderFileGenerator::exportSignal(), HDLPort::HDLPort(), DefaultDecoderGenerator::opcodeWidth(), ProGe::VerilogNetlistWriter::portSignalName(), ProGe::VHDLNetlistWriter::portSignalType(), ProGe::VerilogNetlistWriter::portSignalType(), ProGe::NetlistVisualization::portWidthToString(), ProGe::VHDLNetlistWriter::writeSignalDeclarations(), and ProGe::VerilogNetlistWriter::writeSignalDeclarations().
bool ProGe::NetlistPort::realWidthAvailable | ( | ) | const |
Tells whether the actual bit width of the port is known.
Definition at line 334 of file NetlistPort.cc.
References realWidth_.
Referenced by AvalonMMMasterInterface::addIrqInterface(), AvalonMMMasterInterface::addPort(), PlatformIntegrator::connectToplevelPort(), copyTo(), SOPCBuilderFileGenerator::exportSignal(), HDLPort::HDLPort(), ProGe::VHDLNetlistWriter::portSignalType(), ProGe::VerilogNetlistWriter::portSignalType(), ProGe::NetlistVisualization::portWidthToString(), realWidth(), ProGe::VHDLNetlistWriter::writeSignalDeclarations(), and ProGe::VerilogNetlistWriter::writeSignalDeclarations().
void ProGe::NetlistPort::rename | ( | const std::string & | newname | ) |
Sets new name of the port.
Definition at line 294 of file NetlistPort.cc.
References hasParentBlock(), name(), name_, parentBlock_, ProGe::BaseNetlistBlock::port(), and THROW_EXCEPTION.
Referenced by ProGe::NetlistTools::addPrefixToPortName(), and ProGe::LoopBufferBlock::LoopBufferBlock().
bool ProGe::NetlistPort::resolveRealWidth | ( | int & | width | ) | const |
Definition at line 204 of file NetlistPort.cc.
References ProGe::Parameter::name(), ProGe::BaseNetlistBlock::netlist(), ProGe::Netlist::parameter(), ProGe::Netlist::parameterCount(), parentBlock(), Conversion::toInt(), ProGe::Parameter::value(), and widthFormula().
Referenced by copyTo().
void ProGe::NetlistPort::setDirection | ( | Direction | direction | ) |
Sets direction of the port.
Definition at line 381 of file NetlistPort.cc.
References direction(), and direction_.
Referenced by ProGe::NetlistTools::mirror().
|
private |
Set parent block of this port.
newParent | The new parent. Can be NULL too. |
Definition at line 439 of file NetlistPort.cc.
References parentBlock_.
Referenced by ProGe::BaseNetlistBlock::addPort(), and ProGe::BaseNetlistBlock::removePort().
void ProGe::NetlistPort::setToStatic | ( | StaticSignal | value | ) | const |
Definition at line 410 of file NetlistPort.cc.
References hasStaticValue_, and staticValue_.
Referenced by DefaultICDecoderGenerator::addDummyIfetchDebugPorts(), and HDLPort::convertToNetlistPort().
void ProGe::NetlistPort::setWidthFormula | ( | const std::string & | newFormula | ) |
Changes port's width formula.
Definition at line 324 of file NetlistPort.cc.
References widthFormula_.
Referenced by DefaultICDecoderGenerator::addRV32MicroCode().
StaticSignal ProGe::NetlistPort::staticValue | ( | ) | const |
Definition at line 429 of file NetlistPort.cc.
References staticValue_.
Referenced by ProGe::VHDLNetlistWriter::portSignalName(), and ProGe::VerilogNetlistWriter::portSignalName().
void ProGe::NetlistPort::unsetStatic | ( | ) | const |
Definition at line 417 of file NetlistPort.cc.
References hasStaticValue_.
Referenced by DefaultICDecoderGenerator::generateDebuggerCode().
std::string ProGe::NetlistPort::widthFormula | ( | ) | const |
Returns the formula that defines the width of the port.
Definition at line 316 of file NetlistPort.cc.
References widthFormula_.
Referenced by ProGe::ProcessorWrapperBlock::addDataMemory(), ProGe::ProcessorWrapperBlock::addDataMemory2(), DefaultDecoderGenerator::completeDecoderBlock(), PlatformIntegrator::connectToplevelPort(), copyTo(), DefaultICDecoderGenerator::generateDebuggerCode(), ProGe::VHDLNetlistWriter::parameterWidthValue(), ProGe::VHDLNetlistWriter::portSignalType(), ProGe::VerilogNetlistWriter::portSignalType(), ProGe::NetlistVisualization::portWidthToString(), resolveRealWidth(), ProGe::VHDLNetlistWriter::usesParameterWidth(), ProGe::VHDLNetlistWriter::writeComponentDeclarations(), ProGe::VerilogNetlistWriter::writePortDeclaration(), ProGe::VHDLNetlistWriter::writePortDeclaration(), and ProGe::VHDLNetlistWriter::writePortMappings().
|
friend |
Definition at line 72 of file NetlistPort.hh.
|
private |
|
private |
Direction of the port.
Definition at line 146 of file NetlistPort.hh.
Referenced by direction(), NetlistPort(), and setDirection().
|
mutableprivate |
Indicates if port is connected to vcc or gnd.
Definition at line 150 of file NetlistPort.hh.
Referenced by hasStaticValue(), setToStatic(), and unsetStatic().
|
private |
Name of the port.
Definition at line 138 of file NetlistPort.hh.
|
private |
The parent netlist block.
Definition at line 148 of file NetlistPort.hh.
Referenced by hasParentBlock(), parentBlock(), rename(), setParent(), and ~NetlistPort().
|
private |
Real width of the port.
Definition at line 142 of file NetlistPort.hh.
Referenced by NetlistPort(), realWidth(), and realWidthAvailable().
|
private |
Assigned port usage.
Definition at line 154 of file NetlistPort.hh.
Referenced by assignedSignal(), and assignSignal().
|
mutableprivate |
Static signal value.
Definition at line 152 of file NetlistPort.hh.
Referenced by setToStatic(), and staticValue().
|
private |
Formula for the width of the port.
Definition at line 140 of file NetlistPort.hh.
Referenced by setWidthFormula(), and widthFormula().