Assume, dist and Inside
State what a block may expect from its neighbours with assume property. Read what simulation and formal do with it, and write it with inside and dist.
You Will Be Able To
- Predict what an
assume propertydoes in simulation and in formal. - Split a rule into a guarantee on one block and an assumption on the next.
- Write input sets with
inside, and know thatdistchecks asinside. - Catch an over-constraining assumption with a cover.
- Lesson
- A9.1
- Time
- 30 min
- Runs on
- Verilator
- Check
- 5 questions
A two-input arbiter registers its requests straight into its grants. Formal reports two grants at once within two steps. The arbiter is not wrong: it was built for requesters that never ask together. The proof needs that promise, written as an assumption.
- Manager
- Property
- DUT
- Assumption
- Data
- Structure
- The guarantee
Formal proves on the requester alone that it never asks twice at once.
- The assumption
On the arbiter alone, the same rule becomes an assumption: the solver may not drive both requests.
- The proof
With that assumption, the arbiter's grant rule is proved.
Read the diagram as text
- requester: drives req0, req1
- assert !(req0 && req1): its guarantee
- arbiter: drives gnt0, gnt1
- assume !(req0 && req1): its environment
- assert !(gnt0 && gnt1): its own guarantee
- requester → arbiter: req0, req1
- assert !(req0 && req1) → assume !(req0 && req1): the same rule
- assume !(req0 && req1) → assert !(gnt0 && gnt1): makes it provable
IEEE 1800-2023 16.14.2: an assumption states what the environment does; formal tools use it to restrict the inputs, simulators check it.
Assume Property in Simulation
In simulation an assume property is checked like an assertion. When it fails, its else action runs. The difference is whom it blames: the bench, not the design.
Assume Property in Formal
In formal the solver drives every input. An assumption removes the input sequences that break it; the assertions are then checked on what is left.
Assume-Guarantee Between Blocks
An assumption is a debt. It is paid by proving the same rule as an assertion on the block that drives those inputs. Then each block is proved alone, and the pair is safe together.
dist in an Assumption Acts as Inside
dist gives weights to values for random generation. In an assumption or assertion the weights play no part: x dist {0 := 1, [1:3] := 9} is checked as x inside {0, [1:3]}.
Inside Sets
inside tests membership in a list of values and ranges. It states a legal input set in one line.
Over-Constraining, and Covers as Witnesses
An assumption that is too strong removes legal behaviour, and the assertions then pass for free. A cover on something that must stay possible shows it: it becomes unreachable.
Try It
In one simulation the same rule is checked twice: as the requester's guarantee and as the arbiter's assumption. Neither reports anything, and the grants alternate.
Change assign req1 = want && tok; to assign req1 = want; and predict which two rules report first, and at which edge.
g0=3 g1=2Check Yourself
Common Mistakes
Wrong Write a rule about the design's outputs as an assumption.
The solver then hides every design behaviour that breaks it, and the bug disappears from the proof.
Fix Assume only what the environment drives; assert what the design drives.
Wrong Expect dist weights to matter in an assumption checked by a simulator.
In a check, dist is a membership test; weights only steer random generation.
Fix Read x dist {...} in an assertion or assumption as x inside {...}.
Wrong Trust a passing proof without a cover.
An assumption that is too strong also makes the proof pass.
Fix Add covers for the normal events and check that each one is reached.
Remember
- Simulators check
assume propertylike an assertion; formal tools use it to restrict inputs. - Assume only inputs, and prove each assumption as an assertion on the neighbour that drives them.
distin a check isinside;insidelists legal values and ranges.- A cover that becomes unreachable exposes an over-constraining assumption.