Module 3: Phases and Transactions | Lesson 25

Report and Final Phases

Learn how UVM collects verification results, performs final checks, reports the outcome, and cleanly completes a simulation.

Learning objectives

  • Explain what happens after run_phase() completes.
  • Understand the purpose of extract_phase().
  • Understand the purpose of check_phase().
  • Use report_phase() to summarize verification results.
  • Understand the role of final_phase().
  • Distinguish verification checking from final reporting.
  • Track errors and pass/fail information across a UVM component.
  • Recognize common mistakes in result collection and reporting.

Step 1: What happens after run_phase?

In Lesson 24, you learned how run_phase() performs time-consuming simulation activity.

But finishing stimulus does not automatically mean that verification is complete.

After the run-time activity ends, UVM moves through additional phases that allow the testbench to collect results, perform final checks, report the outcome, and clean up.

A simplified lifecycle is:

build


|
v
connect
|
v
end_of_elaboration
|
v
run
|
v
extract
|
v
check
|
v
report
|
v
final
Key idea: Running the test generates evidence. The later phases turn that evidence into a verification result.

Step 2: The post-run verification lifecycle

It is useful to think about the phases after run_phase() as a pipeline:

RUN


Collect evidence.

EXTRACT
Collect or organize final data.

CHECK
Decide whether verification requirements were satisfied.

REPORT
Communicate the final result.

FINAL
Perform last cleanup or end-of-simulation actions.

These responsibilities are related, but they are not identical.

For example, a scoreboard might count mismatches during simulation. At the end of simulation, the testbench can use check_phase() to determine whether those mismatches mean the test failed.

Step 3: What is extract_phase()?

extract_phase() is a function phase used to extract or collect information from components after simulation activity has completed.

For example, a scoreboard might maintain counters:

int total_checked;


int total_errors;

During simulation, those values can be updated:

function void write(bus_transaction txn);


total_checked++;

if (!matches_expected(txn)) begin
total_errors++;
end

endfunction

Later, the component can use extract_phase() to organize final information:

function void extract_phase(uvm_phase phase);


super.extract_phase(phase);

`uvm_info("SCOREBOARD",
$sformatf("Checked=%0d Errors=%0d",
total_checked,
total_errors),
UVM_LOW)
endfunction

For beginner environments, you may not need to override extract_phase() at all. The important concept is understanding where post-run data can be gathered.

Step 4: What is check_phase()?

check_phase() is where a component can perform final verification checks after the simulation activity has completed.

Suppose a scoreboard counted mismatches:

int total_errors;

The scoreboard can perform a final check:

function void check_phase(uvm_phase phase);


super.check_phase(phase);

if (total_errors != 0) begin
`uvm_error("SCOREBOARD",
$sformatf("%0d errors detected",
total_errors))
end
endfunction

The important distinction is:

run_phase()
|
| observe and collect behavior
v


check_phase()
|
| decide whether final conditions are acceptable
v
report_phase()
|
| communicate the result
Verification mindset: Do not confuse "I observed something" with "the test passed." Observation produces evidence; checking determines correctness.

Step 5: A scoreboard with final checking

Here is a simplified scoreboard that counts transactions and errors.

class bus_scoreboard extends uvm_scoreboard;


int total_checked;
int total_errors;

`uvm_component_utils(bus_scoreboard)

function new(string name = "bus_scoreboard",
uvm_component parent = null);
super.new(name, parent);
endfunction

function void write(bus_transaction txn);


total_checked++;

if (!matches_expected(txn)) begin
  total_errors++;

  `uvm_error("SCOREBOARD",
             "Transaction mismatch")
end


endfunction

function void check_phase(uvm_phase phase);
super.check_phase(phase);


if (total_errors == 0) begin
  `uvm_info("SCOREBOARD",
            "No scoreboard errors detected",
            UVM_LOW)
end
else begin
  `uvm_error("SCOREBOARD",
             $sformatf("%0d scoreboard errors detected",
                       total_errors))
end


endfunction

endclass

The important architecture is:

monitor


|
| observed transaction
v
scoreboard.write()
|
| count/check during simulation
v
check_phase()
|
| final verification decision
v
report_phase()
|
| summarize result

Step 6: What is report_phase()?

report_phase() is used to communicate final verification information after checking has completed.

A component can provide a summary such as:

function void report_phase(uvm_phase phase);


super.report_phase(phase);

`uvm_info("SCOREBOARD",
$sformatf("Final result: checked=%0d errors=%0d",
total_checked,
total_errors),
UVM_LOW)
endfunction

The report phase should answer questions such as:

  • How many transactions were checked?
  • How many errors occurred?
  • Did the expected activity happen?
  • Did the test satisfy its verification requirements?

For larger environments, multiple components can contribute information to the final report.

Step 7: Report messages are verification evidence

UVM reporting is more than printing random debug messages.

Useful messages explain what happened and why it matters.

For example:

`uvm_info("TEST",
      "Starting FIFO verification",
      UVM_LOW)


`uvm_info("SCOREBOARD",
"Received expected transaction",
UVM_LOW)

`uvm_error("SCOREBOARD",
"Expected data did not match actual data")

Compare this with an unhelpful message:

$display("something happened");

A good verification message should help answer:

WHO?


What component reported it?

WHAT?
What happened?

WHY?
Why does it matter?

Detailed UVM reporting policies and report customization are covered later in Lesson 49.

Step 8: What is final_phase()?

final_phase() is the final UVM phase in the component lifecycle.

It can be used for last cleanup or final actions associated with the verification component.

A simple implementation is:

function void final_phase(uvm_phase phase);


super.final_phase(phase);

`uvm_info("TEST",
"Final phase reached",
UVM_LOW)
endfunction

For most beginner testbenches, you will not need much code in final_phase().

The important concept is that UVM provides a final lifecycle point after reporting.

Practical rule: Do not force cleanup code into final_phase() simply because the phase exists. Override a phase when your component has a real responsibility for that phase.

Step 9: Function phases vs task phases

The phases in this lesson are function phases.

Phase Type Typical purpose
extract_phase() Function Collect or organize final data.
check_phase() Function Perform final verification checks.
report_phase() Function Summarize and communicate results.
final_phase() Function Perform final lifecycle actions.

Therefore, these phases should not contain time-consuming operations such as:

#10ns;


@(posedge clk);

Time-consuming activity belongs in task-based run-time phases such as run_phase().

Step 10: A complete result lifecycle

Put the pieces together:

run_phase()
|
| generate stimulus
| observe DUT
| collect transactions
v


extract_phase()
|
| organize final data
v
check_phase()
|
| determine correctness
v
report_phase()
|
| summarize result
v
final_phase()
|
| final actions
v
simulation complete

This gives each phase a focused responsibility.

Simple mental model: Run the test → collect the evidence → check the evidence → report the result → finish cleanly.

Step 11: Common mistakes

Mistake 1: Declaring success just because the test ran

A test that reaches the end without crashing is not automatically a passing test.

For example:

Test completed.


No fatal errors.

This does not prove that the DUT behaved correctly.

You need meaningful checking evidence.

Mistake 2: Performing the final check too early

If the scoreboard checks its final error count before all expected transactions have arrived, the result may be incorrect.

Final checks belong after the run-time activity has completed.

Mistake 3: Using report_phase() as the scoreboard

report_phase() should summarize results, not replace the actual checking logic.

The comparison should happen during observation or in the appropriate checking phase.

Mistake 4: Putting simulation delays in report_phase()

Report phase is a function phase. It should not contain time-consuming operations.

Mistake 5: Printing a huge amount of information

More messages do not necessarily mean better verification.

Separate:

debug information
    from


verification results

Use report severity and verbosity appropriately.

Step 12: Pass and fail thinking

A professional verification environment should be able to answer a simple question:

Did the DUT satisfy the verification requirements?

That answer should be based on evidence.

For example:

Transactions generated: 100


Transactions observed:  100
Transactions checked:   100
Mismatches:                0

This is much more useful than:

Simulation finished.

The goal of UVM is not simply to automate stimulus. It is to create a structured process for producing trustworthy verification evidence.

Step 13: Debugging the end of a test

If a test appears to finish incorrectly, ask these questions in order:

  1. Did run_phase actually complete?
  2. Did all expected transactions reach the monitor?
  3. Did the scoreboard receive all expected transactions?
  4. Were mismatches counted correctly?
  5. Did check_phase execute?
  6. Did report_phase summarize the result?
  7. Did final_phase execute?

A useful temporary trace is:

`uvm_info("PHASE", "RUN completed",   UVM_LOW)


`uvm_info("PHASE", "CHECK completed", UVM_LOW)
`uvm_info("PHASE", "REPORT completed", UVM_LOW)
`uvm_info("PHASE", "FINAL completed",  UVM_LOW)

This can help determine exactly where the lifecycle is behaving differently from what you expect.

Step 14: The complete phase mental model

You have now learned the major responsibilities of the UVM lifecycle.

BUILD


What components should exist?

CONNECT
How should they communicate?

END OF ELABORATION
Does the final topology look correct?

RUN
What happens during simulation?

EXTRACT
What final data do we need?

CHECK
Did the DUT satisfy our requirements?

REPORT
What was the verification result?

FINAL
What final actions are required?

This is the foundation you will use throughout the rest of UVM.

Architectural rule: Give each phase a clear responsibility. Do not use a phase simply because it exists.

Try it yourself

Create a small scoreboard that keeps track of:

total_checked


total_errors

Then implement:

  1. write() to update the counters.
  2. check_phase() to determine whether errors occurred.
  3. report_phase() to print a final summary.
  4. final_phase() to print a final lifecycle message.

Your final report should look conceptually like:

========================================


# UVM VERIFICATION SUMMARY

Transactions checked : 100
Errors detected      : 0
Result               : PASS
========================================

Challenge: Modify the scoreboard so that one intentionally incorrect transaction produces a failing result. Verify that the final report clearly identifies the failure.

Thinking challenge: Explain why "no UVM errors were printed" is not always enough to prove that a test passed.

Key takeaways

  • run_phase() generates and observes simulation activity.
  • extract_phase() can collect or organize final verification data.
  • check_phase() performs final verification checks.
  • report_phase() summarizes and communicates verification results.
  • final_phase() provides a final lifecycle point for cleanup or other last actions.
  • These post-run phases are function phases and should not consume simulation time.
  • A completed simulation is not automatically a passing verification.
  • Verification results should be based on observable evidence and explicit checks.
  • Separate checking logic from reporting logic.
  • The complete mental model is: Create → Configure → Connect → Inspect → Run → Extract → Check → Report → Finalize.