Part 5 · Functional Coverage · Intermediate

Coverage Options & Methods

Hub — per-instance vs type coverage, weights and goals, at_least, the runtime query API, parameterized covergroups, and simulator database control.

Overview

Declaring coverpoints and bins describes what to measure. The option and type_option structures, the built-in methods, and the system tasks describe how it is measured: whether N instances accumulate together or separately, how much each group counts in the rollup percentage, how many hits make a bin trustworthy, and how the simulator stores and merges the results.

These knobs separate a toy covergroup from a production coverage model. The same bins, with the wrong accumulation mode or default weights, produce numbers that mislead an entire sign-off review.

Sub-topics

  1. option.per_instance & Instance Options — type vs instance accumulation, option.name, option.comment, per-port coverage.

  2. Weights, Goals & at_least — option.weight in the parent percentage, option.goal, hit thresholds, type_option vs option.

  3. get_coverage(), sample() & Friends — the runtime query API, start/stop, adaptive stimulus patterns.

  4. Parameterizing Covergroups — constructor arguments, ref arguments, one definition reused across N instances.

  5. Simulator Coverage Control — databases, $set_coverage_db_name, performance switches, regression merge flow.

diagram
OPTIONS & METHODS — topic map

  covergroup my_cg (args...) @(event);     ── 4. parameterization
    option.per_instance = 1;               ── 1. accumulation mode
    option.name   = "port0_cov";           ── 1. report identity
    option.weight = 3;                     ── 2. rollup weighting
    option.goal   = 100;                   ── 2. target percentage
    cp : coverpoint x { option.at_least = 4; } ── 2. hit threshold
  endgroup

  runtime:   cg.sample()  cg.get_inst_coverage()   ── 3. query API
             cg.stop()    cg.start()  $get_coverage
  simulator: $set_coverage_db_name("seed42")       ── 5. database
             per-seed DBs ──merge──► closure report

Key takeaways

  • option.* configures one instance; type_option.* configures the covergroup type — different scopes, different report rows.

  • per_instance, weight, goal, and at_least change what the percentage means — set them deliberately.

  • The method API (sample, get_coverage, start/stop) makes coverage a runtime signal, not just an end-of-sim report.

  • Databases and merging are simulator territory, but the flow concepts are portable across tools.