CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
circt::ImportVerilog::LocationKey Struct Reference

ImportVerilog Elaboration Phases for Hierarchical Names. More...

#include <ImportVerilogInternals.h>

Collaboration diagram for circt::ImportVerilog::LocationKey:
Collaboration graph
[legend]

Public Member Functions

std::strong_ordering operator<=> (const LocationKey &) const =default
 
bool operator== (const LocationKey &) const =default
 

Static Public Member Functions

static LocationKey get (const slang::SourceLocation &loc, const slang::SourceManager &mgr)
 

Public Attributes

uint64_t sortKey
 
size_t offset
 

Detailed Description

ImportVerilog Elaboration Phases for Hierarchical Names.

Hierarchical name resolution is performed in four distinct phases:

  1. Collection: The traverseInstanceBody pass walks the Slang AST to identify all hierarchical references (e.g., Top.sub.var). It records these in hierPaths mapped by module body.
  2. Port Generation: In convertModuleHeader, we inspect hierPaths for the module and add corresponding input/output ports to the generated moore.module to allow cross-module communication.
  3. Wiring: In Structure.cpp during instance creation, we look up the canonical module body's hierPaths to determine which hierarchical values need to be passed as inputs or captured as outputs from the instance.
  4. Resolution: In Expressions.cpp, visitors for rvalues and lvalues resolve hierarchical names by first checking the instance-aware hierValueSymbols map (for cross-instance references) and falling back to standard scoped lookups.

Definition at line 182 of file ImportVerilogInternals.h.

Member Function Documentation

◆ get()

static LocationKey circt::ImportVerilog::LocationKey::get ( const slang::SourceLocation &  loc,
const slang::SourceManager &  mgr 
)
inlinestatic

◆ operator<=>()

std::strong_ordering circt::ImportVerilog::LocationKey::operator<=> ( const LocationKey ) const
default

◆ operator==()

bool circt::ImportVerilog::LocationKey::operator== ( const LocationKey ) const
default

Member Data Documentation

◆ offset

size_t circt::ImportVerilog::LocationKey::offset

Definition at line 184 of file ImportVerilogInternals.h.

Referenced by get().

◆ sortKey

uint64_t circt::ImportVerilog::LocationKey::sortKey

Definition at line 183 of file ImportVerilogInternals.h.


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