slang::ast namespace

The SystemVerilog AST.

Namespaces

namespace SFormat
Utility methods for formatting strings using SystemVerilog formatting styles.

Classes

class AbortAssertionExpr
Represents an abort (accept_on / reject_on) property expression.
class ArbitrarySymbolExpression
Adapts an arbitrary symbol reference for use in an expression tree.
class AssertionExpr
The base class for assertion expressions (sequences and properties).
struct AssertionInstanceDetails
Information required to instantiate a sequence, property, or checker instance.
class AssertionInstanceExpression
Represents an instance of an assertion item, either a sequence, a property, or a formal argument that is being referenced and expanded.
class AssertionPortSymbol
Represents a formal argument / port of an assertion construct, such as a sequence, property, or let construct.
class AssignmentExpression
Represents an assignment expression.
class AssignmentPatternExpressionBase
Base class for assignment pattern expressions.
class AssociativeArrayType
Represents an unpacked array that provides associative lookup.
class ASTContext
Contains required context for binding syntax nodes with symbols to form an AST.
class ASTDiagMap
A helper class that maintains a map of issued diagnostics keyed by their code and location to aid in deduplicating diagnostics across an AST hierarchy.
class ASTSerializer
A class that serializes AST nodes to JSON.
template<typename TDerived, bool VisitStatements, bool VisitExpressions, bool VisitBad = false, bool VisitCanonical = false>
class ASTVisitor
A base class for AST visitors.
class BinaryAssertionExpr
Represents a binary operator in a sequence or property expression.
class BinaryExpression
Represents a binary operator expression.
struct BindDirectiveInfo
Information about how a bind directive applies to some definition or specific target node.
class Bitstream
Provides utility methods for working with bitstream operations.
class BlockEventListControl
Represents a list of block events (used within coverage events).
class BlockStatement
Represents a sequential or parallel block statement.
class BreakStatement
Represents a break statement.
class CallExpression
Represents a subroutine call.
class CaseAssertionExpr
Represents a case operator in a property expression.
class CaseStatement
Represents a case statement.
class CHandleType
Represents storage for pointers passed using the DPI (a "C" compatible handle).
class CheckerSymbol
Represents a checker declaration.
class ClassBuilder
A helper class for constructing class types programmatically.
class ClassType
Represents a class definition type.
class ClockingAssertionExpr
Represents an assertion expression with attached clocking control.
class ClockingBlockSymbol
Represents a clocking block.
class ClockingEventExpression
Represents a clocking event expression.
class ClockingSkew
Represents a skew value that is applied to clocking block signals.
class ClockVarSymbol
Represents a clocking block signal.
class Compilation
A centralized location for creating and caching symbols.
struct CompilationOptions
Contains various options that can control compilation behavior.
class CompilationUnitSymbol
The root of a single compilation unit.
class ConcatenationExpression
Represents a concatenation expression.
class ConcurrentAssertionStatement
Represents a concurrent assertion statement.
class ConditionalAssertionExpr
Represents a conditional operator in a property expression.
class ConditionalConstraint
Represents a constraint defined by an if-else condition.
class ConditionalExpression
Represents a conditional operator expression.
class ConditionalStatement
Represents a conditional statement.
class ConfigBlockSymbol
Represents a config block declaration.
struct ConfigRule
A rule that controls how a specific cell or instance in the design is configured.
class ConstantPattern
Reresents a pattern that matches a given constant expression.
class Constraint
The base class for all constraints in SystemVerilog.
class ConstraintBlockSymbol
Represents a named constraint block declaration within a class.
class ConstraintList
Represents a list of constraints.
class ContinueStatement
Represents a continue statement.
class ContinuousAssignSymbol
Represents a continuous assignment statement.
class ConversionExpression
Represents a type conversion expression (implicit or explicit).
class CopyClassExpression
Represents a new expression that copies a class instance.
class CoverCrossBodySymbol
Represents the body of a cover cross type, separated out because the members of the cross body can't be accessed outside of the cross itself.
class CovergroupBodySymbol
Represents the body of a covergroup type, separated out because the arguments of a covergroup need to live in their own scope so that they can be shadowed by body members.
class CovergroupType
Represents a covergroup definition type.
class CycleDelayControl
Represents a cycle-based delay control.
class DataTypeExpression
Adapts a data type for use in an expression tree.
class DeclaredType
Ties together various syntax nodes that declare the type of some parent symbol along with the logic necessary to resolve that type.
class DefinitionSymbol
Represents a module, interface, or program definition.
class DefParamSymbol
Represents a defparam directive.
class Delay3Control
Represents multiple delays associated with a single gate primitive.
class DelayControl
Represents a delay time control.
class DisableForkStatement
Represents a disable fork statement.
class DisableIffAssertionExpr
Represents a disable iff condition in a property spec.
class DisableSoftConstraint
Represents a constraint that disables a soft random variable.
class DisableStatement
Represents a disable statement.
class DistExpression
Denotes an expression along with a distribution of probabilities for that expression.
class DoWhileLoopStatement
Represents a do while loop statement.
class DPIOpenArrayType
A special case for DPI imports that have "open array" typed arguments.
class DynamicArrayType
Represents a dynamically sized unpacked array.
class ElabSystemTaskSymbol
Represents an elaboration system task, such as $error or $warning.
class ElementSelectExpression
Represents a single element selection expression.
class EmptyArgumentExpression
Represents an empty argument.
class EmptyMemberSymbol
Represents an empty member, i.e.
class EmptyStatement
Represents an empty statement, used as a placeholder or an anchor for attributes.
class EnumType
Represents an enumerated type.
class EnumValueSymbol
Represents an enumerated value / member.
class ErrorType
An empty type symbol that indicates an error occurred while trying to resolve the type of some expression or declaration.
class EvalContext
A container for all context required to evaluate a statement or expression.
struct EvaluatedDimension
The result of evaluating dimension syntax nodes.
class EventListControl
Represents a list of timing controls to wait on.
class EventTriggerStatement
Represents an event triggering statement.
class EventType
Represents a SystemVerilog event handle, which is used for synchronization between asynchronous processes.
class ExplicitImportSymbol
Represents an explicit import from a package.
class Expression
The base class for all expressions in SystemVerilog.
class ExpressionConstraint
Represents a constraint defined by a logical expression.
class ExpressionStatement
Represents an expression that is executed as a standalone statement.
class FieldSymbol
Represents a field member of a struct or union.
class FirstMatchAssertionExpr
Represents a first_match operator in a sequence expression.
class FixedSizeUnpackedArrayType
Represents a fixed size unpacked array (as opposed to a dynamically sized unpacked array, associative array, or queue).
class FloatingType
Represents one of the predefined floating point types, which are used for representing real numbers.
class ForeachConstraint
Represents a constraint that iterates over the elements of an array.
class ForeachLoopStatement
Represents a foreach loop statement.
class ForeverLoopStatement
Represents a forever loop statement.
class ForLoopStatement
Represents a for loop statement.
class FormalArgumentSymbol
Represents a formal argument in subroutine (task or function).
class ForwardingTypedefSymbol
A forward declaration of a user-defined type name.
class GenerateBlockArraySymbol
Represents an array of generate blocks, as generated by a loop generate construct.
class GenerateBlockSymbol
Represents blocks that are instantiated by a loop generate or conditional generate construct.
class GenericClassDefSymbol
Represents a generic class definition, which is a parameterized class that has not yet had its parameter values specified.
class GenvarSymbol
Represents a genvar declaration.
class HierarchicalReference
Represents a hierarchical reference to a symbol.
class HierarchicalValueExpression
Represents an expression that references a named value via hierarchical path.
struct HierarchyOverrideNode
A node in a tree representing an instance in the design hierarchy where parameters should be overriden and/or bind directives should be applied.
class ImmediateAssertionStatement
Represents an immediate assertion statement.
class ImplicationConstraint
Represents a constraint defined by an implication.
class ImplicitEventControl
Represents an implicit event control (i.e. the @* construct).
class InsideExpression
Represents a set membership operator expression.
class InstanceSymbol
Represents an instance of a module, interface, or program.
class InstanceSymbolBase
Common functionality for module, interface, program, and primitive instances.
class IntegerLiteral
Represents an integer literal.
class IntegralType
A base class for integral types, which include all scalar types, predefined integer types, packed arrays, packed structures, packed unions, and enum types.
class InterfacePortSymbol
Represents the public-facing side of a module / program / interface port that is also a connection to an interface instance (optionally with a modport restriction).
class InvalidAssertionExpr
Represents an invalid expression.
class InvalidConstraint
Represents an invalid constraint.
class InvalidExpression
Represents an invalid expression.
class InvalidPattern
Represents an invalid pattern.
class InvalidStatement
Represents an invalid statement.
struct InvalidSymbol
A placeholder symbol type that represents an unknown or invalid symbol.
class InvalidTimingControl
Represents an invalid timing control.
class IteratorSymbol
Represents an iterator variable created for array manipulation methods.
class LetDeclSymbol
Represents a let declaration.
class LocalAssertionVarSymbol
Represents a local variable declared inside an assertion item, such as a sequence or property.
class Lookup
Centralized functionality for looking up symbols by name in the AST.
class LookupLocation
This type denotes the ordering of symbols within a particular scope, for the purposes of determining whether a found symbol is visible compared to the given location.
struct LookupResult
A structure that contains the results of a name lookup operation.
class LSPUtilities
A collection of utility methods for working with LSP expressions.
template<typename TOwner>
struct LSPVisitor
A helper class that finds the longest static prefix of expressions.
class LValue
A representation of an lvalue used for constant evaluation.
class LValueReferenceExpression
A placeholder expression that is generated to take the place of one side of a compound assignment expression's binary operator.
class MemberAccessExpression
Represents an access of a structure variable's members.
class MethodBuilder
A helper class for constructing method symbols programmatically.
class MinTypMaxExpression
Represents a min:typ:max expression.
class ModportClockingSymbol
Represents a clocking block port.
class ModportPortSymbol
Represents a single port specifier in a modport declaration.
class ModportSymbol
Represents a modport within an interface definition.
class MultiPortSymbol
Represents a multi-port, which is a port symbol that externally appears as a single connection but internally connects to multiple names, potentially with varying directions.
class NamedValueExpression
Represents an expression that references a named value.
class NetSymbol
Represents a net declaration.
class NetType
Base class for all net types in SystemVerilog.
class NewArrayExpression
Represents a new[] expression that creates a dynamic array.
class NewClassExpression
Represents a new expression that creates a class instance.
class NewCovergroupExpression
Represents a new expression that creates a covergroup instance.
class NonConstantFunction
An implementation of the SystemSubroutine interface that is also a "simple" subroutine and is not allowed in constant contexts.
class NullLiteral
Represents a null literal.
class NullType
Represents the Null type.
class OneStepDelayControl
Represents the built-in 1step delay.
class OpaqueInstancePath
Represents a path to a specific instance in a design.
class PackageSymbol
A SystemVerilog package construct.
class PackedArrayType
Represents a packed array of some simple element type (vectors, packed structures, other packed arrays).
class PackedStructType
Represents a packed structure of members.
class PackedUnionType
Represents a packed union of members.
class ParameterSymbol
Represents a parameter value.
class Pattern
Base class for "patterns", as used in pattern matching conditional statements and expressions.
class PatternCaseStatement
Represents a pattern case statement.
class PatternVarSymbol
Represents a pattern variable materialized for a pattern matching expression.
class PortSymbol
Represents the public-facing side of a module / program / interface port.
class PredefinedIntegerType
Represents the predefined integer types, which are essentially predefined vector types.
class ProceduralAssignStatement
Represents a procedural assign statement.
class ProceduralCheckerStatement
Represents a procedural checker instantiation statement.
class ProceduralDeassignStatement
Represents a procedural deassign statement.
class PropertySymbol
Represents a named property object.
class PropertyType
Represents the type of property instances and arguments.
class QueueType
Represents an unpacked array that provides queue semantics.
class RandCaseStatement
Represents a randcase statement.
class RandSequenceStatement
Represents a randsequence statement.
class RangeSelectExpression
Represents a range selection expression.
class RealLiteral
Represents a real number literal.
class RepeatedEventControl
Represents a repeat event control.
class RepeatLoopStatement
Represents a repeat loop statement.
class ReplicatedAssignmentPatternExpression
Represents a replicated assignment pattern expression.
class ReplicationExpression
Represents a replication expression.
struct ResolvedConfig
Contains information about a resolved configuration rule that affects an instance and the hierarchy underneath it.
class ReturnStatement
Represents a return statement.
class RootSymbol
Represents the entirety of a design, along with all contained compilation units.
class ScalarType
Represents the single-bit scalar types.
class Scope
Base class for symbols that represent a name scope; that is, they contain children and can participate in name lookup.
class ScriptSession
A helper class that allows evaluating arbitrary snippets of SystemVerilog source code and maintaining state across multiple eval calls.
class SemanticFacts
A helper class that can extract semantic AST information from tokens and syntax nodes.
class SequenceConcatExpr
Represents an assertion expression defined as a delayed concatenation of other expressions.
struct SequenceRange
Represents a range of potential sequence matches.
struct SequenceRepetition
Encodes a repetition of some sub-sequence.
class SequenceSymbol
Represents a named sequence object.
class SequenceType
Represents the type of sequence instances and arguments.
class SequenceWithMatchExpr
Represents a sequence expression along with a list of actions to perform upon matching and/or instructions for repetition.
class SignalEventControl
Represents a signal event control.
class SimpleAssertionExpr
Represents an assertion expression defined as a simple regular expression.
class SimpleAssignmentPatternExpression
Represents a simple assignment pattern expression.
class SimpleSystemSubroutine
An implementation of the SystemSubroutine interface that has basic argument types and a well-defined return type.
class SolveBeforeConstraint
Represents a constraint that enforces ordering of solving variables.
class SpecparamSymbol
Represents a specify parameter.
class Statement
The base class for all statements in SystemVerilog.
class StatementList
Represents a list of statements.
class StreamingConcatenationExpression
Represents a streaming concatenation.
class StringLiteral
Represents a string literal.
class StringType
Represents the built-in ASCII string type.
class StrongWeakAssertionExpr
Represents a strong or weak operator in a property expression.
class StructBuilder
A helper class for constructing struct types programmatically.
class StructuredAssignmentPatternExpression
Represents a structured assignment pattern expression.
class StructurePattern
Represents a pattern that matches a structure.
class SubroutineSymbol
Represents a subroutine (task or function).
class Symbol
Base class for all symbols (logical code constructs) such as modules, types, functions, variables, etc.
class SystemSubroutine
The base class for built-in system subroutines.
class TaggedPattern
Represents a pattern that matches a member of a tagged union.
class TaggedUnionExpression
Represents a tagged union member setter expression.
class TempVarSymbol
Represents a temporary variable materialized within a limited scope such as a single expression.
class TimedStatement
Represents a statement that has an associated timing control.
class TimeLiteral
Represents a time literal.
class TimingControl
The base class for SystemVerilog timing controls (delay, event, etc).
class TransparentMemberSymbol
A class that wraps a hoisted transparent type member, such as an enum value or a symbol inherited from a base class, into a scope.
class Type
Base class for all data types in SystemVerilog.
class TypeAliasType
Represents a type alias, which is introduced via a typedef or type parameter.
class TypeArgFormatter
A diagnostic argument formatter specifically for formatting types.
class TypePrinter
A utility class that prints a SystemVerilog type to a string.
struct TypePrintingOptions
A collection of type printing options.
class TypeReferenceExpression
An expression that gets the type of a nested expression using the type() operator.
class TypeRefType
Represents the result of a type reference expression, i.e. the type() operator.
class UnaryAssertionExpr
Represents a unary operator in a property expression.
class UnaryExpression
Represents a unary operator expression.
class UnbasedUnsizedIntegerLiteral
Represents an unbased unsized integer literal, which fills all bits in an expression.
class UnboundedLiteral
Represents the unbounded queue or range literal.
class UnboundedType
Represents the '$' special token that is a standin for the unbounded end of a queue or range selection.
class UninstantiatedDefSymbol
Represents an instance of a definition (module / interface / program / checker) that is not actually instantiated in the design.
class UniquenessConstraint
Represents a constraint that enforces uniqueness of variables.
class UnpackedStructType
Represents an unpacked structure of members.
class UnpackedUnionType
Represents an unpacked union of members.
class UntypedType
Represents an 'untyped' type, which is used for e.g. arguments of sequences.
class ValueExpressionBase
Common base class for both NamedValueExpression and HierarchicalValueExpression.
class ValueRangeExpression
Denotes a range of values by providing expressions for the lower and upper bounds of the range.
class ValueSymbol
A base class for symbols that represent a value (for example a variable or a parameter).
class VariableDeclStatement
Represents a variable declaration in a statement context.
class VariablePattern
Represents a pattern that stores its match in a pattern variable.
class VariableSymbol
Represents a variable declaration.
class VirtualInterfaceType
Represents a virtual interface type.
class VoidType
Represents the Void (or lack of a) type.
class WaitForkStatement
Represents a wait fork statement.
class WaitOrderStatement
Represents a wait_order statement.
class WaitStatement
Represents a wait statement.
class WhileLoopStatement
Represents a while loop statement.
class WildcardImportSymbol
Represents a wildcard import declaration.
class WildcardPattern
Represents a wildcard pattern that matches anything.

Enums

enum class ASTFlags: uint64_t { None = 0, InsideConcatenation = 1ull << 0, UnevaluatedBranch = 1ull << 1, AllowDataType = 1ull << 2, AssignmentAllowed = 1ull << 3, AssignmentDisallowed = 1ull << 4, NonProcedural = 1ull << 5, StaticInitializer = 1ull << 6, StreamingAllowed = 1ull << 7, TopLevelStatement = 1ull << 8, AllowUnboundedLiteral = 1ull << 9, AllowUnboundedLiteralArithmetic = 1ull << 10, Function = 1ull << 11, Final = 1ull << 12, NonBlockingTimingControl = 1ull << 13, EventExpression = 1ull << 14, AllowTypeReferences = 1ull << 15, AssertionExpr = 1ull << 16, AllowClockingBlock = 1ull << 17, AssertionInstanceArgCheck = 1ull << 18, AssertionDelayOrRepetition = 1ull << 19, LValue = 1ull << 20, PropertyNegation = 1ull << 21, PropertyTimeAdvance = 1ull << 22, RecursivePropertyArg = 1ull << 23, ConcurrentAssertActionBlock = 1ull << 24, AllowCoverageSampleFormal = 1ull << 25, AllowCoverpoint = 1ull << 26, AllowNetType = 1ull << 27, OutputArg = 1ull << 28, AllowInterconnect = 1ull << 29, StreamingWithRange = 1ull << 30, SpecifyBlock = 1ull << 31, SpecparamInitializer = 1ull << 32, DPIArg = 1ull << 33, AssertionDefaultArg = 1ull << 34, LAndRValue = 1ull << 35, NoReference = 1ull << 36, ConfigParam = 1ull << 37, TypeOperator = 1ull << 38, ForkJoinAnyNone = 1ull << 39, DisallowUDNT = 1ull << 40, BindInstantiation = 1ull << 41 }
Specifies flags that control expression and statement creation.
enum class DimensionKind { Unknown, Range, AbbreviatedRange, Dynamic, Associative, Queue, DPIOpenArray }
Specifies possible kinds of dimensions.
enum class EvalFlags: uint8_t { None = 0, IsScript = 1 << 0, CacheResults = 1 << 1, SpecparamsAllowed = 1 << 2, CovergroupExpr = 1 << 3, AllowUnboundedPlaceholder = 1 << 4 }
Various flags that can be applied to a constant expression evaluation.
enum class MinTypMax { Min, Typ, Max }
Specifies which set of min:typ:max expressions should be used during compilation.
enum class CompilationFlags { None = 0, AllowHierarchicalConst = 1 << 0, RelaxEnumConversions = 1 << 1, AllowUseBeforeDeclare = 1 << 2, AllowTopLevelIfacePorts = 1 << 3, LintMode = 1 << 4, IgnoreUnknownModules = 1 << 5, RelaxStringConversions = 1 << 6, AllowRecursiveImplicitCall = 1 << 7, AllowBareValParamAssignment = 1 << 8, AllowSelfDeterminedStreamConcat = 1 << 9, AllowMergingAnsiPorts = 1 << 10, DisableInstanceCaching = 1 << 11, DisallowRefsToUnknownInstances = 1 << 12 }
Defines flags that control compilation behavior.
enum class ConstraintKind { Invalid, List, Expression, Implication, Conditional, Uniqueness, DisableSoft, SolveBefore, Foreach }
Specifies possible kinds of constraints.
enum class ExpressionKind { Invalid, IntegerLiteral, RealLiteral, TimeLiteral, UnbasedUnsizedIntegerLiteral, NullLiteral, UnboundedLiteral, StringLiteral, NamedValue, HierarchicalValue, UnaryOp, BinaryOp, ConditionalOp, Inside, Assignment, Concatenation, Replication, Streaming, ElementSelect, RangeSelect, MemberAccess, Call, Conversion, DataType, TypeReference, ArbitrarySymbol, LValueReference, SimpleAssignmentPattern, StructuredAssignmentPattern, ReplicatedAssignmentPattern, EmptyArgument, ValueRange, Dist, NewArray, NewClass, NewCovergroup, CopyClass, MinTypMax, ClockingEvent, AssertionInstance, TaggedUnion }
Specifies possible expression kinds.
enum class RangeSelectionKind { Simple, IndexedUp, IndexedDown }
Specifies possible kinds of range selection.
enum class ConversionKind { Implicit, Propagated, StreamingConcat, Explicit, BitstreamCast }
Specifies possible kinds of conversions.
enum class AssertionExprKind { Invalid, Simple, SequenceConcat, SequenceWithMatch, Unary, Binary, FirstMatch, Clocking, StrongWeak, Abort, Conditional, Case, DisableIff }
Specifies possible kinds of assertion expressions.
enum class UnaryAssertionOperator { Not, NextTime, SNextTime, Always, SAlways, Eventually, SEventually }
Specifies possible kinds of unary assertion operators.
enum class BinaryAssertionOperator { And, Or, Intersect, Throughout, Within, Iff, Until, SUntil, UntilWith, SUntilWith, Implies, OverlappedImplication, NonOverlappedImplication, OverlappedFollowedBy, NonOverlappedFollowedBy }
Specifies possible kinds of binary assertion operators.
enum class NondegeneracyStatus { None = 0, AdmitsEmpty = 1 << 0, AcceptsOnlyEmpty = 1 << 1, AdmitsNoMatch = 1 << 2 }
Specifies possible classifications of assertion expressions as they relate to "nondegeneracy", as described in the LRM.
enum class UnaryOperator { Plus, Minus, BitwiseNot, BitwiseAnd, BitwiseOr, BitwiseXor, BitwiseNand, BitwiseNor, BitwiseXnor, LogicalNot, Preincrement, Predecrement, Postincrement, Postdecrement }
Specifies possible unary operator kinds.
enum class BinaryOperator { Add, Subtract, Multiply, Divide, Mod, BinaryAnd, BinaryOr, BinaryXor, BinaryXnor, Equality, Inequality, CaseEquality, CaseInequality, GreaterThanEqual, GreaterThan, LessThanEqual, LessThan, WildcardEquality, WildcardInequality, LogicalAnd, LogicalOr, LogicalImplication, LogicalEquivalence, LogicalShiftLeft, LogicalShiftRight, ArithmeticShiftLeft, ArithmeticShiftRight, Power }
Specifies possible binary operator kinds.
enum class ValueRangeKind { Simple, AbsoluteTolerance, RelativeTolerance }
Specifies possible kinds of value ranges.
enum class LookupFlags { None = 0, Type = 1 << 0, AllowDeclaredAfter = 1 << 1, DisallowWildcardImport = 1 << 2, NoUndeclaredError = 1 << 3, NoUndeclaredErrorIfUninstantiated = 1 << 4, AllowIncompleteForwardTypedefs = 1 << 5, NoParentScope = 1 << 6, NoSelectors = 1 << 7, AllowRoot = 1 << 8, AllowUnit = 1 << 9, IfacePortConn = 1 << 10, StaticInitializer = 1 << 11, TypeReference = 1 << 12, AlwaysAllowUpward = 1 << 13, DisallowUnitReferences = 1 << 14, ForceHierarchical = AllowDeclaredAfter | NoUndeclaredErrorIfUninstantiated }
Additional modifiers for a lookup operation.
enum class LookupResultFlags: uint8_t { None = 0, WasImported = 1 << 0, IsHierarchical = 1 << 1, SuppressUndeclared = 1 << 2, FromTypeParam = 1 << 3, FromForwardTypedef = 1 << 4, IfacePort = 1 << 5 }
Flags that indicate additional details about the result of a lookup operation.
enum class PatternKind { Invalid, Wildcard, Constant, Variable, Tagged, Structure }
Specifies possible kinds of patterns.
enum class VariableLifetime { Automatic, Static }
Specifies the lifetime of a variable.
enum class Visibility { Public, Protected, Local }
Specifies the visibility of a symbol or member.
enum class ArgumentDirection { In, Out, InOut, Ref }
Specifies the direction of an argument passed to a port or subroutine.
enum class ProceduralBlockKind { Initial, Final, Always, AlwaysComb, AlwaysLatch, AlwaysFF }
Specifies possible procedural block kinds.
enum class StatementBlockKind { Sequential, JoinAll, JoinAny, JoinNone }
Specifies the kind of a statement block.
enum class DefinitionKind { Module, Interface, Program }
Specifies the kind of a definition.
enum class UnconnectedDrive { None, Pull0, Pull1 }
Specifies possible unconnected drive settings.
enum class EdgeKind { None, PosEdge, NegEdge, BothEdges }
Specifies possible edge kinds.
enum class SubroutineKind { Function, Task }
Specifies possible subroutine kinds.
enum class AssertionKind { Assert, Assume, CoverProperty, CoverSequence, Restrict, Expect }
Specifies possible assertion kinds.
enum class ElabSystemTaskKind { Fatal, Error, Warning, Info, StaticAssert }
Specifies possible elaboration system task kinds.
enum class RandMode { None, Rand, RandC }
Specifies possible randomization modes.
enum class PrimitivePortDirection { In, Out, OutReg, InOut }
Specifies possible directions of primitive ports.
enum class PulseStyleKind { OnEvent, OnDetect, ShowCancelled, NoShowCancelled }
Specifies possible pulse style kinds.
enum class ChargeStrength { Small, Medium, Large }
Specifies possible charge strengths.
enum class DriveStrength { Supply, Strong, Pull, Weak, HighZ }
Specifies possible drive strengths.
enum class ForwardTypeRestriction { None, Enum, Struct, Union, Class, InterfaceClass }
Specifies possible forward type restrictions.
enum class CaseStatementCondition { Normal, WildcardXOrZ, WildcardJustZ, Inside }
Specifies possible case statement condition kinds.
enum class AssignFlags: uint8_t { None = 0, NonBlocking = 1 << 0, InConcat = 1 << 1, InOutPort = 1 << 2 }
A set of flags that control how assignments are checked.
enum class StatementKind { Invalid, Empty, List, Block, ExpressionStatement, VariableDeclaration, Return, Continue, Break, Disable, Conditional, Case, PatternCase, ForLoop, RepeatLoop, ForeachLoop, WhileLoop, DoWhileLoop, ForeverLoop, Timed, ImmediateAssertion, ConcurrentAssertion, DisableFork, Wait, WaitFork, WaitOrder, EventTrigger, ProceduralAssign, ProceduralDeassign, RandCase, RandSequence, ProceduralChecker }
Specifies possible kinds of statements.
enum class StatementFlags { None = 0, InLoop = 1 << 0, InForkJoin = 1 << 1, InRandSeq = 1 << 2, HasTimingError = 1 << 3 }
Various flags that control statement construction.
enum class UniquePriorityCheck { None, Unique, Unique0, Priority }
Specifies possible kinds of unique/priority checks for case statements.
enum class SymbolKind { Unknown, Root, Definition, CompilationUnit, DeferredMember, TransparentMember, EmptyMember, PredefinedIntegerType, ScalarType, FloatingType, EnumType, EnumValue, PackedArrayType, FixedSizeUnpackedArrayType, DynamicArrayType, DPIOpenArrayType, AssociativeArrayType, QueueType, PackedStructType, UnpackedStructType, PackedUnionType, UnpackedUnionType, ClassType, CovergroupType, VoidType, NullType, CHandleType, StringType, EventType, UnboundedType, TypeRefType, UntypedType, SequenceType, PropertyType, VirtualInterfaceType, TypeAlias, ErrorType, ForwardingTypedef, NetType, Parameter, TypeParameter, Port, MultiPort, InterfacePort, Modport, ModportPort, ModportClocking, Instance, InstanceBody, InstanceArray, Package, ExplicitImport, WildcardImport, Attribute, Genvar, GenerateBlock, GenerateBlockArray, ProceduralBlock, StatementBlock, Net, Variable, FormalArgument, Field, ClassProperty, Subroutine, ContinuousAssign, ElabSystemTask, GenericClassDef, MethodPrototype, UninstantiatedDef, Iterator, PatternVar, ConstraintBlock, DefParam, Specparam, Primitive, PrimitivePort, PrimitiveInstance, SpecifyBlock, Sequence, Property, AssertionPort, ClockingBlock, ClockVar, LocalAssertionVar, LetDecl, Checker, CheckerInstance, CheckerInstanceBody, RandSeqProduction, CovergroupBody, Coverpoint, CoverCross, CoverCrossBody, CoverageBin, TimingPath, PulseStyle, SystemTimingCheck, AnonymousProgram, NetAlias, ConfigBlock }
Enumerates possible kinds of symbols.
enum class SymbolIndex: uint32_t { }
A numeric index that can be used to compare the relative ordering of symbols within a single lexical scope.
enum class ConstraintBlockFlags: uint8_t { None = 0, Pure = 1 << 1, Static = 1 << 2, Extern = 1 << 3, ExplicitExtern = 1 << 4, Initial = 1 << 5, Extends = 1 << 6, Final = 1 << 7 }
Specifies various flags that can apply to constraint bocks.
enum class BinsSelectExprKind { Invalid, Condition, Unary, Binary, SetExpr, WithFilter, CrossId }
Specifies possible kinds of bins select expressions.
enum class InstanceFlags: uint8_t { None = 0, Uninstantiated = 1 << 0, FromBind = 1 << 1, ParentFromBind = 1 << 2, TargetedByBind = 1 << 3, PreventsCaching = Uninstantiated | FromBind | ParentFromBind }
Specifies various flags that describe instance behavior.
enum class SystemTimingCheckKind { Unknown, Setup, Hold, SetupHold, Recovery, Removal, RecRem, Skew, TimeSkew, FullSkew, Period, Width, NoChange }
Specifies possible kinds of system timing checks.
enum class MethodFlags: uint16_t { None = 0, Virtual = 1 << 0, Pure = 1 << 1, Static = 1 << 2, Constructor = 1 << 3, InterfaceExtern = 1 << 4, ModportImport = 1 << 5, ModportExport = 1 << 6, DPIImport = 1 << 7, DPIContext = 1 << 8, BuiltIn = 1 << 9, Randomize = 1 << 10, ForkJoin = 1 << 11, DefaultedSuperArg = 1 << 12, Initial = 1 << 13, Extends = 1 << 14, Final = 1 << 15 }
Specifies various flags that can apply to subroutines.
enum class VariableFlags: uint16_t { None = 0, Const = 1 << 0, CompilerGenerated = 1 << 1, ImmutableCoverageOption = 1 << 2, CoverageSampleFormal = 1 << 3, CheckerFreeVariable = 1 << 4, RefStatic = 1 << 5 }
Specifies various flags that can apply to variables.
enum class TimingControlKind { Invalid, Delay, SignalEvent, EventList, ImplicitEvent, RepeatedEvent, Delay3, OneStepDelay, CycleDelay, BlockEventList }
Specifies possible kinds of timing controls.
enum class DeclaredTypeFlags { None = 0, InferImplicit = 1 << 0, InitializerCantSeeParent = 1 << 1, InitializerOverridden = 1 << 2, TypeOverridden = 1 << 3, AutomaticInitializer = 1 << 4, TypedefTarget = 1 << 5, NetType = 1 << 6, UserDefinedNetType = 1 << 7, FormalArgMergeVar = 1 << 8, Rand = 1 << 9, DPIReturnType = 1 << 10, DPIArg = 1 << 11, AllowUnboundedLiteral = 1 << 12, RequireSequenceType = 1 << 13, CoverageType = 1 << 14, InterconnectNet = 1 << 15, InterfaceVariable = 1 << 16, NeedsTypeCheck = NetType | UserDefinedNetType | FormalArgMergeVar | Rand | DPIReturnType | DPIArg | RequireSequenceType | CoverageType | InterfaceVariable }
Various flags that control declared type resolution.
enum class IntegralFlags: uint8_t { Unsigned = 0, TwoState = 0, Signed = 1, FourState = 2, Reg = 4 }
Specifies possible traits for integral types.

Functions

template<typename... Functions>
auto makeVisitor(Functions... funcs) -> auto
Creates an ASTVisitor out of the provided handler functions.

Enum documentation

enum class slang::ast::ASTFlags: uint64_t

Specifies flags that control expression and statement creation.

Enumerators
None

No special behavior specified.

InsideConcatenation

The expression is inside a concatenation; this enables slightly different creation rules.

UnevaluatedBranch

The expression is inside the unevaluated side of a conditional branch.

This is used to avoid issuing warnings for things that won't happen.

AllowDataType

Allow the expression to also be a data type; used in a few places like the first argument to system methods like $bits.

AssignmentAllowed

Assignment is allowed in this context.

This flag is cleared for nested subexpressions, unless they are directly parenthesized.

AssignmentDisallowed

Assignments are disallowed in this context.

As opposed to the AssignmentAllowed flag, this is not cleared and overrides that fact even if we are in a procedural context and would otherwise be allowed to modify variables.

NonProcedural

Expression is not inside a procedural context.

StaticInitializer

Expression is for a static variable's initializer.

References to automatic variables will be disallowed.

StreamingAllowed

Streaming operator is allowed in assignment target, assignment source, bit-stream casting argument, or stream expressions of another streaming concatenation.

This flag is cleared for nested subexpressions, unless they are directly parenthesized.

TopLevelStatement

This is the first expression appearing as an expression statement; potentially this indicates whether a subroutine invocation is as a task (if set) or as a function (unset).

Cleared for nested subexpressions.

AllowUnboundedLiteral

Expression is allowed to be the unbounded literal '$' such as inside a queue select.

AllowUnboundedLiteralArithmetic

Expression is allowed to do arithmetic with an unbounded literal.

Function

AST creation is happening within a function body.

Final

AST creation is happening within a final block.

NonBlockingTimingControl

AST creation is happening within the intra-assignment timing control of a non-blocking assignment expression.

EventExpression

AST creation is happening within an event expression.

AllowTypeReferences

AST creation is in a context where type reference expressions are allowed.

AssertionExpr

AST creation is happening within an assertion expression (sequence or property).

AllowClockingBlock

Allow binding a clocking block as part of a top-level event expression.

AssertionInstanceArgCheck

AST creation is for checking an assertion argument, prior to it being expanded as part of an actual instance.

AssertionDelayOrRepetition

AST creation is for a cycle delay or sequence repetition, where references to assertion formal ports have specific type requirements.

LValue

AST creation is for the left hand side of an assignment operation.

PropertyNegation

AST creation is for the negation of a property, which disallows recursive instantiations.

PropertyTimeAdvance

AST creation is for a property that has come after a positive advancement of time within the parent property definition.

RecursivePropertyArg

AST creation is for an argument passed to a recursive property instance.

ConcurrentAssertActionBlock

AST creation is inside a concurrent assertion's action block.

AllowCoverageSampleFormal

AST creation is for a covergroup expression that permits referencing a formal argument of an overridden sample method.

AllowCoverpoint

Expressions are allowed to reference coverpoint objects directly.

AllowNetType

User-defined nettypes are allowed to be looked up in this context.

OutputArg

AST creation is for an output (or inout) port or function argument.

AllowInterconnect

AST creation is in a context that allows interconnect nets.

StreamingWithRange

AST creation is for a range expression inside a streaming concatenation operator.

SpecifyBlock

AST creation is happening inside a specify block.

SpecparamInitializer

AST creation is for a specparam initializer expression.

DPIArg

AST creation is for a DPI argument type.

AssertionDefaultArg

AST creation is for an assertion instance's default argument.

LAndRValue

AST creation is for an lvalue that also counts as an rvalue.

Only valid when combined with the LValue flag – used for things like the pre & post increment and decrement operators.

NoReference

AST binding should not count symbol references towards that symbol being "used".

If this flag is not set, accessing a variable or net in an expression will count that symbol as being "used".

ConfigParam

AST binding is for a parameter inside a SystemVerilog configuration.

TypeOperator

AST binding is for the contents of the type() operator.

ForkJoinAnyNone

AST binding is inside a fork-join_any or fork-join_none block.

DisallowUDNT

AST binding disallows nets with a user-defined nettype (UDNT).

BindInstantiation

AST binding is for a bind instantiation (port connection or param value).

enum class slang::ast::DimensionKind

Specifies possible kinds of dimensions.

Enumerators
Unknown
Range
AbbreviatedRange

Abbreviated range dimension.

Dynamic

Dynamic dimension.

Associative

Associative dimension.

Queue

Queue dimension.

DPIOpenArray

DPI open array dimension.

enum class slang::ast::EvalFlags: uint8_t

Various flags that can be applied to a constant expression evaluation.

Enumerators
None

No special flags specified.

IsScript

This evaluation is happening inside of a script, so some language rules should be relaxed.

CacheResults

The results of the evaluation can be cached in each expression's constant pointer.

SpecparamsAllowed

Specparams are allowed during evaluation.

CovergroupExpr

Evaluation is for a covergroup expression, which allows some forms of non-constant variables to be referenced.

AllowUnboundedPlaceholder

For parameter evaluation, allow unbounded literals to evaluate to the placeholder value.

Other expressions that have an unbounded literal without a queue target will return an invalid value.

enum class slang::ast::MinTypMax

Specifies which set of min:typ:max expressions should be used during compilation.

Enumerators
Min

Use the "min" delay expressions.

Typ

Use the "typical" delay expressions.

Max

Use the "max" delay expressions.

enum class slang::ast::CompilationFlags

Defines flags that control compilation behavior.

Enumerators
None

No flags specified.

AllowHierarchicalConst

Allow hierarchical names in constant expressions.

RelaxEnumConversions

Allow all integral types to convert implicitly to enum types.

AllowUseBeforeDeclare

Allow symbols to be referenced before they're declared, even if that would otherwise be an error in SystemVerilog.

AllowTopLevelIfacePorts

Allow top-level modules to have interface ports.

This is not allowed in standard SystemVerilog but it defaults to true to make using the API in scripting / programmatic modes more convenient.

LintMode

Compile in "linting" mode where we suppress errors that could be caused by not having an elaborated design.

IgnoreUnknownModules

Don't issue an error when encountering an instantiation for an unknown definition.

RelaxStringConversions

Allow strings to implicitly convert to integers.

AllowRecursiveImplicitCall

Allow implicit call expressions (lacking parentheses) to be recursive function calls.

AllowBareValParamAssignment

Allow module parameter assignments to elide the parentheses.

AllowSelfDeterminedStreamConcat

Allow self-determined streaming concatenation expressions; normally these can only be used in specific assignment-like contexts.

AllowMergingAnsiPorts

Allow merging ANSI port declarations with nets and variables declared in the module body.

DisableInstanceCaching

Disable the use of instance caching, which normally allows skipping duplicate instance bodies to save time when elaborating.

DisallowRefsToUnknownInstances

Disallow references to unknown instances by issuing a diagnostic.

This is only relevant when using IgnoreUnknownModules, since otherwise there would already be errors issued for the unknown instances.

enum class slang::ast::ConstraintKind

Specifies possible kinds of constraints.

Enumerators
Invalid

Invalid constraint.

List

List constraint.

Expression

Expression constraint.

Implication

Implication constraint.

Conditional

Conditional constraint.

Uniqueness

Uniqueness constraint.

DisableSoft

Disable soft constraint.

SolveBefore

Solve before constraint.

Foreach

Foreach constraint.

enum class slang::ast::ExpressionKind

Specifies possible expression kinds.

Enumerators
Invalid

Invalid expression.

IntegerLiteral

Integer literal.

RealLiteral

Real literal.

TimeLiteral

Time literal.

UnbasedUnsizedIntegerLiteral

Unbased unsized integer literal.

NullLiteral

Null literal.

UnboundedLiteral

Unbounded literal.

StringLiteral

String literal.

NamedValue

Named value.

HierarchicalValue

Hierarchical value.

UnaryOp

Unary operator.

BinaryOp

Binary operator.

ConditionalOp

Conditional operator.

Inside

Inside.

Assignment

Assignment.

Concatenation

Concatenation.

Replication

Replication.

Streaming

Streaming concatenation.

ElementSelect

Element select.

RangeSelect

Range select.

MemberAccess

Member access.

Call

Call.

Conversion

Conversion.

DataType

Data type.

TypeReference

Type reference.

ArbitrarySymbol

Arbitrary symbol.

LValueReference

LValue reference.

SimpleAssignmentPattern

Simple assignment pattern.

StructuredAssignmentPattern

Structured assignment pattern.

ReplicatedAssignmentPattern

Replicated assignment pattern.

EmptyArgument

Empty argument.

ValueRange

Value range.

Dist

Distribution.

NewArray

New array.

NewClass

New class.

NewCovergroup

New covergroup.

CopyClass

Copy class.

MinTypMax

MinTypMax.

ClockingEvent

Clocking event.

AssertionInstance

Assertion instance.

TaggedUnion

Tagged union.

enum class slang::ast::RangeSelectionKind

Specifies possible kinds of range selection.

Enumerators
Simple

Simple range selection.

IndexedUp

Indexed up range selection.

IndexedDown

Indexed down range selection.

enum class slang::ast::ConversionKind

Specifies possible kinds of conversions.

Enumerators
Implicit

Implicit conversion.

Propagated

Propagated conversion.

StreamingConcat

Streaming concatenation conversion.

Explicit

Explicit conversion.

BitstreamCast

Bitstream cast conversion.

enum class slang::ast::AssertionExprKind

Specifies possible kinds of assertion expressions.

Enumerators
Invalid

Invalid assertion expression.

Simple

Simple assertion expression.

SequenceConcat

Sequence concatenation assertion expression.

SequenceWithMatch

Sequence with match assertion expression.

Unary

Unary assertion expression.

Binary

Binary assertion expression.

FirstMatch

First match assertion expression.

Clocking

Clocking assertion expression.

StrongWeak

Strong/Weak assertion expression.

Abort

Abort assertion expression.

Conditional

Conditional assertion expression.

Case

Case assertion expression.

DisableIff

Disable iff assertion expression.

enum class slang::ast::UnaryAssertionOperator

Specifies possible kinds of unary assertion operators.

Enumerators
Not

NOT unary assertion operator.

NextTime

Nexttime unary assertion operator.

SNextTime

SNexttime unary assertion operator.

Always

Always unary assertion operator.

SAlways

SAlways unary assertion operator.

Eventually

Eventually unary assertion operator.

SEventually

SEventually unary assertion operator.

enum class slang::ast::BinaryAssertionOperator

Specifies possible kinds of binary assertion operators.

Enumerators
And

AND binary assertion operator.

Or

OR binary assertion operator.

Intersect

Intersect binary assertion operator.

Throughout

Throughout binary assertion operator.

Within

Within binary assertion operator.

Iff

Iff binary assertion operator.

Until

Until binary assertion operator.

SUntil

SUntil binary assertion operator.

UntilWith

UntilWith binary assertion operator.

SUntilWith

SUntilWith binary assertion operator.

Implies

Implies binary assertion operator.

OverlappedImplication

Overlapped implication binary assertion operator.

NonOverlappedImplication

Non-overlapped implication binary assertion operator.

OverlappedFollowedBy

Overlapped followed by binary assertion operator.

NonOverlappedFollowedBy

Non-overlapped followed by binary assertion operator.

enum class slang::ast::NondegeneracyStatus

Specifies possible classifications of assertion expressions as they relate to "nondegeneracy", as described in the LRM.

Enumerators
None

No factors related to nondegeneracy (i.e.

the expression is nondegenerate).

AdmitsEmpty

The sequence admits empty matches.

AcceptsOnlyEmpty

The sequence accepts only empty matches.

AdmitsNoMatch

The sequence definitely admits no match.

enum class slang::ast::UnaryOperator

Specifies possible unary operator kinds.

Enumerators
Plus

Unary plus.

Minus

Unary minus.

BitwiseNot

Bitwise NOT.

BitwiseAnd

Bitwise AND.

BitwiseOr

Bitwise OR.

BitwiseXor

Bitwise XOR.

BitwiseNand

Bitwise NAND.

BitwiseNor

Bitwise NOR.

BitwiseXnor

Bitwise XNOR.

LogicalNot

Logical NOT.

Preincrement

Pre-increment.

Predecrement

Pre-decrement.

Postincrement

Post-increment.

Postdecrement

Post-decrement.

enum class slang::ast::BinaryOperator

Specifies possible binary operator kinds.

Enumerators
Add

Addition.

Subtract

Subtraction.

Multiply

Multiplication.

Divide

Division.

Mod

Modulo.

BinaryAnd

Bitwise AND.

BinaryOr

Bitwise OR.

BinaryXor

Bitwise XOR.

BinaryXnor

Bitwise XNOR.

Equality

Equality comparison.

Inequality

Inequality comparison.

CaseEquality

Case equality comparison.

CaseInequality

Case inequality comparison.

GreaterThanEqual

Greater than or equal comparison.

GreaterThan

Greater than comparison.

LessThanEqual

Less than or equal comparison.

LessThan

Less than comparison.

WildcardEquality

Wildcard equality comparison.

WildcardInequality

Wildcard inequality comparison.

LogicalAnd

Logical AND.

LogicalOr

Logical OR.

LogicalImplication

Logical implication.

LogicalEquivalence

Logical equivalence.

LogicalShiftLeft

Logical shift left.

LogicalShiftRight

Logical shift right.

ArithmeticShiftLeft

Arithmetic shift left.

ArithmeticShiftRight

Arithmetic shift right.

Power

Power.

enum class slang::ast::ValueRangeKind

Specifies possible kinds of value ranges.

Enumerators
Simple

Simple value range.

AbsoluteTolerance

Absolute tolerance value range.

RelativeTolerance

Relative tolerance value range.

enum class slang::ast::LookupFlags

Additional modifiers for a lookup operation.

Enumerators
None

No special modifiers.

Type

A lookup for a type name, as opposed to a value.

These names cannot be hierarchical but can be package or class scoped.

AllowDeclaredAfter

Usually lookups require that the found symbol be declared before the lookup location.

This flag removes that restriction.

DisallowWildcardImport

Don't search through wildcard imports to satisfy the lookup.

NoUndeclaredError

Don't report an error if the lookup is for a simple identifier that cannot be found.

NoUndeclaredErrorIfUninstantiated

Don't report an error if the lookup is for a simple identifier that cannot be found and the context in which we are searching is an uninstantiated module.

AllowIncompleteForwardTypedefs

Allow lookup to resolve to incomplete forward class types.

NoParentScope

The lookup should not continue looking into parent scopes if the name is not found in the initial search scope.

NoSelectors

Additional name selectors are not allowed in the final result.

AllowRoot

Lookup is allowed to return the root symbol via the '$root' scope specifier.

AllowUnit

Lookup is allowed to return the nearest compilation unit via the '$unit' scope specifier.

IfacePortConn

Lookup is resolving an interface port connection expression.

StaticInitializer

Lookup is within a static initializer expression.

TypeReference

Lookup is happening within a type reference expression.

AlwaysAllowUpward

Always allow upward name lookup to occur, even with simple identifiers.

DisallowUnitReferences

Disallow resolving a name to a member declared or imported into the $unit compilation unit scope.

ForceHierarchical

Treat this lookup as hierarchical even if it's a simple name.

enum class slang::ast::LookupResultFlags: uint8_t

Flags that indicate additional details about the result of a lookup operation.

Enumerators
None

No extra result information.

WasImported

The found symbol was imported from a package.

IsHierarchical

The symbol was found via hierarchical lookup.

SuppressUndeclared

There were problems during lookup that indicate we should ignore the lack of a found symbol, because we're in a context where such a failure may be expected (for example, within a default instantiation of a generic class where the base class fails to resolve).

FromTypeParam

The lookup was resolved through a type parameter.

Some language rules restrict where this can be done.

FromForwardTypedef

The lookup was resolved through a forwarded typedef.

Some language rules restrict where this can be done.

IfacePort

The lookup was resolved through an interface port connection.

enum class slang::ast::PatternKind

Specifies possible kinds of patterns.

Enumerators
Invalid

Invalid pattern.

Wildcard

Wildcard pattern.

Constant

Constant pattern.

Variable

Variable pattern.

Tagged

Tagged pattern.

Structure

Structure pattern.

enum class slang::ast::VariableLifetime

Specifies the lifetime of a variable.

Enumerators
Automatic

Automatic lifetime.

Static

Static lifetime.

enum class slang::ast::Visibility

Specifies the visibility of a symbol or member.

Enumerators
Public

Publicly visible.

Protected

Protected visibility.

Local

Private visibility.

enum class slang::ast::ArgumentDirection

Specifies the direction of an argument passed to a port or subroutine.

Enumerators
In

Input argument.

Out

Output argument.

InOut

Bidirectional argument.

Ref

Reference argument.

enum class slang::ast::ProceduralBlockKind

Specifies possible procedural block kinds.

Enumerators
Initial

Initial block.

Final

Final block.

Always

Always block.

AlwaysComb
AlwaysLatch
AlwaysFF

enum class slang::ast::StatementBlockKind

Specifies the kind of a statement block.

Enumerators
Sequential

Sequential block.

JoinAll

Parallel block with "join all" behavior.

JoinAny

Parallel block with "join any" behavior.

JoinNone

Parallel block with "join none" behavior.

enum class slang::ast::DefinitionKind

Specifies the kind of a definition.

Enumerators
Module

Module definition.

Interface

Interface definition.

Program

Program definition.

enum class slang::ast::UnconnectedDrive

Specifies possible unconnected drive settings.

Enumerators
None

No unconnected drive.

Pull0

Pull0 drive.

Pull1

Pull1 drive.

enum class slang::ast::EdgeKind

Specifies possible edge kinds.

Enumerators
None

No edge.

PosEdge

Positive edge.

NegEdge

Negative edge.

BothEdges

Both positive and negative edges.

enum class slang::ast::SubroutineKind

Specifies possible subroutine kinds.

Enumerators
Function

Function.

Task

Task.

enum class slang::ast::AssertionKind

Specifies possible assertion kinds.

Enumerators
Assert

Regular assertion.

Assume

Assume.

CoverProperty

Cover property.

CoverSequence

Cover sequence.

Restrict

Restrict.

Expect

Expect.

enum class slang::ast::ElabSystemTaskKind

Specifies possible elaboration system task kinds.

Enumerators
Fatal

Fatal system task.

Error

Error system task.

Warning

Warning system task.

Info

Info system task.

StaticAssert

Static assert system task.

enum class slang::ast::RandMode

Specifies possible randomization modes.

Enumerators
None

No randomization.

Rand

Normal randomization.

RandC

Cyclic randomization.

enum class slang::ast::PrimitivePortDirection

Specifies possible directions of primitive ports.

Enumerators
In

Input port.

Out

Output port.

OutReg

Output register port.

InOut

Bidirectional port.

enum class slang::ast::PulseStyleKind

Specifies possible pulse style kinds.

Enumerators
OnEvent

On event pulse style.

OnDetect

On detect pulse style.

ShowCancelled

Show cancelled pulse style.

NoShowCancelled

No show cancelled pulse style.

enum class slang::ast::ChargeStrength

Specifies possible charge strengths.

Enumerators
Small

Small charge strength.

Medium

Medium charge strength.

Large

Large charge strength.

enum class slang::ast::DriveStrength

Specifies possible drive strengths.

Enumerators
Supply

Supply drive strength.

Strong

Strong drive strength.

Pull

Pull drive strength.

Weak

Weak drive strength.

HighZ

High impedance drive strength.

enum class slang::ast::ForwardTypeRestriction

Specifies possible forward type restrictions.

Enumerators
None

No restriction.

Enum

Enum restriction.

Struct

Struct restriction.

Union

Union restriction.

Class

Class restriction.

InterfaceClass

Interface class restriction.

enum class slang::ast::CaseStatementCondition

Specifies possible case statement condition kinds.

Enumerators
Normal

Normal case matching.

WildcardXOrZ

Xs and Zs are wildcards.

WildcardJustZ

Just Zs are wildcards.

Inside

Case-inside matching.

enum class slang::ast::AssignFlags: uint8_t

A set of flags that control how assignments are checked.

Enumerators
None

No special assignment behavior specified.

NonBlocking

The assignment is non-blocking.

InConcat

The assignment is occurring inside a concatenation.

InOutPort

The assignment is for an inout port of a module / interface / program.

enum class slang::ast::StatementKind

Specifies possible kinds of statements.

Enumerators
Invalid

Invalid statement.

Empty

Empty statement.

List

List statement.

Block

Block statement.

ExpressionStatement

Expression statement.

VariableDeclaration

Variable declaration statement.

Return

Return statement.

Continue

Continue statement.

Break

Break statement.

Disable

Disable statement.

Conditional

Conditional statement.

Case

Case statement.

PatternCase

Pattern case statement.

ForLoop

For loop statement.

RepeatLoop

Repeat loop statement.

ForeachLoop

Foreach loop statement.

WhileLoop

While loop statement.

DoWhileLoop

Do-while loop statement.

ForeverLoop

Forever loop statement.

Timed

Timed statement.

ImmediateAssertion

Immediate assertion statement.

ConcurrentAssertion

Concurrent assertion statement.

DisableFork

Disable fork statement.

Wait

Wait statement.

WaitFork

Wait fork statement.

WaitOrder

Wait order statement.

EventTrigger

Event trigger statement.

ProceduralAssign

Procedural assign statement.

ProceduralDeassign

Procedural deassign statement.

RandCase

RandCase statement.

RandSequence

RandSequence statement.

ProceduralChecker

Procedural checker statement.

enum class slang::ast::StatementFlags

Various flags that control statement construction.

Enumerators
None

No specific flags specified.

InLoop

Statement creation is happening inside a loop.

InForkJoin

Statement creation is happening inside a fork-join block.

InRandSeq

Statement creation is happening inside a randseq block.

HasTimingError

Statement creation has seen a timing-related error (and so should not issue another).

enum class slang::ast::UniquePriorityCheck

Specifies possible kinds of unique/priority checks for case statements.

Enumerators
None

No unique/priority check.

Unique

Unique check.

Unique0

Unique0 check.

Priority

Priority check.

enum class slang::ast::SymbolKind

Enumerates possible kinds of symbols.

Enumerators
Unknown

Unknown or unset symbol kind.

Root

The root symbol of a design tree.

Definition

Module, interface, or program definition.

CompilationUnit

Compilation unit.

DeferredMember

Deferred member – internal to the library.

TransparentMember

Transparent member – internal to the library.

EmptyMember

Empty member symbol (like an empty semicolon)

PredefinedIntegerType

Predefined integer type.

ScalarType

Scalar type (bit and logic)

FloatingType

Floating type.

EnumType

Enum type.

EnumValue

Enum value.

PackedArrayType

Packed array type.

FixedSizeUnpackedArrayType

Fixed size unpacked array type.

DynamicArrayType

Dynamic array type.

DPIOpenArrayType

DPI open array type.

AssociativeArrayType

Associative array type.

QueueType

Queue type.

PackedStructType

Packed struct type.

UnpackedStructType

Unpacked struct type.

PackedUnionType

Packed union type.

UnpackedUnionType

Unpacked union type.

ClassType

Class type.

CovergroupType

Covergroup type.

VoidType

Void type.

NullType

Null type.

CHandleType

chandle type

StringType

String type.

EventType

Event type.

UnboundedType

Unbounded type ($)

TypeRefType

Type reference type.

UntypedType

Untyped type.

SequenceType

Sequence type.

PropertyType

Property type.

VirtualInterfaceType

Virtual interface type.

TypeAlias

Type alias.

ErrorType

Error type.

ForwardingTypedef

Forwarding typedef.

NetType

Net type.

Parameter

Parameter.

TypeParameter

Type parameter.

Port

Port.

MultiPort

Multi-port.

InterfacePort

Interface port.

Modport

Modport.

ModportPort

Modport port.

ModportClocking

Modport clocking block.

Instance

Module, interface, or program instance.

InstanceBody

The body of an instance.

InstanceArray

An array of instances.

Package

Package.

ExplicitImport

Explicit import.

WildcardImport

Wildcard import.

Attribute

Attribute.

Genvar

Genvar.

GenerateBlock

Generate block.

GenerateBlockArray

Generate block array.

ProceduralBlock

Procedural block.

StatementBlock

Statement block.

Net

Net.

Variable

Variable.

FormalArgument

Formal argument.

Field

Struct or union field.

ClassProperty

Class property.

Subroutine

Subroutine (task or function)

ContinuousAssign

Continuous assign statement.

ElabSystemTask

Elaboration system task.

GenericClassDef

Generic class definition.

MethodPrototype

Method prototype.

UninstantiatedDef

Unknown and/or uninstantiated definition.

Iterator

Special method iterator.

PatternVar

Pattern variable.

ConstraintBlock

Constraint block.

DefParam

Defparam.

Specparam

Specparam.

Primitive

User-defined primitive.

PrimitivePort

User-defined primitive port.

PrimitiveInstance

User-defined primitive instance.

SpecifyBlock

Specify block.

Sequence

Sequence.

Property

Property.

AssertionPort

Assertion port.

ClockingBlock

Clocking block.

ClockVar

Clock variable.

LocalAssertionVar

Local assertion variable.

LetDecl

Let declaration.

Checker

Checker definition.

CheckerInstance

Checker instance.

CheckerInstanceBody

The body of a checker instance.

RandSeqProduction

Randseq production.

CovergroupBody

Covergroup body.

Coverpoint

Coverpoint.

CoverCross

Cover cross.

CoverCrossBody

Cover cross body.

CoverageBin

Coverage bin.

TimingPath

Timing path.

PulseStyle

Pulse style declaration.

SystemTimingCheck

System timing check.

AnonymousProgram

Anonymous program.

NetAlias

Net alias.

ConfigBlock

Config block.

enum class slang::ast::SymbolIndex: uint32_t

A numeric index that can be used to compare the relative ordering of symbols within a single lexical scope.

enum class slang::ast::ConstraintBlockFlags: uint8_t

Specifies various flags that can apply to constraint bocks.

Enumerators
None

No specific flags specified.

Pure

The constraint is 'pure', meaning it requires an implementation in derived classes.

Static

The conbstraint is static, meaning it is shared across all object instances.

Extern

The constraint block was declared extern, either implicitly or explicitly.

ExplicitExtern

The constraint block was explicitly declared extern, which means an out-of-block body is required instead of optional.

Initial

The constraint is marked 'initial', which means it should not override a base class constraint.

Extends

The constraint is marked 'extends', which means it must override a base class constraint.

Final

The constraint is marked 'final', which means it cannot be overridden in a derived class.

enum class slang::ast::BinsSelectExprKind

Specifies possible kinds of bins select expressions.

Enumerators
Invalid

Invalid bins select expression.

Condition

Condition bins select expression.

Unary

Unary bins select expression.

Binary

Binary bins select expression.

SetExpr

Set expression bins select expression.

WithFilter

With filter bins select expression.

CrossId

Cross ID bins select expression.

enum class slang::ast::InstanceFlags: uint8_t

Specifies various flags that describe instance behavior.

Enumerators
None

No flags specified.

Uninstantiated

The module isn't actually instantiated in the design.

This might be because it was created with invalid parameters simply to check name lookup rules but it's never actually referenced elsewhere in the user's code.

FromBind

The instance was created from a bind directive instead of a typical instantiation.

ParentFromBind

The instance resides in a parent instance that itself is from a bind directive.

This applies recursively for the entire bound hierarchy.

TargetedByBind

The instance is the target of a bind instantiation.

PreventsCaching

Flags that prevent caching of this instance in the elaboration cache.

enum class slang::ast::SystemTimingCheckKind

Specifies possible kinds of system timing checks.

Enumerators
Unknown
Setup
Hold
SetupHold
Recovery
Removal
RecRem
Skew

Skew timing check.

TimeSkew

Time skew timing check.

FullSkew

Full skew timing check.

Period

Period timing check.

Width

Width timing check.

NoChange

No change timing check.

enum class slang::ast::MethodFlags: uint16_t

Specifies various flags that can apply to subroutines.

Enumerators
None

No specific flags specified.

Virtual

The method is virtual.

Pure

The method is 'pure' virtual, meaning it requires an implementation in derived classes.

Static

The method is static, meaning it is invocable without an object instance handle.

Constructor

The method is a class constructor.

InterfaceExtern

The method is declared extern from an interface, and so its body must be exported by a module elsewhere.

ModportImport

The method is imported via a modport.

ModportExport

The method is exported via a modport.

DPIImport

The method is a DPI import.

DPIContext

The method is a DPI import marked 'context'.

BuiltIn

The method is built-in via language rules, as opposed to defined by the user.

Randomize

This method is a std::randomize built-in.

These are declared as normal subroutines so they can be found via name lookup, and then a special case translates the calls into the appropriate system subroutine call.

ForkJoin

Used with InterfaceExtern methods to indicate that more than one module is allowed to export the same task.

DefaultedSuperArg

The method is a constructor that has a 'default' argument indicating that the parent class's argument list should be inserted.

Initial

The method is marked 'initial', which means it should not override a base class method.

Extends

The method is marked 'extends', which means it must override a base class method (and also it will be virtual).

Final

The method is marked 'final', which means it cannot be overridden in a derived class.

enum class slang::ast::VariableFlags: uint16_t

Specifies various flags that can apply to variables.

Enumerators
None

No specific flags specified.

Const

The variable is a constant, i.e. not modifiable after initialization.

CompilerGenerated

The variable was not declared by the user but created during compilation.

ImmutableCoverageOption

The variable is a coverage option that is not modifiable outside of the covergroup declaration.

CoverageSampleFormal

The variable is a formal argument of an overridden sample method in a covergroup.

CheckerFreeVariable

This is a checker "free variable", which may behave nondeterministically in simulation and participate differently in formal verification.

RefStatic

The variable is a function port with direction 'ref static'.

enum class slang::ast::TimingControlKind

Specifies possible kinds of timing controls.

Enumerators
Invalid

Invalid timing control.

Delay

Delay timing control.

SignalEvent

Signal event timing control.

EventList

Event list timing control.

ImplicitEvent

Implicit event timing control.

RepeatedEvent

Repeated event timing control.

Delay3

Delay3 timing control.

OneStepDelay

One step delay timing control.

CycleDelay

Cycle delay timing control.

BlockEventList

Block event list timing control.

enum class slang::ast::DeclaredTypeFlags

Various flags that control declared type resolution.

Enumerators
None

No special flags specified.

InferImplicit

If the declared type is implicit, the actual type should be inferred from the initializer.

If this is not set, the type will be resolved as 'logic' if implicit syntax is provided.

InitializerCantSeeParent

The initializer expression cannot refer to the parent symbol.

This is used for parameters which would otherwise be infinitely recursive if they referenced themselves.

InitializerOverridden

The initializer expression has been overridden via a parameter in a hierarchical instantation.

TypeOverridden

The type has been overridden via a type parameter in a hierarchical instantation.

AutomaticInitializer

The initializer is for an automatic variable.

TypedefTarget

The declared type is the target of a typedef.

NetType

The declared type is a net type.

UserDefinedNetType

The declared type is a user-defined net type.

FormalArgMergeVar

The declared type is part of a port I/O declaration and should be merged with the formal argument declared elsewhere in the scope.

Rand

The declared type is for a random variable.

DPIReturnType

The declared type is a DPI return type.

DPIArg

The declared type is for a DPI argument.

AllowUnboundedLiteral

Allow use of the unbounded literal '$' in the initializer expression.

RequireSequenceType

The type must be one allowed in a sequence expression.

CoverageType

The type must be valid in a coverage expression.

InterconnectNet

The type is for an interconnect net, which has special rules.

InterfaceVariable

The type is for a variable declaration inside an interface.

NeedsTypeCheck

A mask of flags that indicate additional type rules are needed to be checked after the type itself is resolved.

enum class slang::ast::IntegralFlags: uint8_t

Specifies possible traits for integral types.

Enumerators
Unsigned

The type is unsigned. This is the default.

TwoState

The type is two state. This is the default.

Signed

The type is signed.

FourState

The type is four state.

Reg

The type used the 'reg' keyword instead of 'logic'; they are semantically identical but preserve the distinction to allow more useful messaging.

Function documentation

template<typename... Functions>
auto slang::ast::makeVisitor(Functions... funcs)

Creates an ASTVisitor out of the provided handler functions.

The provided callable arguments must take two parameters, the first of which is the visitor object itself (so that you can call visitDefault on it if desired) and the second is the AST type to match against.

For example, to create a visitor that will count all of the BinaryExpressions in an AST:

int count = 0;
makeVisitor([&](auto& visitor, const BinaryExpression& expr) {
    count++;
    visitor.visitDefault(expr);
})