CIRCT
20.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 | legalizeFunctionNames (FuncOp func) |
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 107 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 246 of file LegalizeNames.cpp.
References circt::LoweringOptions::caseInsensitiveKeywords, gatherEnumPrefixes(), circt::hw::getVerilogModuleNameAttr(), globalNameResolver, globalNameTable, circt::ExportVerilog::NameCollisionResolver::insertUsedName(), circt::sv::isNameValid(), legalizeInterfaceNames(), legalizeModuleNames(), options, and circt::ExportVerilog::GlobalNameTable::reservedNames.
|
privatedelete |
|
private |
Definition at line 298 of file LegalizeNames.cpp.
References circt::ExportVerilog::GlobalNameTable::enumPrefixes, circt::calyx::direction::get(), and globalNameTable.
Referenced by GlobalNameResolver().
|
private |
Definition at line 355 of file LegalizeNames.cpp.
References esiaccel.accelerator::ctxt, circt::calyx::direction::get(), circt::ExportVerilog::NameCollisionResolver::getLegalName(), globalNameResolver, and circt::ExportVerilog::NameCollisionResolver::insertUsedName().
|
private |
Definition at line 336 of file LegalizeNames.cpp.
References esiaccel.accelerator::ctxt, 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 317 of file LegalizeNames.cpp.
References circt::ExportVerilog::GlobalNameTable::addRenamedParam(), esiaccel.accelerator::ctxt, circt::calyx::direction::get(), circt::ExportVerilog::NameCollisionResolver::getLegalName(), globalNameResolver, globalNameTable, and options.
Referenced by GlobalNameResolver().
|
privatedelete |
|
inline |
Definition at line 113 of file LegalizeNames.cpp.
Referenced by circt::ExportVerilog::legalizeGlobalNames().
|
private |
Set of globally visible names, to ensure uniqueness.
Definition at line 127 of file LegalizeNames.cpp.
Referenced by GlobalNameResolver(), legalizeFunctionNames(), legalizeInterfaceNames(), and legalizeModuleNames().
|
private |
This keeps track of globally visible names like module parameters.
Definition at line 130 of file LegalizeNames.cpp.
Referenced by gatherEnumPrefixes(), GlobalNameResolver(), and legalizeModuleNames().
|
private |
Definition at line 136 of file LegalizeNames.cpp.
Referenced by GlobalNameResolver(), legalizeInterfaceNames(), and legalizeModuleNames().