CIRCT 21.0.0git
|
A data structure that caches and provides paths to module instances in the IR. More...
#include <InstanceGraph.h>
Public Member Functions | |
InstancePathCache (InstanceGraph &instanceGraph) | |
ArrayRef< InstancePath > | getAbsolutePaths (ModuleOpInterface op) |
ArrayRef< InstancePath > | getRelativePaths (ModuleOpInterface op, InstanceGraphNode *node) |
void | replaceInstance (InstanceOpInterface oldOp, InstanceOpInterface newOp) |
Replace an InstanceOp. This is required to keep the cache updated. | |
InstancePath | appendInstance (InstancePath path, InstanceOpInterface inst) |
Append an instance to a path. | |
InstancePath | prependInstance (InstanceOpInterface inst, InstancePath path) |
Prepend an instance to a path. | |
Public Attributes | |
InstanceGraph & | instanceGraph |
The instance graph of the IR. | |
Private Types | |
using | PathsCache = DenseMap< Operation *, ArrayRef< InstancePath > > |
Private Member Functions | |
ArrayRef< InstancePath > | getPaths (ModuleOpInterface op, InstanceGraphNode *top, PathsCache &cache) |
Private Attributes | |
llvm::BumpPtrAllocator | allocator |
An allocator for individual instance paths and entire path lists. | |
PathsCache | absolutePathsCache |
Cached absolute instance paths. | |
DenseMap< InstanceGraphNode *, PathsCache > | relativePathsCache |
Cached relative instance paths. | |
A data structure that caches and provides paths to module instances in the IR.
Definition at line 350 of file InstanceGraph.h.
|
private |
Definition at line 374 of file InstanceGraph.h.
|
inlineexplicit |
Definition at line 354 of file InstanceGraph.h.
InstancePath InstancePathCache::appendInstance | ( | InstancePath | path, |
InstanceOpInterface | inst | ||
) |
Append an instance to a path.
Definition at line 314 of file InstanceGraph.cpp.
References allocator, circt::igraph::InstancePath::begin(), circt::igraph::InstancePath::end(), and circt::igraph::InstancePath::size().
Referenced by getPaths().
ArrayRef< InstancePath > InstancePathCache::getAbsolutePaths | ( | ModuleOpInterface | op | ) |
Definition at line 228 of file InstanceGraph.cpp.
References absolutePathsCache, getPaths(), circt::igraph::InstanceGraph::getTopLevelNode(), and instanceGraph.
Referenced by circt::firrtl::applyGCTMemTaps(), circt::firrtl::applyWiring(), getRelativePaths(), and lowerInternalPathAnno().
|
private |
Definition at line 241 of file InstanceGraph.cpp.
References allocator, appendInstance(), empty, getPaths(), instanceGraph, and circt::igraph::InstanceGraphNode::uses().
Referenced by getAbsolutePaths(), getPaths(), and getRelativePaths().
ArrayRef< InstancePath > InstancePathCache::getRelativePaths | ( | ModuleOpInterface | op, |
InstanceGraphNode * | node | ||
) |
Definition at line 233 of file InstanceGraph.cpp.
References getAbsolutePaths(), getPaths(), circt::igraph::InstanceGraph::getTopLevelNode(), instanceGraph, and relativePathsCache.
InstancePath InstancePathCache::prependInstance | ( | InstanceOpInterface | inst, |
InstancePath | path | ||
) |
Prepend an instance to a path.
Definition at line 323 of file InstanceGraph.cpp.
References allocator, circt::igraph::InstancePath::begin(), circt::igraph::InstancePath::end(), and circt::igraph::InstancePath::size().
void InstancePathCache::replaceInstance | ( | InstanceOpInterface | oldOp, |
InstanceOpInterface | newOp | ||
) |
Replace an InstanceOp. This is required to keep the cache updated.
Definition at line 332 of file InstanceGraph.cpp.
References absolutePathsCache, allocator, instanceGraph, relativePathsCache, and circt::igraph::InstanceGraph::replaceInstance().
Referenced by circt::firrtl::addPortsToModule().
|
private |
Cached absolute instance paths.
Definition at line 382 of file InstanceGraph.h.
Referenced by getAbsolutePaths(), and replaceInstance().
|
private |
An allocator for individual instance paths and entire path lists.
Definition at line 379 of file InstanceGraph.h.
Referenced by appendInstance(), getPaths(), prependInstance(), and replaceInstance().
InstanceGraph& circt::igraph::InstancePathCache::instanceGraph |
The instance graph of the IR.
Definition at line 352 of file InstanceGraph.h.
Referenced by circt::firrtl::addPortsToModule(), applyBodyTypeLoweringAnno(), getAbsolutePaths(), getPaths(), getRelativePaths(), lowerInternalPathAnno(), and replaceInstance().
|
private |
Cached relative instance paths.
Definition at line 385 of file InstanceGraph.h.
Referenced by getRelativePaths(), and replaceInstance().