|
CIRCT 22.0.0git
|
A helper class to facilitate the conversion from a Slang AST to MLIR operations. More...
#include <ImportVerilogInternals.h>

Public Types | |
| using | ValueSymbols = llvm::ScopedHashTable< const slang::ast::ValueSymbol *, Value > |
| A table of defined values, such as variables, that may be referred to by name in expressions. | |
| using | ValueSymbolScope = ValueSymbols::ScopeTy |
Public Member Functions | |
| Context (const ImportVerilogOptions &options, slang::ast::Compilation &compilation, mlir::ModuleOp intoModuleOp, const slang::SourceManager &sourceManager) | |
| Context (const Context &)=delete | |
| MLIRContext * | getContext () |
| Return the MLIR context. | |
| Location | convertLocation (slang::SourceLocation loc) |
Convert a slang SourceLocation into an MLIR Location. | |
| Location | convertLocation (slang::SourceRange range) |
Convert a slang SourceRange into an MLIR Location. | |
| Type | convertType (const slang::ast::Type &type, LocationAttr loc={}) |
| Convert a slang type into an MLIR type. | |
| Type | convertType (const slang::ast::DeclaredType &type) |
| LogicalResult | convertCompilation () |
| Convert hierarchy and structure AST nodes to MLIR ops. | |
| ModuleLowering * | convertModuleHeader (const slang::ast::InstanceBodySymbol *module) |
| Convert a module and its ports to an empty module op in the IR. | |
| LogicalResult | convertModuleBody (const slang::ast::InstanceBodySymbol *module) |
| Convert a module's body to the corresponding IR ops. | |
| LogicalResult | convertPackage (const slang::ast::PackageSymbol &package) |
| Convert a package and its contents. | |
| FunctionLowering * | declareFunction (const slang::ast::SubroutineSymbol &subroutine) |
| Convert a function and its arguments to a function declaration in the IR. | |
| LogicalResult | convertFunction (const slang::ast::SubroutineSymbol &subroutine) |
| Convert a function. | |
| LogicalResult | finalizeFunctionBodyCaptures (FunctionLowering &lowering) |
| LogicalResult | convertClassDeclaration (const slang::ast::ClassType &classdecl) |
| ClassLowering * | declareClass (const slang::ast::ClassType &cls) |
| LogicalResult | convertGlobalVariable (const slang::ast::VariableSymbol &var) |
Convert a variable to a moore.global_variable operation. | |
| bool | isClassDerivedFrom (const moore::ClassHandleType &actualTy, const moore::ClassHandleType &baseTy) |
| Checks whether one class (actualTy) is derived from another class (baseTy). | |
| moore::ClassHandleType | getAncestorClassWithProperty (const moore::ClassHandleType &actualTy, StringRef fieldName) |
| Tries to find the closest base class of actualTy that carries a property with name fieldName. | |
| Value | getImplicitThisRef () const |
| LogicalResult | convertStatement (const slang::ast::Statement &stmt) |
| Value | convertRvalueExpression (const slang::ast::Expression &expr, Type requiredType={}) |
| Value | convertLvalueExpression (const slang::ast::Expression &expr) |
| Value | convertAssertionExpression (const slang::ast::AssertionExpr &expr, Location loc) |
| Value | convertAssertionCallExpression (const slang::ast::CallExpression &expr, const slang::ast::CallExpression::SystemCallInfo &info, Location loc) |
| LogicalResult | collectHierarchicalValues (const slang::ast::Expression &expr, const slang::ast::Symbol &outermostModule) |
| LogicalResult | traverseInstanceBody (const slang::ast::Symbol &symbol) |
| LogicalResult | convertTimingControl (const slang::ast::TimingControl &ctrl) |
| LogicalResult | convertTimingControl (const slang::ast::TimingControl &ctrl, const slang::ast::Statement &stmt) |
| Value | convertToI1 (Value value) |
| Helper function to convert a value to a MLIR I1 value. | |
| Value | convertLTLTimingControl (const slang::ast::TimingControl &ctrl, const Value &seqOrPro) |
| Value | convertToBool (Value value) |
| Helper function to convert a value to its "truthy" boolean value. | |
| Value | convertToBool (Value value, Domain domain) |
| Helper function to convert a value to its "truthy" boolean value and convert it to the given domain. | |
| Value | convertToSimpleBitVector (Value value) |
| Helper function to convert a value to its simple bit vector representation, if it has one. | |
| Value | materializeConversion (Type type, Value value, bool isSigned, Location loc) |
| Helper function to insert the necessary operations to cast a value from one type to another. | |
| Value | materializeSVInt (const slang::SVInt &svint, const slang::ast::Type &type, Location loc) |
Helper function to materialize an SVInt as an SSA value. | |
| Value | materializeSVReal (const slang::ConstantValue &svreal, const slang::ast::Type &type, Location loc) |
| Helper function to materialize a real value as an SSA value. | |
| Value | materializeString (const slang::ConstantValue &string, const slang::ast::Type &astType, Location loc) |
| Helper function to materialize a string as an SSA value. | |
| Value | materializeFixedSizeUnpackedArrayType (const slang::ConstantValue &constant, const slang::ast::FixedSizeUnpackedArrayType &astType, Location loc) |
Helper function to materialize an unpacked array of SVInts as an SSA value. | |
| Value | materializeConstant (const slang::ConstantValue &constant, const slang::ast::Type &type, Location loc) |
Helper function to materialize a ConstantValue as an SSA value. | |
| FailureOr< Value > | convertFormatString (std::span< const slang::ast::Expression *const > arguments, Location loc, moore::IntFormat defaultFormat=moore::IntFormat::Decimal, bool appendNewline=false) |
Convert a list of string literal arguments with formatting specifiers and arguments to be interpolated into a !moore.format_string value. | |
| FailureOr< Value > | convertSystemCallArity0 (const slang::ast::SystemSubroutine &subroutine, Location loc) |
| Convert system function calls only have arity-0. | |
| FailureOr< Value > | convertSystemCallArity1 (const slang::ast::SystemSubroutine &subroutine, Location loc, Value value) |
| Convert system function calls only have arity-1. | |
| FailureOr< Value > | convertSystemCallArity2 (const slang::ast::SystemSubroutine &subroutine, Location loc, Value value1, Value value2) |
| Convert system function calls with arity-2. | |
| FailureOr< Value > | convertAssertionSystemCallArity1 (const slang::ast::SystemSubroutine &subroutine, Location loc, Value value) |
| Convert system function calls within properties and assertion with a single argument. | |
| slang::ConstantValue | evaluateConstant (const slang::ast::Expression &expr) |
| Evaluate the constant value of an expression. | |
Public Attributes | |
| const ImportVerilogOptions & | options |
| slang::ast::Compilation & | compilation |
| mlir::ModuleOp | intoModuleOp |
| const slang::SourceManager & | sourceManager |
| OpBuilder | builder |
| The builder used to create IR operations. | |
| SymbolTable | symbolTable |
| A symbol table of the MLIR module we are emitting into. | |
| std::map< slang::SourceLocation, Operation * > | orderedRootOps |
| The top-level operations ordered by their Slang source location. | |
| DenseMap< const slang::ast::InstanceBodySymbol *, std::unique_ptr< ModuleLowering > > | modules |
| How we have lowered modules to MLIR. | |
| std::queue< const slang::ast::InstanceBodySymbol * > | moduleWorklist |
| A list of modules for which the header has been created, but the body has not been converted yet. | |
| DenseMap< const slang::ast::SubroutineSymbol *, std::unique_ptr< FunctionLowering > > | functions |
| Functions that have already been converted. | |
| DenseMap< const slang::ast::ClassType *, std::unique_ptr< ClassLowering > > | classes |
| Classes that have already been converted. | |
| ValueSymbols | valueSymbols |
| DenseMap< const slang::ast::ValueSymbol *, moore::GlobalVariableOp > | globalVariables |
| A table of defined global variables that may be referred to by name in expressions. | |
| SmallVector< const slang::ast::ValueSymbol * > | globalVariableWorklist |
| A list of global variables that still need their initializers to be converted. | |
| DenseMap< const slang::ast::InstanceBodySymbol *, SmallVector< HierPathInfo > > | hierPaths |
| Collect all hierarchical names used for the per module/instance. | |
| DenseSet< StringAttr > | sameHierPaths |
| It's used to collect the repeat hierarchical names on the same path. | |
| SmallVector< Value > | lvalueStack |
| A stack of assignment left-hand side values. | |
| SmallVector< LoopFrame > | loopStack |
| A stack of loop continuation and exit blocks. | |
| std::function< void(moore::ReadOp)> | rvalueReadCallback |
| A listener called for every variable or net being read. | |
| std::function< void(mlir::Operation *)> | variableAssignCallback |
| A listener called for every variable or net being assigned. | |
| slang::TimeScale | timeScale |
| The time scale currently in effect. | |
| Value | currentThisRef = {} |
Variable to track the value of the current function's implicit this reference. | |
Private Member Functions | |
| FunctionLowering * | declareCallableImpl (const slang::ast::SubroutineSymbol &subroutine, mlir::StringRef qualifiedName, llvm::SmallVectorImpl< Type > &extraParams) |
| Helper function to extract the commonalities in lowering of functions and methods. | |
A helper class to facilitate the conversion from a Slang AST to MLIR operations.
Keeps track of the destination MLIR module, builders, and various worklists and utilities needed for conversion.
Definition at line 88 of file ImportVerilogInternals.h.
| using circt::ImportVerilog::Context::ValueSymbols = llvm::ScopedHashTable<const slang::ast::ValueSymbol *, Value> |
A table of defined values, such as variables, that may be referred to by name in expressions.
The expressions use this table to lookup the MLIR value that was created for a given declaration in the Slang AST node.
Definition at line 289 of file ImportVerilogInternals.h.
| using circt::ImportVerilog::Context::ValueSymbolScope = ValueSymbols::ScopeTy |
Definition at line 291 of file ImportVerilogInternals.h.
|
inline |
Definition at line 89 of file ImportVerilogInternals.h.
|
delete |
| LogicalResult Context::collectHierarchicalValues | ( | const slang::ast::Expression & | expr, |
| const slang::ast::Symbol & | outermostModule | ||
| ) |
Definition at line 114 of file HierarchicalNames.cpp.
References convertLocation().
| Value Context::convertAssertionCallExpression | ( | const slang::ast::CallExpression & | expr, |
| const slang::ast::CallExpression::SystemCallInfo & | info, | ||
| Location | loc | ||
| ) |
Definition at line 353 of file AssertionExpr.cpp.
References builder, convertAssertionSystemCallArity1(), and convertRvalueExpression().
| Value Context::convertAssertionExpression | ( | const slang::ast::AssertionExpr & | expr, |
| Location | loc | ||
| ) |
Definition at line 386 of file AssertionExpr.cpp.
| FailureOr< Value > Context::convertAssertionSystemCallArity1 | ( | const slang::ast::SystemSubroutine & | subroutine, |
| Location | loc, | ||
| Value | value | ||
| ) |
Convert system function calls within properties and assertion with a single argument.
Definition at line 296 of file AssertionExpr.cpp.
References builder.
Referenced by convertAssertionCallExpression().
| LogicalResult Context::convertClassDeclaration | ( | const slang::ast::ClassType & | classdecl | ) |
Definition at line 1729 of file Structure.cpp.
References classes, declareClass(), and timeScale.
Referenced by declareClass().
| LogicalResult Context::convertCompilation | ( | ) |
Convert hierarchy and structure AST nodes to MLIR ops.
Convert an entire Slang compilation to MLIR ops.
This is the main entry point for the conversion.
Definition at line 673 of file Structure.cpp.
References builder, compilation, convertLocation(), convertModuleBody(), convertModuleHeader(), convertRvalueExpression(), globalVariables, globalVariableWorklist, moduleWorklist, timeScale, and traverseInstanceBody().
| FailureOr< Value > Context::convertFormatString | ( | std::span< const slang::ast::Expression *const > | arguments, |
| Location | loc, | ||
| moore::IntFormat | defaultFormat = moore::IntFormat::Decimal, |
||
| bool | appendNewline = false |
||
| ) |
Convert a list of string literal arguments with formatting specifiers and arguments to be interpolated into a !moore.format_string value.
Returns failure if an error occurs. Returns a null value if the formatted string is trivially empty. Otherwise returns the formatted string.
Definition at line 292 of file FormatStrings.cpp.
| LogicalResult Context::convertFunction | ( | const slang::ast::SubroutineSymbol & | subroutine | ) |
Convert a function.
Definition at line 1200 of file Structure.cpp.
References builder, convertLocation(), convertStatement(), convertType(), currentThisRef, declareFunction(), finalizeFunctionBodyCaptures(), rewriteCallSitesToPassCaptures(), rvalueReadCallback, timeScale, valueSymbols, and variableAssignCallback.
| LogicalResult Context::convertGlobalVariable | ( | const slang::ast::VariableSymbol & | var | ) |
Convert a variable to a moore.global_variable operation.
Definition at line 1750 of file Structure.cpp.
References builder, convertLocation(), convertType(), globalVariables, globalVariableWorklist, guessNamespacePrefix(), intoModuleOp, and orderedRootOps.
| Location Context::convertLocation | ( | slang::SourceLocation | loc | ) |
Convert a slang SourceLocation into an MLIR Location.
Definition at line 69 of file ImportVerilog.cpp.
References getContext(), and sourceManager.
Referenced by collectHierarchicalValues(), convertCompilation(), convertFunction(), convertGlobalVariable(), convertLocation(), convertLTLTimingControl(), convertLvalueExpression(), convertModuleHeader(), convertPackage(), convertRvalueExpression(), convertStatement(), convertType(), convertType(), declareCallableImpl(), declareClass(), declareFunction(), handleRoot(), traverseInstanceBody(), and visitClassProperty().
| Location Context::convertLocation | ( | slang::SourceRange | range | ) |
Convert a slang SourceRange into an MLIR Location.
Definition at line 73 of file ImportVerilog.cpp.
References convertLocation().
| Value Context::convertLTLTimingControl | ( | const slang::ast::TimingControl & | ctrl, |
| const Value & | seqOrPro | ||
| ) |
Definition at line 271 of file TimingControls.cpp.
References builder, and convertLocation().
| Value Context::convertLvalueExpression | ( | const slang::ast::Expression & | expr | ) |
Definition at line 1977 of file Expressions.cpp.
References convertLocation().
| LogicalResult Context::convertModuleBody | ( | const slang::ast::InstanceBodySymbol * | module | ) |
Convert a module's body to the corresponding IR ops.
The module op must have already been created earlier through a convertModuleHeader call.
Definition at line 915 of file Structure.cpp.
References builder, hierPaths, modules, timeScale, and valueSymbols.
Referenced by convertCompilation().
| ModuleLowering * Context::convertModuleHeader | ( | const slang::ast::InstanceBodySymbol * | module | ) |
Convert a module and its ports to an empty module op in the IR.
Also adds the op to the worklist of module bodies to be lowered. This acts like a module "declaration", allowing instances to already refer to a module even before its body has been lowered.
Definition at line 736 of file Structure.cpp.
References builder, convertLocation(), convertType(), circt::hw::ModulePort::Input, modules, circt::hw::ModulePort::Output, and timeScale.
Referenced by convertCompilation().
| LogicalResult Context::convertPackage | ( | const slang::ast::PackageSymbol & | package | ) |
Convert a package and its contents.
Definition at line 991 of file Structure.cpp.
References builder, convertLocation(), intoModuleOp, timeScale, and valueSymbols.
| Value Context::convertRvalueExpression | ( | const slang::ast::Expression & | expr, |
| Type | requiredType = {} |
||
| ) |
Definition at line 1967 of file Expressions.cpp.
References convertLocation(), and materializeConversion().
Referenced by convertAssertionCallExpression(), and convertCompilation().
| LogicalResult Context::convertStatement | ( | const slang::ast::Statement & | stmt | ) |
Definition at line 953 of file Statements.cpp.
References assert(), builder, and convertLocation().
Referenced by convertFunction(), and convertTimingControl().
| FailureOr< Value > Context::convertSystemCallArity0 | ( | const slang::ast::SystemSubroutine & | subroutine, |
| Location | loc | ||
| ) |
Convert system function calls only have arity-0.
Definition at line 2370 of file Expressions.cpp.
References builder.
| FailureOr< Value > Context::convertSystemCallArity1 | ( | const slang::ast::SystemSubroutine & | subroutine, |
| Location | loc, | ||
| Value | value | ||
| ) |
Convert system function calls only have arity-1.
Definition at line 2397 of file Expressions.cpp.
References builder, and convertToSimpleBitVector().
| FailureOr< Value > Context::convertSystemCallArity2 | ( | const slang::ast::SystemSubroutine & | subroutine, |
| Location | loc, | ||
| Value | value1, | ||
| Value | value2 | ||
| ) |
Convert system function calls with arity-2.
Definition at line 2530 of file Expressions.cpp.
References builder.
| LogicalResult Context::convertTimingControl | ( | const slang::ast::TimingControl & | ctrl | ) |
Definition at line 212 of file TimingControls.cpp.
References handleRoot().
| LogicalResult Context::convertTimingControl | ( | const slang::ast::TimingControl & | ctrl, |
| const slang::ast::Statement & | stmt | ||
| ) |
Definition at line 217 of file TimingControls.cpp.
References builder, convertStatement(), handleRoot(), and rvalueReadCallback.
| Value Context::convertToBool | ( | Value | value | ) |
Helper function to convert a value to its "truthy" boolean value.
Definition at line 1984 of file Expressions.cpp.
References builder.
Referenced by convertToBool().
| Value Context::convertToBool | ( | Value | value, |
| Domain | domain | ||
| ) |
Helper function to convert a value to its "truthy" boolean value and convert it to the given domain.
Definition at line 2139 of file Expressions.cpp.
References convertToBool(), getContext(), and materializeConversion().
| Value Context::convertToI1 | ( | Value | value | ) |
Helper function to convert a value to a MLIR I1 value.
Helper function to convert a value to an i1 value.
Definition at line 394 of file AssertionExpr.cpp.
References builder.
| Value Context::convertToSimpleBitVector | ( | Value | value | ) |
Helper function to convert a value to its simple bit vector representation, if it has one.
Otherwise returns null. Also returns null if the given value is null.
Definition at line 2147 of file Expressions.cpp.
References materializeConversion().
Referenced by convertSystemCallArity1().
| Type Context::convertType | ( | const slang::ast::DeclaredType & | type | ) |
Definition at line 199 of file Types.cpp.
References convertLocation(), and convertType().
| Type Context::convertType | ( | const slang::ast::Type & | type, |
| LocationAttr | loc = {} |
||
| ) |
Convert a slang type into an MLIR type.
Returns null on failure. Uses the provided location for error reporting, or tries to guess one from the given type. Types tend to have unreliable location information, so it's generally a good idea to pass in a location.
Definition at line 193 of file Types.cpp.
References convertLocation().
Referenced by convertFunction(), convertGlobalVariable(), convertModuleHeader(), convertType(), getFunctionSignature(), materializeFixedSizeUnpackedArrayType(), materializeSVInt(), and visitClassProperty().
|
private |
Helper function to extract the commonalities in lowering of functions and methods.
Convert a function and its arguments to a function declaration in the IR.
This does not convert the function body.
Definition at line 1106 of file Structure.cpp.
References builder, convertLocation(), functions, getFunctionSignature(), intoModuleOp, orderedRootOps, and symbolTable.
Referenced by declareFunction().
| ClassLowering * Context::declareClass | ( | const slang::ast::ClassType & | cls | ) |
Definition at line 1682 of file Structure.cpp.
References builder, classes, convertClassDeclaration(), convertLocation(), intoModuleOp, orderedRootOps, and symbolTable.
Referenced by convertClassDeclaration().
| FunctionLowering * Context::declareFunction | ( | const slang::ast::SubroutineSymbol & | subroutine | ) |
Convert a function and its arguments to a function declaration in the IR.
This does not convert the function body.
Definition at line 1013 of file Structure.cpp.
References classes, convertLocation(), declareCallableImpl(), functions, getContext(), and guessNamespacePrefix().
Referenced by convertFunction().
| slang::ConstantValue Context::evaluateConstant | ( | const slang::ast::Expression & | expr | ) |
Evaluate the constant value of an expression.
Definition at line 2128 of file Expressions.cpp.
References compilation.
| LogicalResult Context::finalizeFunctionBodyCaptures | ( | FunctionLowering & | lowering | ) |
Definition at line 1397 of file Structure.cpp.
References circt::ImportVerilog::FunctionLowering::captureIndex, circt::ImportVerilog::FunctionLowering::captures, getContext(), and circt::ImportVerilog::FunctionLowering::op.
Referenced by convertFunction().
| moore::ClassHandleType Context::getAncestorClassWithProperty | ( | const moore::ClassHandleType & | actualTy, |
| StringRef | fieldName | ||
| ) |
Tries to find the closest base class of actualTy that carries a property with name fieldName.
Definition at line 2574 of file Expressions.cpp.
References resolve().
Referenced by visitClassProperty().
|
inline |
Return the MLIR context.
Definition at line 99 of file ImportVerilogInternals.h.
References intoModuleOp.
Referenced by convertLocation(), convertToBool(), declareFunction(), finalizeFunctionBodyCaptures(), getFunctionSignature(), materializeFixedSizeUnpackedArrayType(), materializeString(), and materializeSVInt().
|
inline |
Definition at line 138 of file ImportVerilogInternals.h.
References currentThisRef.
Referenced by visitClassProperty().
| bool Context::isClassDerivedFrom | ( | const moore::ClassHandleType & | actualTy, |
| const moore::ClassHandleType & | baseTy | ||
| ) |
Checks whether one class (actualTy) is derived from another class (baseTy).
True if it's a subclass, false otherwise.
Definition at line 2548 of file Expressions.cpp.
References resolve().
Referenced by maybeUpcastHandle().
| Value Context::materializeConstant | ( | const slang::ConstantValue & | constant, |
| const slang::ast::Type & | type, | ||
| Location | loc | ||
| ) |
Helper function to materialize a ConstantValue as an SSA value.
Returns null if the constant cannot be materialized.
Definition at line 2112 of file Expressions.cpp.
References materializeFixedSizeUnpackedArrayType(), materializeString(), materializeSVInt(), and materializeSVReal().
| Value Context::materializeConversion | ( | Type | type, |
| Value | value, | ||
| bool | isSigned, | ||
| Location | loc | ||
| ) |
Helper function to insert the necessary operations to cast a value from one type to another.
Definition at line 2273 of file Expressions.cpp.
References assert(), builder, circt::moore::FourValued, materializeConversion(), materializePackedToSBVConversion(), materializeSBVToPackedConversion(), maybeUpcastHandle(), and circt::moore::TwoValued.
Referenced by convertRvalueExpression(), convertToBool(), convertToSimpleBitVector(), getSelectIndex(), materializeConversion(), materializeSVInt(), and visitClassProperty().
| Value Context::materializeFixedSizeUnpackedArrayType | ( | const slang::ConstantValue & | constant, |
| const slang::ast::FixedSizeUnpackedArrayType & | astType, | ||
| Location | loc | ||
| ) |
Helper function to materialize an unpacked array of SVInts as an SSA value.
Definition at line 2059 of file Expressions.cpp.
References builder, convertSVIntToFVInt(), convertType(), circt::moore::FourValued, getContext(), and circt::moore::TwoValued.
Referenced by materializeConstant().
| Value Context::materializeString | ( | const slang::ConstantValue & | string, |
| const slang::ast::Type & | astType, | ||
| Location | loc | ||
| ) |
Helper function to materialize a string as an SSA value.
Materialize a Slang string literal as a literal string constant op.
Definition at line 2020 of file Expressions.cpp.
References builder, and getContext().
Referenced by materializeConstant().
| Value Context::materializeSVInt | ( | const slang::SVInt & | svint, |
| const slang::ast::Type & | type, | ||
| Location | loc | ||
| ) |
Helper function to materialize an SVInt as an SSA value.
Materialize a Slang integer literal as a constant op.
Definition at line 2040 of file Expressions.cpp.
References builder, convertSVIntToFVInt(), convertType(), circt::moore::FourValued, getContext(), materializeConversion(), and circt::moore::TwoValued.
Referenced by materializeConstant().
| Value Context::materializeSVReal | ( | const slang::ConstantValue & | svreal, |
| const slang::ast::Type & | type, | ||
| Location | loc | ||
| ) |
Helper function to materialize a real value as an SSA value.
Materialize a Slang real literal as a constant op.
Definition at line 1998 of file Expressions.cpp.
References assert(), and builder.
Referenced by materializeConstant().
| LogicalResult Context::traverseInstanceBody | ( | const slang::ast::Symbol & | symbol | ) |
Definition at line 183 of file HierarchicalNames.cpp.
References convertLocation().
Referenced by convertCompilation().
| OpBuilder circt::ImportVerilog::Context::builder |
The builder used to create IR operations.
Definition at line 261 of file ImportVerilogInternals.h.
Referenced by convertAssertionCallExpression(), convertAssertionSystemCallArity1(), convertCompilation(), convertFunction(), convertGlobalVariable(), convertLTLTimingControl(), convertModuleBody(), convertModuleHeader(), convertPackage(), convertStatement(), convertSystemCallArity0(), convertSystemCallArity1(), convertSystemCallArity2(), convertTimingControl(), convertToBool(), convertToI1(), declareCallableImpl(), declareClass(), getSelectIndex(), handleRoot(), materializeConversion(), materializeFixedSizeUnpackedArrayType(), materializePackedToSBVConversion(), materializeSBVToPackedConversion(), materializeString(), materializeSVInt(), materializeSVReal(), maybeUpcastHandle(), and visitClassProperty().
| DenseMap<const slang::ast::ClassType *, std::unique_ptr<ClassLowering> > circt::ImportVerilog::Context::classes |
Classes that have already been converted.
Definition at line 284 of file ImportVerilogInternals.h.
Referenced by convertClassDeclaration(), declareClass(), and declareFunction().
| slang::ast::Compilation& circt::ImportVerilog::Context::compilation |
Definition at line 256 of file ImportVerilogInternals.h.
Referenced by convertCompilation(), and evaluateConstant().
| Value circt::ImportVerilog::Context::currentThisRef = {} |
Variable to track the value of the current function's implicit this reference.
Definition at line 339 of file ImportVerilogInternals.h.
Referenced by convertFunction(), and getImplicitThisRef().
| DenseMap<const slang::ast::SubroutineSymbol *, std::unique_ptr<FunctionLowering> > circt::ImportVerilog::Context::functions |
Functions that have already been converted.
Definition at line 280 of file ImportVerilogInternals.h.
Referenced by declareCallableImpl(), and declareFunction().
| DenseMap<const slang::ast::ValueSymbol *, moore::GlobalVariableOp> circt::ImportVerilog::Context::globalVariables |
A table of defined global variables that may be referred to by name in expressions.
Definition at line 297 of file ImportVerilogInternals.h.
Referenced by convertCompilation(), and convertGlobalVariable().
| SmallVector<const slang::ast::ValueSymbol *> circt::ImportVerilog::Context::globalVariableWorklist |
A list of global variables that still need their initializers to be converted.
Definition at line 300 of file ImportVerilogInternals.h.
Referenced by convertCompilation(), and convertGlobalVariable().
| DenseMap<const slang::ast::InstanceBodySymbol *, SmallVector<HierPathInfo> > circt::ImportVerilog::Context::hierPaths |
Collect all hierarchical names used for the per module/instance.
Definition at line 304 of file ImportVerilogInternals.h.
Referenced by convertModuleBody().
| mlir::ModuleOp circt::ImportVerilog::Context::intoModuleOp |
Definition at line 257 of file ImportVerilogInternals.h.
Referenced by convertGlobalVariable(), convertPackage(), declareCallableImpl(), declareClass(), getContext(), and resolve().
| SmallVector<LoopFrame> circt::ImportVerilog::Context::loopStack |
A stack of loop continuation and exit blocks.
Each loop will push the relevant info onto this stack, lower its loop body statements, and pop the info off the stack again. Continue and break statements encountered as part of the loop body statements will use this information to branch to the correct block.
Definition at line 323 of file ImportVerilogInternals.h.
| SmallVector<Value> circt::ImportVerilog::Context::lvalueStack |
A stack of assignment left-hand side values.
Each assignment will push its lowered left-hand side onto this stack before lowering its right-hand side. This allows expressions to resolve the opaque LValueReferenceExpressions in the AST.
Definition at line 316 of file ImportVerilogInternals.h.
| DenseMap<const slang::ast::InstanceBodySymbol *, std::unique_ptr<ModuleLowering> > circt::ImportVerilog::Context::modules |
How we have lowered modules to MLIR.
Definition at line 272 of file ImportVerilogInternals.h.
Referenced by convertModuleBody(), and convertModuleHeader().
| std::queue<const slang::ast::InstanceBodySymbol *> circt::ImportVerilog::Context::moduleWorklist |
A list of modules for which the header has been created, but the body has not been converted yet.
Definition at line 275 of file ImportVerilogInternals.h.
Referenced by convertCompilation().
| const ImportVerilogOptions& circt::ImportVerilog::Context::options |
Definition at line 255 of file ImportVerilogInternals.h.
| std::map<slang::SourceLocation, Operation *> circt::ImportVerilog::Context::orderedRootOps |
The top-level operations ordered by their Slang source location.
This is used to produce IR that follows the source file order.
Definition at line 267 of file ImportVerilogInternals.h.
Referenced by convertGlobalVariable(), declareCallableImpl(), and declareClass().
| std::function<void(moore::ReadOp)> circt::ImportVerilog::Context::rvalueReadCallback |
A listener called for every variable or net being read.
This can be used to collect all variables read as part of an expression or statement, for example to populate the list of observed signals in an implicit event control @*.
Definition at line 329 of file ImportVerilogInternals.h.
Referenced by convertFunction(), and convertTimingControl().
| DenseSet<StringAttr> circt::ImportVerilog::Context::sameHierPaths |
It's used to collect the repeat hierarchical names on the same path.
Such as Top.sub.a and sub.a, they are equivalent. The variable "a" will be added to the port list. But we only record once. If we don't do that. We will view the strange IR, such as module @Sub(out y, out y);
Definition at line 310 of file ImportVerilogInternals.h.
| const slang::SourceManager& circt::ImportVerilog::Context::sourceManager |
Definition at line 258 of file ImportVerilogInternals.h.
Referenced by convertLocation().
| SymbolTable circt::ImportVerilog::Context::symbolTable |
A symbol table of the MLIR module we are emitting into.
Definition at line 263 of file ImportVerilogInternals.h.
Referenced by declareCallableImpl(), declareClass(), and resolve().
| slang::TimeScale circt::ImportVerilog::Context::timeScale |
The time scale currently in effect.
Definition at line 335 of file ImportVerilogInternals.h.
Referenced by convertClassDeclaration(), convertCompilation(), convertFunction(), convertModuleBody(), convertModuleHeader(), convertPackage(), and getTimeScaleInFemtoseconds().
| ValueSymbols circt::ImportVerilog::Context::valueSymbols |
Definition at line 292 of file ImportVerilogInternals.h.
Referenced by convertFunction(), convertModuleBody(), and convertPackage().
| std::function<void(mlir::Operation *)> circt::ImportVerilog::Context::variableAssignCallback |
A listener called for every variable or net being assigned.
This can be used to collect all variables assigned in a task scope.
Definition at line 332 of file ImportVerilogInternals.h.
Referenced by convertFunction().