Loading [MathJax]/extensions/tex2jax.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
circt::igraph::InstancePathCache Struct Reference

A data structure that caches and provides paths to module instances in the IR. More...

#include <InstanceGraph.h>

Collaboration diagram for circt::igraph::InstancePathCache:
Collaboration graph
[legend]

Public Member Functions

 InstancePathCache (InstanceGraph &instanceGraph)
 
ArrayRef< InstancePathgetAbsolutePaths (ModuleOpInterface op)
 
ArrayRef< InstancePathgetRelativePaths (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

InstanceGraphinstanceGraph
 The instance graph of the IR.
 

Private Types

using PathsCache = DenseMap< Operation *, ArrayRef< InstancePath > >
 

Private Member Functions

ArrayRef< InstancePathgetPaths (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 *, PathsCacherelativePathsCache
 Cached relative instance paths.
 

Detailed Description

A data structure that caches and provides paths to module instances in the IR.

Definition at line 350 of file InstanceGraph.h.

Member Typedef Documentation

◆ PathsCache

using circt::igraph::InstancePathCache::PathsCache = DenseMap<Operation *, ArrayRef<InstancePath> >
private

Definition at line 374 of file InstanceGraph.h.

Constructor & Destructor Documentation

◆ InstancePathCache()

circt::igraph::InstancePathCache::InstancePathCache ( InstanceGraph instanceGraph)
inlineexplicit

Definition at line 354 of file InstanceGraph.h.

Member Function Documentation

◆ appendInstance()

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().

◆ getAbsolutePaths()

ArrayRef< InstancePath > InstancePathCache::getAbsolutePaths ( ModuleOpInterface  op)

◆ getPaths()

ArrayRef< InstancePath > InstancePathCache::getPaths ( ModuleOpInterface  op,
InstanceGraphNode top,
PathsCache cache 
)
private

◆ getRelativePaths()

ArrayRef< InstancePath > InstancePathCache::getRelativePaths ( ModuleOpInterface  op,
InstanceGraphNode node 
)

◆ prependInstance()

InstancePath InstancePathCache::prependInstance ( InstanceOpInterface  inst,
InstancePath  path 
)

◆ replaceInstance()

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().

Member Data Documentation

◆ absolutePathsCache

PathsCache circt::igraph::InstancePathCache::absolutePathsCache
private

Cached absolute instance paths.

Definition at line 382 of file InstanceGraph.h.

Referenced by getAbsolutePaths(), and replaceInstance().

◆ allocator

llvm::BumpPtrAllocator circt::igraph::InstancePathCache::allocator
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

InstanceGraph& circt::igraph::InstancePathCache::instanceGraph

◆ relativePathsCache

DenseMap<InstanceGraphNode *, PathsCache> circt::igraph::InstancePathCache::relativePathsCache
private

Cached relative instance paths.

Definition at line 385 of file InstanceGraph.h.

Referenced by getRelativePaths(), and replaceInstance().


The documentation for this struct was generated from the following files: