Home / Learn Verilog / Functional Coverage

Functional Coverage

Did we test enough?

The gistDid we test enough?

The idea, explained simply

Coveragecovergroupcoverpoint: what to trackbins: value bucketscross: combinations
Coverage

In plain terms

Covergroups count which values and combinations the test hit.

Why we use it

Tells you when verification is complete.

Under the hood

coverpoint + bins.

Real-world use

  • Everyday RTL design
  • FPGA and ASIC projects
  • Testbenches and debugging

Try it

Manual coverage binsVerilog: edit and run

Coverage = are all bins hit?

SystemVerilog covergroup
covergroup cg @(posedge clk);\n  cp_op : coverpoint op { bins low = {[0:3]}; bins mid = {[4:11]}; bins high = {[12:15]}; }\nendgroup\ncg cov = new();
Careful:This simulator runs the core of SystemVerilog (logic, always_ff, always_comb, enum, typedef, int, loops with int, break/continue, inside, immediate assert). Features shown only in the grey code box need a full simulator (Icarus -g2012, Verilator, Questa, VCS, Xcelium).

Quick quiz

1. Coverage measures...