CIRCT
18.0.0git
|
This class keeps track of modules and interfaces that need to be renamed, as well as module ports, parameters, declarations and verif labels that need to be renamed. More...
Public Member Functions | |
GlobalNameResolver (mlir::ModuleOp topLevel, const LoweringOptions &options) | |
Construct a GlobalNameResolver and perform name legalization of the module/interfaces, port/parameter and declaration names. More... | |
GlobalNameTable | takeGlobalNameTable () |
Private Member Functions | |
void | legalizeModuleNames (HWModuleOp module) |
Check to see if the port names of the specified module conflict with keywords or themselves. More... | |
void | legalizeInterfaceNames (InterfaceOp interface) |
void | gatherEnumPrefixes (mlir::ModuleOp topLevel) |
GlobalNameResolver (const GlobalNameResolver &)=delete | |
void | operator= (const GlobalNameResolver &)=delete |
Private Attributes | |
NameCollisionResolver | globalNameResolver |
Set of globally visible names, to ensure uniqueness. More... | |
GlobalNameTable | globalNameTable |
This keeps track of globally visible names like module parameters. More... | |
const LoweringOptions & | options |
This class keeps track of modules and interfaces that need to be renamed, as well as module ports, parameters, declarations and verif labels that need to be renamed.
This can happen either due to conflicts between them or due to a conflict with a Verilog keyword.
Once constructed, this is immutable.
Definition at line 98 of file LegalizeNames.cpp.
GlobalNameResolver::GlobalNameResolver | ( | mlir::ModuleOp | topLevel, |
const LoweringOptions & | options | ||
) |
Construct a GlobalNameResolver and perform name legalization of the module/interfaces, port/parameter and declaration names.
Construct a GlobalNameResolver and do the initial scan to populate and unique the module/interfaces and port/parameter names.
Definition at line 224 of file LegalizeNames.cpp.
References circt::LoweringOptions::caseInsensitiveKeywords, gatherEnumPrefixes(), circt::hw::getVerilogModuleNameAttr(), globalNameResolver, circt::ExportVerilog::NameCollisionResolver::insertUsedName(), circt::sv::isNameValid(), legalizeInterfaceNames(), legalizeModuleNames(), and options.
|
privatedelete |
|
private |
Definition at line 269 of file LegalizeNames.cpp.
References circt::ExportVerilog::GlobalNameTable::enumPrefixes, circt::calyx::direction::get(), and globalNameTable.
Referenced by GlobalNameResolver().
|
private |
Definition at line 307 of file LegalizeNames.cpp.
References circt::calyx::direction::get(), circt::ExportVerilog::NameCollisionResolver::getLegalName(), globalNameResolver, and options.
Referenced by GlobalNameResolver().
|
private |
Check to see if the port names of the specified module conflict with keywords or themselves.
If so, add the replacement names to globalNameTable.
Definition at line 288 of file LegalizeNames.cpp.
References circt::ExportVerilog::GlobalNameTable::addRenamedParam(), circt::calyx::direction::get(), circt::ExportVerilog::NameCollisionResolver::getLegalName(), globalNameResolver, globalNameTable, and options.
Referenced by GlobalNameResolver().
|
privatedelete |
|
inline |
Definition at line 104 of file LegalizeNames.cpp.
Referenced by circt::ExportVerilog::legalizeGlobalNames().
|
private |
Set of globally visible names, to ensure uniqueness.
Definition at line 117 of file LegalizeNames.cpp.
Referenced by GlobalNameResolver(), legalizeInterfaceNames(), and legalizeModuleNames().
|
private |
This keeps track of globally visible names like module parameters.
Definition at line 120 of file LegalizeNames.cpp.
Referenced by gatherEnumPrefixes(), and legalizeModuleNames().
|
private |
Definition at line 126 of file LegalizeNames.cpp.
Referenced by GlobalNameResolver(), legalizeInterfaceNames(), and legalizeModuleNames().