What "Done" Means
Simulation cannot prove a design correct, so when do you stop? Learn why "all tests pass" is not the answer. See how a plan defines done, and how a team signs off a design on what it has shown.
You Will Be Able To
- Explain why simulation alone cannot prove a design correct.
- Describe done as every row of a plan shown, not as every test passing.
- Name the four readings a sign-off decision weighs.
- Lesson
- B1.4
- Time
- 18 min
- Runs on
- Your browser
- Check
- 5 questions
The dashboard is green. Three tests, three passes, no failures for a week. The manager asks the question every project reaches: "Are we done?" The honest answer depends on a test that nobody ever wrote.
- File
- Test
- Report
- Measure
- Result
- Neutral
- Analysis
- Control
- The plan
Done is defined before testing starts: a list of what must be shown, one row per feature.
- Checks and coverage
Passing tests say what was checked. Coverage says what the tests actually exercised.
- Bugs
When new bugs keep arriving, the design is not settled, whatever the other needles say.
- The decision
Sign-off weighs all four. A row with no test is invisible on every needle but the plan.
Read the diagram as text
- Plan: every feature has a row
- Checks: each row has tests that pass
- Coverage: what the tests really reached
- Bugs: new bugs found per week, falling
- Sign-off: a decision people make
- A row nobody ran: shows only on the plan needle
- Plan → Sign-off: complete?
- Checks → Sign-off: passing?
- Coverage → Sign-off: reached?
- Bugs → Sign-off: settling?
- A row nobody ran → Plan: missing
A sketch of what a sign-off review looks at. Real dashboards show many more numbers; these four questions stay.
Before You Start
Read The Specification and the Design Under Test first: the specification gives features, and each feature needs a check.
| Question | |
|---|---|
| 1 | Why can simulation never prove a design has no bugs? |
| 2 | What does "all tests pass" tell you, and what does it hide? |
| 3 | What is a verification plan for? |
| 4 | What four readings does a sign-off weigh? |
| 5 | How can a design pass every test and still be wrong? |
The Idea: You Cannot Try Everything
The adder of the first lesson had 256 input pairs, and the bench tried them all. That is rare. A 32-bit adder has about 18 billion billion pairs. Even at a billion checks a second, far faster than any simulator, trying them all takes about 585 years.
Designs with memory are worse. A counter's output depends on every input it has seen since reset, so the number of possible histories never ends. Simulation tries some of them. Whatever was not tried is unknown, not correct.
So "done" cannot mean "proved correct". It means something you can actually reach. Before testing starts, the team writes down what must be shown. Done is when all of it has been shown, and the remaining risk is one the team agrees to accept.
New Words
| Word | Meaning |
|---|---|
| Verification plan | The list of everything that must be shown about a design: one row per feature, with how it is checked. |
| Test | One run of the design with chosen inputs and checks, ending in pass or fail. |
| Coverage | A measure of what the tests actually exercised, as opposed to what they meant to. |
| Sign-off | The decision that verification is complete enough to build the chip. |
| Hole | A plan row or a situation that no test has reached. |
Done Is Defined by the Plan
A verification plan turns the specification into rows. Each row names a feature and how it will be driven. It says how it will be checked, and how anyone will know it was reached. For the counter of the last lesson, four rows cover the basics.
| Row | Feature | Check |
|---|---|---|
| 1 | Reset: after reset the count is 0 | Read the count after reset |
| 2 | Count: each enabled clock adds 1 | Enable for 5 clocks, expect 5 |
| 3 | Hold: with enable low the count stays | Disable for 3 clocks, expect no change |
| 4 | Wrap: after 9 the count goes to 0 | Count past 9, expect 0 |
Now a test passing means something precise: one row is shown. And a row with no test is visible as a hole. Without the plan, a missing test is invisible. A dashboard can only count tests that exist.
The Rules
Rule 1: Simulation cannot prove a design correct.
It shows behaviour for the inputs it tried. The rest is unknown.
Rule 2: Done is defined before testing.
The plan lists what must be shown; each row says how it is driven and checked.
Rule 3: A passing test shows its own row and nothing else.
A row with no test is a hole, even when every test is green.
Rule 4: Sign-off weighs four readings.
Plan complete, checks passing, coverage reached, and new bugs settling. It is a decision people make, with the risk they accept written down.
Sources for These Rules
Spear and Tumbush (2012), section 1.1.1: you can never prove no bugs are left. Section 1.1.2: the plan, derived from the specification, lists the features and techniques. Section 1.4: directed tests are checked off the plan one by one.
Mehta (2018), section 2.1: the cycle of developing, simulating, debugging and covering. Section 2.1.4: measuring how well the tests covered the design's intent.
Mehta (2018), section 15.5.1: the test plan says how each function is tested and how results meet pass or fail criteria.
The 585 years is arithmetic: 2 to the power 64 pairs at one billion a second.
The Lab: Three Green Tests
The lab has a counter with a bug: it wraps after 10 instead of 9. Three tests run first, one each for rows 1, 2 and 3 of the plan. Each calls a small check task that compares the count with an expected value and prints PASS or FAIL.
@(negedge clk) rst = 0; check("reset", 0);
clocks(1, 5); check("count", 5);
clocks(0, 3); check("hold", 5);
clocks(1, 5); check("wrap", 0);A task is a named block of bench code you can call, like a function that may wait for clocks. Here clocks(1, 5) holds enable at 1 for 5 clocks.
test reset: PASS (count 0)
test count: PASS (count 5)
test hold: PASS (count 5)
dashboard: 3 tests run, 3 passed
plan: 4 rows (reset, count, hold, wrap); rows with a test: 3; never run: wrap
test wrap: FAIL (count 10, expected 0)The first four rows are the green dashboard: three tests run, three passed. Rule 3 tells you what they show: reset, count and hold. The plan line names the hole: wrap was never run. The last row runs it. Five more enabled clocks from 5 should wrap to 0. The count reads 10, a value this 0-to-9 counter must never show.
Nothing about the first three tests was wrong. They were simply not the whole plan. Without the plan line, this run would end at a green dashboard.
Why Sign-Off Is a Decision
Why is sign-off a decision by people instead of a threshold a tool checks? Because every reading can mislead alone. Tests can pass while a row has none. Coverage can be full while a check is weak. A quiet week of bugs can mean nobody ran anything new.
So a sign-off review asks all four questions together. It records what is still open and why the team accepts it. That record matters later, when the first chips come back and someone asks what was checked.
Traps
The first trap is counting tests. A project that measures progress by the number of passing tests will write many easy tests. The plan measures the right thing: rows shown.
The second trap is the plan nobody updates. The specification changes, a feature is added, and the plan keeps its old rows. Every needle stays green while the new feature has no test at all.
The third trap is mistaking quiet for quality. Bug reports slow down near the end of every project. Sometimes the design has settled. Sometimes the team simply stopped looking in new places. Coverage tells the two apart: see Code Coverage: What Ran and Functional Coverage: What Was Tested.
At Scale
This section looks ahead. A chip plan can have thousands of rows.
Plans with owners
Each row has an owner, a priority and a status. Reviews walk the rows that are still open.
Coverage tied to rows
Coverage measurements are linked to plan rows, so a hole shows up as a row that is not yet reached.
Where This Goes Next
This lesson defined done. These lessons build each needle.
| The idea from this page | Where it is taught |
|---|---|
| Writing the plan of a real block, row by row | The Verification Plan |
| Measuring which code the tests ran | Code Coverage: What Ran |
| Writing a plan from a specification | Start From the FIFO Rules |
| Measuring what tests reached, with coverage | What Coverage Measures |
| Proving a property for every input, where simulation cannot | Your First Proof: the Same SVA, No Testbench |
| A chip-level plan and its sign-off | The Chip-Level Verification Plan |
Try It
Run the lab. Read the dashboard line, then the plan line, then the last row.
Fix the counter so it wraps after 9. Predict the last row before you run it.
Add a fifth plan row of your own, such as reset while counting, and write its test.
test reset: PASS (count 0) test count: PASS (count 5) test hold: PASS (count 5) dashboard: 3 tests run, 3 passed plan: 4 rows (reset, count, hold, wrap); rows with a test: 3; never run: wrap test wrap: FAIL (count 10, expected 0)Check Yourself
Common Mistakes
Wrong Call the design done when every test passes.
Passing tests show their own rows; a row with no test shows nothing.
Fix Call it done when every plan row has been shown and open risks are written down.
Wrong Measure progress by the number of tests.
Many easy tests can leave whole features untested.
Fix Measure rows of the plan shown, and coverage reached.
Wrong Treat a quiet week of bug reports as proof of quality.
It can mean nobody looked anywhere new.
Fix Read it together with coverage and the plan.
Remember
- Simulation cannot prove correctness; untried inputs and histories are unknown.
- Done is defined before testing, by the plan: every row shown.
- A passing test shows its own row; a row with no test is a hole that every dashboard misses.
- Sign-off is a decision weighing plan, checks, coverage and bugs, with open risks written down.