CIRCT  20.0.0git
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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:
Collaboration graph
[legend]

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. More...
 
StringAttr getEnumPrefix (Type type) const
 
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. More...
 
DenseMap< Type, StringAttr > enumPrefixes
 
DenseSet< StringAttr > reservedNames
 List of names which are marked as reserved for any name. More...
 

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 66 of file ExportVerilogInternals.h.

◆ GlobalNameTable() [3/3]

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

Member Function Documentation

◆ addRenamedParam()

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

◆ 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.

◆ 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

Friends And Related Function Documentation

◆ GlobalNameResolver

friend class GlobalNameResolver
friend

Definition at line 65 of file ExportVerilogInternals.h.

Member Data Documentation

◆ enumPrefixes

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

◆ 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 78 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 85 of file ExportVerilogInternals.h.

Referenced by circt::ExportVerilog::GlobalNameResolver::GlobalNameResolver().


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