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

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
    • Covergroup and Coverpoint Puzzles
      • Auto vs explicit bins with illegal transition context
      • Default bin is not scored
      • Bin array math with mixed declarations
      • Transition bin sequence counting
      • illegal_bins vs ignore_bins accounting
      • Same traffic, different denominator
    • Cross Coverage Puzzles
    • Coverage Options Puzzles
    • Coverage Closure and Sampling Timing Puzzles
    • Functional Coverage Puzzles: Tricky Q&A
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Covergroup and Coverpoint Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Functional Coverage Puzzles
  4. Covergroup and Coverpoint Puzzles
  5. illegal_bins vs ignore_bins accounting
On this page

    VLSI DV Interview PuzzlesAll levels

    illegal_bins vs ignore_bins accounting

    Compute legal coverage and classify each sampled value as legal, ignored, or illegal. Options: none set (all defaults: at_least = 1, weight = 1, auto_bin_max = 64).

    Puzzle

    Difficulty: Medium · Puzzle 5 of 6 · Topic: Covergroup and Coverpoint Puzzles

    Compute legal coverage and classify each sampled value as legal, ignored, or illegal. Options: none set (all defaults: at_least = 1, weight = 1, auto_bin_max = 64).

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    covergroup cg with function sample(bit [3:0] req_len);
      cp_len: coverpoint req_len {
        bins short = {[1:4]};
        bins long  = {[5:8]};
        ignore_bins keepalive = {0};
        illegal_bins too_big  = {[9:15]};
      }
    endgroup
    
    initial begin
      cg c = new();
      c.sample(0);
      c.sample(3);
      c.sample(6);
      c.sample(10);
      c.sample(2);
      c.sample(15);
    end

    Hint

    Only short and long are legal scored bins in the denominator.

    Step-by-step solution

    Diagram
    1) Legal bins are short and long -> denominator 2.
    2) Hits: short hit by 3 and 2, long hit by 6.
    3) Value 0 is ignored (keepalive), values 10 and 15 are illegal.
    4) Legal coverage is 2/2 = 100% with two illegal hits logged.

    Answer

    Answer: Legal coverage is 100% (short and long both hit). Sample classification: ignored={0}, illegal={10,15}, legal={3,6,2}.

    How this was checked

    Checked by running a model of the rule in a Python model. A model of the LRM rule: ignored and illegal values never reach the legal bins, which both end up hit.

    Why candidates get it wrong

    Ignore and illegal activity can be present even when legal coverage is 100%, so closure does not imply protocol correctness.

    Interviewer follow-up

    Would you keep too_big as illegal_bins or move it to assertions for better debug diagnostics? Model answer: Do both. An assertion in the monitor is always active, gives a timed message and works without coverage enabled; illegal_bins is a backstop that flags the same event in the coverage database. Do not rely on illegal_bins alone as the protocol check.

    Say it out loud

    I would classify each sample first: 0 is ignored, 10 and 15 are illegal, and 3, 6 and 2 are legal. Both legal bins, short and long, are hit, so legal coverage is 100 percent. Ignored values leave the calculation and illegal values only raise errors. The trap is reading 100 percent as protocol correctness, because two illegal hits happened, so I would check the illegal count too.

    Related topics

    • Exclusions, Patterns & Filters

    • Bins, Illegal Bins and Ignore Bins

    • Back to Covergroup and Coverpoint Puzzles

    • Functional Coverage Puzzles section

    Previous

    140 / 293

    Next: Same traffic, different denominator

    Up next

    Up nextSame traffic, different denominator

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Auto vs explicit bins with illegal transition context
    • Default bin is not scored
    • Bin array math with mixed declarations