CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::ExportVerilog::GlobalNameTable Struct Reference

This class keeps track of global names at the module/interface level. More...

#include <ExportVerilogInternals.h>

Collaboration diagram for circt::ExportVerilog::GlobalNameTable:

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ GlobalNameTable() [1/3]

circt::ExportVerilog::GlobalNameTable::GlobalNameTable ( GlobalNameTable && )
default

◆ GlobalNameTable() [2/3]

circt::ExportVerilog::GlobalNameTable::GlobalNameTable ( )
inlineprivate

Definition at line 70 of file ExportVerilogInternals.h.

◆ GlobalNameTable() [3/3]

circt::ExportVerilog::GlobalNameTable::GlobalNameTable ( const GlobalNameTable & )
privatedelete

References GlobalNameTable().

Member Function Documentation

◆ addRenamedParam()

void circt::ExportVerilog::GlobalNameTable::addRenamedParam ( Operation * module,
StringAttr oldName,
StringRef newName )
inlineprivate

Definition at line 74 of file ExportVerilogInternals.h.

References renamedParams.

◆ addReservedNames()

void GlobalNameTable::addReservedNames ( NameCollisionResolver & nameResolver) const

◆ getEnumPrefix()

StringAttr circt::ExportVerilog::GlobalNameTable::getEnumPrefix ( Type type) const
inline

Definition at line 56 of file ExportVerilogInternals.h.

References enumPrefixes.

◆ getPackageEnumField()

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 38 of file LegalizeNames.cpp.

References packageEnumFields.

◆ getParameterVerilogName()

StringRef circt::ExportVerilog::GlobalNameTable::getParameterVerilogName ( Operation * module,
StringAttr paramName ) const
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().

◆ operator=()

void circt::ExportVerilog::GlobalNameTable::operator= ( const GlobalNameTable & )
privatedelete

References GlobalNameTable().

◆ GlobalNameResolver

friend class GlobalNameResolver
friend

Definition at line 69 of file ExportVerilogInternals.h.

References GlobalNameResolver.

Referenced by GlobalNameResolver.

Member Data Documentation

◆ enumPrefixes

DenseMap<Type, StringAttr> circt::ExportVerilog::GlobalNameTable::enumPrefixes
private

Definition at line 86 of file ExportVerilogInternals.h.

Referenced by getEnumPrefix().

◆ packageEnumFields

DenseMap<std::pair<Type, StringAttr>, std::pair<Operation *, StringAttr> > circt::ExportVerilog::GlobalNameTable::packageEnumFields
private

Map (enum alias, original member) to (owning package, legalized member).

Definition at line 90 of file ExportVerilogInternals.h.

Referenced by getPackageEnumField().

◆ renamedParams

DenseMap<std::pair<Operation *, Attribute>, StringAttr> circt::ExportVerilog::GlobalNameTable::renamedParams
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().

◆ reservedNames

DenseSet<StringAttr> circt::ExportVerilog::GlobalNameTable::reservedNames
private

List of names which are marked as reserved for any name.

Definition at line 93 of file ExportVerilogInternals.h.

Referenced by addReservedNames().


The documentation for this struct was generated from the following files: