|
slang-netlist
0.12.0
|
Represent the netlist connectivity of an elaborated design. More...
#include <NetlistGraph.hpp>
Classes | |
| struct | BitDriver |
| struct | SensitivitySource |
| A clock/reset signal driving a State node, paired with its edge kind. More... | |
Public Member Functions | |
| void | build (ast::Compilation &compilation, analysis::AnalysisManager &analysisManager, BuilderOptions options={}) |
| auto | lookup (std::string_view name) const -> NetlistNode * |
| auto | lookup (std::string_view name, DriverBitRange bounds) const -> std::vector< NetlistNode * > |
| auto | getDrivers (std::string_view name, DriverBitRange bounds) const -> std::vector< NetlistNode * > |
| auto | getDrivers (NetlistNode const &node) const -> std::vector< NetlistNode * > |
| auto | getBitDrivers (std::string_view name, DriverBitRange bounds) const -> std::vector< BitDriver > |
| auto | getBitDrivers (std::string_view name) const -> std::vector< BitDriver > |
| auto | getCombFanOut (NetlistNode &node) const -> std::vector< NetlistNode * > |
| auto | getCombFanIn (NetlistNode &node) const -> std::vector< NetlistNode * > |
| auto | getSensitivity (NetlistNode &node) const -> std::vector< SensitivitySource > |
| auto | getConstantDrivers (NetlistNode &node) const -> std::vector< NetlistNode * > |
| auto | findNodes (std::string_view pattern) const -> std::vector< NetlistNode * > |
| auto | findNodesRegex (std::string_view pattern) const -> std::vector< NetlistNode * > |
Find named nodes whose hierarchical path matches the regex pattern. | |
| auto | filterNodes (NodeKind kind) const |
| void | mergeParallelEdges () |
| auto | getBuildProfile () const -> BuildProfile const & |
| Return the profiling data from the last build() call. | |
| void | setBuildProfile (BuildProfile const &profile) |
| Set the profiling data (called internally by NetlistBuilder). | |
| void | addBlackBoxPath (std::string path) |
| Record the hierarchical path of a black-boxed instance. | |
| auto | getBlackBoxPaths () const -> std::span< std::string const > |
| Return the hierarchical paths of the black-boxed instances. | |
| auto | getBlackBoxCoverage (NetlistNode const &node) const -> BlackBoxCoverage |
| Public Member Functions inherited from slang::netlist::DirectedGraph< NetlistNode, NetlistEdge > | |
| DirectedGraph ()=default | |
| auto | begin () const -> const_iterator |
| auto | end () const -> const_iterator |
| auto | findNode (const NetlistNode &nodeToFind) const -> node_descriptor |
| auto | getNode (node_descriptor node) const -> NetlistNode & |
| Given a node descriptor, return the node by reference. | |
| auto | addNode () -> NetlistNode & |
| auto | removeNode (NetlistNode &nodeToRemove) -> bool |
| auto | getOrAddEdge (NetlistNode &sourceNode, NetlistNode &targetNode) -> NetlistEdge & |
| auto | addEdge (NetlistNode &sourceNode, NetlistNode &targetNode) -> NetlistEdge & |
| auto | removeEdge (NetlistNode &sourceNode, NetlistNode &targetNode) -> bool |
| auto | outDegree (const NetlistNode &node) const -> size_t |
| Return the number of edges outgoing from the specified node. | |
| auto | inDegree (const NetlistNode &node) const -> size_t |
| Return the number of edges incident to the specified node. | |
| auto | numNodes () const -> size_t |
| Return the size of the graph. | |
| auto | numEdges () const -> size_t |
| Return the number of edges in the graph. | |
Public Attributes | |
| FileTable | fileTable |
| SymbolTable | symbolTable |
Additional Inherited Members | |
| Public Types inherited from slang::netlist::DirectedGraph< NetlistNode, NetlistEdge > | |
| using | NodePtrType |
| using | NodeListType |
| using | iterator |
| using | const_iterator |
| using | node_descriptor |
| using | edge_descriptor |
| using | DirectedGraphType |
| Static Public Attributes inherited from slang::netlist::DirectedGraph< NetlistNode, NetlistEdge > | |
| static const size_t | null_node |
| Protected Attributes inherited from slang::netlist::DirectedGraph< NetlistNode, NetlistEdge > | |
| std::mutex | nodesMutex |
| NodeListType | nodes |
Represent the netlist connectivity of an elaborated design.
|
inline |
Record the hierarchical path of a black-boxed instance.
| void slang::netlist::NetlistGraph::build | ( | ast::Compilation & | compilation, |
| analysis::AnalysisManager & | analysisManager, | ||
| BuilderOptions | options = {} ) |
Build the netlist from an elaborated compilation.
Caller is responsible for having run VisitAll, frozen the compilation, and run the analysis manager prior to this call. options configures the build, including parallel execution, thread pool size, and precision upgrades; see BuilderOptions.
|
inlinenodiscard |
Return a view of all nodes of the specified kind.
| kind | The kind of nodes to filter. |
|
nodiscard |
Find named nodes whose hierarchical path matches the glob pattern.
Supported wildcards: * zero or more characters within a single path segment (does not cross .). **, ... zero or more characters including . (recursive). ? exactly one character within a single path segment.
|
nodiscard |
Find named nodes whose hierarchical path matches the regex pattern.
|
nodiscard |
Return the per-bit drivers of the entire symbol name.
Equivalent to getBitDrivers over the symbol's whole width; use this when no bit range is specified, since a symbol may be split across several driver nodes by bit-aligned resolution.
|
nodiscard |
Return the per-bit drivers of the symbol name over bounds.
Unlike getDrivers, which returns the deduplicated set of driver nodes, this keeps one entry per contributing edge, each clipped to the sub-range of name that the driver actually covers, so callers can report bit-level provenance. Entries are sorted by ascending bit position and deduplicated on (bounds, driver).
|
nodiscard |
Classify a node against the recorded black-box instance paths.
A Port node directly below a black-boxed instance is on the boundary; any other node at or below a black-boxed instance is contained. Nodes with no hierarchical path, or outside every box, are outside. Containment takes precedence over the boundary when boxes nest.
|
inlinenodiscard |
Return the hierarchical paths of the black-boxed instances.
|
inlinenodiscard |
Return the profiling data from the last build() call.
|
nodiscard |
Return all nodes that can reach node via combinational edges in the backward (fan-in) direction. The traversal stops at State nodes.
|
nodiscard |
Return all nodes reachable from node via combinational edges in the forward (fan-out) direction. The traversal stops at State nodes.
|
nodiscard |
Return the Constant nodes feeding node if its combinational fan-in bottoms out only at Constants (i.e. the sink is tied off to literal values). Returns an empty vector if any non-constant source reaches node — namely a State node (depends on a register) or an undriven top-level input Port (depends on an external signal) — or if node has no Constant in its fan-in at all.
Variables, Assignments, Conditionals, Cases, Merges, and driven Ports in the fan-in are treated as pass-throughs.
|
nodiscard |
Return the unique nodes with an incoming edge to node.
This returns immediate drivers only. Use getCombFanIn for recursive combinational fan-in.
|
nodiscard |
Return the set of driver nodes for the symbol with the given hierarchical name over the bit range bounds.
A driver is any node that is the source of an edge annotated with a matching symbol reference whose bounds overlap bounds. Each driver is reported at most once.
|
nodiscard |
|
nodiscard |
Lookup a node in the graph by its hierarchical name.
| name | The hierarchical name of the node. |
|
nodiscard |
| void slang::netlist::NetlistGraph::mergeParallelEdges | ( | ) |
Collapse parallel edges that carry abutting or overlapping ranges of the same symbol into one edge spanning the union of their ranges.
Only edges sharing a source, a target, a symbol and an edge kind are combined, so connectivity is unchanged. Run as the last step of build(), where it establishes the invariant that each (source, target, symbol, edge kind) relation holds one edge per maximal contiguous range, regardless of the order in which those ranges were emitted. Edges added afterwards may break that invariant.
|
inline |
Set the profiling data (called internally by NetlistBuilder).
| FileTable slang::netlist::NetlistGraph::fileTable |
| SymbolTable slang::netlist::NetlistGraph::symbolTable |