slang::ast::AssertionExpr class

The base class for assertion expressions (sequences and properties).

Derived classes

class AbortAssertionExpr final
Represents an abort (accept_on / reject_on) property expression.
class BinaryAssertionExpr final
Represents a binary operator in a sequence or property expression.
class CaseAssertionExpr final
Represents a case operator in a property expression.
class ClockingAssertionExpr final
Represents an assertion expression with attached clocking control.
class ConditionalAssertionExpr final
Represents a conditional operator in a property expression.
class DisableIffAssertionExpr final
Represents a disable iff condition in a property spec.
class FirstMatchAssertionExpr final
Represents a first_match operator in a sequence expression.
class InvalidAssertionExpr final
Represents an invalid expression.
class SequenceConcatExpr final
Represents an assertion expression defined as a delayed concatenation of other expressions.
class SequenceWithMatchExpr final
Represents a sequence expression along with a list of actions to perform upon matching and/or instructions for repetition.
class SimpleAssertionExpr final
Represents an assertion expression defined as a simple regular expression.
class StrongWeakAssertionExpr final
Represents a strong or weak operator in a property expression.
class UnaryAssertionExpr final
Represents a unary operator in a property expression.

Public types

struct NondegeneracyCheckResult
A result structure for checking nondegeneracy.
enum class NondegeneracyRequirement { Default, OverlapOp, NonOverlapOp }
Specifies binding behavior of property expressions as it pertains to nondegeneracy checking.

Public functions

void requireSequence(const ASTContext& context) const
Reports an error if the assertion expression is not valid in a sequence.
void requireSequence(const ASTContext& context, DiagCode code) const
Reports an error if the assertion expression is not valid in a sequence.
bool bad() const
Indicates whether the expression is invalid.
NondegeneracyCheckResult checkNondegeneracy() const
Checks whether this assertion expression is nondegenerate or whether it has properties of degeneracy (admitting empty matches or no matches at all).
std::optional<SequenceRange> computeSequenceLength() const
Computes possible clock ticks (delay) length of sequence under assertion expression.
bool canSucceedVacuously() const
Returns true if this expression can succeed vacuously, according to the SystemVerilog LRM rules for vacuous evaluation attempts.
bool isParenthesized() const
Returns true if this expression is known to be within a pair of parentheses, and otherwise false.
template<typename T>
T& as()
Casts this expression to the given concrete derived type.
template<typename T>
const T& as() const
Casts this expression to the given concrete derived type.
template<typename T>
T* as_if()
Tries to cast this expression to the given concrete derived type.
template<typename T>
const T* as_if() const
Tries to cast this expression to the given concrete derived type.
template<typename TVisitor, typename... Args>
decltype(auto) visit(TVisitor& visitor, Args && ... args) const
Visits this expression's concrete derived type via the provided visitor object.

Public variables

AssertionExprKind kind
The kind of expression; indicates the type of derived class.
const syntax::SyntaxNode* syntax
The syntax used to create the expression, if any.

Enum documentation

enum class slang::ast::AssertionExpr::NondegeneracyRequirement

Specifies binding behavior of property expressions as it pertains to nondegeneracy checking.

Enumerators
Default

Any sequence that is used as a property shall be nondegenerate.

OverlapOp

Any sequence that is used as the antecedent of an overlapping implication or followed-by operator shall be nondegenerate.

NonOverlapOp

Any sequence that is used as the antecedent of a nonoverlapping implication or followed-by operator shall admit at least one match.

Such a sequence can admit only empty matches.

Function documentation

template<typename T>
T& slang::ast::AssertionExpr::as()

Casts this expression to the given concrete derived type.

Asserts that the type is appropriate given this expression's kind.

template<typename T>
const T& slang::ast::AssertionExpr::as() const

Casts this expression to the given concrete derived type.

Asserts that the type is appropriate given this expression's kind.

template<typename T>
T* slang::ast::AssertionExpr::as_if()

Tries to cast this expression to the given concrete derived type.

If the type is not appropriate given this expression's kind, returns nullptr.

template<typename T>
const T* slang::ast::AssertionExpr::as_if() const

Tries to cast this expression to the given concrete derived type.

If the type is not appropriate given this expression's kind, returns nullptr.

Variable documentation

const syntax::SyntaxNode* slang::ast::AssertionExpr::syntax

The syntax used to create the expression, if any.

An expression tree can be created manually in which case it may not have a syntax representation.