CIRCT 23.0.0git
Loading...
Searching...
No Matches
Private Member Functions | Private Attributes | List of all members
LowerXMRPass Class Reference
Inheritance diagram for LowerXMRPass:
Inheritance graph
[legend]
Collaboration diagram for LowerXMRPass:
Collaboration graph
[legend]

Private Member Functions

void runOnOperation () override
 
void getRefABIPrefix (FModuleLike mod, SmallVectorImpl< char > &prefix)
 Generate the ABI ref_<module> prefix string into prefix.
 
StringAttr getRefABIMacroForPort (FModuleLike mod, size_t portIndex, const Twine &prefix, bool backTick=false)
 Get full macro name as StringAttr for the specified ref port.
 
LogicalResult resolveReferencePath (mlir::TypedValue< RefType > refVal, ImplicitLocOpBuilder builder, mlir::FlatSymbolRefAttr &ref, SmallString< 128 > &stringLeaf)
 
LogicalResult resolveReference (mlir::TypedValue< RefType > refVal, ImplicitLocOpBuilder &builder, FlatSymbolRefAttr &ref, StringAttr &xmrAttr)
 
LogicalResult handleForceReleaseOp (Operation *op)
 
LogicalResult handleRefResolve (RefResolveOp resolve)
 
void setPortToRemove (Operation *op, size_t index, size_t numPorts)
 
LogicalResult handleInstanceOp (InstanceOp inst, InstanceGraph &instanceGraph)
 
LogicalResult handlePublicModuleRefPorts (FModuleOp module)
 
hw::InnerSymbolNamespace & getModuleNamespace (FModuleLike module)
 Get the cached namespace for a module.
 
InnerRefAttr getInnerRefTo (Value val)
 
InnerRefAttr getInnerRefTo (Operation *op)
 
void markForRemoval (Operation *op)
 
std::optional< size_t > getRemoteRefSend (Value val, bool errorIfNotFound=true)
 
size_t addReachingSendsEntry (Value atRefVal, XMRNode::SymOrIndexOp info, std::optional< size_t > continueFrom=std::nullopt)
 
void garbageCollect ()
 
bool isZeroWidth (FIRRTLBaseType t)
 

Private Attributes

DenseMap< Operation *, hw::InnerSymbolNamespace > moduleNamespaces
 Cached module namespaces.
 
DenseSet< Operation * > visitedModules
 
DenseMap< Value, size_t > dataflowAt
 Map of a reference value to an entry into refSendPathList.
 
SmallVector< XMRNode > refSendPathList
 refSendPathList is used to construct a path to the RefSendOp.
 
llvm::EquivalenceClasses< Value > * dataFlowClasses
 
DenseMap< Operation *, llvm::BitVector > refPortsToRemoveMap
 
SmallVector< Operation * > opsToRemove
 RefResolve, RefSend, and Connects involving them that will be removed.
 
DenseMap< size_t, SmallString< 128 > > xmrPathSuffix
 Record the internal path to an external module or a memory.
 
CircuitNamespacecircuitNamespace
 
hw::HierPathCache * hierPathCache
 Utility to create HerPathOps at a predefined location in the circuit.
 
DenseMap< FModuleOp, ModuleState > moduleStates
 Per-module helpers for creating operations within modules.
 

Detailed Description

Definition at line 126 of file LowerXMR.cpp.

Member Function Documentation

◆ addReachingSendsEntry()

size_t LowerXMRPass::addReachingSendsEntry ( Value  atRefVal,
XMRNode::SymOrIndexOp  info,
std::optional< size_t >  continueFrom = std::nullopt 
)
inlineprivate

Definition at line 791 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ garbageCollect()

void LowerXMRPass::garbageCollect ( )
inlineprivate

Definition at line 800 of file LowerXMR.cpp.

◆ getInnerRefTo() [1/2]

InnerRefAttr LowerXMRPass::getInnerRefTo ( Operation *  op)
inlineprivate

Definition at line 758 of file LowerXMR.cpp.

◆ getInnerRefTo() [2/2]

InnerRefAttr LowerXMRPass::getInnerRefTo ( Value  val)
inlineprivate

Definition at line 747 of file LowerXMR.cpp.

References circt::firrtl::getInnerRefTo().

Referenced by runOnOperation().

◆ getModuleNamespace()

hw::InnerSymbolNamespace & LowerXMRPass::getModuleNamespace ( FModuleLike  module)
inlineprivate

Get the cached namespace for a module.

Definition at line 743 of file LowerXMR.cpp.

◆ getRefABIMacroForPort()

StringAttr LowerXMRPass::getRefABIMacroForPort ( FModuleLike  mod,
size_t  portIndex,
const Twine &  prefix,
bool  backTick = false 
)
inlineprivate

Get full macro name as StringAttr for the specified ref port.

Uses existing 'prefix', optionally preprends the backtick character.

Definition at line 455 of file LowerXMR.cpp.

◆ getRefABIPrefix()

void LowerXMRPass::getRefABIPrefix ( FModuleLike  mod,
SmallVectorImpl< char > &  prefix 
)
inlineprivate

Generate the ABI ref_<module> prefix string into prefix.

Definition at line 446 of file LowerXMR.cpp.

References toVector().

◆ getRemoteRefSend()

std::optional< size_t > LowerXMRPass::getRemoteRefSend ( Value  val,
bool  errorIfNotFound = true 
)
inlineprivate

Definition at line 767 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ handleForceReleaseOp()

LogicalResult LowerXMRPass::handleForceReleaseOp ( Operation *  op)
inlineprivate

Definition at line 551 of file LowerXMR.cpp.

◆ handleInstanceOp()

LogicalResult LowerXMRPass::handleInstanceOp ( InstanceOp  inst,
InstanceGraph instanceGraph 
)
inlineprivate

Get the resolution string for this ref-type port.

Definition at line 612 of file LowerXMR.cpp.

References circt::firrtl::getInnerRefTo().

Referenced by runOnOperation().

◆ handlePublicModuleRefPorts()

LogicalResult LowerXMRPass::handlePublicModuleRefPorts ( FModuleOp  module)
inlineprivate

Definition at line 687 of file LowerXMR.cpp.

◆ handleRefResolve()

LogicalResult LowerXMRPass::handleRefResolve ( RefResolveOp  resolve)
inlineprivate

◆ isZeroWidth()

bool LowerXMRPass::isZeroWidth ( FIRRTLBaseType  t)
inlineprivate

Definition at line 847 of file LowerXMR.cpp.

References circt::firrtl::FIRRTLBaseType::getBitWidthOrSentinel().

Referenced by runOnOperation().

◆ markForRemoval()

void LowerXMRPass::markForRemoval ( Operation *  op)
inlineprivate

Definition at line 765 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ resolveReference()

LogicalResult LowerXMRPass::resolveReference ( mlir::TypedValue< RefType >  refVal,
ImplicitLocOpBuilder &  builder,
FlatSymbolRefAttr &  ref,
StringAttr &  xmrAttr 
)
inlineprivate

Definition at line 534 of file LowerXMR.cpp.

◆ resolveReferencePath()

LogicalResult LowerXMRPass::resolveReferencePath ( mlir::TypedValue< RefType >  refVal,
ImplicitLocOpBuilder  builder,
mlir::FlatSymbolRefAttr &  ref,
SmallString< 128 > &  stringLeaf 
)
inlineprivate

Definition at line 461 of file LowerXMR.cpp.

References assert(), and toVector().

◆ runOnOperation()

void LowerXMRPass::runOnOperation ( )
inlineoverrideprivate

◆ setPortToRemove()

void LowerXMRPass::setPortToRemove ( Operation *  op,
size_t  index,
size_t  numPorts 
)
inlineprivate

Definition at line 605 of file LowerXMR.cpp.

Referenced by runOnOperation().

Member Data Documentation

◆ circuitNamespace

CircuitNamespace* LowerXMRPass::circuitNamespace
private

Definition at line 879 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ dataflowAt

DenseMap<Value, size_t> LowerXMRPass::dataflowAt
private

Map of a reference value to an entry into refSendPathList.

Each entry in refSendPathList represents the path to RefSend. The path is required since there can be multiple paths to the RefSend and we need to identify a unique path.

Definition at line 858 of file LowerXMR.cpp.

◆ dataFlowClasses

llvm::EquivalenceClasses<Value>* LowerXMRPass::dataFlowClasses
private

Definition at line 869 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ hierPathCache

hw::HierPathCache* LowerXMRPass::hierPathCache
private

Utility to create HerPathOps at a predefined location in the circuit.

This handles caching and keeps the order consistent.

Definition at line 883 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ moduleNamespaces

DenseMap<Operation *, hw::InnerSymbolNamespace> LowerXMRPass::moduleNamespaces
private

Cached module namespaces.

Definition at line 851 of file LowerXMR.cpp.

◆ moduleStates

DenseMap<FModuleOp, ModuleState> LowerXMRPass::moduleStates
private

Per-module helpers for creating operations within modules.

Definition at line 886 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ opsToRemove

SmallVector<Operation *> LowerXMRPass::opsToRemove
private

RefResolve, RefSend, and Connects involving them that will be removed.

Definition at line 874 of file LowerXMR.cpp.

◆ refPortsToRemoveMap

DenseMap<Operation *, llvm::BitVector> LowerXMRPass::refPortsToRemoveMap
private

Definition at line 871 of file LowerXMR.cpp.

Referenced by runOnOperation().

◆ refSendPathList

SmallVector<XMRNode> LowerXMRPass::refSendPathList
private

refSendPathList is used to construct a path to the RefSendOp.

Each entry is an XMRNode, with an InnerRefAttr or indexing op, and a pointer to the next node in the path. The InnerRefAttr can be to an InstanceOp or to the XMR defining op, the index op records narrowing along path. All the nodes representing an InstanceOp or indexing operation must have a valid NextNodeOnPath. Only the node representing the final XMR defining op has no NextNodeOnPath, which denotes a leaf node on the path.

Definition at line 867 of file LowerXMR.cpp.

◆ visitedModules

DenseSet<Operation *> LowerXMRPass::visitedModules
private

Definition at line 853 of file LowerXMR.cpp.

◆ xmrPathSuffix

DenseMap<size_t, SmallString<128> > LowerXMRPass::xmrPathSuffix
private

Record the internal path to an external module or a memory.

Definition at line 877 of file LowerXMR.cpp.

Referenced by runOnOperation().


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