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
    • Cross Coverage Puzzles
    • Coverage Options Puzzles
      • auto_bin_max and at_least together
      • Weighted aggregate coverage math
      • Instance coverage, type coverage and merge_instances
      • option.at_least per instance with averaged type coverage
      • auto_bin_max is ignored once bins are explicit
      • option.weight zero removes metric influence
    • 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

←Coverage Options Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Functional Coverage Puzzles
  4. Coverage Options Puzzles
  5. Weighted aggregate coverage math
On this page

    VLSI DV Interview PuzzlesAll levels

    Weighted aggregate coverage math

    Compute cp_opcode coverage, cp_size coverage, and weighted group coverage. Options set: cp_opcode option.weight = 3, cp_size option.weight = 1 (at_least = 1, auto_bin_max default).

    Puzzle

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

    Compute cp_opcode coverage, cp_size coverage, and weighted group coverage. Options set: cp_opcode option.weight = 3, cp_size option.weight = 1 (at_least = 1, auto_bin_max default).

    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%.

    How this was checked

    Checked by running a model of the rule in a Python model. A model of weighted aggregation: (3*50 + 1*100) / 4 = 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? Model answer: Only cp_opcode contributes, so the group reports 50%; cp_size still shows 100% on its own line.

    Say it out loud

    I would weight each coverpoint, not average the percentages. The opcode coverpoint is 50 percent with weight 3, and size is 100 percent with weight 1, so the aggregate is 62.5 percent. The trap is the unweighted average of 75 percent. I would next check whether the weights reflect real importance in the plan.

    Related topics

    • Weights, Goals & at_least

    • Coverage Options That Change the Numbers

    • Back to Coverage Options Puzzles

    • Functional Coverage Puzzles section

    Previous

    149 / 293

    Next: Instance coverage, type coverage and merge_instances

    Up next

    Up nextInstance coverage, type coverage and merge_instances

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • option.at_least per instance with averaged type coverage
    • auto_bin_max is ignored once bins are explicit
    • option.weight zero removes metric influence