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.

Four Needles on the Sign-Off DashboardStep through the four readings a team looks at before it calls a design done. No single needle is enough.
  • File
  • Test
  • Report
  • Measure
  • Result
  • Neutral
  • Analysis
  • Control
Four Needles on the Sign-Off DashboardStep through the four readings a team looks at before it calls a design done. No single needle is enough. file Plan every feature has arow test Checks each row has teststhat pass report Coverage what the tests reallyreached measure Bugs new bugs found perweek, falling result Sign-off a decision people make neutral A row nobody ran shows only on the planneedle complete?passing?reached?settling?missing
  1. file Planevery feature has a row
    • complete? → Sign-off
  2. test Checkseach row has tests that pass
    • passing? → Sign-off
  3. report Coveragewhat the tests really reached
    • reached? → Sign-off
  4. measure Bugsnew bugs found per week, falling
    • settling? → Sign-off
  5. result Sign-offa decision people make
  6. neutral A row nobody ranshows only on the plan needle
    • missing → Plan
  1. The plan

    Done is defined before testing starts: a list of what must be shown, one row per feature.

  2. Checks and coverage

    Passing tests say what was checked. Coverage says what the tests actually exercised.

  3. Bugs

    When new bugs keep arriving, the design is not settled, whatever the other needles say.

  4. 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.

Five questions this page answers
Question
1Why can simulation never prove a design has no bugs?
2What does "all tests pass" tell you, and what does it hide?
3What is a verification plan for?
4What four readings does a sign-off weigh?
5How 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

New words on this page
WordMeaning
Verification planThe list of everything that must be shown about a design: one row per feature, with how it is checked.
TestOne run of the design with chosen inputs and checks, ending in pass or fail.
CoverageA measure of what the tests actually exercised, as opposed to what they meant to.
Sign-offThe decision that verification is complete enough to build the chip.
HoleA 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.

A four-row plan for the counter
RowFeatureCheck
1Reset: after reset the count is 0Read the count after reset
2Count: each enabled clock adds 1Enable for 5 clocks, expect 5
3Hold: with enable low the count staysDisable for 3 clocks, expect no change
4Wrap: after 9 the count goes to 0Count 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

  1. Rule 1: Simulation cannot prove a design correct.

    It shows behaviour for the inputs it tried. The rest is unknown.

  2. Rule 2: Done is defined before testing.

    The plan lists what must be shown; each row says how it is driven and checked.

  3. 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.

  4. 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.

The four tests. Each clocks call holds enable for some clocks; each check compares the count.
@(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.

Printed by the lab (Icarus).
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

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead. A chip plan can have thousands of rows.

  1. Plans with owners

    Each row has an owner, a priority and a status. Reviews walk the rows that are still open.

  2. 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.

Where each idea is taught in depth
The idea from this pageWhere it is taught
Writing the plan of a real block, row by rowThe Verification Plan
Measuring which code the tests ranCode Coverage: What Ran
Writing a plan from a specificationStart From the FIFO Rules
Measuring what tests reached, with coverageWhat Coverage Measures
Proving a property for every input, where simulation cannotYour First Proof: the Same SVA, No Testbench
A chip-level plan and its sign-offThe 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.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 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

Predict the outputThe counter is fixed so it wraps after 9. The same four tests run. What is the last line the lab prints?
// counter: counts up on each clock while en is high; after 9 it goes back to 0.
module counter (input logic clk, rst, en, output logic [3:0] count);
  always_ff @(posedge clk)
    if (rst) count <= 0;
    else if (en) count <= (count == 9) ? 0 : count + 1;
endmodule

module tb;
  logic clk = 0, rst = 1, en = 0;
  logic [3:0] count;
  int run = 0, passed = 0;
  counter dut (.clk, .rst, .en, .count);
  always #1 clk = ~clk;
  task automatic check(input string name, input int want);
    run++;
    if (count === want) begin passed++; $display("test %s: PASS (count %0d)", name, count); end
    else $display("test %s: FAIL (count %0d, expected %0d)", name, count, want);
  endtask
  task automatic clocks(input bit e, input int n);
    en = e; repeat (n) @(negedge clk);
  endtask
  initial begin
    @(negedge clk) rst = 0;   check("reset", 0);
    clocks(1, 5);             check("count", 5);
    clocks(0, 3);             check("hold", 5);
    $display("dashboard: %0d tests run, %0d passed", run, passed);
    $display("plan: 4 rows (reset, count, hold, wrap); rows with a test: 3; never run: wrap");
    clocks(1, 5);             check("wrap", 0);
    $finish;
  end
endmodule
ConceptWhy can simulation not prove a design correct?
ConceptWhat does a verification plan define?
ConceptIn the lab, why did the dashboard stay green for three tests?
ConceptWhich four readings does a sign-off weigh?

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.

Practice

Report a problem with this page