Coverage-Driven Verification and Closure

If random stimulus is the engine, functional coverage is the fuel gauge. Coverage-driven verification (CDV) closes the loop: run random tests, measure which interesting scenarios were hit, find the gaps, and steer new constraints or tests at them until coverage reaches its goal. Without coverage you never know whether 10,000 random tests exercised the design or just hammered one path.

Covergroups and the closure loop

A covergroup samples variables into coverpoints with bins; cross coverage records combinations (e.g. every opcode × every addressing mode). The CDV loop is: (1) run random regression, (2) merge coverage, (3) read the holes, (4) add constraints/tests aimed at the holes, (5) repeat to closure. The syntax is shown for reference (needs a SV simulator — run it in the Verification Lab):

covergroup cg_bus @(posedge clk);
  cp_op  : coverpoint txn.op  { bins rd = {READ}; bins wr = {WRITE}; }
  cp_len : coverpoint txn.len { bins small = {[1:4]};
                                bins big   = {[5:16]}; }
  x_op_len : cross cp_op, cp_len;      // every op x every length class
endgroup

cg_bus cg = new();
// ... cg.sample() happens automatically on the clock
// report: $display("coverage = %0.1f%%", cg.get_coverage());

The essence — tracking which bins were hit until all are covered — runs in plain code the browser simulator executes: it classifies 500 random transactions into bins and reports coverage, reaching 100% once every bin is seen:

module tb;
  initial begin
    bit [3:0] bins_hit = 0;        // 4 length-class bins
    for (int i = 0; i < 500; i++) begin
      int len = $urandom_range(1,16);
      if      (len <= 4)  bins_hit[0] = 1;
      else if (len <= 8)  bins_hit[1] = 1;
      else if (len <= 12) bins_hit[2] = 1;
      else                bins_hit[3] = 1;
    end
    $display("length-class bins hit = %b  coverage = %0d%%",
             bins_hit, ($countones(bins_hit)*100)/4);
    $finish;
  end
endmodule
length-class bins hit = 0100  coverage = 25%
- /var/folders/l0/gs5hnkm56g54bmxg32r6nnwr0000gn/T/tmp13s6pjn5/tb.sv:13: Verilog $finish

Check yourself

What is the difference between code coverage and functional coverage?

Code coverage (line, branch, toggle, FSM) is automatic and measures which RTL was exercised; it can be 100% while the design is still under-verified. Functional coverage is user-defined from the spec — covergroups and crosses that say which meaningful scenarios occurred. You need both; functional coverage defines ‘done’.

Describe the coverage-driven verification closure loop.

Run constrained-random regressions, merge the functional coverage, identify unhit bins/crosses (coverage holes), then add or tune constraints/tests to target those holes, and repeat until the coverage goal is met. Coverage, not test count, decides when verification is complete.

Have questions about this topic?
Share your question in comments or talk to our mentor team for batch guidance.

Need Fee, Duration, or Demo Class Details?

Talk to our admin team for the latest batch plan and career guidance.

Contact Admin Team
▶ Try it in the ChipXpert Lab

Compile and simulate this in the browser — no install. Edit the code and re-run instantly.

Open in Verification Lab

Learn Verilog with mentors, labs and placement support

This free series is maintained by the ChipXpert training team in Hyderabad & Bengaluru. Go deeper with instructor-led courses on real EDA tools.

Explore VLSI Courses
Next batch starts 18th November 2026
Start your VLSI career with ChipXpert

Live online and classroom batches in Hyderabad & Bengaluru. Fill in your details and a counsellor will call you back.

  • Real EDA tools in your browser: industry-standard EDAReal EDA tools in your browser
  • Recorded sessions on the elearn portalRecorded sessions
  • Placement assistance: resume, mock interviewsPlacement assistance
  • Merit scholarship up to 60% · EMI optionsScholarship up to 60%
Hi! Ask me about courses, fees, batches or discounts. ×
BENGALURU
HYDERABAD