Division of Labour: The Gaps Between Proofs
Find what no proof covers after a design is divided: the glue, a missing case and a hack left in the file.
You Will Be Able To
- Write a top-level property that crosses the glue between two proven blocks.
- Prove that a case split is complete with one assertion.
- Find a temporary
ifdef FORMALchange and rerun without it. - Keep a ledger of blocks, cases and hacks for the sign-off review.
- Lesson
- F10.4
- Time
- 18 min
- Runs on
- SymbiYosys
- Check
- 5 questions
Two engineers each proved one block: the encoder never raised hi and lo together, and the server always gave hi the higher grant. A third person wrote the top level and crossed the two wires. Both proofs stayed green, and every high request got the low grant.
Measured with smtbmc yices at depth 20. Level 2 goes in at step 1, and grant 1 comes out at step 3. Wire a carries hi into the lo pin of the server.
The Wires Between Two Proofs
- Design
- Property
- Data
- Analysis
Read the diagram as text
- lvl: top-level input
- enc: proven: never hi and lo together
- Glue: proven by nobody: wire a to lo, wire b to hi
- srv: proven: hi wins
- Top-level property: grant equals the level two cycles ago
- grant: top-level output
- lvl → enc: proven
- enc: proven → Glue: proven by nobody: hi, lo
- Glue: proven by nobody → srv: proven: crossed
- srv: proven → grant
- Top-level property → grant: checks
Only the bottom-left box crosses the glue. Without it, the two green proofs say nothing about the pair.
| Run | Measured result | Time |
|---|---|---|
enc alone, its block property | BMC PASS to depth 20 | 437 ms |
srv alone, its block property | BMC PASS to depth 20 | 437 ms |
pair with crossed glue, both block properties | BMC PASS to depth 20 | 459 ms |
pair with crossed glue, the top-level property | FAIL at reported step 4 | 468 ms |
pair with straight glue, the top-level property | BMC PASS to depth 20 | 578 ms |
Mode bmc, depth 20, smtbmc yices, reset assumed in step 0.
A block proof stops at the block's ports. The glue is everything outside every block: wires, inverters, small muxes. Someone must own it. Give it a top-level property, or a connectivity check (F5.3) when it is only wires.
A Case Split with a Hole
| Case | In the plan | Measured result |
|---|---|---|
| FIXED | yes | part of the run below |
| INCR | yes | part of the run below |
| WRAP | no: "nothing changed there" | never run |
| FIXED and INCR together | - | BMC PASS to depth 20 |
The cases cover every mode: busy |-> mode_q == FIXED || mode_q == INCR | - | FAIL at reported step 3 |
am steps an address inside a window. The last row is one extra assertion. Its trace shows mode_q at 2, which is WRAP.
A case split proves one property once per case (F4.3). The proof of the whole needs one more fact: the cases together are every legal input. Write that fact as an assertion and prove it. A list in a plan is not a proof.
A hard split uses an assumption per case, so a missing case is a missing run. A soft split uses a condition per assertion, so a missing case is a missing line. The completeness assertion catches both.
A Hack That Stayed
In the file since week two
`ifdef FORMAL
localparam LIMIT = 3; // temporary
`else
localparam LIMIT = 40;
`endif
The watchdog barks after 3 quiet cycles. BMC PASS to depth 20.
What ships
localparam LIMIT = 40;
reg [4:0] cnt;
Five bits cannot count to 40, so the watchdog never barks. At depth 50: FAIL at reported step 42.
A smaller parameter is a sound way to start (F4.5). It becomes a false positive when nobody removes it. The same is true of a forced signal, a cut and an extra assumption added for one debug session. Search the RTL and the bench for FORMAL before sign-off, and justify or delete each hit.
The Ledger
| Row | Question at the review | Evidence |
|---|---|---|
| Every block | Who proved it, and at which boundary? | the proof report |
| Every wire and gate outside the blocks | Which property crosses it? | a top-level or connectivity run |
| Every case split | Do the cases cover every legal input? | the completeness assertion, proven |
Every FORMAL hit, cut and extra assumption | Is it still needed, and is it sound? | a run without it, or a written argument |
The ledger is part of the sign-off page (F7.3). It is reviewed by someone outside the proof team.
Division of labour is the only way to prove a large design. Each division adds a seam. The ledger lists the seams, so that the parts add up to the whole.
Asked in Interviews
| Question | Answer |
|---|---|
| Block A and block B are both proven. What is still unverified? | The glue between them, and whether each block's assumptions hold at the other's outputs. |
| How do you know a case split is complete? | An assertion that the disjunction of the cases covers every legal input, proven on the design. |
What is the risk of ifdef FORMAL in RTL? | The proven design differs from the shipped one. Every such change needs a removal or a justification. |
| Who should check the glue around a blackboxed analog block? | Whoever owns the level above it. It must be named, because both block owners will assume the other does. |
Try It
A block property
if (!rst && hi_q) assert(grant == 2'd2);
It reads the server's own pins. It cannot see which wire feeds them.
The top-level property
if (!rst && age == 2'd2)
assert(grant == (lvl_qq == 2'd3 ? 2'd0 : lvl_qq));
It reads a top-level input and a top-level output, so it crosses the glue.
top is pair; the two blocks are flattened into it.[options]
mode bmc
depth 20
[engines]
smtbmc yices
[script]
read_verilog -formal -sv design.sv
prep -top pair
[files]
design.svRun the block properties
Run as it is: BMC PASS to depth 20. Both block properties are inside the pair.
Add the top-level property
Keep the level of two cycles ago in
lvl_qqand assert thatgrantmatches it: FAIL at reported step 4.Read the wires
In the trace, follow
aandbfrom the encoder to the server.Uncross the glue
Connect
atohiandbtolo: BMC PASS to depth 20.
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 Counting green block proofs as a proof of the assembly.
No block property reads the wires outside its own ports.
Fix Add one end-to-end property per function, or a connectivity check, at the level that holds the glue.
Wrong Listing the cases in the plan and running them.
A missing case produces no failure, because nothing in the tool knows that it exists.
Fix Assert that the cases cover every legal input, and prove it.
// cases: x4 and x8
assume property (@(posedge clk) width == X8);assert property (@(posedge clk)
width == X4 || width == X8 || width == X16);Wrong Leaving ifdef FORMAL changes in the RTL after the proof converges.
The tool proves the file it reads, which is no longer the shipped design.
Fix Search for FORMAL at sign-off. Remove each hit or justify it in the ledger.
Remember
- A block proof ends at the block's ports. The glue needs its own property.
- A case split needs a proven assertion that the cases cover every legal input.
- A reduced parameter, a cut or a force is a different design until it is removed or justified.
- The ledger lists blocks, glue, cases and hacks, and someone outside the team reviews it.