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

#include <HierPathCache.h>

Collaboration diagram for circt::hw::HierPathCache:
Collaboration graph
[legend]

Public Member Functions

 HierPathCache (Namespace *ns, OpBuilder::InsertPoint insertionPoint)
 
HierPathOp getOrCreatePath (ArrayAttr pathArray, Location loc, StringRef nameHint="xmrPath")
 Get an existing hw::HierPathOp at the default location in the circuit.
 
HierPathOp getOrCreatePath (ArrayAttr pathArray, Location loc, OpBuilder::InsertPoint &insertPoint, StringRef nameHint="xmrPath")
 Get an existing hw::HierPathOp at a specific location in the circuit.
 

Private Attributes

Namespacens
 A namespace in which symbols for hierarchical path ops will be created.
 
DenseMap< mlir::Attribute, hw::HierPathOp > pathCache
 A cache of already created HierPathOps.
 
OpBuilder::InsertPoint pathInsertPoint
 The insertion point where the pass inserts HierPathOps.
 

Detailed Description

Definition at line 30 of file HierPathCache.h.

Constructor & Destructor Documentation

◆ HierPathCache()

circt::hw::HierPathCache::HierPathCache ( Namespace ns,
OpBuilder::InsertPoint  insertionPoint 
)
inline

Definition at line 32 of file HierPathCache.h.

Member Function Documentation

◆ getOrCreatePath() [1/2]

HierPathOp circt::hw::HierPathCache::getOrCreatePath ( ArrayAttr  pathArray,
Location  loc,
OpBuilder::InsertPoint &  insertPoint,
StringRef  nameHint = "xmrPath" 
)

Get an existing hw::HierPathOp at a specific location in the circuit.

The insertion point will be updated to allow for this method to be used repeatedly to create the ops predictably, one after the other.

Definition at line 24 of file HierPathCache.cpp.

References assert(), circt::Namespace::newName(), ns, and pathCache.

◆ getOrCreatePath() [2/2]

HierPathOp circt::hw::HierPathCache::getOrCreatePath ( ArrayAttr  pathArray,
Location  loc,
StringRef  nameHint = "xmrPath" 
)

Get an existing hw::HierPathOp at the default location in the circuit.

Definition at line 19 of file HierPathCache.cpp.

References getOrCreatePath(), and pathInsertPoint.

Referenced by getOrCreatePath().

Member Data Documentation

◆ ns

Namespace* circt::hw::HierPathCache::ns
private

A namespace in which symbols for hierarchical path ops will be created.

Definition at line 48 of file HierPathCache.h.

Referenced by getOrCreatePath().

◆ pathCache

DenseMap<mlir::Attribute, hw::HierPathOp> circt::hw::HierPathCache::pathCache
private

A cache of already created HierPathOps.

This is used to avoid repeatedly creating the same HierPathOp.

Definition at line 52 of file HierPathCache.h.

Referenced by getOrCreatePath().

◆ pathInsertPoint

OpBuilder::InsertPoint circt::hw::HierPathCache::pathInsertPoint
private

The insertion point where the pass inserts HierPathOps.

Definition at line 55 of file HierPathCache.h.

Referenced by getOrCreatePath().


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