← Design Verification Interviews

Interview Question · Concept

Cover Property vs Covergroup

L1 JuniorL2 Mid-Levelfunctional coveragesvacoverage model

The Question

The interviewer asks

When do you use cover property and when a covergroup?

Reveal the Model Answer

Use cover property for a sequence of events on signals over time, such as "request, two stalled cycles, then a grant". It reuses the assertion language and counts each time the sequence completes. Use a covergroup for values and their combinations, such as packet length crossed with kind. Only a covergroup has bins, crosses and a percentage. cover property lives in modules, interfaces and checkers, not in classes.

What Each Construct CountsArrows show where each construct gets its data and what it reports.
What Each Construct CountsArrows show where each construct gets its data and what it reports. component Interface signals req, stall and gnt,sampled every clock component Monitortransaction Length and kind ofone packet component cover property req ##[1:3] gnt; ina module, interface orchecker component Covergroup Bins on length andkind, and their cross component Match count How many times thesequence completed component Coverage percent Bins and cross cellshit, out of all every clockcountssample()bins hit
Read the diagram as text
  • Interface signals: req, stall and gnt, sampled every clock
  • Monitor transaction: Length and kind of one packet
  • cover property: req ##[1:3] gnt; in a module, interface or checker
  • Covergroup: Bins on length and kind, and their cross
  • Match count: How many times the sequence completed
  • Coverage percent: Bins and cross cells hit, out of all
  • Interface signals → cover property: every clock
  • cover property → Match count: counts
  • Monitor transaction → Covergroup: sample()
  • Covergroup → Coverage percent: bins hit

The cover property describes timing between events. The covergroup describes values and their combinations, and only it gives a percentage.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Listen For (Junior)

A good junior answer picks cover property for events spread over several cycles and a covergroup for value combinations. It gives one example of each.

Cross-Questions

Where the interviewer goes next. Open a node to practise that follow-up.

WhyWhat IfBreak ItCompareScale It

  1. Cover Property vs Covergroup
  2. CompareCover Sequence vs Cover PropertyL2 Mid-Level

    Compare cover sequence (req ##[1:3] gnt) with cover property (req ##[1:3] gnt). Can their counts differ?

    Reveal the Model Answer

    Yes. cover property counts at most one success per attempt. cover sequence counts every match, so one attempt can count several times. Suppose gnt is high in all three cycles after one req. The sequence cover counts three matches, and the property cover counts one. Use the property form to count scenarios, and the sequence form to see how often each ending happens.

    Self-Check

    Tick each key point you covered in your answer.

    Spec Misquote

    "They are two spellings of the same statement."

    The standard defines different counting: per attempt for properties, per match for sequences.

    Source IEEE 1800-2017 §16.14.3

  3. What IfTemporal Coverage in a Class-Based BenchL2 Mid-Level

    Asked if they work in a class-based bench

    What if your bench is all classes? Where does coverage of a timed sequence go?

    Reveal the Model Answer

    Put the cover property in the interface or in a checker bound to the design; classes cannot hold it. Or let the monitor turn the timing into a value, such as a stall length per transfer. Then sample that value in a covergroup. The covergroup route gives bins and crosses with other transaction fields. The interface route stays closest to the signals.

    Self-Check

    Tick each key point you covered in your answer.

    Spec Misquote

    "Write cover property inside the monitor class."

    Concurrent assertions and covers are not allowed in classes. The compile fails.

    Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §25.3 (PDF p445)

  4. WhySampling a Covergroup When a Sequence MatchesL2 Mid-LevelL3 Senior

    Can a sequence in the interface feed a covergroup directly, so a timed event gets bins and crosses?

    Reveal the Model Answer

    Yes. A sequence can call a function when it matches, for example (req ##[1:3] gnt, cg.sample(len)). With with function sample(...), the covergroup receives the values seen at that match, even local variables of the sequence. That gives a timed event, such as a grant latency, real bins and crosses.

    Self-Check

    Tick each key point you covered in your answer.

    Misconception

    "Assertions and covergroups can't talk to each other."

    Subroutine calls on a sequence match exist for exactly this. Passing the values as sample arguments keeps them correct for that match.

    Source Mehta, Introduction to SystemVerilog, §15.14 user-defined sample (PDF p613)

  5. Scale ItWhat a Cover Means in FormalL2 Mid-LevelL3 Senior

    In formal verification, what does a cover property tell you that a simulation count cannot?

    Reveal the Model Answer

    Formal tries to reach the cover from reset under the assumptions. A reached cover comes with a trace, which proves the scenario can happen. An unreachable cover proves it cannot happen under those assumptions. That often means the assumptions are too tight, so covers are the main check against over-constraint.

    Self-Check

    Tick each key point you covered in your answer.

    What Interviewers Listen For (Senior)

    A good senior answer writes covers for the key scenarios before trusting any proof. It treats an unreachable cover as a finding to investigate.

    Half-Truth

    "A cover that formal cannot reach is a design bug."

    It may be an over-constrained assumption, or a scenario the spec really forbids. Check the assumptions before blaming the design.

    Source Seligman, Schubert, Kiran Kumar, Formal Verification (2nd ed.), ch. 9, an over-tight assumption (PDF p312)

  6. Break ItA Cover Reached During ResetL2 Mid-Level

    How could a cover property report a hit that never happened in real traffic?

    Reveal the Model Answer

    If the sequence can match on reset values, it is covered while the design is held in reset. For example, !valid ##1 !valid matches on any two reset cycles. Add disable iff (rst) to the cover, or include a real event such as valid && ready in the sequence.

    Self-Check

    Tick each key point you covered in your answer.

    Missed Corner

    "Covers don't need reset handling; only assertions do."

    Reset values are as real to a cover as to an assertion. Without disable iff, reset cycles can satisfy it.

    Source Seligman, Schubert, Kiran Kumar, Formal Verification (2nd ed.), ch. 9, misleading cover with bad reset (PDF p310)

What People Get Wrong

Common wrong answers and why they fail.

Missed Corner

"A cover on req |-> ##[1:3] gnt with thousands of hits proves the handshake was exercised."

Every cycle without req is a vacuous success of the implication. Reports list vacuous successes separately; cover the sequence req ##[1:3] gnt instead.

Source IEEE 1800-2017 §16.14.3

Tool as Truth

"The cover's pass action never printed, so the sequence never happened."

Verilator 5.052, as measured, never runs a cover's pass action. So read the count from the coverage report.

Source ASIC Point engine notes (Verilator 5.052 SVA probes), row "cover property with a pass action"

Wrong Altitude

"Use cover property for everything, including data values."

It has no bins or crosses. Covering 16 lengths by 3 kinds would take 48 cover statements and give no single percentage.

Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §25.4 (PDF p445)

Learn It, Then Prove It