CIRCT 24.0.0git
Loading...
Searching...
No Matches
LowerClasses.cpp File Reference
#include "circt/Analysis/FIRRTLInstanceInfo.h"
#include "circt/Dialect/FIRRTL/FIRRTLAnnotationHelper.h"
#include "circt/Dialect/FIRRTL/FIRRTLAnnotations.h"
#include "circt/Dialect/FIRRTL/FIRRTLDialect.h"
#include "circt/Dialect/FIRRTL/FIRRTLTypes.h"
#include "circt/Dialect/FIRRTL/FIRRTLUtils.h"
#include "circt/Dialect/FIRRTL/OwningModuleCache.h"
#include "circt/Dialect/FIRRTL/Passes.h"
#include "circt/Dialect/HW/InnerSymbolNamespace.h"
#include "circt/Dialect/OM/OMAttributes.h"
#include "circt/Dialect/OM/OMOps.h"
#include "circt/Support/ConversionPatternSet.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/IR/Threading.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "circt/Dialect/FIRRTL/Passes.h.inc"
Include dependency graph for LowerClasses.cpp:

Go to the source code of this file.

Namespaces

namespace  circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
namespace  circt::firrtl

Macros

#define GEN_PASS_DEF_LOWERCLASSES

Functions

void checkAddContainingModulePorts (bool hasContainingModule, OpBuilder builder, SmallVector< Attribute > &fieldNames, SmallVector< NamedAttribute > &fieldTypes)
static om::ClassLike convertExtClass (FModuleLike moduleLike, OpBuilder builder, Twine name, ArrayRef< StringRef > formalParamNames, bool hasContainingModule)
static om::ClassLike convertClass (FModuleLike moduleLike, OpBuilder builder, Twine name, ArrayRef< StringRef > formalParamNames, bool hasContainingModule)
static LogicalResult lowerObjectInClass (FObjectLike firrtlObject, ArrayRef< Value > args, firrtl::PathOp containingModuleRef, SmallVectorImpl< RtlPortsInfo > &rtlPortsToCreate, std::mutex &intraPassMutex, SmallVectorImpl< Operation * > &opsToErase)
static LogicalResult updateObjectInClass (firrtl::ObjectOp firrtlObject, const PathInfoTable &pathInfoTable, SmallVectorImpl< RtlPortsInfo > &rtlPortsToCreate, std::mutex &intraPassMutex, SmallVectorImpl< Operation * > &opsToErase)
static LogicalResult updateObjectInClass (firrtl::ObjectCreateOp firrtlObject, const PathInfoTable &pathInfoTable, SmallVectorImpl< RtlPortsInfo > &rtlPortsToCreate, std::mutex &intraPassMutex, SmallVectorImpl< Operation * > &opsToErase)
static LogicalResult updateInstanceInClass (InstanceOp firrtlInstance, hw::HierPathOp hierPath, InstanceGraph &instanceGraph, const PathInfoTable &pathInfoTable, SmallVectorImpl< Operation * > &opsToErase)
static LogicalResult updateInstanceInModule (InstanceOp firrtlInstance, InstanceGraph &instanceGraph, SmallVectorImpl< Operation * > &opsToErase)
static LogicalResult updateInstancesInModule (FModuleOp moduleOp, InstanceGraph &instanceGraph, SmallVectorImpl< Operation * > &opsToErase)
static LogicalResult updateObjectsAndInstancesInClass (om::ClassOp classOp, InstanceGraph &instanceGraph, const LoweringState &state, const PathInfoTable &pathInfoTable, SmallVectorImpl< RtlPortsInfo > &rtlPortsToCreate, std::mutex &intraPassMutex, SmallVectorImpl< Operation * > &opsToErase)
static void populateConversionTarget (ConversionTarget &target)
static void populateTypeConverter (TypeConverter &converter)
static void populateRewritePatterns (ConversionPatternSet &patterns, TypeConverter &converter, const PathInfoTable &pathInfoTable, const DenseMap< StringAttr, firrtl::ClassType > &classTypeTable)

Macro Definition Documentation

◆ GEN_PASS_DEF_LOWERCLASSES

#define GEN_PASS_DEF_LOWERCLASSES

Definition at line 37 of file LowerClasses.cpp.

Function Documentation

◆ checkAddContainingModulePorts()

void checkAddContainingModulePorts ( bool hasContainingModule,
OpBuilder builder,
SmallVector< Attribute > & fieldNames,
SmallVector< NamedAttribute > & fieldTypes )

Definition at line 1086 of file LowerClasses.cpp.

Referenced by convertClass(), and convertExtClass().

◆ convertClass()

om::ClassLike convertClass ( FModuleLike moduleLike,
OpBuilder builder,
Twine name,
ArrayRef< StringRef > formalParamNames,
bool hasContainingModule )
static

Definition at line 1121 of file LowerClasses.cpp.

References checkAddContainingModulePorts().

◆ convertExtClass()

om::ClassLike convertExtClass ( FModuleLike moduleLike,
OpBuilder builder,
Twine name,
ArrayRef< StringRef > formalParamNames,
bool hasContainingModule )
static

Definition at line 1097 of file LowerClasses.cpp.

References checkAddContainingModulePorts(), and circt::firrtl::In.

◆ lowerObjectInClass()

LogicalResult lowerObjectInClass ( FObjectLike firrtlObject,
ArrayRef< Value > args,
firrtl::PathOp containingModuleRef,
SmallVectorImpl< RtlPortsInfo > & rtlPortsToCreate,
std::mutex & intraPassMutex,
SmallVectorImpl< Operation * > & opsToErase )
static

Definition at line 1353 of file LowerClasses.cpp.

References getLoc(), and success().

Referenced by updateObjectInClass(), and updateObjectInClass().

◆ populateConversionTarget()

void populateConversionTarget ( ConversionTarget & target)
static

Definition at line 2245 of file LowerClasses.cpp.

References failure().

◆ populateRewritePatterns()

void populateRewritePatterns ( ConversionPatternSet & patterns,
TypeConverter & converter,
const PathInfoTable & pathInfoTable,
const DenseMap< StringAttr, firrtl::ClassType > & classTypeTable )
static

Definition at line 2380 of file LowerClasses.cpp.

◆ populateTypeConverter()

void populateTypeConverter ( TypeConverter & converter)
static

Definition at line 2291 of file LowerClasses.cpp.

References assert(), and elementType.

◆ updateInstanceInClass()

LogicalResult updateInstanceInClass ( InstanceOp firrtlInstance,
hw::HierPathOp hierPath,
InstanceGraph & instanceGraph,
const PathInfoTable & pathInfoTable,
SmallVectorImpl< Operation * > & opsToErase )
static

◆ updateInstanceInModule()

LogicalResult updateInstanceInModule ( InstanceOp firrtlInstance,
InstanceGraph & instanceGraph,
SmallVectorImpl< Operation * > & opsToErase )
static

◆ updateInstancesInModule()

LogicalResult updateInstancesInModule ( FModuleOp moduleOp,
InstanceGraph & instanceGraph,
SmallVectorImpl< Operation * > & opsToErase )
static

Definition at line 1630 of file LowerClasses.cpp.

References assert(), failure(), success(), and updateInstanceInModule().

◆ updateObjectInClass() [1/2]

LogicalResult updateObjectInClass ( firrtl::ObjectCreateOp firrtlObject,
const PathInfoTable & pathInfoTable,
SmallVectorImpl< RtlPortsInfo > & rtlPortsToCreate,
std::mutex & intraPassMutex,
SmallVectorImpl< Operation * > & opsToErase )
static

Definition at line 1476 of file LowerClasses.cpp.

References assert(), and lowerObjectInClass().

◆ updateObjectInClass() [2/2]

LogicalResult updateObjectInClass ( firrtl::ObjectOp firrtlObject,
const PathInfoTable & pathInfoTable,
SmallVectorImpl< RtlPortsInfo > & rtlPortsToCreate,
std::mutex & intraPassMutex,
SmallVectorImpl< Operation * > & opsToErase )
static

◆ updateObjectsAndInstancesInClass()

LogicalResult updateObjectsAndInstancesInClass ( om::ClassOp classOp,
InstanceGraph & instanceGraph,
const LoweringState & state,
const PathInfoTable & pathInfoTable,
SmallVectorImpl< RtlPortsInfo > & rtlPortsToCreate,
std::mutex & intraPassMutex,
SmallVectorImpl< Operation * > & opsToErase )
static