slang::ast::DefinitionSymbol class

Represents a module, interface, or program definition.

Base classes

class Symbol
Base class for all symbols (logical code constructs) such as modules, types, functions, variables, etc.

Public types

struct ParameterDecl
Information about a single parameter declaration.

Constructors, destructors, conversion operators

DefinitionSymbol(const Scope& scope, LookupLocation lookupLocation, const syntax::ModuleDeclarationSyntax& syntax, const NetType& defaultNetType, UnconnectedDrive unconnectedDrive, std::optional<TimeScale> directiveTimeScale, const syntax::SyntaxTree* syntaxTree)
Constructs a new instance of the DefinitionSymbol class.

Public functions

auto getKindString() const -> std::string_view
Returns a string description of the definition kind, such as "module", "interface", or "program".
auto getArticleKindString() const -> std::string_view
Returns a string description of the definition kind, including an indefinite article.
auto getInstanceCount() const -> size_t
Returns the number of times the definition has been instantiated so far in the visited design.
void noteInstantiated() const
Notes that the definition has been instantiated.

Public variables

const NetType& defaultNetType
The default nettype for implicit nets within this definition.
DefinitionKind definitionKind
The kind of definition (module, interface, or program).
VariableLifetime defaultLifetime
The default lifetime for variables declared within this definition.
UnconnectedDrive unconnectedDrive
The drive setting to use for unconnected nets within this definition.
std::optional<TimeScale> timeScale
The timescale specified for this definition, or nullopt if none is explicitly specified.
SmallVector<ParameterDecl, 8> parameters
A list of parameters declared by this definition.
const syntax::PortListSyntax* portList
A list of ports declared by this definition.
flat_hash_set<std::string_view> modports
A set of modport names declared by this definition.
std::vector<BindDirectiveInfo> bindDirectives
A set of bind directives that apply to all instances of this definition.
const syntax::SyntaxTree* syntaxTree
The syntax tree that contains this definition, or nullptr if constructed outside of any specific syntax tree.
const SourceLibrary& sourceLibrary
The source library that contains the definition.
bool hasNonAnsiPorts
Indicates whether this definition has non-ansi port declarations.

Function documentation

std::string_view slang::ast::DefinitionSymbol::getArticleKindString() const

Returns a string description of the definition kind, including an indefinite article.

e.g. "a module", "an interface".