The Verification Plan
Read a specification into plan rows: feature, stimulus, check, coverage, priority. Use the plan as the definition of done, and see what happens to a feature the plan never names.
You Will Be Able To
- Read a short specification into plan rows, one feature per row.
- Give each row its stimulus, its check and its coverage.
- Rank rows by risk, so the riskiest features are verified first.
- Explain why the plan is the definition of done, and what a missing row costs.
- Lesson
- B4.1
- Time
- 22 min
- Runs on
- Your browser
- Check
- 5 questions
The transmitter's tests all pass, and the manager asks one question: are we done? Nobody can answer, because nobody wrote down what done means. Ten minutes with the specification and a table would have answered it.
- Design
- Step
- Control / FSM
- Test
- Result
- Data
- A feature
Read one thing the design must do from the specification. That is the start of a row.
- How to reach it
Write the stimulus that makes the feature happen: a directed case, a constraint, a corner.
- How to decide it
Write the check that decides pass or fail: a model comparison, an assertion.
- How to know it ran
Name the coverage that shows the stimulus really reached the feature.
- Who and how urgent
Give the row a priority from its risk, and a person who owns it.
Read the diagram as text
- Specification: the UART transmitter, one page
- Feature: R3: two frames back to back
- Stimulus: start again in the clock busy falls
- Check: both bytes arrive, no frame error
- Coverage: count back-to-back starts
- Priority and name: high; who writes it
- Specification → Feature: read into
- Feature → Stimulus: how to reach it
- Stimulus → Check: how to decide it
- Check → Coverage: how to know it ran
- Feature → Priority and name: risk and person
An idea drawing of one plan row. The lab below runs five rows of the transmitter's plan.
Before You Start
What "Done" Means showed that a plan defines done. This lesson writes one. A plan row uses three earlier lessons: Directed Tests, Assertions: Checks That Travel With the Design and Functional Coverage: What Was Tested.
| Question | |
|---|---|
| 1 | What is a verification plan, and what is in one row? |
| 2 | How do you read a specification into rows? |
| 3 | Why does a plan rank its rows? |
| 4 | Why is the plan the definition of done? |
| 5 | What happens to a feature the plan never names? |
The Idea: Write Down What Done Means
Every lesson so far gave you a tool: directed cases, random stimulus, corners, assertions, coverage. A real design needs all of them, in the right places. The verification plan is where you decide which tool goes where, before you write a line of the bench.
A plan is a table. Each row is one feature, read from the specification. The row then says how to reach the feature, how to check it, and how to know it was reached. It also says how much it matters and who will do it. When every row has passed its check and filled its coverage, you are done. Not before, and not because the tests ran out of ideas.
The plan is written early and it keeps growing. New rows appear when the specification changes or a bug shows a feature nobody listed.
New Words
| Word | Meaning |
|---|---|
| Verification plan | A table of what must be verified: one feature per row, with its stimulus, check, coverage, priority and owner. |
| Plan row | One feature of the design and everything needed to verify it. |
| Priority | How soon a row must be done, set by its risk: how likely a bug is, and how bad it would be. |
| Owner | The person who writes and closes a row. |
| UART transmitter | A block that sends a byte one bit at a time on one wire. A start bit comes first and a stop bit last. |
| Frame | The ten bits of one UART byte on the wire. |
The Smallest Example: The Transmitter's Plan
Here is the whole specification of the small UART transmitter used in this module. It sends a byte as a start bit (0), eight data bits low bit first, and a stop bit (1). Each bit lasts four clocks. A start pulse is taken only while busy is 0, and data is read in that same clock. Reset makes the line idle.
Read it sentence by sentence and turn each promise into a row.
| Row | Feature | Stimulus | Check | Coverage | Priority |
|---|---|---|---|---|---|
| R1 | One byte makes one correct frame | send 41 | receiver model gets 41, no frame error | frames sent | high |
| R2 | Every data bit reaches the wire | send 55, then AA | both bytes arrive exactly | each bit seen at 0 and 1 | high |
| R3 | Two frames back to back | start again in the clock busy falls | both bytes, no frame error | back-to-back starts | high |
| R4 | start while busy is ignored | pulse start in the middle of a frame | only the first byte arrives | starts while busy | medium |
| R5 | Reset during a frame | reset in the middle of a frame | line idle at 1, busy 0 | resets while busy | medium |
Notice what is not here. The specification says data is read in the same clock as start. No row tests what happens when data changes straight after that clock. Keep that gap in mind: Debugging: From a Failure to a Cause finds a bug living in it.
The Rules
Rule 1: One promise, one row.
Read the specification sentence by sentence. Each promise it makes becomes a row.
Rule 2: Every row has a stimulus, a check and a coverage item.
Stimulus reaches the feature, the check decides pass or fail, coverage proves it was reached.
Rule 3: Rank by risk.
New logic, complex logic and corners come first. A plan has more rows than time.
Rule 4: Done means every row closed.
Each row's check passed and its coverage filled, or its gap is written down and accepted at sign-off. A pile of passing tests does not define done.
Rule 5: The plan grows.
A changed specification, or a bug in a feature no row named, adds a row.
Sources for These Rules
A comprehensive verification plan: subsystems, stimulus and response, traffic, checking, assertions, coverage, regressions: Mehta, ASIC/SoC Functional Design Verification, section 2.2.
The test plan formed from the design specification as the starter of the verification flow: Mehta, section 15.5.1.
Writing a plan from the specification as the first step of verification: Spear and Tumbush, section 1.1.
The Lab: The Plan, Run Row by Row
The lab runs the five rows against uart_tx. A model of the far end of the wire samples every bit in its middle and collects the bytes. Each row prints its own verdict, and the last line counts the closed rows:
R1 one byte, one correct frame PASS
R2 patterns 55 and AA PASS
R3 two frames back to back PASS
R4 start while busy is ignored PASS
R5 reset mid-frame, line idle PASS
plan rows passed: 5 of 5Rule 4 at work: five of five, so by this plan the transmitter is done. Now plant a bug that ends busy one bit early, cutting the stop bit short:
R1 one byte, one correct frame PASS
R2 patterns 55 and AA FAIL
R3 two frames back to back FAIL
R4 start while busy is ignored PASS
R5 reset mid-frame, line idle PASS
plan rows passed: 3 of 5R2 and R3 fail. Both send a byte straight after the last one finished, and the short stop bit is only visible then. A single byte with idle time after it looks perfect, which is why R1 still passes.
One more experiment. Plant the bug from the gap above, where the transmitter reads data one clock late. The plan prints plan rows passed: 5 of 5. Rule 5 at work, the hard way: no row asked the question, so no test failed.
Why a Plan Before the Tests
Why write a plan instead of just writing tests? Because tests answer "does this case work?" and nobody can ask "are we done?" of a pile of tests. The plan turns that question into a list people can read and agree with. That includes the designer, who knows where the risks are.
Why give every row a coverage item? Because a random test may never reach the feature it was meant for. A passing check on a feature that was never reached is not evidence of anything. Coverage is how a row proves its stimulus arrived.
Traps
The first trap is a plan written from the tests. Someone lists the tests that exist and calls it a plan. It then says done the moment it is written, and every feature without a test stays invisible. Write rows from the specification.
The second trap is the row with no check. "Send back-to-back frames" is stimulus, not verification. If nothing compares the bytes, a broken stop bit passes. Every row needs a sentence that starts with "check that".
The third trap is the frozen plan. The specification changes in week six, the plan does not, and the new feature ships with no test. Treat the plan as a living document, and review it with the designer whenever either one changes.
Where This Goes Next
Plans exist at every level of a project. These pages show the same idea for bigger designs.
| The idea from this page | Where it is taught |
|---|---|
| A test plan for a FIFO, in SystemVerilog | Start From the FIFO Rules |
| An assertion plan | An Assertion Plan |
| A coverage model from a plan | Capstone: A Coverage Model That Finds Holes |
| A formal verification plan | The Formal Verification Plan |
| The chip-level verification plan | The Chip-Level Verification Plan |
Try It
Run it: five plan rows, each a short test with its own verdict.
In uart_tx, change bits == 1 to bits == 2, which cuts the stop bit short. Predict the last line.
Write a sixth row: change data straight after the start clock, and check that the byte sent is still the old one.
R1 one byte, one correct frame PASS R2 patterns 55 and AA PASS R3 two frames back to back PASS R4 start while busy is ignored PASS R5 reset mid-frame, line idle PASS plan rows passed: 5 of 5Check Yourself
Common Mistakes
Wrong List the tests that exist and call it a plan.
Features without a test never appear, and the plan says done at once.
Fix Write one row per promise of the specification.
Wrong Write rows that only describe stimulus.
Stimulus with no check cannot fail.
Fix Give every row a check and a coverage item.
Wrong Freeze the plan after the first review.
New and changed features ship with no test.
Fix Add rows when the specification changes or a bug shows a gap.
Remember
- A verification plan is a table: one row per promise of the specification.
- Each row has a stimulus to reach it, a check to decide it and coverage to prove it was reached.
- Rows are ranked by risk; done means every row closed.
- A feature with no row has no test; the plan grows when the specification or a bug shows a gap.