Module 4: Coverage and Assertions | Intermediate UVM

Assertion and UVM Integration

Connect signal-level temporal checking with UVM diagnostics, transactions, and regression control without mixing their responsibilities.

Learning objectives

  • Explain how SVA and UVM complement each other in a production verification environment.
  • Distinguish assertion evaluation from UVM transaction-level checking and reporting.
  • Decide when an assertion should remain independent of UVM.
  • Integrate assertion-related diagnostics with UVM without moving temporal checking into a scoreboard.
  • Understand practical patterns for communicating assertion events to UVM.
  • Use UVM configuration to enable or disable optional assertion checking when appropriate.
  • Design assertion diagnostics that can be correlated with transactions, streams, resets, and simulation time.
  • Debug failures across the SVA, monitor, scoreboard, and DUT boundaries.

Step 1: Why integrate assertions with UVM?

Lessons 37 and 38 established two important ideas:

  • SVA is excellent for expressing temporal and protocol rules.
  • bind makes those assertions reusable without modifying the DUT source.

A production UVM environment adds another requirement: failures need useful context and must fit into the environment's debug and regression workflow.

For example, an assertion might detect that a response signal appeared without a valid request. The assertion can identify the exact clock cycle, but the engineer may also want:

  • the current transaction or protocol ID;
  • the UVM test and seed;
  • the relevant monitor transaction;
  • the scoreboard state;
  • the reset epoch;
  • the surrounding waveform activity.

UVM and SVA can provide complementary evidence without becoming the same mechanism.

Core principle: Let SVA check temporal signal relationships. Let UVM handle transactions, configuration, diagnostics, and environment-level coordination.

Step 2: Understand the two execution models

The first integration mistake is treating SVA as though it were a UVM component. It is not.

SVA UVM
Evaluates temporal properties Coordinates verification components
Samples signals at defined clocking events Processes transactions and phase activity
Expresses signal-level relationships Expresses environment-level behavior
Can be implemented in modules/checkers Uses classes and UVM components
Can be bound directly to DUT scopes Uses TLM, configuration, factory, and phases

Integration means connecting these two worlds where useful—not forcing one abstraction to perform the other's job.

Step 3: The simplest integration: keep the assertion independent

Many assertions do not need any UVM integration at all.

module ready_valid_checker (


input logic        clk,
input logic        rst_n,
input logic        valid,
input logic        ready,
input logic [31:0] data
);

assert property (
@(posedge clk)
disable iff (!rst_n)
valid && !ready |=> $stable(data)
)
else $error(
"READY_VALID: payload changed while transfer was stalled"
);

endmodule

This checker is already useful in a UVM simulation. The UVM test drives the DUT, the checker observes the DUT, and the simulator reports an assertion violation.

There is no reason to create a UVM component merely to route this failure through another reporting path if the simulator's assertion reporting already provides everything the project needs.

Good integration can mean no integration code. Keep a checker independent when its failure message, waveform location, and simulator reporting are sufficient.

Step 4: Add useful context to assertion failures

An assertion failure becomes much more useful when the message identifies the property and the time of failure.

assert property (


@(posedge clk)
disable iff (!rst_n)
req |=> ack
)
else $error(
"REQ_ACK: missing acknowledgement at time %0t",
$time
);

A checker can also report relevant sampled signal values:

assert property (


@(posedge clk)
disable iff (!rst_n)
valid && !ready |=> $stable(data)
)
else $error(
"READY_VALID: data changed while stalled: data=%0h time=%0t",
data,
$time
);

Keep these messages focused. A huge diagnostic dump inside every assertion can make regression logs harder to read.

Detailed transaction information can usually come from the UVM monitor and transaction recording rather than being reconstructed inside every assertion.

Step 5: Relate assertion failures to monitored transactions

A useful production workflow is to correlate two kinds of evidence:

Signal-level evidence
    |
    v
 SVA failure
    |
    +------+
           |
           v
    Waveform / time
           |
           v
   UVM monitor transaction
           |
           v
   Scoreboard / predictor
           |
           v
   Expected behavior

Suppose an assertion reports a protocol violation at time 1250ns. The monitor may have reconstructed a transaction around that same clock edge. The engineer can then determine whether:

  • the monitor interpreted the interface correctly;
  • the DUT accepted the transaction;
  • the scoreboard saw the same transaction;
  • the protocol violation occurred before or after transaction acceptance.

This is often more valuable than attempting to make the assertion itself understand every transaction detail.

Step 6: Do not put temporal checking into the scoreboard

A common temptation is to implement an assertion-like rule procedurally inside a scoreboard:

// Usually a poor abstraction for a cycle-level protocol rule


if (valid && !ready) begin
saved_data = data;
// Later manually check whether data changed...
end

This can become difficult when multiple transactions overlap, clocks interact, reset occurs, or several protocol rules must be tracked simultaneously.

If the requirement is naturally stated as:

"When condition A occurs on a clock edge, condition B must remain true or occur within a specified temporal relationship."

SVA is usually the clearer abstraction.

The scoreboard should remain focused on transaction-level questions such as:

actual transaction
   |
   v


correlate with expected
|
v
compare fields
|
v
pass / mismatch

Step 7: When does UVM need to receive an assertion event?

Sometimes an assertion failure needs to participate in higher-level verification logic. Examples include:

  • collecting assertion failures in a structured UVM component;
  • associating an assertion event with a verification stream;
  • maintaining project-specific failure statistics;
  • capturing additional context when a property fails;
  • coordinating specialized testbench behavior after a monitored protocol event.

This is a legitimate integration requirement, but it should be introduced deliberately.

Do not create a custom UVM communication mechanism simply because assertions exist.

Step 8: Use a small event bridge when structured communication is needed

One practical pattern is to have a SystemVerilog checker invoke a small callback or bridge when a property fails, with the UVM side responsible for higher-level handling.

The exact implementation depends on the project's simulator, coding conventions, and integration requirements. The architectural separation should remain:

                SVA
             |
      property violation
             |
             v
      assertion bridge
             |
             v
      UVM-side handling
             |
    +--------+---------+
    |                  |
    v                  v
UVM report        failure context

The important point is that the bridge carries an event or diagnostic; it should not turn the assertion into a transaction-level checker.

In many environments, a simpler approach is preferable: let the assertion report its own failure and let the UVM monitor provide transaction context independently.

Step 9: Use UVM reporting consistently

UVM reporting and assertion reporting have different origins, but the diagnostic philosophy should be consistent.

Mechanism Best use
uvm_info Detailed UVM diagnostics
uvm_warning Nonfatal noteworthy conditions
uvm_error Verification failures detected by UVM components
uvm_fatal Conditions where meaningful continuation is impossible
$error in an assertion action block Reporting an assertion property violation

Do not assume that every assertion failure must literally become a uvm_error. Simulator assertion reporting and UVM reporting are separate mechanisms and can be configured according to project requirements.

Important: Report severity and simulation termination are separate concerns. Whether a report stops simulation depends on the configured report action and environment policy.

Step 10: Add a UVM-side assertion configuration

Some environments need the ability to enable or disable optional assertion checking. This can be useful when a checker is expensive, under development, or only relevant to certain tests.

A simple UVM configuration object can carry the verification policy:

class assertion_config extends uvm_object;


`uvm_object_utils(assertion_config)

bit enable_protocol_checks = 1;

function new(string name = "assertion_config");
super.new(name);
endfunction
endclass

The important architectural distinction is that the UVM configuration does not rewrite an SVA property dynamically. The testbench can use configuration to control how the assertion infrastructure is instantiated, enabled, or handled according to the implementation.

For example, a top-level testbench may conditionally instantiate optional checker modules or configure checker-specific enable signals.

Step 11: Prefer explicit assertion enable signals when runtime control is required

A reusable checker can include an enable input:

module protocol_checker (


input logic clk,
input logic rst_n,
input logic enable_checks,
input logic valid,
input logic ready
);

assert property (
@(posedge clk)
disable iff (!rst_n || !enable_checks)
valid |-> ready
)
else $error(
"PROTOCOL: valid asserted without ready"
);

endmodule

The testbench can then control enable_checks through the chosen top-level integration mechanism.

This is generally clearer than attempting to manipulate assertion behavior indirectly through unrelated UVM objects.

Design rule: Keep the assertion's enable/disable semantics explicit. A reader should be able to determine from the checker when a property is active.

Step 12: Understand assertion failures during negative testing

Not every test that intentionally causes a DUT error should fail the regression.

For example, a negative test might intentionally send malformed protocol traffic to verify error handling. Whether an assertion should fire depends on what the assertion represents.

Ask:

  1. Is the malformed traffic legal according to the interface contract?
  2. Is the assertion checking legal protocol behavior or deliberately invalid stimulus?
  3. Should the test expect the assertion to fire?
  4. How will the regression distinguish an expected assertion from an unexpected one?

This is an important production-environment issue. Assertions are not automatically "wrong" in a negative test; their meaning depends on the property being checked and the test's intent.

Step 13: Keep assertion failures and transaction failures distinguishable

Consider a test that produces both:

1. READY/VALID assertion failure


2. Scoreboard data mismatch
3. Timeout

These may all originate from one DUT defect, or they may be unrelated. Do not automatically treat every later failure as an independent root cause.

A useful classification is:

Failure Likely layer
Payload changed while stalled Protocol / DUT interface
Expected response data mismatch DUT behavior or predictor/reference model
Unknown response ID Correlation / protocol / monitor
No response before deadline Timing / DUT / monitor / timeout policy

Lesson 30's debug strategy remains valuable here: find the earliest meaningful failure and trace the transaction through the environment before assuming that every subsequent error is independent.

Step 14: A practical integrated environment

A reusable intermediate UVM environment can combine all the mechanisms introduced so far:

                         +------------------+
                     |    UVM Test      |
                     +--------+---------+
                              |
                              v
                     +------------------+
                     | Virtual Sequence |
                     +--------+---------+
                              |
                              v
                       +-------------+
                       |   Driver    |
                       +------+------+ 
                              |
                              v
                          +-------+
                          |  DUT  |
                          +---+---+
                              |
             +----------------+----------------+
             |                                 |
             v                                 v
      +-------------+                  +----------------+
      | UVM Monitor |                  | Bound SVA      |
      +------+------+                  | Protocol Check |
             |                         +----------------+
             |
      +------+------+------+
      |             |      |
      v             v      v
  Predictor    Scoreboard Coverage
      |
      v


Reference Model

Assertion failure
|
v
Simulator / project reporting
|
+----> waveform
|
+----> UVM transaction context
|
+----> regression triage

This architecture keeps responsibilities separated while still providing a unified debugging workflow.

Step 15: Validate the integration in stages

  1. Validate the SVA by itself. Run legal and intentionally illegal signal traces.
  2. Validate the bind. Confirm the checker is attached to the intended DUT instance.
  3. Run the UVM environment. Confirm normal transactions still flow through monitor, predictor, scoreboard, and coverage.
  4. Create an assertion failure. Verify the failure is visible in the regression output.
  5. Correlate the failure with the monitor. Locate the corresponding transaction and clock edge.
  6. Check regression behavior. Confirm the project correctly classifies the assertion failure according to its configured policy.
Integration test: A complete test should demonstrate both sides: legal behavior produces no unexpected assertion failures, while a deliberate protocol violation produces a clear, reproducible assertion diagnostic.

Common mistakes

Debugging strategy

When an assertion failure appears in a UVM regression, follow the evidence across abstraction levels:

Assertion failure
  |
  v


Property name + clock edge
|
v
Sampled signal values
|
v
Waveform
|
v
UVM monitor transaction
|
v
Predictor / reference model
|
v
Scoreboard state
|
v
DUT behavior
|
v
Root cause

Ask these questions in order:

  1. Did the property trigger on the intended event?
  2. Was the sampling clock correct?
  3. Was reset or checker enable active?
  4. Does the waveform actually violate the specification?
  5. What transaction did the UVM monitor reconstruct at that time?
  6. Did the predictor and scoreboard see the same transaction boundary?
  7. Is the failure caused by the DUT, checker, monitor, or testbench?

Try it yourself

  1. Create a reusable ready/valid SVA checker with a payload-stability property.
  2. Bind it to a DUT interface.
  3. Drive legal traffic from a UVM sequence.
  4. Confirm that the monitor and scoreboard report the expected transaction.
  5. Intentionally violate the ready/valid protocol.
  6. Locate the assertion failure in the simulation log and waveform.
  7. Find the corresponding UVM transaction and explain the relationship between the two observations.

Challenge: Correlate a protocol failure with transaction data

Build a small environment where a bound assertion checks:

valid && !ready |=> $stable(data)

The UVM monitor records the same interface as transactions.

Create a test that:

  1. generates a valid transfer;
  2. stalls the interface;
  3. changes the payload illegally;
  4. causes the assertion to fail;
  5. identifies the corresponding monitor transaction in the waveform.

Then answer:

  • Did the assertion and monitor identify the same protocol event?
  • Was the monitor's transaction boundary aligned with the assertion's sampling boundary?
  • Would routing this assertion through UVM provide additional value?
  • What information should remain in the assertion message rather than being duplicated by UVM?

Advanced extension: Add an optional checker-enable mechanism and demonstrate that normal protocol checking can be disabled for a test where the property is intentionally not applicable.

Knowledge check

  1. Does a bound assertion need to be a UVM component?
    No. A bound checker can remain a SystemVerilog module or checker independent of UVM.
  2. When should an assertion remain independent?
    When its simulator reporting and waveform information already provide sufficient diagnostic value.
  3. Why should temporal protocol checking usually remain in SVA?
    SVA directly expresses clocked temporal relationships and avoids reproducing complex cycle-level state tracking procedurally in a scoreboard.
  4. What does UVM add?
    Transaction-level context, configuration, component coordination, reporting infrastructure, and regression-oriented organization.
  5. Should every assertion failure be converted into uvm_error?
    No. The appropriate reporting and regression policy depends on the project and the role of the assertion.
  6. Why correlate assertions with monitor transactions?
    To connect precise signal-level temporal evidence with transaction-level context useful for debugging.
  7. Can an assertion pass without proving that its scenario occurred?
    Yes. Implication properties can pass vacuously when their antecedent never occurs.

Key takeaways

  • SVA and UVM solve complementary verification problems and should not be collapsed into one abstraction.
  • Many bound assertions can remain completely independent of UVM.
  • Use UVM to provide transaction, configuration, reporting, and regression context when that adds real value.
  • Keep temporal signal checking in SVA rather than recreating it procedurally inside scoreboards.
  • Assertion failures become much more useful when they can be correlated with waveform and monitor transactions.
  • Negative tests require an explicit policy for whether an assertion violation is expected.
  • Assertion enable/disable behavior should be explicit and intentional.
  • Always validate both legal behavior and the intentional assertion-failure path.

What comes next?

The assertion workflow is now complete at the architecture level:

Lesson 37  Write SystemVerilog Assertions
 ↓


Lesson 38  Bind reusable assertion checkers
↓
Lesson 39  Integrate assertions with UVM
↓
Lesson 40  Debug assertion failures

The next lesson focuses entirely on failure investigation. Writing a correct assertion is only half the job; when a property fails in a large regression, you must determine whether the problem is the DUT, assertion, sampling boundary, reset behavior, testbench, or stimulus.

Lesson 40: Assertion Debugging will build a systematic debugging workflow around failed properties, waveform timing, antecedent/consequent evaluation, reset, vacuous success, overlapping assertion attempts, and the distinction between a faulty property and a real DUT violation.