#include <oagFpgaModGraph.h>
Static Public Member Functions | |
RtlGraph * | getGraph (oa::oaDesign *design) |
RtlGraph * | getGraph (oa::oaModule *module) |
Returns the graph of a design. | |
RtlGraph * | getGraph (const ModRef &x) |
Returns the graph of a module's design. | |
void | failIfInDifferentModules (oa::oaModule *x, oa::oaModule *y) |
Generates an error if the two modules are not identical. | |
void | failIfInDifferentModules (ModRef x, ModRef y) |
oa::oaModule * | convertModRefListToRefList (const list< ModRef > &source, list< BBRef > &result) |
Converts a list of ModRefs in a given module into a list of Refs. | |
void | convertRefListToModRefList (const list< BBRef > &source, oa::oaModule *module, list< ModRef > &result) |
Converts a list of BBRefs in a given module into a list of ModRefs. | |
void | convertRefVectorToModRefVector (const vector< BBRef > &source, oa::oaModule *module, vector< ModRef > &result) |
Converts a vector of Refs in a given module into a vector of ModRefs. | |
Functional operations | |
ModRef | getNull (oa::oaModule *module) |
bool | isNull (ModRef x) |
Returns a null reference inside the given module. | |
ModRef | constantOne (oa::oaModule *module) |
Tests a reference to see if it is null. | |
ModRef | constantZero (oa::oaModule *module) |
Returns a reference in the given module to the function that is always true. | |
void | setTerminalDriver (ModRef terminal, ModRef driver) |
Sets the driver of a given terminal. | |
Intra-module incremental graph traversal | |
RtlNode::FuncType | getNodeType (ModRef x) |
RtlNode::OptType | getNodeOptType (ModRef x) |
Returns the type of the referenced graph node. | |
RtlNode::SeqType | getNodeSeqType (ModRef x) |
Returns the operator type of the referenced graph node. | |
int | getNumOutputBits (ModRef x) |
Returns the sequential type of the referenced graph node. | |
BBRef | getPrimaryBBID (ModRef x) |
Returns the number of bits of the output bus, return one if it's a single bit output. | |
ModRef | getTerminalDriver (ModRef terminal) |
Returns the primary ID (ie. the first position in bbNodes in a RTL of a RtlNode). | |
bool | isTerminal (ModRef x) |
Returns the driver of a TERMINAL node. | |
bool | isFunctional (ModRef x) |
Tests if a reference is to a TERMINAL node. | |
ModRef | getNextState (ModRef sequential) |
bool | isSequential (ModRef x) |
Returns the next state input of a SEQUENTIAL node. | |
list< ModRef > | getFanin (ModRef x) |
Returns the fan-ins of a node that lie within the same module. | |
list< ModRef > | getFanout (ModRef x) |
Returns the fan-outs of a node that lie within the same module. | |
void | getFanout (ModRef x, list< ModRef > &result) |
Returns the fan-outs of a node that lie within the same module. | |
bool | hasFanout (ModRef x) |
Explicitly managing graph-to-net connections | |
Returns the fanout of a node. | |
ModRef | prepareNetToBBConnection (oa::oaModBitNet *net) |
Creates an terminal node to represent the function of a net. | |
oa::oaModBitNet * | getNetToBBConnection (ModRef ref) |
Returns the OpenAccess net connected to a given graph TERMINAL. | |
ModRef | getNetToBBConnection (oa::oaModBitNet *net) |
Returns the graph node connected to a given OpenAccess net. | |
void | setNetToBBConnection (oa::oaModBitNet *net, ModRef ref) |
Creates a logical connection between an OpenAccess net and a graph TERMINAL node. | |
void | removeNetToBBConnection (oa::oaModBitNet *net) |
oa::oaModBitNet * | findDriverOfEquivalentNets (oa::oaModBitNet *net) |
Returns the equivalent net that is driving a net. | |
void | connectEquivalentNetsInGraph (oa::oaModule *module) |
Connects the TERMINAL nodes of equivalent nets. | |
Advanced graph traversal | |
bool | hasCombinationalCycle (oa::oaModule *module) |
Tests if there are any combinational cycles in a module's design. | |
void | getTransitiveFanin (ModRef x, list< ModRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false) |
Returns a list of all nodes in the transitive fan-in of one node. | |
void | getTransitiveFanin (ModRef x, vector< ModRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false) |
Returns a vector of all nodes in the transitive fan-in of one node. | |
void | getTransitiveFanin (list< ModRef > x, list< ModRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false) |
Returns a list of all nodes in the transitive fan-in of several nodes. | |
void | getTransitiveFanin (list< ModRef > x, vector< ModRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false) |
Returns a vector of all nodes in the transitive fan-in of several nodes. | |
void | getTransitiveFanout (ModRef x, list< ModRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false) |
Returns a list of all nodes in the transitive fan-out of one node. | |
void | getTransitiveFanout (ModRef x, vector< ModRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false) |
Returns a vector of all nodes in the transitive fan-out of one node. | |
void | getTransitiveFanout (list< ModRef > x, list< ModRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false) |
Returns a list of all nodes in the transitive fan-out of several nodes. | |
void | getTransitiveFanout (list< ModRef > x, vector< ModRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false) |
Returns a vector of all nodes in the transitive fan-out of several nodes. | |
Global graph queries | |
void | getOutputs (oa::oaModule *module, list< ModRef > &result) |
Gets all output terminals inside a module. |
The ModGraph class is not a data structure on its own, but instead provides an interface for manipulating functionality graphs in the folded module domain view. All methods in the ModGraph class are static. The ModRef structure provides the mechanism for referring to graph nodes within this view, and most ModGraph methods operate on ModRefs.
The module view is appropriate for making modifications to the local functional descriptions of design objects. The functional graphs describe the local behavior of each logical object (module), with every instantiation (occurrence) of a given object type (module) behaving identically. Every occurrence inherits its local functional behavior from the module type that it implements. This is analagous to the role that physical descriptions play in the block domain.
The module view is not appropriate for working with the global functionality of hierarchical designs. Two different instantiations (occurrences) may implement the same local behavior, but the global functions being implemented on each of their pins depends on their connectivity and context in the larger design. To manipulate global functionality, it does not suffice to traverse the folded (module) design view; the unfolded (occurrence) hierarchy is better suited. The OccGraph class provided the interface for manipulating graphs in this view.
Definition at line 48 of file oagFpgaModGraph.h.
|
Connects the TERMINAL nodes of equivalent nets. Functionally identical nets can also be marked equivalent in the OpenAccess database itself. The semantics of this are unfortunately very unclear as to whether this means either (1) the two nets already both implement the same functionality or (2) the nets don't already implement the same functionality but they should (for example by physical connection). For example, the verilog2oa imports continuous assignments by marking the nets as equivalent. In Verilog, this construct implies (2). In such cases, it may be convenient and/or necessary to reflect this functional dependency in the graph, this routine provides the means to do so. For a group of nets that are marked equivalent, the one that is being driven (as an input or in the graph) is first discovered. The TERMINAL node of this net is then set as the driver as the TERMINAL nodes of the other nets. If no driver is found, the nets are left as is. If there are multiple equivalent nets that are being driven, the existing drivers will not be modified. This should only be the case if the equivalent nets feature in the OpenAccess database is being used in the manner of (1). Because only the undriven nets are modified, this should be compatible with such as use case as well.
Definition at line 1195 of file oagFpgaModGraph.cpp. References findDriverOfEquivalentNets(), getNetToBBConnection(), getTerminalDriver(), isNull(), oagFpga::ModRef::printName(), setTerminalDriver(), and oagFpga::toBitNet(). |
|
Tests a reference to see if it is null.
Definition at line 86 of file oagFpgaModGraph.h. |
|
Returns a reference in the given module to the function that is always true.
Definition at line 92 of file oagFpgaModGraph.h. |
|
Converts a list of ModRefs in a given module into a list of Refs.
Definition at line 57 of file oagFpgaModGraph.cpp. Referenced by getTransitiveFanin(), and getTransitiveFanout(). |
|
Converts a list of BBRefs in a given module into a list of ModRefs.
Definition at line 39 of file oagFpgaModGraph.cpp. Referenced by getFanin(), getFanout(), getTransitiveFanin(), and getTransitiveFanout(). |
|
Converts a vector of Refs in a given module into a vector of ModRefs.
Definition at line 79 of file oagFpgaModGraph.cpp. Referenced by getTransitiveFanin(), and getTransitiveFanout(). |
|
Definition at line 486 of file oagFpgaModGraph.h. References oagFpga::ModRef::module. |
|
Generates an error if the two modules are not identical.
Definition at line 20 of file oagFpgaModGraph.cpp. Referenced by setNetToBBConnection(), and setTerminalDriver(). |
|
Returns the equivalent net that is driving a net. The driving net is the first equivalent net that satisfies one of these conditions: 1. connected to an input Term 2. connected to a TERMINAL node that is not driven by NULL In the case where the given net is itself the driver for the group, NULL be returned.
Definition at line 1089 of file oagFpgaModGraph.cpp. References DEBUG_PRINT, DEBUG_PRINTMORE, getNetToBBConnection(), getTerminalDriver(), isNull(), and isTerminal(). Referenced by connectEquivalentNetsInGraph(). |
|
Returns the fan-ins of a node that lie within the same module.
Definition at line 360 of file oagFpgaModGraph.cpp. References convertRefListToModRefList(), getGraph(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. |
|
Returns the fan-outs of a node that lie within the same module.
Definition at line 393 of file oagFpgaModGraph.cpp. References convertRefListToModRefList(), getFanout(), getGraph(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. |
|
Returns the fan-outs of a node that lie within the same module.
Definition at line 376 of file oagFpgaModGraph.cpp. References convertRefListToModRefList(), getGraph(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. Referenced by getFanout(). |
|
Returns the graph of a module's design.
Definition at line 479 of file oagFpgaModGraph.h. References oagFpga::ModRef::module. |
|
Returns the graph of a design. This module's functional description will be contained within this graph, along with the functional descriptions of other modules in the same design.
Definition at line 469 of file oagFpgaModGraph.h. |
|
All design modules' functional descriptions will be contained within this graph.
Definition at line 460 of file oagFpgaModGraph.h. Referenced by getFanin(), getFanout(), getTransitiveFanin(), getTransitiveFanout(), hasCombinationalCycle(), and setTerminalDriver(). |
|
Returns the graph node connected to a given OpenAccess net.
Definition at line 781 of file oagFpgaModGraph.cpp. References oagFpga::Manager::getNetToBBConnection(). |
|
Returns the OpenAccess net connected to a given graph TERMINAL.
Definition at line 765 of file oagFpgaModGraph.cpp. References oagFpga::Manager::getNetToBBConnection(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. Referenced by connectEquivalentNetsInGraph(), and findDriverOfEquivalentNets(). |
|
If the reference is not to a SEQUENTIAL node, an error will be generated.
Definition at line 243 of file oagFpgaModGraph.h. References oagFpga::ModRef::module, and oagFpga::ModRef::ref. |
|
Returns the type of the referenced graph node.
Definition at line 189 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. |
|
Returns the operator type of the referenced graph node.
Definition at line 196 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. |
|
Definition at line 182 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. |
|
There is a no global ModGraph null reference; one unique null reference exists for each module. This function returns the unique null reference for the given module. Some ModGraph operations are dependent on the module context of their parameters, even if they are null.
Definition at line 66 of file oagFpgaModGraph.h. |
|
Returns the sequential type of the referenced graph node.
Definition at line 202 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. |
|
Gets all output terminals inside a module. An output terminal is a TERMINAL node that is connected to an output oaModTerm. If the bit net attached to the oaModTerm does not have a connection to the graph, one is created.
Definition at line 838 of file oagFpgaModGraph.cpp. References prepareNetToBBConnection(), and oagFpga::toBitNet(). |
|
Returns the number of bits of the output bus, return one if it's a single bit output.
Definition at line 207 of file oagFpgaModGraph.h. References oagFpga::BBRef, and oagFpga::ModRef::ref. |
|
Returns the primary ID (ie. the first position in bbNodes in a RTL of a RtlNode). This function only returns the graph reference that is driving this terminal. If the node is driven by a connected OpenAccess net, a null reference is returned. If the reference is not to a TERMINAL node, an error will be generated.
Definition at line 215 of file oagFpgaModGraph.h. References oagFpga::ModRef::module, and oagFpga::ModRef::ref. Referenced by connectEquivalentNetsInGraph(), and findDriverOfEquivalentNets(). |
|
Returns a vector of all nodes in the transitive fan-in of several nodes. The nodes in the transitive fan-in are appended to the provided vector in forward topological order. The initial node is not included. All references will be non-inverted. See RtlGraph::getTransitiveFanin() for more details.
Definition at line 581 of file oagFpgaModGraph.cpp. References convertModRefListToRefList(), convertRefVectorToModRefVector(), getGraph(), and oagFpga::RtlGraph::getTransitiveFanin(). |
|
Returns a list of all nodes in the transitive fan-in of several nodes. The nodes in the transitive fan-in are appended to the provided list in forward topological order. The initial node is not included. All references will be non-inverted. See RtlGraph::getTransitiveFanin() for more details.
Definition at line 521 of file oagFpgaModGraph.cpp. References convertModRefListToRefList(), convertRefListToModRefList(), getGraph(), and oagFpga::RtlGraph::getTransitiveFanin(). |
|
Returns a vector of all nodes in the transitive fan-in of one node. The nodes in the transitive fan-in are appended to the provided vector in forward topological order. The initial node is not included. All references will be non-inverted. See RtlGraph::getTransitiveFanin() for more details.
Definition at line 467 of file oagFpgaModGraph.cpp. References convertRefVectorToModRefVector(), getGraph(), oagFpga::RtlGraph::getTransitiveFanin(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. |
|
Returns a list of all nodes in the transitive fan-in of one node. The nodes in the transitive fan-in are appended to the provided list in forward topological order. The initial node is not included. See RtlGraph::getTransitiveFanin() for more details.
Definition at line 414 of file oagFpgaModGraph.cpp. References convertRefListToModRefList(), getGraph(), oagFpga::RtlGraph::getTransitiveFanin(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. |
|
Returns a vector of all nodes in the transitive fan-out of several nodes. The nodes in the transitive fan-out are appended to the provided vector in forward topological order. The initial node is not included. All references will be non-inverted. See RtlGraph::getTransitiveFanout() for more details.
Definition at line 611 of file oagFpgaModGraph.cpp. References convertModRefListToRefList(), convertRefVectorToModRefVector(), getGraph(), and oagFpga::RtlGraph::getTransitiveFanout(). |
|
Returns a list of all nodes in the transitive fan-out of several nodes. The nodes in the transitive fan-out are appended to the provided list in forward topological order. The initial node is not included. All references will be non-inverted. See RtlGraph::getTransitiveFanout() for more details.
Definition at line 551 of file oagFpgaModGraph.cpp. References convertModRefListToRefList(), convertRefListToModRefList(), getGraph(), and oagFpga::RtlGraph::getTransitiveFanout(). |
|
Returns a vector of all nodes in the transitive fan-out of one node. The nodes in the transitive fan-out are appended to the provided vector in forward topological order. The initial node is not included. All references will be non-inverted. See RtlGraph::getTransitiveFanout() for more details.
Definition at line 494 of file oagFpgaModGraph.cpp. References convertRefVectorToModRefVector(), getGraph(), oagFpga::RtlGraph::getTransitiveFanout(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. |
|
Returns a list of all nodes in the transitive fan-out of one node. The nodes in the transitive fan-out are appended to the provided list in forward topological order. The initial node is not included. All references will be non-inverted. See RtlGraph::getTransitiveFanout() for more details.
Definition at line 440 of file oagFpgaModGraph.cpp. References convertRefListToModRefList(), getGraph(), oagFpga::RtlGraph::getTransitiveFanout(), oagFpga::ModRef::module, and oagFpga::ModRef::ref. |
|
Tests if there are any combinational cycles in a module's design. All modules in the same design will be checked.
Definition at line 291 of file oagFpgaModGraph.cpp. References getGraph(), and oagFpga::RtlGraph::hasCombinationalCycle(). |
|
Definition at line 298 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. |
|
Tests if a reference is to a TERMINAL node. Tests if a reference is to a functional node (CONTROL,
Definition at line 235 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. |
|
Returns a null reference inside the given module. The module that the reference is in is irrelevant.
Definition at line 78 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. Referenced by connectEquivalentNetsInGraph(), and findDriverOfEquivalentNets(). |
|
Returns the next state input of a SEQUENTIAL node.
Definition at line 252 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. |
|
Returns the driver of a TERMINAL node.
Definition at line 229 of file oagFpgaModGraph.h. References oagFpga::ModRef::ref. Referenced by findDriverOfEquivalentNets(). |
|
Creates an terminal node to represent the function of a net. If an terminal node is already associated with the net, then the existing one is returned. If a new terminal node is created, it will implement a null function.
Definition at line 749 of file oagFpgaModGraph.cpp. References oagFpga::Manager::prepareNetToBBConnection(). Referenced by getOutputs(). |
|
|
|
Creates a logical connection between an OpenAccess net and a graph TERMINAL node.
Definition at line 797 of file oagFpgaModGraph.cpp. References failIfInDifferentModules(), oagFpga::ModRef::module, oagFpga::ModRef::ref, and oagFpga::Manager::setNetToBBConnection(). |
|
Sets the driver of a given terminal. The reference must be to a TERMINAL node. The terminal and driver must be in the same module.
Definition at line 147 of file oagFpgaModGraph.cpp. References failIfInDifferentModules(), getGraph(), oagFpga::ModRef::ref, and oagFpga::RtlGraph::setTerminalDriver(). Referenced by connectEquivalentNetsInGraph(). |