What formal verification really is
Imagine you are handed a padlock and asked: "Can this lock ever be opened without the right key?" One way to answer is to try every key in a big bucket and see whether any of them works. That is simulation: you pick inputs, run them, and look at the results. If none of your keys opens the lock, you feel better — but you have only tested the keys you had.
The other way is to take the lock apart and reason about the pins and springs until you can say, with certainty, which keys can turn the cylinder. That is formal verification (FV): instead of trying values, a tool builds a mathematical model of the design and proves whether a statement about it holds for every possible input sequence.
Why "trying more tests" does not scale
Consider a humble 32-bit adder with two inputs. It has 264 ≈ 1.8 × 1019 input combinations. Even at a billion simulations per second, checking them all would take roughly 585 years — for a block with no state at all. Add a few registers and the number of sequences of inputs explodes far beyond that. Real designs have thousands of flip-flops. Simulation can never be exhaustive; it can only be clever about where it looks.
Formal tools avoid enumerating values one by one. They manipulate sets of values symbolically (using techniques you will meet in Chapter 2), so a single run can say "for all 264 input pairs, the sum is correct" or "here is the one input pair where it is wrong".
The three ingredients
Every formal run, whatever the tool, combines three things:
- The design — your RTL, usually SystemVerilog or VHDL.
- Assertions — statements that must always be true, e.g.
grant is never given to two requesters at once. - Assumptions (constraints) — what the outside world is allowed to do, e.g.
a request stays high until it is granted.
The tool then answers one question per assertion: "Is there any sequence of legal inputs, starting from reset, that makes this assertion false?"
The vocabulary you will use daily
| Term | Meaning |
|---|---|
| Property | A statement about design behaviour, written in a language such as SVA (SystemVerilog Assertions). |
| Assertion | A property the design must satisfy. The tool tries to break it. |
| Assumption | A property the tool treats as true about the inputs. It limits the search to legal behaviour. |
| Cover | A behaviour you want to see happen. The tool tries to produce a waveform that reaches it. |
| Counterexample (CEX) | A concrete waveform, from reset, that violates an assertion. |
| Proof | A guarantee that no counterexample exists, for any input sequence of any length. |
| Bounded proof | A guarantee that no counterexample exists up to N cycles from reset. |