Pass, Fail and Vacuous Controls
Silence pass or fail actions without stopping the checks, with $assertpassoff, $assertpasson, $assertfailoff, $assertfailon, $assertnonvacuouson and $assertvacuousoff.
You Will Be Able To
- Predict which action blocks run after each action control task.
- Tell a task that silences actions from one that stops checking.
- Keep real passes and drop vacuous ones, by the standard and on Verilator 5.052.
- Name where Verilator 5.052 departs from the standard.
- Lesson
- A7.6
- Time
- 25 min
- Runs on
- Verilator
- Check
- 5 questions
A regression log has 40,000 lines. 39,000 of them are "pass" messages from a handshake rule that is mostly idle. The team wants the failures and the real passes, not the vacuous ones. Six tasks switch the action blocks without touching the checks.
- Step
- Result
- Control / FSM
- Control
- Three results
An attempt of
req |-> ackends as a real pass, a vacuous pass or a failure. - Pass actions
$assertpassoffsilences both kinds of pass.$assertvacuousoffsilences only the vacuous ones. - Fail actions
$assertfailoffsilences the else action, including the default$error. The failure still happens.
Read the diagram as text
- attempt: req |-> ack
- real pass: pass action
- vacuous pass: pass action
- failure: else action
- $assertpassoff / passon: both kinds of pass
- $assertvacuousoff / nonvacuouson: one kind of pass
- $assertfailoff / failon: the else action
- attempt → real pass: ack high
- attempt → vacuous pass: req low
- attempt → failure: ack low
- $assertpassoff / passon → real pass: switches
- $assertvacuousoff / nonvacuouson → vacuous pass: switches
- $assertfailoff / failon → failure: switches
IEEE 1800-2023 20.11. None of these tasks stops a check; $assertoff does that.
$assertpassoff: No Pass Actions
$assertpassoff stops the pass action for every success, real or vacuous. The checks go on, and failures still run their else action.
Every program in this lesson uses the rule req |-> ack and the same stimulus. Real passes come at 15, 35 and 65, vacuous passes at 5, 25 and 55, and failures at 45 and 75.
$assertpasson: Pass Actions Again
$assertpasson turns the pass action back on for both kinds of success.
$assertfailoff: No Fail Actions
$assertfailoff stops the else action, and the default $error when there is no else. The failure still happens; only its report is gone.
$assertfailon: Fail Actions Again
$assertfailon turns the else action back on. Failures inside the silent window stay unreported.
$assertnonvacuouson: Real Passes Only
After $assertpassoff, $assertnonvacuouson turns the pass action back on for real passes only. Vacuous passes stay silent.
Standard behaviour, derived from IEEE 1800-2023 20.11 (docs/sva-standard-traces/A7.md, sva-187). The last row was measured: Verilator 5.052 turns both kinds of pass back on.
On Verilator 5.052, let the pass action tell the two kinds apart itself. A real pass of req |-> ack has req high in its sampled value.
$assertvacuousoff: No Vacuous Pass Actions
$assertvacuousoff stops the pass action on vacuous successes only. Real passes and failures still run their actions.
Standard behaviour, IEEE 1800-2023 20.11; the rule is derived in docs/sva-standard-traces/A7.md, sva-188, on another stimulus. Verilator 5.052 accepts the task and ignores it (measured).
Where the Tool and the Standard Part
| Code | Standard | Verilator 5.052 (measured) |
|---|---|---|
$assertvacuousoff; | vacuous passes run no pass action | ignored |
$assertpassoff; then $assertnonvacuouson; | real passes print again, vacuous ones stay silent | both kinds print again |
a bare if statement as the pass action, then $assertpassoff; | the pass action stops | ignored; inside begin-end it works |
IEEE 1800-2023 20.11. Measured by tools/probes/sva-w1b/departures.mjs.
Try It
The log keeps every failure and every real pass from 50 on. The window from 27 to 50 is fully silent for passes, and the vacuous pass at 55 never prints.
Move vac_on = 0 to 27 and remove both tasks. Predict which lines change: that is the effect of $assertvacuousoff.
t=5 vacuous pass t=15 real pass t=25 vacuous pass t=45 fail t=65 real pass t=75 failCheck Yourself
Common Mistakes
Wrong Use $assertfailoff to quiet a noisy log.
It hides real failures; the regression then reports a clean run.
Fix Silence passes with $assertpassoff or $assertvacuousoff, and leave failures on.
Wrong Expect $assertpassoff to stop the checks.
It only skips pass actions; the attempts still run and still fail.
Fix Use $assertoff or $assertkill to stop checking.
Wrong Rely on $assertvacuousoff on Verilator 5.052.
The tool ignores it, so vacuous passes still print.
Fix Test $sampled of the antecedent in the pass action, inside begin-end.
hs: assert property (req |-> ack)
passes++;hs: assert property (req |-> ack)
begin if ($sampled(req)) passes++; endRemember
- Action control tasks switch action blocks; the checks and their verdicts go on.
$assertpassoffand$assertpassonswitch both kinds of pass;$assertfailoffand$assertfailonswitch the else action.$assertvacuousoffsilences vacuous passes only;$assertnonvacuousonbrings back real passes only.- Verilator 5.052 ignores
$assertvacuousoffand makes$assertnonvacuousonact like$assertpasson.