Skip to main content

Using the cover directive in SystemVerilog and functional coverage

· loading · loading · ·
Kerim Turak
Education SystemVerilog Verification SystemVerilog SVA Cover Assertion Verification Functional Coverage Testbench
Education SystemVerilog Verification
Author
Kerim Turak
Digital IC Design & Verification Engineer
Table of Contents
SystemVerilog Design Series - This article is part of a series.
Part 38: This Article

📌 What is the Cover Directive?
#

In SystemVerilog, the cover directive is used in the design or testbench environment to check whether a certain behavior has occurred. It is a critical mechanism for functional coverage tracking.

Example:

cover property (@(posedge clk) req |-> ack);

In this example:

  • When the req signal is active, it checks whether the ack signal is active in the next cycle.
  • It does not produce an assertion failure; it only triggers a coverage event when the condition is met.

🛠️ Why Use Cover?
#

Testbench Activity: Used to see whether every path in the design (e.g., state transitions or handshake scenarios) has been exercised.

Coverage Analysis: Measures test coverage, reporting which behaviors have been tested and which are missing.

Combination with Assertions: The same property can be used with both assert and cover directives:

assert property (p_handshake);
cover property (p_handshake);

🔍 Use Cases for Cover
#

  • FSM (Finite State Machine) Coverage: Ensures all state transitions are tested.

  • Handshake Protocols: Checks whether every combination of request-acknowledge, valid-ready, etc. has occurred.

  • Protocol Coverage: Monitors different transaction combinations in protocols like PCIe and AMBA.


📝 Considerations When Using Cover
#

  • Simulation Dependent: The cover directive only checks for behavior occurrences during simulation. For formal verification, assertion coverage depends on the assertion coverage tool.

  • No Error Messages: If the cover condition is not met, the test does not fail; only coverage is reported as missing.


🔧 Simple Example
#

property p_valid_ready;
  @(posedge clk) valid |-> ready;
endproperty

cover property(p_valid_ready);

In this example:

  • When valid is asserted, ready is checked in the next cycle.
  • If this scenario occurs, the coverage is ticked.

SystemVerilog Design Series - This article is part of a series.
Part 38: This Article

Related

Property Reuse in SystemVerilog: Parameters, Arguments, and Assertion Binding
· loading · loading
Kerim Turak
Education SystemVerilog Verification SystemVerilog SVA Property Assertion Binding Parameterized Property Verification Reusable Property Testbench
Education SystemVerilog Verification
What is SystemVerilog Assertion (SVA) and Why Use It?
· loading · loading
Kerim Turak
Education SystemVerilog Verification SystemVerilog Assertion Verification Formal Verification Concurrent Assertion Immediate Assertion SVA
Education SystemVerilog Verification
Immediate Assertion
· loading · loading
Kerim Turak
Education SystemVerilog Verification SystemVerilog Assertion Verification Immediate Assertion Deferred Immediate Assertion Design Verification
Education SystemVerilog Verification
SystemVerilog Assertions: Delay, Repetition, and Status
· loading · loading
Kerim Turak
Education SystemVerilog Verification SystemVerilog Assertion Verification Repetition Delay Overlap Go-to Repetition Assertion Status
Education SystemVerilog Verification
SystemVerilog Assertions: Same Cycle and Next Cycle Implication
· loading · loading
Kerim Turak
Education SystemVerilog Verification SystemVerilog Assertion Verification Same Cycle Implication Next Cycle Implication Assertion Overlapping Functions
Education SystemVerilog Verification
SystemVerilog Sequence, Sequence Implication, and Usage
· loading · loading
Kerim Turak
Education SystemVerilog Verification SystemVerilog Assertion Verification Sequence Sequence Implication Overlapping Non-Overlapping Conditional Property Never Property $Rose $Fell Disable Iff
Education SystemVerilog Verification