Expand description
SVA Semantic Model
Provides an AST for a subset of SystemVerilog Assertions, a parser for that subset, and structural equivalence checking.
This model enables the Z3 semantic equivalence pipeline: FOL (from LOGOS) ↔ SVA (from LLM) checked for structural match.
Structs§
- Checker
Decl - Checker declaration (IEEE Chapter 17)
- Dist
Item - A dist item — value or range with weight
- Elaboration
Context - Context for elaborating directives with default clocking and disable iff.
IEEE 16.15:
default clockingapplies to all assertions in scope that lack an explicit clock. IEEE 16.16:default disable iffapplies the reset condition to all assertions lacking explicitdisable iff. - LetDecl
- Let declaration (IEEE 11.12) — pure expression substitution
- Property
Decl - Named property declaration (IEEE 16.12)
- RandVar
- Random variable in a checker (IEEE 17.7)
- Sequence
Decl - Named sequence declaration (IEEE 16.8)
- SvaDirective
- A concurrent assertion directive (IEEE 16.14)
- SvaParse
Error - Parse error for SVA subset.
- SvaPort
- A port in a named sequence or property declaration
Enums§
- Clock
Edge - Clock edge type
- Dist
Kind - Dist weight kind (IEEE 18.5.4)
- Immediate
Deferred - Deferred assertion timing (IEEE 16.4)
- Rand
VarType - Type discriminant for random variables (IEEE 17.7, extended in 2023)
- SvaDirective
Kind - Assertion directive kind (IEEE 16.14)
- SvaExpr
- SVA expression AST — models a useful subset of SystemVerilog Assertions.
- SvaPort
Type - Port type for named sequence/property declarations (IEEE 16.8, 16.12)
Functions§
- checker_
quantifier_ structure - Get checker’s random variable quantifier structure. Returns (const_rand_vars, per_timestep_rand_vars).
- elaborate_
directives - Elaborate a set of directives by applying default clocking and disable iff.
- parse_
sva - Parse a subset of SVA text into an SvaExpr.
- parse_
sva_ directive - Parse a concurrent assertion directive (IEEE 16.14).
- resolve_
checker - Resolve a checker instance by binding ports into its assertions.
- resolve_
let_ instance - Resolve
letdeclarations by inlining expression substitution. IEEE 11.12:letis pure expression substitution with no temporal semantics. - resolve_
sequence_ instance - Resolve a sequence instance by substituting actuals for formals.
- sva_
expr_ to_ string - Render an SvaExpr back to valid SVA text. Closes the round-trip: parse_sva(text) → SvaExpr → sva_expr_to_string → text.
- sva_
exprs_ structurally_ equivalent - Check if two SvaExpr trees are structurally equivalent.
- translate_
dist_ to_ ranges - Translate dist items into range constraints for formal verification.
IEEE 16.14.2: In formal mode,
dist≡inside(range restriction only). - validate_
dist - Validate dist list is non-empty.