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.

A write right after a read changes the read data
01234clkfreerdfreewrfreewdata080mem08rvalidrdata080rdwr in stage 2rdata is the written word
Scroll horizontally ↔

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

Each Assumption Removes Part of the WorldLeft to right: the set of input sequences the tool explores. Each arrow is one assumption or bench setting.
  • Model
  • Assumption
  • Result
  • Control
  • Analysis
Each assumption removes part of the worldLeft to right: the set of input sequences the tool explores. Each arrow is one assumption or bench setting. model Every inputsequence reads and writes inany order assumption After the modeassumption no write right after aread assumption After acontradiction no sequence is left atall result Bug visible the write lands inread stage 2 result Bug hidden the proof passes; onecover is unreached result Nothing to check every property holdson an empty set rd |=> !wrmem != 0
  1. model Every input sequencereads and writes in any order
    • rd |=> !wr → After the mode assumption
    • Bug visible
  2. result Bug visiblethe write lands in read stage 2
  3. assumption After the mode assumptionno write right after a read
    • mem != 0 → After a contradiction
    • Bug hidden
  4. result Bug hiddenthe proof passes; one cover is unreached
  5. assumption After a contradictionno sequence is left at all
    • Nothing to check
  6. result Nothing to checkevery property holds on an empty set
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 mcMeasured resultTime
With assume rd |=> !wr, two assertionsBMC PASS to depth 201316 ms
No assumption, same two assertionsFAIL at reported step 41053 ms
Fixed RTL, no assumptionBMC PASS to depth 201198 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

PropertyIts antecedent coverUnder the mode assumptionWith no assumption
rd |-> ##2 rvalid && rdata == $past(mem, 2)!rst && rdreached, reported step 2reached, reported step 2
rd_q && wr |=> rdata == $past(cap)!rst && rd_q && wrunreachedreached, 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 addedMeasured result
Mode bmc, smtbmc yicesRefused: ENGINE_FAILED. SBY log: Assumptions are unsatisfiable!
Mode prove, abc pdrProve PASS (k = 20)
Mode cover, both antecedent coversunreached, 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

QuestionAnswer
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

props.sv: the mode assumption and the two assertions.
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));
The task. For the cover runs set 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.sv
  1. Run the bench

    Run as it is: BMC PASS to depth 20.

  2. Cover each antecedent

    Replace the two assertions with cover property (@(posedge clk) !rst && rd); and cover property (@(posedge clk) !rst && rd_q && wr);. Set mode cover. Read which one SBY lists as unreached.

  3. Drop the assumption

    Delete the assume line and go back to mode bmc: FAIL at reported step 4. Find the write in the trace.

  4. Fix the RTL

    Make stage 2 load cap only: 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

Predict the outputThe mc bench under assume rd |=> !wr, with the two antecedent covers !rst && rd and !rst && rd_q && wr. Mode cover, default depth 20, smtbmc yices, reset assumed in step 0. The overall cover result is:
module mc(input clk, rst, rd, wr, input [3:0] wdata,
  output reg rvalid=0, output reg [3:0] rdata=0);
  reg [3:0] mem=0, cap=0;
  reg rd_q=0;
  always @(posedge clk)
    if (rst) begin mem <= 0; cap <= 0; rd_q <= 0; rvalid <= 0; rdata <= 0; end
    else begin
      if (wr) mem <= wdata;
      rd_q <= rd;  cap <= mem;                 // stage 1: capture the word
      rvalid <= rd_q;
      rdata  <= wr ? wdata : cap;           // stage 2. bug: a write here leaks into the read
    end
`ifdef FORMAL
  always @(posedge clk) begin
    if ($initstate) begin assume(rst); end else begin assume(!rst); end
  end
`endif
endmodule
Read included file: props.sv
assume property (@(posedge clk) disable iff (rst) rd |=> !wr);
cover property (@(posedge clk) !rst && rd);
cover property (@(posedge clk) !rst && rd_q && wr);
ConceptA bench has ten implications, and SBY reports PASS in mode bmc. What does the log say about the two whose antecedents can never be true?
Read the waveformIn this failing run, at which step does the write land that corrupts the read?
A write right after a read changes the read data
01234clkfreerdfreewrfreewdata080mem08rvalidrdata080rdwr in stage 2rdata is the written word
Scroll horizontally ↔

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.

ConceptA cover of "a response with an error code" is reached at step 1. Reset is active in step 0 only. What should you check before you trust it?
ConceptTwo teams agree in a meeting that the address bus stays stable during a request. The FPV bench assumes it. What keeps that assumption honest?

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.

Before
assert property (@(posedge clk) req && !busy |=> gnt);
cover  property (@(posedge clk) gnt);
After
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.

Before
wire op_check = op == 2'd3;
assume(op_check);
After
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.

Practice

Report a problem with this page