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 Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
    • Covergroup and Coverpoint Puzzles
    • Cross Coverage Puzzles
    • Coverage Options Puzzles
    • Coverage Closure and Sampling Timing Puzzles
      • Sampling region off-by-one on state bins
      • Unreachable bin from stimulus constraints
      • Manual sample called at wrong phase
      • get_coverage vs get_inst_coverage interpretation
      • Unreachable cross tuple from protocol rules
      • at_least threshold causes closure plateau
    • Functional Coverage Puzzles: Tricky Q&A
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Coverage Closure and Sampling Timing Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Functional Coverage Puzzles
  4. Coverage Closure and Sampling Timing Puzzles
  5. Sampling region off-by-one on state bins

VLSI DV Interview Puzzles · All levels

Sampling region off-by-one on state bins

Team expects bins 1,2,3 after three clocks but report differs. Compute actual hits and explain.

On this page

    Puzzle

    Difficulty: Medium · Puzzle 1 of 6 · Topic: Coverage Closure and Sampling Timing Puzzles

    Team expects bins 1,2,3 after three clocks but report differs. Compute actual hits and explain.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    bit clk;
    bit [1:0] state;
    
    covergroup cg_evt @(posedge clk);
      cp_state: coverpoint state {
        bins s0 = {0};
        bins s1 = {1};
        bins s2 = {2};
        bins s3 = {3};
      }
    endgroup
    
    cg_evt c = new();
    
    always_ff @(posedge clk)
      state <= state + 1;
    
    initial begin
      state = 0;
      repeat (3) @(posedge clk);
    end

    Hint

    Event sampling happens before NBA updates from always_ff.

    Step-by-step solution

    Diagram
    1) On each posedge, covergroup samples current state in active region.
    2) state update uses NBA, so sampled values are pre-update.
    3) Across three clocks from initial 0, sampled values are 0,1,2.
    4) Hit bins are s0,s1,s2 -> 3/4 = 75%.

    Answer

    Answer: Actual coverage is 75% because sampled states are 0,1,2 (not 1,2,3).

    Why candidates get it wrong

    Waveform cursors often show post-NBA values, which can mislead coverage root-cause analysis.

    Interviewer follow-up

    What monitor timing change would capture post-update states without modifying DUT logic?

    Related topics

    • Back to Coverage Closure and Sampling Timing Puzzles

    • Functional Coverage Puzzles section

    Previous

    148 / 210

    Next: Unreachable bin from stimulus constraints

    Up next

    Up nextUnreachable bin from stimulus constraints

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Manual sample called at wrong phase
    • get_coverage vs get_inst_coverage interpretation
    • Unreachable cross tuple from protocol rules