CIRCT  20.0.0git
Public Member Functions | Public Attributes | Private Attributes | List of all members
circt::igraph::InstancePathCache Struct Reference

A data structure that caches and provides absolute 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< InstancePathgetAbsolutePaths (ModuleOpInterface op, InstanceGraphNode *top)
 
void replaceInstance (InstanceOpInterface oldOp, InstanceOpInterface newOp)
 Replace an InstanceOp. This is required to keep the cache updated. More...
 
InstancePath appendInstance (InstancePath path, InstanceOpInterface inst)
 Append an instance to a path. More...
 
InstancePath prependInstance (InstanceOpInterface inst, InstancePath path)
 Prepend an instance to a path. More...
 

Public Attributes

InstanceGraphinstanceGraph
 The instance graph of the IR. More...
 

Private Attributes

llvm::BumpPtrAllocator allocator
 An allocator for individual instance paths and entire path lists. More...
 
DenseMap< Operation *, ArrayRef< InstancePath > > absolutePathsCache
 Cached absolute instance paths. More...
 

Detailed Description

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

Definition at line 329 of file InstanceGraph.h.

Constructor & Destructor Documentation

◆ InstancePathCache()

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

Definition at line 333 of file InstanceGraph.h.

Member Function Documentation

◆ appendInstance()

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

◆ getAbsolutePaths() [1/2]

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

◆ getAbsolutePaths() [2/2]

ArrayRef< InstancePath > InstancePathCache::getAbsolutePaths ( ModuleOpInterface  op,
InstanceGraphNode top 
)

Definition at line 237 of file InstanceGraph.cpp.

References empty, and circt::igraph::InstanceGraphNode::uses().

◆ 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 325 of file InstanceGraph.cpp.

Referenced by circt::firrtl::addPortsToModule().

Member Data Documentation

◆ absolutePathsCache

DenseMap<Operation *, ArrayRef<InstancePath> > circt::igraph::InstancePathCache::absolutePathsCache
private

Cached absolute instance paths.

Definition at line 353 of file InstanceGraph.h.

◆ allocator

llvm::BumpPtrAllocator circt::igraph::InstancePathCache::allocator
private

An allocator for individual instance paths and entire path lists.

Definition at line 350 of file InstanceGraph.h.

◆ instanceGraph

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

The instance graph of the IR.

Definition at line 331 of file InstanceGraph.h.

Referenced by circt::firrtl::addPortsToModule(), and lowerInternalPathAnno().


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