Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Reading Paths
  • Concept Map
  • Meet DCRouter
  • Glossary
  • Part 0: What Verification Is8
  • Part 1: What Can Go Wrong11
  • Part 2: Specifications as Checkable Rules8
  • Part 3: Observability and Controllability7
  • Part 4: Stimulus11
  • Part 5: Checking11
  • Part 6: Coverage10
    • What Coverage Measures
    • Code Coverage
    • Functional Coverage Models
    • Crosses and the Combinatorial Explosion
    • Closure Curves
    • Holes and Unreachable Bins
    • Coverage-Driven Stimulus
    • Mutation Testing
    • A Coverage Model for DCRouter
    • Drills: Coverage
  • Part 7: Formal and Simulation10
  • Part 8: Verification Levels and Reuse8
  • Part 9: Planning and Risk9
  • Part 10: Emulation and Prototyping8
  • Part 11: Post-Silicon Validation8
  • Part 12: Bug Economics8
  • Part 13: Debug7
  • Part 14: Sign-Off7
  • Part 15: Verification in Context8
  • Part 16: Case Studies5
  • Part 17: Capstones5
  • Part 18: Interview Preparation6
Loading lesson

‹Part 6: Coverage
  1. Topics
  2. First Principles of Verification Strategy
  3. Part 6: Coverage
  4. Functional Coverage Models

Part 6 · Coverage · Senior (S)

Functional Coverage Models

Functional coverage is written by people from the verification plan: coverpoints for the values that matter, bins that group them meaningfully, and crosses for the combinations that matter. How to derive a model from rules and risks, a SystemVerilog covergroup for DCRouter's headers, and the questions that keep a model honest.

On this page

    Note

    Level: Senior (S) · Answers: How do we know we have tested enough?

    Before this: Code Coverage, Requirements Traceability

    A verification engineer is asked for a coverage model for DCRouter and writes one coverpoint per input signal, with automatic bins for every value. The model has thousands of bins, most of them meaningless (every value of the CRC byte), and it says nothing about what matters: a packet of length 15 arriving when the FIFO is nearly full, or an error on a high-priority packet. Coverage written from the signals measures the signals; coverage written from the plan measures the plan.

    How do you write a functional coverage model that measures what matters?

    The obvious answer, and why it breaks

    The obvious model covers everything the tool can see, automatically. It produces huge numbers of bins, closes slowly on irrelevant ones (all 256 CRC values), and misses situations that are not a single signal's value: sequences, combinations, configurations, events across ports. A model is a statement of which situations must occur before the team believes the design works; only people who know the risks can write it.

    The idea: from the plan to points, bins and crosses

    Element

    Is

    DCRouter example

    Coverpoint

    A quantity that matters, sampled at a meaningful moment

    A header's length, sampled when the header is accepted

    Bins

    Groups of values that should behave alike, plus the boundaries

    len 0, len 1, len 2–14, len 15

    Cross

    A combination of coverpoints that matters together

    Destination × priority × length class

    Event bin

    A situation that is not one value

    "Woken by input 3 alone", "two tails in one cycle"

    Illegal or ignored bins

    Values that must not occur, or that do not matter

    A bad CRC on a length-0 packet (one fault per packet)

    Each element should trace to a rule (R1 to R13) or a risk from the plan (lesson 2.6), so an empty bin always means "this rule or risk was never exercised".

    A covergroup for DCRouter's headers

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    // snippet: DCRouter header coverage as a SystemVerilog covergroup
    covergroup hdr_cg with function sample(bit [1:0] dst, bit prio, bit [3:0] len);
      cp_dst  : coverpoint dst;                                   // 4 automatic bins
      cp_prio : coverpoint prio;                                  // 2 automatic bins
      cp_len  : coverpoint len { bins len0 = {0}; bins len1 = {1};  // boundaries apart,
                                 bins mid  = {[2:14]}; bins len15 = {15}; }   // the middle grouped
      x_hdr   : cross cp_dst, cp_prio, cp_len;                    // 32 combinations (R3, R4, R5, R6)
    endgroup
    // sampled when a header is accepted: hdr_cg.sample(d[15:14], d[13], d[12:9]);

    The course's runnable model (lesson 6.9) expresses the same bins as named counters, so it runs on every simulator the course uses; the design of the model, which matters more than its syntax, is identical.

    Deriving a model: the questions

    • For each rule: what values, combinations and events must occur for its check to be meaningful?

    • For each risk: which situation would expose it (lesson 1.9's places bugs hide)?

    • For each boundary: is it a bin of its own (0, 1, max, full, empty)?

    • For each mode: is every configuration value, and every change of it, covered?

    • For each event across ports or time: simultaneous, back to back, during sleep, right after reset?

    • For each bin: what is the sampling moment, and could the bin be hit without the situation really happening?

    How real teams write coverage models

    Practice

    Purpose

    Coverage model reviewed with designers and architects

    Situations that matter, not signals that exist

    Every coverpoint traced to a plan item

    Holes map directly to untested requirements

    Illegal bins for impossible values

    The model doubles as a check that they never occur

    What breaks

    A coverage model (illustrative) sampled the FIFO's occupancy every cycle and had a bin for "full". It closed quickly. But the bug lived in a push arriving while full with a simultaneous pop, an event across two signals in one cycle that the model never named. The bin "full" was hit thousands of times by tests that never pushed while full. Naming the event ("push and pop together at full") would have shown the hole.

    Why this matters

    Senior lens. Review a coverage model as you would a test plan: every bin should name a situation someone cares about and trace to a rule or risk. Fewer, sharper bins beat thousands of automatic ones; a model that closes easily on meaningless bins is worse than none, because it looks like evidence.

    Interview

    Asked: "Design a coverage model for a FIFO."

    Weak answer: Cover every value of the data and the count.

    Strong answer: From the rules and risks, not the signals. Occupancy with bins for empty, one, middle, one-below-full and full; events: push at full (refused), pop at empty (refused), push and pop together at each of empty, middle and full; wrap-around of the pointers; back-to-back full-empty-full; reset while non-empty; and data patterns only where they matter, such as all-zeros and all-ones for stuck bits. I'd cross occupancy with the push/pop combination, ignore data values otherwise, and make each bin trace to a rule so an empty bin means a rule untested.

    Follow-ups: (1) Why not cover every data value? (2) What is the sampling moment for 'push at full'?

    Check yourself Why does the length coverpoint keep 0, 1 and 15 as separate bins but group 2 to 14?

    0, 1 and 15 are boundaries where bugs concentrate (BUG_4, BUG_12, BUG_3); 2 to 14 should behave alike, and one bin for them keeps the model small.

    Check yourself Why is "bad CRC on a length-0 packet" an ignored or illegal bin?

    The test environment injects at most one fault per packet, so the combination never occurs by design; counting it as a hole would be noise.

    Key takeaways

    • Functional coverage is written by people, from the plan: coverpoints, bins, crosses and events.

    • Boundaries get their own bins; values that behave alike are grouped; impossible values are illegal or ignored.

    • Every bin should trace to a rule or risk, so each hole means something untested.

    Keep going

    Next: Lesson 6.4, Crosses and the Combinatorial Explosion. Why crosses explode, and how to keep the ones that matter.

    Related topics

    • Part 6 overview: Coverage

    • SystemVerilog course: Functional Coverage

    Previous

    64 / 160

    Next: Crosses and the Combinatorial Explosion

    Up next

    Up nextCrosses and the Combinatorial Explosion

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • What Coverage Measures
    • Closure Curves
    • Holes and Unreachable Bins