slang namespace

Root namespace.

Contents

Classes

class AbortAssertionExpr
Represents an abort (accept_on / reject_on) property expression.
class AssertionInstanceExpression
class AssertionPortSymbol
class AssignmentExpression
Represents an assignment expression.
class AssignmentPatternExpressionBase
Base class for assignment pattern expressions.
struct AssociativeArray
Represents a SystemVerilog associative array, for use during constant evaluation.
class AssociativeArrayType
Represents an unpacked array that provides associative lookup.
template<typename TDerived, bool VisitStatements, bool VisitExpressions>
struct ASTVisitor
class Bag
class BinaryAssertionExpr
Represents a binary operator in a sequence or property expression.
class BinaryExpression
Represents a binary operator expression.
class BindContext
template<typename T>
class bitmask
class BlockStatement
Represents a sequential or parallel block statement.
struct BufferID
class BumpAllocator
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 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
class ClockingSkew
Represents a skew value that is applied to clocking block signals.
class ClockVarSymbol
Represents a clocking block signal.
class CommandLine
class Compilation
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.
struct ConstantRange
class ConstantValue
class ConstraintBlockSymbol
Represents a named constraint block declaration within a class.
class ConstraintList
Represents a list of constraints.
struct ConstTokenOrSyntax
A token or a constant syntax node.
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.
template<typename T>
class CopyPtr
class CVConstIterator
class CVIterator
class DataTypeExpression
class DeclaredType
class DefParamSymbol
Represents a defparam directive.
class DesignTreeNode
class Diagnostic
Wraps up a reported diagnostic along with location in source and any arguments.
class DiagnosticEngine
class Diagnostics
A collection of diagnostics.
class DisableIffAssertionExpr
Represents a disable iff condition in a property spec.
class DisableSoftConstraint
Represents a constraint that disables a soft random variable.
class DistExpression
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
class EmptyMemberSymbol
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
class EvalContext
class EventType
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
class FloatingType
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
template<typename Fn>
class function_ref
class GenerateBlockArraySymbol
Represents an array of generate blocks, as generated by a loop generate construct.
class GenerateBlockSymbol
class GenericClassDefSymbol
class GenvarSymbol
Represents a genvar declaration.
class HierarchicalReferenceExpression
class HierarchicalValueExpression
Represents an expression that references a named value via hierarchical path.
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
class InterfacePortSymbol
class InvalidExpression
class InvalidStatement
template<typename DerivedT, typename IteratorCategoryT, typename T, typename DifferenceTypeT = std::ptrdiff_t, typename PointerT = T*, typename ReferenceT = T&>
class iterator_facade
template<typename TIterator>
class iterator_range
A range represented by an interator pair, begin and end.
class IteratorSymbol
Represents an iterator variable created for array manipulation methods.
class JsonWriter
class LetDeclSymbol
Represents a let declaration.
class Lexer
struct LexerOptions
Contains various options that can control lexing behavior.
class LocalAssertionVarSymbol
struct logic_t
class Lookup
Centralized functionality for looking up symbols by name in the AST.
class LookupLocation
struct LookupResult
A structure that contains the results of a name lookup operation.
class LValue
class LValueReferenceExpression
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 NamedValueExpression
Represents an expression that references a named value.
class NetSymbol
Represents a net declaration.
class NetType
class NewArrayExpression
Represents a new[] expression that creates a dynamic array.
class NewClassExpression
Represents a new expression that creates a class instance.
template<typename T>
class not_null
class NullLiteral
Represents a null literal.
class NullType
struct NumericTokenFlags
Various flags for numeric tokens.
class OpenRangeExpression
class OS
A collection of various OS-specific utility functions.
class PackageSymbol
A SystemVerilog package construct.
class PackedArrayType
class PackedStructType
Represents a packed structure of members.
class PackedUnionType
Represents a packed union of members.
class ParameterSymbol
Represents a parameter value.
struct ParamOverrideNode
class Parser
Implements a full syntax parser for SystemVerilog.
class ParserBase
struct ParserOptions
Contains various options that can control parsing behavior.
class PortSymbol
class PredefinedIntegerType
Represents the predefined integer types, which are essentially predefined vector types.
class Preprocessor
struct PreprocessorOptions
Contains various options that can control preprocessing behavior.
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.
struct real_t
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.
template<typename T, typename Index>
class SafeIndexedVector
class ScalarType
Represents the single-bit scalar types.
class Scope
template<typename F>
class ScopeGuard
class ScriptSession
template<typename T>
class SeparatedSyntaxList
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
struct shortreal_t
class SimpleAssertionExpr
Represents an assertion expression defined as a simple regular expression.
class SimpleAssignmentPatternExpression
Represents an assignment pattern expression.
class SimpleSystemSubroutine
template<typename K, typename V, size_t N, typename Entry = ska::detailv3::sherwood_v3_entry<std::pair<K, V>>, typename Alloc = StackAllocator<Entry, N>>
class SmallMap
template<typename T, size_t N, typename Entry = ska::detailv3::sherwood_v3_entry<T>, typename Alloc = StackAllocator<Entry, N>>
class SmallSet
template<typename T>
class SmallVector
template<typename T, size_t N>
class SmallVectorSized
class SolveBeforeConstraint
Represents a constraint that enforces ordering of solving variables.
struct SourceBuffer
class SourceLocation
class SourceManager
class SourceRange
Combines a pair of source locations that denote a range of source text.
class SpecparamSymbol
Represents a specify parameter.
class Statement
The base class for all statements in SystemVerilog.
class StatementBinder
class StatementList
Represents a list of statements.
class StorageElement
class StreamingConcatenationExpression
Represents a streaming concatenation.
class StringLiteral
Represents a string literal.
template<typename T>
class StringTable
class StringType
Represents an ASCII string type.
class StrongWeakAssertionExpr
Represents a strong or weak operator in a property expression.
class StructuredAssignmentPatternExpression
Represents an assignment pattern expression.
class SubroutineSymbol
Represents a subroutine (task or function).
class SVInt
class SVIntStorage
struct SVQueue
Represents a SystemVerilog queue, for use during constant evaluation.
struct SVUnion
Represents a SystemVerilog unpacked union, for use during constant evaluation.
class Symbol
class SyntaxFacts
template<typename T>
class SyntaxList
A syntax node that represents a list of child syntax nodes.
class SyntaxListBase
A base class for syntax nodes that represent a list of items.
class SyntaxNode
Base class for all syntax nodes.
class SyntaxPrinter
template<typename TDerived>
class SyntaxRewriter
class SyntaxTree
template<typename TDerived>
class SyntaxVisitor
class TaggedUnionExpression
Represents a tagged union member setter expression.
class TimeLiteral
Represents a time literal.
struct TimeScale
struct TimeScaleValue
A combination of a unit and magnitude for a time scale value.
class Token
class TokenList
A syntax node that represents a list of child tokens.
struct TokenOrSyntax
A token or a syntax node.
template<typename TNode>
struct TokenOrSyntaxBase
A base class template for a sum type representing either a token or a syntax node.
class TransparentMemberSymbol
class Trivia
class Type
class TypeAliasType
Represents a type alias, which is introduced via a typedef or type parameter.
template<typename T>
class TypedBumpAllocator
class TypeReferenceExpression
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
class UniquenessConstraint
Represents a constraint that enforces uniqueness of variables.
class UnknownModuleSymbol
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 ValueSymbol
class VariableSymbol
Represents a variable declaration.
class VersionInfo
Provides access to compile-time generated version info about the library.
class VirtualInterfaceType
Represents a virtual interface type.
class VoidType
class WildcardImportSymbol

Enums

enum class BindFlags { None = 0, Constant = 1 << 0, NoHierarchicalNames = 1 << 1, InsideConcatenation = 1 << 2, UnevaluatedBranch = 1 << 3, AllowDataType = 1 << 4, EnumInitializer = 1 << 5, NoAttributes = 1 << 6, AssignmentAllowed = 1 << 7, AssignmentDisallowed = 1 << 8, NonProcedural = 1 << 9, StaticInitializer = 1 << 10, StreamingAllowed = 1 << 11, TopLevelStatement = 1 << 12, AllowUnboundedLiteral = 1 << 13, AllowUnboundedLiteralArithmetic = 1 << 14, SpecparamsAllowed = 1 << 15, Function = 1 << 16, Final = 1 << 17, NonBlockingTimingControl = 1 << 18, EventExpression = 1 << 19, AllowTypeReferences = 1 << 20, AssertionExpr = 1 << 21, AllowClockingBlock = 1 << 22, AssertionInstanceArgCheck = 1 << 23, AssertionDelayOrRepetition = 1 << 24, LValue = 1 << 25, PropertyNegation = 1 << 26, PropertyTimeAdvance = 1 << 27, RecursivePropertyArg = 1 << 28, ConcurrentAssertActionBlock = 1 << 29 }
Specifies flags that control expression and statement binding.
enum class EvalFlags: uint8_t { None = 0, IsScript = 1, IsVerifying = 2, CacheResults = 4 }
Various flags that can be applied to a constant expression evaluation.
enum class LookupFlags { None = 0, Constant = 1 << 0, Type = 1 << 1, AllowDeclaredAfter = 1 << 2, DisallowWildcardImport = 1 << 3, NoUndeclaredError = 1 << 4, NoUndeclaredErrorIfUninstantiated = 1 << 5, TypedefTarget = 1 << 6, NoParentScope = 1 << 7, RegisterUpwardNames = 1 << 8, ForceHierarchical = AllowDeclaredAfter | RegisterUpwardNames | NoUndeclaredErrorIfUninstantiated }
Additional modifiers for a lookup operation.
enum class MinTypMax { Min, Typ, Max }
enum class DiagnosticSeverity { Ignored, Note, Warning, Error, Fatal }
enum class LiteralBase: uint8_t { Binary, Octal, Decimal, Hex }
Specifies the base of an integer (for converting to/from a string)
enum class TimeUnit: uint8_t { Seconds, Milliseconds, Microseconds, Nanoseconds, Picoseconds, Femtoseconds }
Scale unit for a time value.
enum class TimeScaleMagnitude: uint8_t { One = 1, Ten = 10, Hundred = 100 }
enum class KeywordVersion: uint8_t { v1364_1995 = 0, v1364_2001_noconfig = 1, v1364_2001 = 2, v1364_2005 = 3, v1800_2005 = 4, v1800_2009 = 5, v1800_2012 = 6, v1800_2017 = 7 }
enum class TriviaKind: uint8_t { Unknown, Whitespace, EndOfLine, LineComment, BlockComment, DisabledText, SkippedTokens, SkippedSyntax, Directive }
The kind of trivia we've stored.
enum class MethodFlags: uint16_t { None = 0, Virtual = 1 << 0, Pure = 1 << 1, Static = 1 << 2, Constructor = 1 << 3, InterfaceImport = 1 << 4, DPIImport = 1 << 5, DPIContext = 1 << 6, NotConst = 1 << 7, Randomize = 1 << 8 }
Specifies various flags that can apply to subroutines.
enum class SymbolIndex: uint32_t { }
enum class DeclaredTypeFlags { None = 0, InferImplicit = 1 << 0, RequireConstant = 1 << 1, AutomaticInitializer = 1 << 2, Port = 1 << 3, TypedefTarget = 1 << 4, NetType = 1 << 5, UserDefinedNetType = 1 << 6, FormalArgMergeVar = 1 << 7, Rand = 1 << 8, DPIReturnType = 1 << 9, DPIArg = 1 << 10, SpecparamsAllowed = 1 << 11, AllowUnboundedLiteral = 1 << 12, RequireSequenceType = 1 << 13, NeedsTypeCheck = Port | NetType | UserDefinedNetType | FormalArgMergeVar | Rand | DPIReturnType | DPIArg | RequireSequenceType }
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.

Typedefs

using bitwidth_t = uint32_t
A type that can represent the largest possible bit width of a SystemVerilog integer.

Functions

auto countLeadingZeros32(uint32_t value) -> uint32_t
auto countLeadingZeros64(uint64_t value) -> uint32_t
auto checkedAddS32(int32_t a, int32_t b) -> std::optional<int32_t>
auto checkedSubS32(int32_t a, int32_t b) -> std::optional<int32_t>
auto checkedMulU32(uint32_t a, uint32_t b) -> std::optional<uint32_t>
auto clog2(const SVInt& v) -> uint32_t
Returns the ceiling of the log_2 of the value. If value is zero, returns zero.
ENUM(VariableLifetime, LIFETIME)
Specifies the storage lifetime of a variable.
ENUM(Visibility, VISIBILITY)
Specifies the visibility of class members.
ENUM(ArgumentDirection, DIRECTION)
Specifies behavior of an argument passed to a subroutine.
ENUM(ProceduralBlockKind, BLOCK)
Specifies possible procedural block kinds.
ENUM(StatementBlockKind, BLOCK)
Specifies possible statement block kinds.
ENUM(DefinitionKind, DEF)
Specifies possible definition kinds.
ENUM(UnconnectedDrive, UD)
Specifies possible unconnected drive settings.
ENUM(EdgeKind, EDGE)
Specifies possible edge kinds.
ENUM(SubroutineKind, SRK)
Specifies possible subroutine kinds.
ENUM(AssertionKind, ASK)
Specifies possible assertion kinds.
ENUM(ElabSystemTaskKind, ELAB)
Specifies possible elaboration system task kinds.
ENUM(RandMode, MODE)
Specifies possible assertion kinds.
ENUM(PrimitivePortDirection, DIRECTION)
Specifies behavior of a primitive port.
auto xxhash(const void* input, size_t len) -> size_t
Hashes the provided input using the xxhash XXH3 algorithm.
template<typename T, typename... Rest>
void hash_combine(size_t& seed, const T& v, Rest... rest)
template<typename T>
auto make_range(T begin, T end) -> iterator_range<T>
Constructs an iterator_range from two provided iterators (inferring the types involved).
template<typename TContainer>
auto make_reverse_range(TContainer&& container) -> auto
auto toStringView(span<char> text) -> string_view
Converts a span of characters into a string_view.
void uintToStr(SmallVector<char>& buffer, uint32_t value)
Converts the provided value into a string, storing it into buffer.
void uintToStr(SmallVector<char>& buffer, uint64_t value)
Converts the provided value into a string, storing it into buffer.
auto strToInt(string_view str, size_t* pos = nullptr, int base = 10) -> optional<int32_t>
auto strToUInt(string_view str, size_t* pos = nullptr, int base = 10) -> optional<uint32_t>
auto strToDouble(string_view str, size_t* pos = nullptr) -> optional<double>
auto editDistance(string_view left, string_view right, bool allowReplacements = true, int maxDistance = 0) -> int
auto widen(string_view str) -> string_view
Widens the provided UTF8 string into UTF16 wchars.
auto narrow(string_view str) -> string_view
Widens the provided UTF16 string into UTF8.

Enum documentation

enum class slang::BindFlags

Specifies flags that control expression and statement binding.

Enumerators
None

No special binding behavior specified.

Constant

The binding is for a constant expression, so report an error if it's not constant for some reason.

NoHierarchicalNames

No hierarchical references are allowed to symbols. This is implied by Constant but can be specified on its own if the expression doesn't need to be fully constant.

InsideConcatenation

The expression is inside a concatenation; this enables slightly different binding 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 bound 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.

SpecparamsAllowed

Specparams are allowed even if this is also a constant expression.

Function

Binding is happening within a function body.

Final

Binding is happening within a final block.

NonBlockingTimingControl

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

EventExpression

Binding is happening within an event expression.

AllowTypeReferences

Binding is in a context where type reference expressions are allowed.

AssertionExpr

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

AllowClockingBlock

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

AssertionInstanceArgCheck

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

AssertionDelayOrRepetition

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

LValue

Binding is for the left hand side of an assignment operation.

PropertyNegation

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

PropertyTimeAdvance

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

RecursivePropertyArg

Binding is for an argument passed to a recursive property instance.

ConcurrentAssertActionBlock

Binding is inside a concurrent assertion's action block.

enum class slang::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.

IsVerifying

This evaluation is happening to verify the const-ness of an expression, not to figure out a final result.

CacheResults

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

enum class slang::LookupFlags

Additional modifiers for a lookup operation.

Enumerators
None

No special modifiers.

Constant

The lookup is occurring in a constant context. This adds an additional restriction that the symbols cannot be referenced by hierarchical path.

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.

RegisterUpwardNames

The presence of upward name paths should be registered with the compilation.

ForceHierarchical

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

enum class slang::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::DiagnosticSeverity

The severity of a given diagnostic. This is not tied to the diagnostic itself; it can be configured on a per-diagnostic basis at runtime.

enum class slang::LiteralBase: uint8_t

Specifies the base of an integer (for converting to/from a string)

enum class slang::TimeUnit: uint8_t

Scale unit for a time value.

enum class slang::TimeScaleMagnitude: uint8_t

As allowed by SystemVerilog, time scales can be expressed in one of only a few magnitudes.

enum class slang::KeywordVersion: uint8_t

Different restricted sets of keywords that can be set using the `begin_keywords directive. The values of the enum correspond to indexes to allKeywords[] in LexerFacts.cpp

enum class slang::TriviaKind: uint8_t

The kind of trivia we've stored.

enum class slang::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.

InterfaceImport

The method is imported into an interface instance.

DPIImport

The method is a DPI import.

DPIContext

The method is a DPI import marked 'context'.

NotConst

The method is known not to be constant, even if it otherwise meets all of the requirements for a constant function. Used for built-in methods only.

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.

enum class slang::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::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.

RequireConstant

The bound initializer is required to be a constant expression.

AutomaticInitializer

The initializer is for an automatic variable.

Port

The type being bound is for a port.

TypedefTarget

The type being bound is the target of a typedef.

NetType

The type being bound is a net type.

UserDefinedNetType

The type being bound is a user-defined net type.

FormalArgMergeVar

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

Rand

The type being bound is for a random variable.

DPIReturnType

The type being bound is a DPI return type.

DPIArg

The type being bound is for a DPI argument.

SpecparamsAllowed

Specparams are allowed in the initializer expression, even if the expression is otherwise not constant.

AllowUnboundedLiteral

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

RequireSequenceType

The type must be one allowed in a sequence expression.

NeedsTypeCheck

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

enum class slang::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.

Typedef documentation

using slang::bitwidth_t = uint32_t

A type that can represent the largest possible bit width of a SystemVerilog integer.

Function documentation

uint32_t slang::countLeadingZeros32(uint32_t value)

If value is zero, returns 32. Otherwise, returns the number of zeros, starting from the MSB.

uint32_t slang::countLeadingZeros64(uint64_t value)

If value is zero, returns 64. Otherwise, returns the number of zeros, starting from the MSB.

std::optional<int32_t> slang::checkedAddS32(int32_t a, int32_t b)

Performs an addition of two signed 32-bit integers and returns the result if it does not overflow. If it does, nullopt is returned instead.

std::optional<int32_t> slang::checkedSubS32(int32_t a, int32_t b)

Performs a subtraction of two signed 32-bit integers and returns the result if it does not overflow. If it does, nullopt is returned instead.

std::optional<uint32_t> slang::checkedMulU32(uint32_t a, uint32_t b)

Performs a multiplication of two unsigned 32-bit integers and returns the result if it does not overflow. If it does, nullopt is returned instead.

uint32_t slang::clog2(const SVInt& v)

Returns the ceiling of the log_2 of the value. If value is zero, returns zero.

slang::ENUM(VariableLifetime, LIFETIME)

Specifies the storage lifetime of a variable.

slang::ENUM(Visibility, VISIBILITY)

Specifies the visibility of class members.

slang::ENUM(ArgumentDirection, DIRECTION)

Specifies behavior of an argument passed to a subroutine.

slang::ENUM(ProceduralBlockKind, BLOCK)

Specifies possible procedural block kinds.

slang::ENUM(StatementBlockKind, BLOCK)

Specifies possible statement block kinds.

slang::ENUM(DefinitionKind, DEF)

Specifies possible definition kinds.

slang::ENUM(UnconnectedDrive, UD)

Specifies possible unconnected drive settings.

slang::ENUM(EdgeKind, EDGE)

Specifies possible edge kinds.

slang::ENUM(SubroutineKind, SRK)

Specifies possible subroutine kinds.

slang::ENUM(AssertionKind, ASK)

Specifies possible assertion kinds.

slang::ENUM(ElabSystemTaskKind, ELAB)

Specifies possible elaboration system task kinds.

slang::ENUM(RandMode, MODE)

Specifies possible assertion kinds.

slang::ENUM(PrimitivePortDirection, DIRECTION)

Specifies behavior of a primitive port.

size_t slang::xxhash(const void* input, size_t len)

Hashes the provided input using the xxhash XXH3 algorithm.

template<typename T, typename... Rest>
void slang::hash_combine(size_t& seed, const T& v, Rest... rest)

Hash combining function, based on the function from Boost. It hashes the provided v object and combines it with the previous hash value in seed.

template<typename T>
iterator_range<T> slang::make_range(T begin, T end)

Constructs an iterator_range from two provided iterators (inferring the types involved).

template<typename TContainer>
auto slang::make_reverse_range(TContainer&& container)

Constructs a reversed iterator_range from the provided container, using std::make_reverse_iterator.

string_view slang::toStringView(span<char> text)

Converts a span of characters into a string_view.

void slang::uintToStr(SmallVector<char>& buffer, uint32_t value)

Converts the provided value into a string, storing it into buffer.

void slang::uintToStr(SmallVector<char>& buffer, uint64_t value)

Converts the provided value into a string, storing it into buffer.

optional<int32_t> slang::strToInt(string_view str, size_t* pos = nullptr, int base = 10)

Returns the converted value, or nullopt if conversion fails (invalid string, overflow, etc).

Parses the provided str in the specified base into a signed integer. If pos is non-null, it will be set to point to the first character in the source string that was not part of the conversion.

optional<uint32_t> slang::strToUInt(string_view str, size_t* pos = nullptr, int base = 10)

Returns the converted value, or nullopt if conversion fails (invalid string, overflow, etc).

Parses the provided str in the specified base into an unsigned integer. If pos is non-null, it will be set to point to the first character in the source string that was not part of the conversion.

optional<double> slang::strToDouble(string_view str, size_t* pos = nullptr)

Returns the converted value, or nullopt if conversion fails (invalid string, overflow, etc).

Parses the provided str into a floating point value. If pos is non-null, it will be set to point to the first character in the source string that was not part of the conversion.

int slang::editDistance(string_view left, string_view right, bool allowReplacements = true, int maxDistance = 0)

Determines the number of edits to the left string that are required to change it into the right string. If allowReplacements is true, characters can be substituted as needed. Otherwise, only swaps are allowed.

If maxDistance is >0 and the computed distance is at least that much, give up and return maxDistance + 1.

string_view slang::widen(string_view str)

Widens the provided UTF8 string into UTF16 wchars.

string_view slang::narrow(string_view str)

Widens the provided UTF16 string into UTF8.