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
      • auto_bin_max and at_least together
      • Weighted aggregate coverage math
      • per_instance exposure of hidden holes
      • type_option.at_least across all instances
      • type_option.auto_bin_max bin grouping
      • option.weight zero removes metric influence
    • Coverage Closure and Sampling Timing Puzzles
    • Functional Coverage Puzzles: Tricky Q&A
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Coverage Options Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Functional Coverage Puzzles
  4. Coverage Options Puzzles
  5. Weighted aggregate coverage math

VLSI DV Interview Puzzles · All levels

Weighted aggregate coverage math

Compute cp_opcode coverage, cp_size coverage, and weighted group coverage.

On this page

    Puzzle

    Difficulty: Hard · Puzzle 2 of 6 · Topic: Coverage Options Puzzles

    Compute cp_opcode coverage, cp_size coverage, and weighted group coverage.

    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 [1:0] opcode, bit size);
      cp_opcode: coverpoint opcode {
        option.weight = 3;
        bins op[] = {[0:3]};
      }
      cp_size: coverpoint size {
        option.weight = 1;
        bins s0 = {0};
        bins s1 = {1};
      }
    endgroup
    
    initial begin
      cg c = new();
      c.sample(0,0);
      c.sample(1,1);
      c.sample(1,0);
    end

    Hint

    First compute each coverpoint percentage, then apply weighted average by option.weight.

    Step-by-step solution

    Diagram
    1) cp_opcode has 4 bins (0..3), hit bins are 0 and 1 -> 2/4 = 50%.
    2) cp_size has 2 bins, both hit -> 2/2 = 100%.
    3) Weighted group coverage = (3*50 + 1*100) / (3+1).
    4) Result = 62.5%.

    Answer

    Answer: cp_opcode = 50%, cp_size = 100%, weighted aggregate = 62.5%.

    Why candidates get it wrong

    Teams sometimes average percentages unweighted and report 75%, which is wrong when weights differ.

    Interviewer follow-up

    If cp_size weight is changed to 0, what aggregate would be reported?

    Related topics

    • Back to Coverage Options Puzzles

    • Functional Coverage Puzzles section

    Previous

    143 / 210

    Next: per_instance exposure of hidden holes

    Up next

    Up nextper_instance exposure of hidden holes

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • type_option.at_least across all instances
    • type_option.auto_bin_max bin grouping
    • option.weight zero removes metric influence