Vacuity That Hides in Plain Sight
Find the part of the legal world that a passing bench never visits, with one cover for every property.
You Will Be Able To
- Write an antecedent cover for every implication and read which ones are unreached.
- Explain why a cover reached inside reset proves nothing about the running design.
- Predict what two engines report when an assumption contradicts the reset state.
- Check an assumption as an assertion in simulation.
- Lesson
- F10.2
- Time
- 20 min
- Runs on
- SymbiYosys
- Check
- 5 questions
A memory block passed every property for two months. The bench assumed that no write follows a read by one cycle. The team had agreed that such traffic was absurd. The neighbour block sent exactly that traffic, and a write in the second read stage replaced the read data.
Measured with smtbmc yices at depth 20. The read at step 1 should return the word mem held then, 0. It returns 8, the word written at step 2.
A Proof About a Smaller World
- Model
- Assumption
- Result
- Control
- Analysis
Read the diagram as text
- Every input sequence: reads and writes in any order
- After the mode assumption: no write right after a read
- After a contradiction: no sequence is left at all
- Bug visible: the write lands in read stage 2
- Bug hidden: the proof passes; one cover is unreached
- Nothing to check: every property holds on an empty set
- Every input sequence → After the mode assumption: rd |=> !wr
- After the mode assumption → After a contradiction: mem != 0
- Every input sequence → Bug visible
- After the mode assumption → Bug hidden
- After a contradiction → Nothing to check
Partial vacuity is the middle column: some traffic remains, so the bench looks alive.
F3.2 showed over-constraint between two assumptions. This lesson covers four cases that look healthier. In each case some traffic still runs or a cover is green. Part of the legal world is still missing.
Bench for mc | Measured result | Time |
|---|---|---|
With assume rd |=> !wr, two assertions | BMC PASS to depth 20 | 1316 ms |
| No assumption, same two assertions | FAIL at reported step 4 | 1053 ms |
| Fixed RTL, no assumption | BMC PASS to depth 20 | 1198 ms |
mc holds one word and reads it in two stages. Mode bmc, depth 20, smtbmc yices, reset assumed in step 0.
A Witness for Every Pass
| Property | Its antecedent cover | Under the mode assumption | With no assumption |
|---|---|---|---|
rd |-> ##2 rvalid && rdata == $past(mem, 2) | !rst && rd | reached, reported step 2 | reached, reported step 2 |
rd_q && wr |=> rdata == $past(cap) | !rst && rd_q && wr | unreached | reached, reported step 3 |
Mode cover, depth 20. The second property passed in the first table. Its trigger never happened.
An implication whose antecedent (the left side of |->) never becomes true passes with nothing checked (A1.3 Implication and vacuous success). In formal the cause is the environment, so the cure is a routine. For every implication, cover the antecedent and read the result.
SBY prints one PASS for the whole task. It has no line that says a property passed with its trigger unreached. You must ask for that with a cover. Many commercial tools add these covers for you. Read their report too.
A Cover That Is Reached in Reset
Polarity inverted
cover property (@(posedge clk) disable iff (rst_n) dbus != 8'd0);
Awake only while the block is in reset. The cover is reached. The bus shows the scan path there.
Asleep in reset
cover property (@(posedge clk) disable iff (!rst_n) dbus != 8'd0);
Cover unreached within the depth. A leftover assume(!en) keeps the bus at zero. Without it: reached at step 3.
rst_n is active low, so the cover must sleep when it is 0. During reset a design can show values that mean nothing (F1.6). A cover that is awake there turns that noise into a green tick. For every reached cover, check that the witness lies outside reset.
A Queue That Never Starts
The name says "check"
wire op_check = op == 2'd3; // 1 when NOT legal
assume(op_check);
Only the reserved opcode is left. BMC PASS to depth 20. Covers: started unreached, full unreached.
The meaning, negated
wire op_check = op == 2'd3; // 1 when NOT legal
assume(!op_check);
Pushes and pops happen. FAIL at reported step 5: stall lags count. Fixed RTL: BMC PASS to depth 20.
The assertion count <= 2 passed because nothing was ever pushed. The bench was not empty: the reserved opcode still arrived on every cycle. Cover the first step of each scenario, here a nonzero count, and not only its end.
When No Trace Exists
Bench for mc, with assume mem != 0 added | Measured result |
|---|---|
| Mode bmc, smtbmc yices | Refused: ENGINE_FAILED. SBY log: Assumptions are unsatisfiable! |
| Mode prove, abc pdr | Prove PASS (k = 20) |
| Mode cover, both antecedent covers | unreached, unreached |
Reset clears mem, and the assumption says it is never zero. No sequence gets past step 0.
An assumption can contradict a bench setting: the reset sequence, an initial value or a clock. Then the set of legal traces is empty, and every property holds on an empty set. The smtbmc engine checks the assumptions first and stops. The PDR engine here does not, and it reports a proof.
The Simulation That Disagreed
In the formal bench
assume property (@(posedge clk) disable iff (rst) rd |=> !wr);
A promise that nobody checks. The proof depends on it.
In the system simulation
assert property (@(posedge clk) disable iff (rst) rd |=> !wr);
The neighbour breaks it at time 75. Over the run: assumption broken 51 times, wrong read data 49 times.
An assumption about a neighbour is a claim about another block. Give the same line to that block's proof or to the system simulation as an assertion (F7.4). Here a random neighbour broke it within the first few cycles, and the read data was wrong 49 times.
Asked in Interviews
| Question | Answer |
|---|---|
| What is partial vacuity? | Some legal behaviour is excluded while other traffic still runs. Tools detect an empty world, not a smaller one. |
| How do you detect a vacuous implication in SBY? | Cover its antecedent. SBY has no per-property vacuity report. |
| Can a reached cover mislead? | Yes, when the witness lies inside reset or uses values that only exist there. |
| How do you keep an assumption honest? | Prove it on the neighbour or assert it in simulation. |
Try It
assume property (@(posedge clk) disable iff (rst) rd |=> !wr);
assert property (@(posedge clk) disable iff (rst) rd |-> ##2 rvalid && rdata == $past(mem, 2));
assert property (@(posedge clk) disable iff (rst) rd_q && wr |=> rdata == $past(cap));mode cover.[options]
mode bmc
depth 20
[engines]
smtbmc yices
[script]
read_verilog -formal -sv design.sv props.sv
prep -top mc
[files]
design.sv
props.svRun the bench
Run as it is: BMC PASS to depth 20.
Cover each antecedent
Replace the two assertions with
cover property (@(posedge clk) !rst && rd);andcover property (@(posedge clk) !rst && rd_q && wr);. Set mode cover. Read which one SBY lists as unreached.Drop the assumption
Delete the
assumeline and go back to mode bmc: FAIL at reported step 4. Find the write in the trace.Fix the RTL
Make stage 2 load
caponly: BMC PASS to depth 20, with no assumption at all.
design.sv
props.sv
Use assert property (@(posedge clk) ...);. Leave blank for immediate assertions in the design.
Inputs are free unless constrained. Run to find a counterexample or check a proof.
Model: one positive-edge clock, binary data. Sampled history requires declaration-initialized variables; primary-input history is unsupported.
SBY summary and log
Check Yourself
Common Mistakes
Wrong Covering the consequent of an implication.
The consequent can be true in cycles where the trigger never fired, so the cover says nothing about the trigger.
Fix Cover the antecedent, outside reset.
assert property (@(posedge clk) req && !busy |=> gnt);
cover property (@(posedge clk) gnt);assert property (@(posedge clk) req && !busy |=> gnt);
cover property (@(posedge clk) !rst && req && !busy);Wrong Running only an unbounded engine on a new bench.
The PDR run here proved a bench whose assumptions allow no trace at all.
Fix Run a cover task and a bounded smtbmc run first. Both noticed the empty world.
Wrong Naming a wire for the check, not for its meaning.
A name like op_check does not say whether 1 is good or bad, so the negation gets lost.
Fix Name the condition itself, such as op_illegal, and assume its negation.
wire op_check = op == 2'd3;
assume(op_check);wire op_illegal = op == 2'd3;
assume(!op_illegal);Wrong Covering only the end of a scenario.
When the end is unreached you cannot tell whether the scenario stopped late or never began.
Fix Cover the first step as well, such as one accepted push before a full queue.
Remember
- Partial vacuity leaves some traffic running, so the bench looks alive while a scenario is missing.
- Cover the antecedent of every implication. SBY does not report an unreached trigger by itself.
- A cover must sleep in reset, and its witness must lie outside reset.
- A contradiction between an assumption and reset leaves no trace. smtbmc stops; PDR here reports a proof.
- Assert every assumption somewhere else: in the neighbour's proof or in simulation.