CIRCT 20.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ResolveTracesPass Struct Reference
Inheritance diagram for ResolveTracesPass:
Inheritance graph
[legend]
Collaboration diagram for ResolveTracesPass:
Collaboration graph
[legend]

Public Member Functions

void runOnOperation () override
 

Private Member Functions

unsigned getSymbolIndex (Attribute attr)
 Get a symbol index and update symbol datastructures.
 
void buildTarget (AnnoPathValue &path, SmallString< 64 > &newTarget)
 Convert an annotation path to a string with symbol substitutions.
 
AnnoPathValue updateTargetImpl (Annotation &anno, FModuleLike &module, FIRRTLBaseType type, hw::InnerRefAttr name, AnnoTarget target)
 Internal implementation that updates an Annotation to add a "target" field based on the current location of the annotation in the circuit.
 
std::optional< AnnoPathValueupdatePortTarget (FModuleLike &module, Annotation &anno, unsigned portIdx, hw::InnerRefAttr innerRef)
 Add a "target" field to a port Annotation that indicates the current location of the port in the circuit.
 
std::optional< AnnoPathValueupdateTarget (FModuleLike &module, Operation *op, Annotation &anno, hw::InnerRefAttr innerRef)
 Add a "target" field to an Annotation that indicates the current location of a component in the circuit.
 
std::optional< AnnoPathValueupdateModuleTarget (FModuleLike &module, Annotation &anno)
 Add a "target" field to an Annotation on a Module that indicates the current location of the module.
 

Private Attributes

NLATablenlaTable
 Stores a pointer to an NLA Table.
 
hw::InnerSymbolTableCollection * istc
 Stores a pointer to an inner symbol table collection.
 
unsigned symbolIdx = 0
 Global symbol index used for substitutions, e.g., "{{42}}".
 
DenseMap< Attribute, unsigned > symbolMap
 Map of symbol to symbol index.
 
SmallVector< Attribute > symbols
 Symbol substitutions for the JSON verbatim op.
 

Detailed Description

Definition at line 75 of file ResolveTraces.cpp.

Member Function Documentation

◆ buildTarget()

void ResolveTracesPass::buildTarget ( AnnoPathValue path,
SmallString< 64 > &  newTarget 
)
inlineprivate

◆ getSymbolIndex()

unsigned ResolveTracesPass::getSymbolIndex ( Attribute  attr)
inlineprivate

Get a symbol index and update symbol datastructures.

Definition at line 101 of file ResolveTraces.cpp.

References symbolIdx, symbolMap, and symbols.

Referenced by buildTarget().

◆ runOnOperation()

void ResolveTracesPass::runOnOperation ( )
override

◆ updateModuleTarget()

std::optional< AnnoPathValue > ResolveTracesPass::updateModuleTarget ( FModuleLike &  module,
Annotation anno 
)
inlineprivate

Add a "target" field to an Annotation on a Module that indicates the current location of the module.

This will be local or non-local depending on the Annotation.

Definition at line 257 of file ResolveTraces.cpp.

References circt::firrtl::Annotation::getMember(), circt::firrtl::NLATable::getModule(), circt::firrtl::NLATable::getNLA(), istc, and nlaTable.

Referenced by runOnOperation().

◆ updatePortTarget()

std::optional< AnnoPathValue > ResolveTracesPass::updatePortTarget ( FModuleLike &  module,
Annotation anno,
unsigned  portIdx,
hw::InnerRefAttr  innerRef 
)
inlineprivate

Add a "target" field to a port Annotation that indicates the current location of the port in the circuit.

Definition at line 222 of file ResolveTraces.cpp.

References circt::firrtl::getBaseType(), and updateTargetImpl().

Referenced by runOnOperation().

◆ updateTarget()

std::optional< AnnoPathValue > ResolveTracesPass::updateTarget ( FModuleLike &  module,
Operation *  op,
Annotation anno,
hw::InnerRefAttr  innerRef 
)
inlineprivate

Add a "target" field to an Annotation that indicates the current location of a component in the circuit.

Definition at line 233 of file ResolveTraces.cpp.

References circt::firrtl::getBaseType(), and updateTargetImpl().

Referenced by runOnOperation().

◆ updateTargetImpl()

AnnoPathValue ResolveTracesPass::updateTargetImpl ( Annotation anno,
FModuleLike &  module,
FIRRTLBaseType  type,
hw::InnerRefAttr  name,
AnnoTarget  target 
)
inlineprivate

Internal implementation that updates an Annotation to add a "target" field based on the current location of the annotation in the circuit.

The value of the "target" will be a local target if the Annotation is local and a non-local target if the Annotation is non-local.

Definition at line 196 of file ResolveTraces.cpp.

References circt::firrtl::Annotation::getFieldID(), circt::firrtl::Annotation::getMember(), circt::firrtl::NLATable::getModule(), circt::firrtl::NLATable::getNLA(), istc, and nlaTable.

Referenced by updatePortTarget(), and updateTarget().

Member Data Documentation

◆ istc

hw::InnerSymbolTableCollection* ResolveTracesPass::istc
private

Stores a pointer to an inner symbol table collection.

Definition at line 87 of file ResolveTraces.cpp.

Referenced by runOnOperation(), updateModuleTarget(), and updateTargetImpl().

◆ nlaTable

NLATable* ResolveTracesPass::nlaTable
private

Stores a pointer to an NLA Table.

This is populated during runOnOperation.

Definition at line 84 of file ResolveTraces.cpp.

Referenced by runOnOperation(), updateModuleTarget(), and updateTargetImpl().

◆ symbolIdx

unsigned ResolveTracesPass::symbolIdx = 0
private

Global symbol index used for substitutions, e.g., "{{42}}".

This value is the next index that will be used.

Definition at line 91 of file ResolveTraces.cpp.

Referenced by getSymbolIndex().

◆ symbolMap

DenseMap<Attribute, unsigned> ResolveTracesPass::symbolMap
private

Map of symbol to symbol index.

This is used to reuse symbol substitutions.

Definition at line 95 of file ResolveTraces.cpp.

Referenced by getSymbolIndex().

◆ symbols

SmallVector<Attribute> ResolveTracesPass::symbols
private

Symbol substitutions for the JSON verbatim op.

Definition at line 98 of file ResolveTraces.cpp.

Referenced by getSymbolIndex(), and runOnOperation().


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