slang::ast::ValueDriver class

Represents an expression that drives a value by assigning to some range of its type.

Public static functions

static auto getBounds(const Expression& prefixExpression, EvalContext& evalContext, const Type& rootType) -> std::optional<DriverBitRange>
Computes bounds for a driver given its longest static prefix expression.

Constructors, destructors, conversion operators

ValueDriver(DriverKind kind, const Expression& longestStaticPrefix, const Symbol& containingSymbol, bitmask<AssignFlags> flags, const SourceRange* symExprSR = nullptr)
Constructs a new ValueDriver instance.

Public functions

auto isInputPort() const -> bool
Indicates whether the driver is for an input port.
auto isUnidirectionalPort() const -> bool
Indicates whether the driver is for a unidirectional port (i.e. not an inout or ref port).
auto isClockVar() const -> bool
Indicates whether the driver is for a clocking variable.
auto isLocalVarFormalArg() const -> bool
Indicates whether the driver is for an assertion local variable formal argument.
auto isNetAlias() const -> bool
Indicates whether the driver is for a net alias.
auto isInSingleDriverProcedure() const -> bool
Indicates whether the driver is inside a single-driver procedure (such as always_comb).
auto isInSubroutine() const -> bool
Indicates whether the driver is inside a subroutine.
auto isInInitialBlock() const -> bool
Indicates whether the driver is inside an initial block.
auto isInAlwaysFFBlock() const -> bool
Indicates whether the driver is inside an always_ff block.
auto isInAlwaysLatchBlock() const -> bool
Indicates whether the driver is inside an always_latch block.
auto getSourceRange() const -> SourceRange
Gets the source range describing the driver as written in the source code.

Public variables

not_null<const Expression*> prefixExpression
The expression that drives the value.
not_null<const Symbol*> containingSymbol
The symbol that contains the driver expression.
const Expression* procCallExpression
If the driver is implied inside a procedure by a subroutine, this is the call expression for that subroutine.
bitmask<AssignFlags> flags
Flags that control how the driver operates.
DriverKind kind
The kind of driver (procedural or continuous).
const SourceRange* symExprSR
Stored driven value expression source range for diagnostic.