CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::ImportVerilog Namespace Reference

Classes

struct  AmbiguousHierCapture
 A function whose hierarchical reference resolves to one symbol reachable through more than one instance. More...
struct  PortLowering
 Port lowering information. More...
struct  FlattenedIfacePort
 Lowering information for a single signal flattened from an interface port. More...
struct  InterfaceLowering
 Lowering information for an expanded interface instance. More...
struct  VirtualInterfaceLowering
 Cached lowering information for representing SystemVerilog virtual interface handles as Moore types (a struct of references to interface members). More...
struct  VirtualInterfaceMemberAccess
 A mapping entry for resolving Slang virtual interface member accesses. More...
struct  ModuleLowering
 Module lowering information. More...
struct  FunctionLowering
 Function lowering information. More...
struct  ClassLowering
struct  LoopFrame
 Information about a loops continuation and exit blocks relevant while lowering the loop's body statements. More...
struct  HierPathInfo
 Hierarchical path information. More...
struct  LocationKey
 ImportVerilog Elaboration Phases for Hierarchical Names. More...
struct  Context
 A helper class to facilitate the conversion from a Slang AST to MLIR operations. More...

Typedefs

using CaptureMap
 The result of capture analysis: for each function, the set of non-local, non-global variable symbols that the function captures directly or transitively through calls.

Enumerations

enum class  Domain
 The number of values each bit of a type can assume. More...

Functions

bool isCompileTimeConstant (slang::ast::SymbolKind kind)
 Return true if symbols of this kind are elaboration-time constants.
const slang::ast::InstanceSymbol * getRootInstance (const slang::ast::HierarchicalReference &ref)
 Return the first instance on a hierarchical reference path, i.e.
CaptureMap analyzeFunctionCaptures (const slang::ast::RootSymbol &root, SmallVectorImpl< AmbiguousHierCapture > &ambiguous)
 Analyze the AST rooted at root to determine which variables each function captures: symbols referenced inside the function's body (directly or through called functions) that are neither local nor global, including hierarchical references to other instances.
const slang::ast::InstanceBodySymbol * getCanonicalBody (const slang::ast::InstanceSymbol &inst)
 Get the slang canonical body for the given instance, if there is one.
Value getSelectIndex (Context &context, Location loc, Value index, const slang::ConstantRange &range)
 Map an index into an array, with bounds range, to a bit offset of the underlying bit storage.

Typedef Documentation

◆ CaptureMap

Initial value:
DenseMap<const slang::ast::SubroutineSymbol *,

The result of capture analysis: for each function, the set of non-local, non-global variable symbols that the function captures directly or transitively through calls.

Definition at line 53 of file CaptureAnalysis.h.

Enumeration Type Documentation

◆ Domain

enum class circt::moore::Domain
strong

The number of values each bit of a type can assume.

Definition at line 51 of file MooreTypes.h.

Function Documentation

◆ analyzeFunctionCaptures()

CaptureMap circt::ImportVerilog::analyzeFunctionCaptures ( const slang::ast::RootSymbol & root,
SmallVectorImpl< AmbiguousHierCapture > & ambiguous )

Analyze the AST rooted at root to determine which variables each function captures: symbols referenced inside the function's body (directly or through called functions) that are neither local nor global, including hierarchical references to other instances.

Captures that cannot be resolved to a single instance are reported in ambiguous.

Referenced by circt::ImportVerilog::Context::convertCompilation().

◆ getCanonicalBody()

const slang::ast::InstanceBodySymbol * circt::ImportVerilog::getCanonicalBody ( const slang::ast::InstanceSymbol & inst)
inline

Get the slang canonical body for the given instance, if there is one.

If there isn't one, fall back to the normal body.

Definition at line 42 of file ImportVerilogInternals.h.

Referenced by circt::ImportVerilog::Context::convertCompilation().

◆ getRootInstance()

const slang::ast::InstanceSymbol * circt::ImportVerilog::getRootInstance ( const slang::ast::HierarchicalReference & ref)

Return the first instance on a hierarchical reference path, i.e.

the instance the reference enters the hierarchy through.

◆ getSelectIndex()

Value circt::ImportVerilog::getSelectIndex ( Context & context,
Location loc,
Value index,
const slang::ConstantRange & range )

Map an index into an array, with bounds range, to a bit offset of the underlying bit storage.

This is a dynamic version of slang::ConstantRange::translateIndex.

Definition at line 65 of file Expressions.cpp.

References context.

Referenced by getRuntimeSizeAtLevel().

◆ isCompileTimeConstant()

bool circt::ImportVerilog::isCompileTimeConstant ( slang::ast::SymbolKind kind)

Return true if symbols of this kind are elaboration-time constants.

They are materialized inline instead of being captured or ported.