namespace
astThe SystemVerilog AST.
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.
- 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 ASTSerializer
- A class that serializes AST nodes to JSON.
-
template<typename TDerived, bool VisitStatements, bool VisitExpressions>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.
- class Bitstream
- Provides utility methods for working with bitstream operations.
- class BlockStatement
- Represents a sequential or parallel block statement.
- class CallExpression
- Represents a subroutine call.
- class CaseAssertionExpr
- Represents a case operator in a property expression.
- 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 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 ConfigBlockSymbol
- Represents a config block declaration.
- class ConstraintBlockSymbol
- Represents a named constraint block declaration within a class.
- class ConstraintList
- Represents a list of constraints.
- 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 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 Definition
- Represents a module, interface, or program definition.
- class DefParamSymbol
- Represents a defparam directive.
- class DisableIffAssertionExpr
- Represents a disable iff condition in a property spec.
- class DisableSoftConstraint
- Represents a constraint that disables a soft random variable.
- class DistExpression
- Denotes an expression along with a distribution of probabilities for that expression.
- 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 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 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 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 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 ImplicationConstraint
- Represents a constraint defined by an implication.
- class InsideExpression
- Represents a set membership operator expression.
- 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 InvalidExpression
- Represents an invalid expression, which is usually generated and inserted into an expression tree due to violation of language semantics or type checking.
- class InvalidStatement
- Represents an invalid statement, which is usually generated and inserted into a statement list due to violation of language semantics or type checking.
- 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 LValue
- An lvalue is anything that can appear on the left hand side of an assignment expression.
- 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 NullLiteral
- Represents a null literal.
- class NullType
- Represents the Null type.
- class OpenRangeExpression
- Denotes a range of values by providing expressions for the lower and upper bounds of the range.
- 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 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 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 RangeSelectExpression
- Represents a range selection expression.
- class RealLiteral
- Represents a real number literal.
- class ReplicatedAssignmentPatternExpression
- Represents a replicated assignment pattern expression.
- class ReplicationExpression
- Represents a replication expression.
- 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 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 SimpleAssertionExpr
- Represents an assertion expression defined as a simple regular expression.
- class SimpleAssignmentPatternExpression
- Represents an 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 an 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 an assignment pattern expression.
- 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 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 TimeLiteral
- Represents a time literal.
- 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 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 unboudned 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 ValueDriver
- Represents an expression that drives a value by assigning to some range of its type.
- class ValueExpressionBase
- Common base class for both NamedValueExpression and HierarchicalValueExpression.
- class ValueSymbol
- A base class for symbols that represent a value (for example a variable or a parameter).
- class VariableSymbol
- Represents a variable declaration.
- class VirtualInterfaceType
- Represents a virtual interface type.
- class VoidType
- Represents the Void (or lack of a) type.
- class WildcardImportSymbol
- Represents a wildcard import declaration.
Enums
-
enum class ASTFlags: uint64_
t { None = 0, InsideConcatenation = 1ull << 0, UnevaluatedBranch = 1ull << 1, AllowDataType = 1ull << 2, EnumInitializer = 1ull << 3, NoAttributes = 1ull << 4, AssignmentAllowed = 1ull << 5, AssignmentDisallowed = 1ull << 6, NonProcedural = 1ull << 7, StaticInitializer = 1ull << 8, StreamingAllowed = 1ull << 9, TopLevelStatement = 1ull << 10, AllowUnboundedLiteral = 1ull << 11, AllowUnboundedLiteralArithmetic = 1ull << 12, Function = 1ull << 13, Final = 1ull << 14, NonBlockingTimingControl = 1ull << 15, EventExpression = 1ull << 16, AllowTypeReferences = 1ull << 17, AssertionExpr = 1ull << 18, AllowClockingBlock = 1ull << 19, AssertionInstanceArgCheck = 1ull << 20, AssertionDelayOrRepetition = 1ull << 21, LValue = 1ull << 22, PropertyNegation = 1ull << 23, PropertyTimeAdvance = 1ull << 24, RecursivePropertyArg = 1ull << 25, ConcurrentAssertActionBlock = 1ull << 26, AllowCoverageSampleFormal = 1ull << 27, AllowCoverpoint = 1ull << 28, AllowNetType = 1ull << 29, OutputArg = 1ull << 30, ProceduralAssign = 1ull << 31, ProceduralForceRelease = 1ull << 32, AllowInterconnect = 1ull << 33, NotADriver = 1ull << 34, StreamingWithRange = 1ull << 35, SpecifyBlock = 1ull << 36, DPIArg = 1ull << 37, AssertionDefaultArg = 1ull << 38, LAndRValue = 1ull << 39, NoReference = 1ull << 40 } - Specifies flags that control expression and statement creation.
-
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, AllowDupInitialDrivers = 1 << 3, AllowTopLevelIfacePorts = 1 << 4, StrictDriverChecking = 1 << 5, LintMode = 1 << 6, SuppressUnused = 1 << 7, IgnoreUnknownModules = 1 << 8, RelaxStringConversions = 1 << 9 }
- Defines flags that control compilation behavior.
- enum class LookupFlags { None = 0, Type = 1 << 0, AllowDeclaredAfter = 1 << 1, DisallowWildcardImport = 1 << 2, NoUndeclaredError = 1 << 3, NoUndeclaredErrorIfUninstantiated = 1 << 4, TypedefTarget = 1 << 5, NoParentScope = 1 << 6, NoSelectors = 1 << 7, AllowRoot = 1 << 8, ForceHierarchical = AllowDeclaredAfter | NoUndeclaredErrorIfUninstantiated }
- Additional modifiers for a lookup operation.
-
enum class AssignFlags: uint8_
t { None = 0, NonBlocking = 1 << 0, InConcat = 1 << 1, InputPort = 1 << 2, OutputPort = 1 << 3, InOutPort = 1 << 4, ClockVar = 1 << 5, AssertionLocalVarFormalArg = 1 << 6, SlicedPort = 1 << 7 } - A set of flags that control how assignments are checked.
-
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 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 } - 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 } - Specifies various flags that can apply to variables.
- 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
#include <slang/ast/ASTContext.h>
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. |
EnumInitializer |
The expression being created is an enum value initializer. |
NoAttributes |
Attributes are disallowed on expressions in this context. |
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. |
ProceduralAssign |
AST creation is for a procedural assign statement. |
ProceduralForceRelease |
AST creation is for a procedural force / release / deassign statement. |
AllowInterconnect |
AST creation is in a context that allows interconnect nets. |
NotADriver |
AST creation is in a context where drivers should not be registered for lvalues, even if they otherwise would normally be. This is used, for example, in potentially unrollable for loops to let the loop unroller handle the drivers. |
StreamingWithRange |
AST creation is for a range expression inside a streaming concatenation operator. |
SpecifyBlock |
AST creation is happening inside a specify block. |
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". |
enum class slang:: ast:: EvalFlags: uint8_ t
#include <slang/ast/ASTContext.h>
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 |
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
#include <slang/ast/Compilation.h>
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
#include <slang/ast/Compilation.h>
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. |
AllowDupInitialDrivers |
Signals driven by an always_comb are normally not allowed to be driven by any other process. This flag allows initial blocks to also drive such signals. |
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. |
StrictDriverChecking |
Perform strict checking of variable drivers, which currently means not taking into account procedural for loop unrolling. |
LintMode |
Compile in "linting" mode where we suppress errors that could be caused by not having an elaborated design. |
SuppressUnused |
Suppress warnings about unused code elements. |
IgnoreUnknownModules |
Don't issue an error when encountering an instantiation for an unknown definition. |
RelaxStringConversions |
Allow strings to implicitly convert to integers. |
enum class slang:: ast:: LookupFlags
#include <slang/ast/Lookup.h>
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. |
TypedefTarget |
The lookup is for a typedef target type, which has a special exemption to allow scoped access 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. |
ForceHierarchical |
Treat this lookup as hierarchical even if it's a simple name. |
enum class slang:: ast:: AssignFlags: uint8_ t
#include <slang/ast/SemanticFacts.h>
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. |
InputPort |
The assignment is for an input port of a module / interface / program (the assignment to the internal symbol from the port itself). |
OutputPort |
The assignment is for an output port of a module / interface / program (the assignment from the internal symbol from the port itself). |
InOutPort |
The assignment is for an inout port of a module / interface / program. |
ClockVar |
The assignment is from a clocking block signal. |
AssertionLocalVarFormalArg |
The assignment is from an assertion instance's local variable formal argument. |
SlicedPort |
The assignment is for an output port that was sliced due to an array of instances being connected to an array argument. |
enum class slang:: ast:: SymbolIndex: uint32_ t
#include <slang/ast/Symbol.h>
A numeric index that can be used to compare the relative ordering of symbols within a single lexical scope.
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. |
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. |
enum class slang:: ast:: DeclaredTypeFlags
#include <slang/ast/types/DeclaredType.h>
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
#include <slang/ast/types/Type.h>
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
#include <slang/ast/ASTVisitor.h>
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); })