OpenASIP
2.0
|
#include <Netlist.hh>
Public Types | |
typedef boost::graph_traits< Netlist >::edge_iterator | iterator |
typedef boost::graph_traits< const Netlist >::edge_iterator | const_iterator |
typedef DescriptorMap::iterator | descriptor_iterator |
typedef DescriptorMap::const_iterator | const_descriptor_iterator |
Public Member Functions | |
Netlist () | |
virtual | ~Netlist () |
bool | connect (const NetlistPort &port1, const NetlistPort &port2, int port1FirstBit, int port2FirstBit, int width=1) |
bool | connect (const NetlistPort &port1, const NetlistPort &port2) |
bool | connect (const NetlistPortGroup &group1, const NetlistPortGroup &group2) |
bool | connectBy (SignalType byType, const NetlistPortGroup &group1, const NetlistPortGroup &group2) |
bool | connect (const NetlistPortGroup &group1, const NetlistPortGroup &group2, std::map< SignalType, SignalType > connectionMap) |
bool | connectGroupByName (const NetlistPortGroup &group1, const NetlistPortGroup &group2) |
void | disconnectPorts (const NetlistPort &port1, const NetlistPort &port2) |
bool | isPortConnected (const NetlistPort &port) const |
bool | isEmpty () const |
bool | hasConnections () const |
size_t | registerPort (NetlistPort &port) |
size_t | descriptor (const NetlistPort &port) const |
bool | isRegistered (const NetlistPort &port) const |
void | unregisterPort (NetlistPort &port) |
void | setParameter (const std::string &name, const std::string &type, const std::string &value) |
void | setParameter (const Parameter ¶m) |
void | removeParameter (const std::string &name) |
bool | hasParameter (const std::string &name) const |
size_t | parameterCount () const |
Parameter | parameter (size_t index) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
descriptor_iterator | descriptorBegin () |
descriptor_iterator | descriptorEnd () |
const_descriptor_iterator | descriptorBegin () const |
const_descriptor_iterator | descriptorEnd () const |
Static Public Member Functions | |
static void | connectClocks (NetlistBlock &block) |
static void | connectResets (NetlistBlock &block) |
Private Types | |
typedef std::map< const NetlistPort *, size_t > | DescriptorMap |
Map type for vertex descriptors. More... | |
typedef std::vector< Parameter > | ParameterTable |
Vector type for parameters. More... | |
Private Attributes | |
DescriptorMap | vertexDescriptorMap_ |
Vertex descriptor map. More... | |
ParameterTable | parameters_ |
Parameters of the netlist. More... | |
TCEString | coreEntityName_ |
This should be set to the entity name of the generate core, if it's not the same as the toplevel module name. More... | |
Static Private Attributes | |
static const std::string | INVERTER_MODULE |
static const std::string | INVERTER_INPUT |
static const std::string | INVERTER_OUTPUT |
Represents a netlist of port connections.
Definition at line 63 of file Netlist.hh.
typedef DescriptorMap::const_iterator ProGe::Netlist::const_descriptor_iterator |
Definition at line 133 of file Netlist.hh.
typedef boost::graph_traits<const Netlist>::edge_iterator ProGe::Netlist::const_iterator |
Definition at line 126 of file Netlist.hh.
typedef DescriptorMap::iterator ProGe::Netlist::descriptor_iterator |
Definition at line 132 of file Netlist.hh.
|
private |
Map type for vertex descriptors.
Definition at line 68 of file Netlist.hh.
typedef boost::graph_traits<Netlist>::edge_iterator ProGe::Netlist::iterator |
Definition at line 125 of file Netlist.hh.
|
private |
Vector type for parameters.
Definition at line 143 of file Netlist.hh.
ProGe::Netlist::Netlist | ( | ) |
|
virtual |
Netlist::const_iterator ProGe::Netlist::begin | ( | ) |
Definition at line 443 of file Netlist.cc.
Referenced by ProGe::NetlistVisualization::listConnections().
const_iterator ProGe::Netlist::begin | ( | ) | const |
bool ProGe::Netlist::connect | ( | const NetlistPort & | port1, |
const NetlistPort & | port2 | ||
) |
Connects two netlist ports completely.
Each bit of the first port is connected to a bit of the second port. The bits are connected in the same order (the first bit of the first port is connected to the first bit of the second port).
port1 | The first port to connect. |
port2 | The second port to connect. |
Return | true, if connection was successful. |
Definition at line 117 of file Netlist.cc.
References ProGe::Signal::activeState(), ProGe::NetlistPort::assignedSignal(), and descriptor().
bool ProGe::Netlist::connect | ( | const NetlistPort & | port1, |
const NetlistPort & | port2, | ||
int | port1FirstBit, | ||
int | port2FirstBit, | ||
int | width = 1 |
||
) |
Partially connects two netlist ports.
Connects two given subsets of bits of two netlist ports. The bit subsets have equal cardinality and represent an ordered range of adjacent bits. The bits are connected in the same order (the first bit of the subset of the first port is connected to the first bit of the subset of the second port).
port1 | The first port to connect. |
port2 | The second port to connect. |
port1FirstBit | The first bit of the first port to connect. |
port2FirstBit | The first bit of the second port to connect. |
width | The width of the connection. |
Return | true, if connection was successful. |
Definition at line 83 of file Netlist.cc.
References ProGe::NetlistPort::dataType(), and descriptor().
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), ProGe::NetlistGenerator::addFUToNetlist(), ProGe::NetlistGenerator::addGCUToNetlist(), ProGe::NetlistGenerator::addGeneratableFUsToNetlist(), DefaultDecoderGenerator::addGlockPortToDecoder(), DefaultICGenerator::addICToNetlist(), ProGe::ProcessorWrapperBlock::addInstructionMemory(), DefaultDecoderGenerator::addLockReqPortToDecoder(), XilinxBlockRamGenerator::addMemory(), DefaultICDecoderGenerator::addRV32MicroCode(), DefaultDecoderGenerator::completeDecoderBlock(), connect(), connectBy(), connectClocks(), ProGe::BaseNetlistBlock::connectClocks(), connectGroupByName(), AlteraHibiDpRamGenerator::connectPorts(), MemoryGenerator::connectPorts(), connectResets(), ProGe::BaseNetlistBlock::connectResets(), PlatformIntegrator::connectToplevelPort(), DefaultICDecoderGenerator::generateDebuggerCode(), AlmaIFIntegrator::initAlmaifBlock(), AlmaIFIntegrator::integrateCore(), and PlatformIntegrator::integrateCore().
bool ProGe::Netlist::connect | ( | const NetlistPortGroup & | group1, |
const NetlistPortGroup & | group2 | ||
) |
Trivially connect ports of the groups together by their signal types.
Return | true, if connection was successful. |
Definition at line 149 of file Netlist.cc.
References assert, connect(), AssocTools::containsKey(), and ProGe::NetlistPortGroup::portCount().
bool ProGe::Netlist::connect | ( | const NetlistPortGroup & | group1, |
const NetlistPortGroup & | group2, | ||
std::map< SignalType, SignalType > | connectionMap | ||
) |
Makes connection between two different netlist port group by connection map using their SignalTypes.
The connections are made from the first group to the second group by using the connection map. todo...
group1 | The first port group. |
group2 | The second port group. |
connectionMap | The connection rules. |
Definition at line 209 of file Netlist.cc.
References connect(), ProGe::OPEN, ProGe::NetlistPortGroup::portBySignal(), and ProGe::UNDEFINED.
bool ProGe::Netlist::connectBy | ( | SignalType | byType, |
const NetlistPortGroup & | group1, | ||
const NetlistPortGroup & | group2 | ||
) |
Make single port connection by given signal type.
Signal type is assumed to be unique within the both port groups.
Definition at line 182 of file Netlist.cc.
References assert, connect(), ProGe::NetlistPortGroup::hasPortBySignal(), and ProGe::NetlistPortGroup::portBySignal().
|
static |
Definition at line 483 of file Netlist.cc.
References assert, ProGe::CLOCK, connect(), isPortConnected(), ProGe::NetlistBlock::netlist(), ProGe::BaseNetlistBlock::portsBy(), ProGe::BaseNetlistBlock::subBlock(), and ProGe::NetlistBlock::subBlockCount().
Referenced by ProGe::NetlistGenerator::addGCUToNetlist().
bool ProGe::Netlist::connectGroupByName | ( | const NetlistPortGroup & | group1, |
const NetlistPortGroup & | group2 | ||
) |
Trivially connect ports of the groups together by their port names. Useful for exporting e.g. bus connections to higher-level netlist block
Return | true, if connection was successful. |
Definition at line 238 of file Netlist.cc.
References assert, connect(), AssocTools::containsKey(), and ProGe::NetlistPortGroup::portCount().
Referenced by AlmaIFIntegrator::initAlmaifBlock().
|
static |
Definition at line 511 of file Netlist.cc.
References assert, connect(), isPortConnected(), ProGe::NetlistBlock::netlist(), ProGe::BaseNetlistBlock::portsBy(), ProGe::RESET, ProGe::BaseNetlistBlock::subBlock(), and ProGe::NetlistBlock::subBlockCount().
Referenced by ProGe::NetlistGenerator::addGCUToNetlist().
size_t ProGe::Netlist::descriptor | ( | const NetlistPort & | port | ) | const |
Returns descriptor for the given port.
Definition at line 325 of file Netlist.cc.
References assert, MapTools::containsKey(), and vertexDescriptorMap_.
Referenced by connect(), disconnectPorts(), isPortConnected(), registerPort(), unregisterPort(), ProGe::VerilogNetlistWriter::writePortMappings(), ProGe::VHDLNetlistWriter::writePortMappings(), ProGe::VerilogNetlistWriter::writeSignalAssignments(), ProGe::VHDLNetlistWriter::writeSignalAssignments(), ProGe::VerilogNetlistWriter::writeSignalDeclarations(), and ProGe::VHDLNetlistWriter::writeSignalDeclarations().
Netlist::const_descriptor_iterator ProGe::Netlist::descriptorBegin | ( | ) |
Definition at line 463 of file Netlist.cc.
References vertexDescriptorMap_.
Referenced by ProGe::NetlistVisualization::listNetlistDescriptors().
const_descriptor_iterator ProGe::Netlist::descriptorBegin | ( | ) | const |
Netlist::const_descriptor_iterator ProGe::Netlist::descriptorEnd | ( | ) |
Definition at line 468 of file Netlist.cc.
References vertexDescriptorMap_.
Referenced by ProGe::NetlistVisualization::listNetlistDescriptors().
const_descriptor_iterator ProGe::Netlist::descriptorEnd | ( | ) | const |
void ProGe::Netlist::disconnectPorts | ( | const NetlistPort & | port1, |
const NetlistPort & | port2 | ||
) |
Removes connection between two ports.
Definition at line 135 of file Netlist.cc.
References descriptor().
Referenced by DefaultICDecoderGenerator::addRV32MicroCode().
Netlist::const_iterator ProGe::Netlist::end | ( | ) |
Definition at line 448 of file Netlist.cc.
Referenced by ProGe::NetlistVisualization::listConnections().
const_iterator ProGe::Netlist::end | ( | ) | const |
bool ProGe::Netlist::hasConnections | ( | ) | const |
Returns true if there are some connections between ports.
Definition at line 296 of file Netlist.cc.
bool ProGe::Netlist::hasParameter | ( | const std::string & | name | ) | const |
Tells whether the netlist has the given parameter.
name | Name of the parameter. |
Definition at line 403 of file Netlist.cc.
References parameters_.
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), and setParameter().
bool ProGe::Netlist::isEmpty | ( | ) | const |
Tells whether the netlist is empty.
Definition at line 288 of file Netlist.cc.
Referenced by ProGe::VerilogNetlistWriter::write().
bool ProGe::Netlist::isPortConnected | ( | const NetlistPort & | port | ) | const |
Tells whether the netlist port is connected in this netlist instance
port | The netlist port |
Definition at line 273 of file Netlist.cc.
References descriptor().
Referenced by connectClocks(), and connectResets().
bool ProGe::Netlist::isRegistered | ( | const NetlistPort & | port | ) | const |
Returns true if the netlist has the given port.
Definition at line 334 of file Netlist.cc.
References MapTools::containsKey(), and vertexDescriptorMap_.
Parameter ProGe::Netlist::parameter | ( | size_t | index | ) | const |
Returns the parameter at the given position.
index | The position. |
OutOfRange | If the given index is negative or not smaller than the number of parameters. |
Definition at line 434 of file Netlist.cc.
References __func__, parameterCount(), and parameters_.
Referenced by PlatformIntegrator::copyProgeBlockToNetlist(), ProGe::NetlistPort::resolveRealWidth(), ProGe::NetlistBlock::shallowCopy(), ProGe::BaseNetlistBlock::shallowCopy(), ProGe::VerilogNetlistWriter::writeNetlistParameterPackage(), and ProGe::VHDLNetlistWriter::writeNetlistParameterPackage().
size_t ProGe::Netlist::parameterCount | ( | ) | const |
Returns the number of parameters in the netlist.
Definition at line 422 of file Netlist.cc.
References parameters_.
Referenced by parameter(), ProGe::NetlistPort::resolveRealWidth(), ProGe::NetlistBlock::shallowCopy(), ProGe::BaseNetlistBlock::shallowCopy(), ProGe::VHDLNetlistWriter::writeBlock(), ProGe::VerilogNetlistWriter::writeBlock(), ProGe::VHDLNetlistWriter::writeNetlistParameterPackage(), and ProGe::VerilogNetlistWriter::writeNetlistParameterPackage().
size_t ProGe::Netlist::registerPort | ( | NetlistPort & | port | ) |
Registers given port to the netlist to make connection possible.
This method does not need to be called by clients.
port | The port. |
Definition at line 309 of file Netlist.cc.
References assert, MapTools::containsKey(), descriptor(), and vertexDescriptorMap_.
Referenced by ProGe::BaseNetlistBlock::addPort(), and ProGe::BaseNetlistBlock::addSubBlock().
void ProGe::Netlist::removeParameter | ( | const std::string & | name | ) |
Removes the given parameter from the netlist.
name | Name of the parameter. |
Definition at line 386 of file Netlist.cc.
References parameters_.
Referenced by setParameter().
void ProGe::Netlist::setParameter | ( | const Parameter & | param | ) |
Definition at line 376 of file Netlist.cc.
References ProGe::Parameter::name(), setParameter(), ProGe::Parameter::type(), and ProGe::Parameter::value().
void ProGe::Netlist::setParameter | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | value | ||
) |
[DEPRECATED] Adds a parameter for the netlist.
If the netlist already has a parameter with the given name, it is replaced by the new parameter.
name | Name of the parameter. |
type | Type of the parameter. |
value | Value of the parameter. |
Definition at line 362 of file Netlist.cc.
References hasParameter(), parameters_, and removeParameter().
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), PlatformIntegrator::copyProgeBlockToNetlist(), setParameter(), ProGe::NetlistBlock::shallowCopy(), and ProGe::BaseNetlistBlock::shallowCopy().
void ProGe::Netlist::unregisterPort | ( | NetlistPort & | port | ) |
Removes port from the netlist and all connections related to it.
Definition at line 342 of file Netlist.cc.
References MapTools::containsKey(), descriptor(), and vertexDescriptorMap_.
Referenced by ProGe::BaseNetlistBlock::removePort().
|
private |
This should be set to the entity name of the generate core, if it's not the same as the toplevel module name.
Definition at line 152 of file Netlist.hh.
|
staticprivate |
Definition at line 155 of file Netlist.hh.
|
staticprivate |
Definition at line 154 of file Netlist.hh.
|
staticprivate |
Definition at line 156 of file Netlist.hh.
|
private |
Parameters of the netlist.
Definition at line 148 of file Netlist.hh.
Referenced by hasParameter(), parameter(), parameterCount(), removeParameter(), and setParameter().
|
private |
Vertex descriptor map.
Definition at line 146 of file Netlist.hh.
Referenced by descriptor(), descriptorBegin(), descriptorEnd(), isRegistered(), registerPort(), and unregisterPort().