CIRCT 20.0.0git
|
Private Member Functions | |
hw::OutputFileAttr | getOutputFile (SymbolRefAttr layerName) |
hw::OutputFileAttr | outputFileForLayer (StringRef circuitName, SymbolRefAttr layerName) |
FModuleOp | buildNewModule (OpBuilder &builder, LayerBlockOp layerBlock, SmallVectorImpl< PortInfo > &ports) |
Safely build a new module with a given namehint. | |
FailureOr< InnerRefMap > | runOnModuleLike (FModuleLike moduleLike) |
Strip layer colors from the module's interface. | |
LogicalResult | runOnModuleBody (FModuleOp moduleOp, InnerRefMap &innerRefMap) |
Extract layerblocks and strip probe colors from all ops under the module. | |
void | removeLayersFromPorts (FModuleLike moduleLike) |
Update the module's port types to remove any explicit layer requirements from any probe types. | |
void | removeLayersFromValue (Value value) |
Update the value's type to remove any layers from any probe types. | |
void | removeLayersFromRefCast (RefCastOp cast) |
Remove any layers from the result of the cast. | |
void | lowerInlineLayerBlock (LayerOp layer, LayerBlockOp layerBlock) |
Lower an inline layerblock to an ifdef block. | |
void | preprocessLayers (CircuitNamespace &ns, OpBuilder &b, LayerOp layer, StringRef circuitName, SmallVector< FlatSymbolRefAttr > &stack) |
Preprocess layers to build macro declarations and cache information about the layers so that this can be quired later. | |
void | preprocessLayers (CircuitNamespace &ns, LayerOp layer, StringRef circuitName) |
void | runOnOperation () override |
Entry point for the function. | |
Private Attributes | |
llvm::sys::SmartMutex< true > * | circuitMutex |
Indicates exclusive access to modify the circuitNamespace and the circuit. | |
DenseMap< LayerBlockOp, StringRef > | moduleNames |
A map of layer blocks to module name that should be created for it. | |
DenseMap< LayerOp, FlatSymbolRefAttr > | macroNames |
A map from inline layers to their macro names. | |
DenseMap< SymbolRefAttr, LayerOp > | symbolToLayer |
A mapping of symbol name to layer operation. | |
Definition at line 138 of file LowerLayers.cpp.
|
private |
Safely build a new module with a given namehint.
Multi-process safe function to build a module in the circuit and return it.
This handles geting a lock to modify the top-level circuit.
The name provided is only a namehint for the module—a unique name will be generated if there are conflicts with the namehint in the circuit-level namespace.
Definition at line 212 of file LowerLayers.cpp.
References assert(), circuitMutex, getOutputFile(), and moduleNames.
Referenced by runOnModuleBody().
|
inlineprivate |
Definition at line 140 of file LowerLayers.cpp.
References symbolToLayer.
Referenced by buildNewModule(), and outputFileForLayer().
|
private |
Lower an inline layerblock to an ifdef block.
Definition at line 312 of file LowerLayers.cpp.
References macroNames.
Referenced by runOnModuleBody().
|
inlineprivate |
Definition at line 147 of file LowerLayers.cpp.
References fileNameForLayer(), and getOutputFile().
Referenced by runOnModuleBody().
|
private |
Definition at line 782 of file LowerLayers.cpp.
References preprocessLayers().
|
private |
Preprocess layers to build macro declarations and cache information about the layers so that this can be quired later.
Definition at line 755 of file LowerLayers.cpp.
References macroNameForLayer(), macroNames, circt::Namespace::newName(), preprocessLayers(), and symbolToLayer.
Referenced by preprocessLayers(), preprocessLayers(), and runOnOperation().
|
private |
Update the module's port types to remove any explicit layer requirements from any probe types.
Definition at line 253 of file LowerLayers.cpp.
References removeLayersFromValue().
Referenced by runOnModuleLike().
|
private |
Remove any layers from the result of the cast.
If the cast becomes a nop, remove the cast itself from the IR.
Definition at line 237 of file LowerLayers.cpp.
Referenced by runOnModuleBody().
|
private |
Update the value's type to remove any layers from any probe types.
Definition at line 230 of file LowerLayers.cpp.
Referenced by removeLayersFromPorts(), and runOnModuleBody().
|
private |
Extract layerblocks and strip probe colors from all ops under the module.
Definition at line 321 of file LowerLayers.cpp.
References assert(), buildNewModule(), circt::hw::InnerSymbolTable::get(), circt::firrtl::getFieldName(), circt::firrtl::getFieldRefForTarget(), instanceNameForLayer(), circt::isAncestorOfValueOwner(), lowerInlineLayerBlock(), moduleNames, circt::Namespace::newName(), outputFileForLayer(), removeLayersFromRefCast(), removeLayersFromValue(), and symbolToLayer.
Referenced by runOnModuleLike().
|
private |
Strip layer colors from the module's interface.
Definition at line 282 of file LowerLayers.cpp.
References removeLayersFromPorts(), and runOnModuleBody().
|
overrideprivate |
Entry point for the function.
Process a circuit to remove all layer blocks in each module and top-level layer definition.
Definition at line 791 of file LowerLayers.cpp.
References circuitMutex, empty, moduleNameForLayer(), moduleNames, circt::Namespace::newName(), preprocessLayers(), and circt::firrtl::transformReduce().
|
private |
Indicates exclusive access to modify the circuitNamespace and the circuit.
Definition at line 196 of file LowerLayers.cpp.
Referenced by buildNewModule(), and runOnOperation().
|
private |
A map from inline layers to their macro names.
Definition at line 202 of file LowerLayers.cpp.
Referenced by lowerInlineLayerBlock(), and preprocessLayers().
|
private |
A map of layer blocks to module name that should be created for it.
Definition at line 199 of file LowerLayers.cpp.
Referenced by buildNewModule(), runOnModuleBody(), and runOnOperation().
|
private |
A mapping of symbol name to layer operation.
Definition at line 205 of file LowerLayers.cpp.
Referenced by getOutputFile(), preprocessLayers(), and runOnModuleBody().