Automatically infer formal correctness properties from Verilog/SystemVerilog RTL code and generate SystemVerilog Assertions (SVA). Identifies control-flow invariants (mutual exclusion, valid-ready handshakes, pipeline ordering, safety properties), liveness expectations, and temporal properties. Use when working with RTL designs that need formal property generation, when adding assertions to existing RTL, or when users ask to infer properties, generate assertions, or create formal specifications from hardware designs.
5k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
141
stars on the repo
on the repository, not the skill itself
Install
one command, takes just this skill from the repository
This skill analyzes Verilog/SystemVerilog RTL code and automatically infers implicit correctness properties, generating formal SystemVerilog Assertions (SVA). The skill identifies common hardware patterns and generates appropriate safety, liveness, and fairness properties with clear explanations.
Workflow
Step 1: Parse and Understand RTL Structure
Analyze the input RTL code to extract key components:
Identify signals and their roles:
Clock and reset signals
Control signals (valid, ready, enable, grant, request)
Data signals
State variables (FSM states, counters, flags)
Recognize structural patterns:
State machines (one-hot, binary encoded)
Handshake protocols (valid-ready, req-ack)
Pipelines (with/without stalls)
FIFOs and buffers
Arbiters and mutual exclusion logic
Counters (saturating, wraparound)
Memory interfaces
Extract clock/reset conventions:
Clock signal name and edge (posedge/negedge)
Reset signal name, polarity (active high/low), and type (sync/async)
Reset values for state variables
Step 2: Identify Control-Flow Invariants
Systematically analyze the design for common invariant patterns:
Mutual Exclusion:
Grant signals from arbiters
Mutually exclusive enable signals
One-hot state encodings
Look for: Multiple signals that should never be active simultaneously
Valid-Ready Handshakes:
Data stability during valid-without-ready
Valid persistence until handshake completes
No data loss (eventual completion)
Look for: Pairs of valid/ready signals with associated data
Pipeline Ordering:
Valid bit propagation through stages
Data stability in pipeline stages
Stall behavior (freezing pipeline state)
Look for: Arrays of valid signals, stage indices, pipeline registers
Note: Liveness properties require careful analysis. Only infer when there's clear evidence of intended eventual behavior. Use bounded liveness (with timeouts) when unbounded liveness may not hold.
Step 4: Map Patterns to Properties
Use the pattern library in common_patterns.md to generate appropriate assertions:
Match identified patterns to known property templates
Instantiate properties with actual signal names from the design
Adjust timing parameters based on design characteristics (e.g., pipeline depth, timeout values)
**Explanation**:
<Natural language description of what this property checks and why>
**Signals Involved**:
- `<signal1>`: <role/description>
- `<signal2>`: <role/description>
**Rationale**:
<Why this property was inferred from the RTL structure>
---
[Repeat for each property]
### Assumed Environment Constraints (Assume)
[Same format as above, but using `assume` directive]
### Coverage Properties (Cover)
[Same format as above, but using `cover` directive]
### Summary
- Total properties inferred: <count>
- Strong invariants: <count>
- Environment assumptions: <count>
- Coverage properties: <count>
- Patterns identified: <list of patterns>
- Verification recommendations: <suggestions>
Important Guidelines
Be conservative: Only infer properties with clear evidence in the RTL
Explain reasoning: Always justify why a property was inferred
Mark confidence: Indicate confidence level (High/Medium/Low) for each property
Avoid false positives: Better to miss a property than infer an incorrect one
Consider timing: Ensure delay values match design behavior
Check vacuity: Suggest cover properties for antecedents to avoid vacuous success
Document assumptions: Clearly state any assumptions made during inference
Provide context: Explain how properties relate to overall design correctness
Example Usage
User request: "Infer properties from this FIFO module"
Process:
Parse RTL and identify: full, empty, wr_en, rd_en, count signals
Recognize FIFO pattern with full/empty flags
Infer safety properties:
No write when full
No read when empty
Count within bounds [0:DEPTH]
Full and empty mutually exclusive (unless DEPTH=1)
Infer liveness property:
Write eventually makes FIFO non-empty
Generate SVA assertions with explanations
Classify as strong invariants (assert)
Add coverage for full and empty conditions
References
common_patterns.md - Library of common RTL patterns and their properties