Skip to main content

Module 5 — Functional Coverage

VLSI Verification  •  SystemVerilog Series

Module 5 — Functional Coverage

Measuring whether your constrained-random stimulus actually exercised the scenarios that matter: covergroups, coverpoints, cross coverage, and the bins that shape how values are bucketed and scored.

🧩 Intermediate ⏱ ~20 min read 💻 Code Examples Included

44Covergroup

A covergroup is a user-defined container for functional coverage collection — it groups related coverpoints and crosses, and is sampled either automatically (on a clock event) or manually via .sample().

SystemVerilog
class packet; rand bit [3:0] opcode; rand bit [1:0] size; // covergroup tied to a clocking event -- samples automatically covergroup cg_pkt @(posedge clk); cp_opcode: coverpoint opcode; cp_size: coverpoint size; endgroup function new(); cg_pkt = new(); // covergroup must be constructed, like a class object endfunction endclass // Manual sampling variant (no clocking event) covergroup cg_manual; cp_opcode: coverpoint opcode; endgroup // elsewhere: cg_manual.sample(); // explicitly triggered // Querying overall / per-group coverage $display("coverage = %0.2f%%", cg_pkt.get_coverage());
📘 Covergroup Placement

Covergroups are commonly instantiated inside a monitor (sampling actual DUT-observed values) rather than inside the transaction class itself — this measures what the DUT actually did, not just what stimulus was generated.

45Coverpoint

A coverpoint tracks the values (or value ranges/bins) taken by a single variable or expression during simulation, reporting what percentage of its defined bins were hit.

SystemVerilog
covergroup cg @(posedge clk); // coverpoint on a simple variable cp_addr: coverpoint addr; // coverpoint on an EXPRESSION, not just a raw variable cp_upper_nibble: coverpoint addr[7:4]; // coverpoint with explicit bins (see Section 47 for full bin syntax) cp_burst: coverpoint burst_len { bins small = {[1:4]}; bins large = {[5:16]}; } // option controls -- per-coverpoint settings cp_addr_opts: coverpoint addr { option.at_least = 2; // bin needs 2 hits to count as "covered" option.auto_bin_max = 16; // auto-create at most 16 bins } endgroup
💡 Auto-Bins

If you don't specify explicit bins, SystemVerilog auto-creates bins for the coverpoint's full value range, up to option.auto_bin_max bins (default 64) — beyond that, values get grouped into equal-sized ranges automatically.

46Cross Coverage

cross coverage tracks combinations of two or more coverpoints together — critical for catching bugs that only appear under specific combinations of conditions (e.g., "write while FIFO nearly full"), which individual coverpoints alone can't reveal.

SystemVerilog
covergroup cg @(posedge clk); cp_opcode: coverpoint opcode { bins ops[] = {[0:7]}; } cp_mode: coverpoint mode { bins modes[] = {IDLE, ACTIVE, ERROR}; } // cross combines every bin of cp_opcode with every bin of cp_mode x_op_mode: cross cp_opcode, cp_mode; // cross with its own bins to select/name specific interesting combos x_selective: cross cp_opcode, cp_mode { bins error_case = binsof(cp_mode) intersect {ERROR}; ignore_bins boring = binsof(cp_opcode) intersect {0} && binsof(cp_mode) intersect {IDLE}; } endgroup
⚠️ Cross Explosion

A cross's total bin count is (roughly) the product of the number of bins in each crossed coverpoint. Crossing two coverpoints with 20 bins each yields up to 400 cross bins — use ignore_bins aggressively to prune combinations that are unreachable or uninteresting, or coverage closure becomes unmanageable.

47Bins

Bins define how a coverpoint's value space is bucketed for coverage counting — a single value, a range, an array of bins, or a transition sequence can each become its own bin.

SystemVerilog
covergroup cg; cp_len: coverpoint len { bins zero = {0}; // single value bins small = {[1:63]}; // range bins mid = {[64:511]}; bins large = {[512:1500]}; bins specific[] = {8, 16, 32, 64}; // [] -- creates 4 SEPARATE bins, // one per listed value bins grouped = {8, 16, 32, 64}; // no [] -- ONE bin covering all 4 values } // transition bins -- coverage of a VALUE SEQUENCE over time cp_state: coverpoint state { bins idle_to_active = (IDLE => ACTIVE); bins full_cycle = (IDLE => ACTIVE => DONE => IDLE); bins any_to_error = (IDLE, ACTIVE => ERROR); // multiple sources, one target } endgroup
Bin StyleSyntaxUse Case
Single valuebins z = {0};Track one specific important value
Rangebins r = {[1:63]};Group a contiguous range as one coverage goal
Array of binsbins b[] = {...};Track each listed value independently
Transitionbins t = (A => B);Coverage of state/sequence transitions over time

48Ignore Bins

ignore_bins explicitly excludes specific values or combinations from coverage counting entirely — they're removed from both the coverage total and the hit count, as if they didn't exist.

SystemVerilog
covergroup cg; cp_addr: coverpoint addr { ignore_bins reserved = {[8'hF0:8'hFF]}; // reserved address range -- // never expected, don't count it // against coverage % } cp_mode: coverpoint mode { bins valid_modes[] = {IDLE, READ, WRITE}; } // ignore specific CROSS combinations that can never legally occur x_addr_mode: cross cp_addr, cp_mode { ignore_bins unreachable = binsof(cp_addr) intersect {[8'hF0:8'hFF]}; } endgroup
📘 Why It Matters for Sign-Off

Coverage closure meetings live and die by "100% coverage" claims. ignore_bins lets the team formally exclude values that are structurally unreachable (e.g., reserved address space, unsupported opcode encodings), keeping the reported percentage meaningful instead of artificially capped below 100%.

49Illegal Bins

illegal_bins marks values that should never occur — if the coverpoint samples a value falling into an illegal bin, the simulator raises a runtime error, actively flagging a bug rather than passively excluding the value.

SystemVerilog
covergroup cg; cp_opcode: coverpoint opcode { bins valid_ops[] = {[0:9]}; illegal_bins bad_op = {[10:15]}; // opcodes 10-15 are undefined/reserved -- // sampling one of these is a DUT/TB bug, // simulator raises an error immediately } endgroup
Bin TypeEffect on Coverage %Effect if SampledIntent
Normal binCounted, contributes to %Increments hit countExpected, interesting values
ignore_binsExcluded entirelySilently not countedStructurally unreachable / uninteresting values
illegal_binsExcluded entirelyRuntime error raisedValues that indicate a genuine bug if ever seen
🚫 Interview Trap

"What's the difference between ignore_bins and illegal_bins?" Both remove the value from coverage math, but illegal_bins additionally triggers a simulation error the moment it's sampled — ignore_bins is silent. Mixing these up in an interview is a common stumble.

🎯 Module 5 Recap

  • covergroup is the container; it must be constructed with new() like a class object, and samples automatically on a clocking event or manually via .sample().
  • coverpoint tracks one variable or expression's value distribution.
  • cross tracks combinations across coverpoints — watch out for bin-count explosion.
  • bins can be single values, ranges, arrays of bins, or value-transition sequences.
  • ignore_bins silently excludes values from coverage; illegal_bins excludes them AND raises a runtime error if hit.

📚 Next up — Module 6: Assertions (immediate & concurrent assertions, properties, sequences, implication & repetition operators)

↑ Back to Table of Contents

Comments

Popular posts from this blog

Module 1 — SystemVerilog Basics

VLSI Verification  •  SystemVerilog Series Module 1 — SystemVerilog Basics A complete, example-driven walkthrough of SystemVerilog fundamentals: data types, variables vs nets, arrays of every flavor, strings, enums, structs, unions, and typedef — the building blocks every verification engineer needs before UVM. 🧩 Beginner → Intermediate ⏱ ~25 min read 💻 Code Examples Included 📑 Table of Contents Introduction to SystemVerilog Verilog vs SystemVerilog Data Types: 2-State vs 4-State Logic Variables and Nets Arrays: Packed vs Unpacked Dynamic Arrays Queues Associative Arrays Strings Enumerations Structures Unions Typedef 1 Introduction to SystemVerilog SystemVerilog (IEEE 1800) is a unified hardware description and verification language (HDVL). It extends Verilog (IEEE 1364) with powerful constructs for design (interfaces, always_comb/always_ff, enhanced d...

Clock Domain Crossing (CDC): A Complete Beginner's Guide to Metastability, Synchronizers & Safe Data Transfer

Clock Domain Crossing (CDC): A Complete Beginner's Guide to Metastability, Synchronizers & Safe Data Transfer Modern System-on-Chip (SoC) designs rarely operate with a single clock. Instead, different modules such as CPUs, GPUs, memory controllers, communication interfaces, and peripherals often run at different clock frequencies or even use completely independent clock sources . When data moves from one clock domain to another, timing uncertainty can cause serious problems such as metastability , data corruption , and unpredictable system behaviour . This challenge is known as Clock Domain Crossing (CDC) . CDC is one of the most important topics in ASIC Design , RTL Design , ASIC Verification , FPGA Design , and SoC Architecture . Every modern chip—from smartphones to automotive processors—uses CDC techniques to ensure reliable communication between multiple clock domains. In this article, we'll explore CDC fundamentals, metastability, synchronization techniques, asynchro...

GPU Memory System & Interconnect: How Data Travels Inside a Modern GPU

GPU Memory System & Interconnect: How Data Travels Inside a Modern GPU Modern GPUs deliver incredible computing power by processing thousands of operations simultaneously. While compute cores often receive the spotlight, the real performance of a GPU depends heavily on how efficiently data moves between memory and compute units. A GPU memory system is designed to provide extremely high bandwidth while keeping latency as low as possible. This is achieved through a collection of specialized hardware components working together, including the Memory Controller, HBM/GDDR memory, Crossbar, Network-on-Chip (NoC), DMA Engine, PCIe Interface, and NVLink. In this article, we'll explore each component in detail and understand how they collectively enable high-performance parallel computing. Why Does GPU Memory Matter? Every GPU application—from gaming and graphics rendering to AI model training and scientific simulations—requires continuous movement of enormous amounts of data. For examp...

AXI Verification Interview Questions and Real-World Debugging

AMBA Protocol Series · Part 10 of 10 AXI Verification Interview Questions and Real-World Debugging Common protocol violations, how to read them off a waveform, and a curated set of interview questions with concise, correct answers — the capstone of the core 10-day series. AMBA Protocol Series: From APB & AHB to AXI — A Complete Guide for VLSI Engineers This wraps up the core 10-day series. Everything here draws directly on Days 1–9 — if any answer below feels unfamiliar, that's a good signal for which earlier post to revisit. (If you want to go further, see the 20-day extended list at the end of this post.) In This Article Common Protocol Violations Debugging From a Waveform Interview Questions and Answers Series Recap Extending the Series 1. Common Protocol Violations VALID deasserted before handshake — a source drops VALID before READY ever went high (violates the Day 8 stabi...

Timing Basics in Static Timing Analysis (STA): Delay Models, Sequential Timing, and Wire Delays

Timing Basics in Static Timing Analysis (STA) Static Timing Analysis (STA) is one of the most important verification techniques used in modern VLSI design. Before a chip is manufactured, engineers must verify that every signal reaches its destination within the required clock period. Even if a design passes functional simulation, it may still fail after fabrication because of timing violations. Unlike simulation, Static Timing Analysis mathematically analyzes every timing path without applying input test vectors. This makes STA significantly faster and capable of analyzing millions of timing paths efficiently. Table of Contents What is Static Timing Analysis? Why STA is Required Propagation Delay Contamination Delay Cell Delay Models Combinational Gate Delay Sequential Timing Setup Time Hold Time Wire Delay RC Delay Model PVT Corners Worked Examples Interview Questions Key Takeaways What is Static Timing Analysis? Static Ti...

Cache Basics and Cache Mapping Techniques

  Cache Basics and Cache Mapping Techniques  Modern processors execute billions of instructions every second. However, processor speed has increased much faster than main memory (RAM) speed. This difference, known as the memory wall , creates a performance bottleneck because the CPU often has to wait for data from slower memory. To solve this problem, computer systems use cache memory —a small, high-speed memory located between the CPU and the main memory. In this article, we will understand the fundamentals of cache memory, the principle of locality, cache organization, and the three major cache mapping techniques. What is Cache Memory? Cache memory is a small, high-speed memory that stores copies of frequently accessed data from the main memory. Since accessing cache is much faster than accessing RAM, the CPU first checks whether the required data is available in the cache. If the data is found in the cache, it is called a cache hit . Otherwise, the CPU fetches the dat...

CMOS Power & Scaling Explained: Dynamic Power, Leakage Power, Short-Circuit Power & Technology Scaling

  CMOS Power & Scaling Explained: Dynamic Power, Leakage Power, Short-Circuit Power & Technology Scaling Day 6 | CMOS Design Fundamentals | The Silicon Stack As integrated circuits continue to become smaller, faster, and more powerful, power consumption has emerged as one of the biggest challenges in modern VLSI design. While early digital circuits primarily focused on functionality and speed, today's processors, AI accelerators, smartphones, and IoT devices must deliver high performance while operating within strict power and thermal limits. A modern System-on-Chip (SoC) may contain billions of CMOS transistors , each switching billions of times per second. Even a tiny amount of power consumed by each transistor adds up to significant energy consumption across the entire chip. Excessive power not only drains batteries but also generates heat, reduces reliability, and limits performance. Understanding where CMOS power comes from and how it can be reduced is therefore ...