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. Instance coverage, type coverage and merge_instances
On this page

    VLSI DV Interview PuzzlesAll levels

    Instance coverage, type coverage and merge_instances

    Compute c0.get_inst_coverage(), c1.get_inst_coverage() and the type coverage cg::get_coverage() with type_option.merge_instances = 1. Then say what the type coverage would be with merge_instances = 0. Options set: option.per_instance = 1 and type_option.merge_instances = 1 on the covergroup (at_least = 1, weight = 1).

    Puzzle

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

    Compute c0.get_inst_coverage(), c1.get_inst_coverage() and the type coverage cg::get_coverage() with type_option.merge_instances = 1. Then say what the type coverage would be with merge_instances = 0. Options set: option.per_instance = 1 and type_option.merge_instances = 1 on the covergroup (at_least = 1, weight = 1).

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    covergroup cg with function sample(bit mode);
      option.per_instance = 1;
      type_option.merge_instances = 1;
      cp_mode: coverpoint mode {
        bins off = {0};
        bins on  = {1};
      }
    endgroup
    
    initial begin
      cg c0 = new();
      cg c1 = new();
      c0.sample(0);
      c0.sample(1);
      c1.sample(0);
    end

    Hint

    merge_instances = 1 merges the bins of all instances (union of hits). merge_instances = 0 averages the instance coverages.

    Step-by-step solution

    Diagram
    1) c0 hits off and on -> 2/2 = 100% instance coverage.
    2) c1 hits only off -> 1/2 = 50% instance coverage.
    3) With type_option.merge_instances = 1 the type coverage merges the instances: off is hit (by c0 and c1), on is hit (by c0) -> 2/2 = 100%.
    4) With merge_instances = 0 (the LRM default) type coverage is the weighted average of the instances: (100 + 50) / 2 = 75%.

    Answer

    Answer: c0 = 100%, c1 = 50%, type coverage with merge_instances = 1 is 100% (with merge_instances = 0 it would be 75%).

    How this was checked

    Checked by running a model of the rule in a Python model. A model of the LRM rule: merging pools the hits of both instances (100%), while averaging them gives 75%.

    Why candidates get it wrong

    The merged type number says 100% while c1 never saw mode = 1. per_instance only makes instance data available for reporting; it is merge_instances that selects union versus average, so state it explicitly because tools do not all default alike.

    Interviewer follow-up

    How would results appear if option.per_instance were left at 0? Model answer: Instance coverage is not kept or reported per instance, so only the type-level number is visible (100% here with merge_instances = 1) and c1's hole is invisible. per_instance does not change the type number itself.

    Say it out loud

    I would read the two instances separately: c0 is 100 percent and c1 is 50 percent. With merge_instances set to one, the type coverage is the union of both, so it is 100 percent, and with it set to zero it would be 75 percent, the average. The trap is that the merged 100 percent hides that c1 never saw mode 1. I would state merge_instances explicitly because tools differ in default.

    Related topics

    • option.per_instance & Instance Options

    • get_coverage(), sample() & Friends

    • Back to Coverage Options Puzzles

    • Functional Coverage Puzzles section

    Previous

    150 / 293

    Next: option.at_least per instance with averaged type coverage

    Up next

    Up nextoption.at_least per instance with averaged type coverage

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • auto_bin_max and at_least together
    • auto_bin_max is ignored once bins are explicit
    • option.weight zero removes metric influence