|
CIRCT 24.0.0git
|
This class keeps track of global names at the module/interface level. More...
#include <ExportVerilogInternals.h>

Public Member Functions | |
| GlobalNameTable (GlobalNameTable &&)=default | |
| StringRef | getParameterVerilogName (Operation *module, StringAttr paramName) const |
| Return the string to use for the specified parameter name in the specified module. | |
| StringAttr | getEnumPrefix (Type type) const |
| std::optional< std::pair< Operation *, StringAttr > > | getPackageEnumField (hw::EnumFieldAttr field) const |
| Return the owning package and legalized member name, or nullopt if absent. | |
| void | addReservedNames (NameCollisionResolver &nameResolver) const |
Private Member Functions | |
| GlobalNameTable () | |
| GlobalNameTable (const GlobalNameTable &)=delete | |
| void | operator= (const GlobalNameTable &)=delete |
| void | addRenamedParam (Operation *module, StringAttr oldName, StringRef newName) |
Private Attributes | |
| DenseMap< std::pair< Operation *, Attribute >, StringAttr > | renamedParams |
| This contains entries for any parameters that got renamed. | |
| DenseMap< Type, StringAttr > | enumPrefixes |
| DenseMap< std::pair< Type, StringAttr >, std::pair< Operation *, StringAttr > > | packageEnumFields |
| Map (enum alias, original member) to (owning package, legalized member). | |
| DenseSet< StringAttr > | reservedNames |
| List of names which are marked as reserved for any name. | |
Friends | |
| class | GlobalNameResolver |
This class keeps track of global names at the module/interface level.
It is built in a global pass over the entire design and then frozen to allow concurrent accesses.
Definition at line 43 of file ExportVerilogInternals.h.
|
default |
|
inlineprivate |
Definition at line 70 of file ExportVerilogInternals.h.
|
privatedelete |
|
inlineprivate |
Definition at line 74 of file ExportVerilogInternals.h.
References renamedParams.
Referenced by circt::ExportVerilog::GlobalNameResolver::legalizeModuleNames().
| void GlobalNameTable::addReservedNames | ( | NameCollisionResolver & | nameResolver | ) | const |
Definition at line 31 of file LegalizeNames.cpp.
References circt::ExportVerilog::NameCollisionResolver::insertUsedName(), and reservedNames.
Referenced by legalizeModuleLocalNames(), and circt::ExportVerilog::GlobalNameResolver::legalizePackageNames().
|
inline |
Definition at line 56 of file ExportVerilogInternals.h.
References enumPrefixes.
Referenced by circt::ExportVerilog::FieldNameResolver::getEnumFieldName().
| std::optional< std::pair< Operation *, StringAttr > > GlobalNameTable::getPackageEnumField | ( | hw::EnumFieldAttr | field | ) | const |
Return the owning package and legalized member name, or nullopt if absent.
Definition at line 37 of file LegalizeNames.cpp.
References packageEnumFields.
Referenced by circt::ExportVerilog::FieldNameResolver::getEnumFieldName().
|
inline |
Return the string to use for the specified parameter name in the specified module.
Parameters may be renamed for a variety of reasons (e.g. conflicting with ports or Verilog keywords), and this returns the legalized name to use.
Definition at line 50 of file ExportVerilogInternals.h.
References renamedParams.
Referenced by legalizeModuleLocalNames().
|
privatedelete |
|
friend |
Definition at line 69 of file ExportVerilogInternals.h.
|
private |
Definition at line 86 of file ExportVerilogInternals.h.
Referenced by circt::ExportVerilog::GlobalNameResolver::gatherEnumPrefixes(), and getEnumPrefix().
|
private |
Map (enum alias, original member) to (owning package, legalized member).
Definition at line 90 of file ExportVerilogInternals.h.
Referenced by getPackageEnumField(), and circt::ExportVerilog::GlobalNameResolver::legalizePackageNames().
|
private |
This contains entries for any parameters that got renamed.
The key is a moduleop/paramName tuple, the value is the name to use.
Definition at line 82 of file ExportVerilogInternals.h.
Referenced by addRenamedParam(), and getParameterVerilogName().
|
private |
List of names which are marked as reserved for any name.
Definition at line 93 of file ExportVerilogInternals.h.
Referenced by addReservedNames(), and circt::ExportVerilog::GlobalNameResolver::GlobalNameResolver().