Module 2: TLM and Data Flow | Intermediate UVM

Transaction Recording

Make verification activity observable by recording meaningful transactions, timing, relationships, and protocol activity for efficient debug and analysis.

Learning objectives

  • Explain the purpose of transaction recording in a UVM verification environment.
  • Distinguish transaction recording from UVM reporting and waveform dumping.
  • Identify which transaction fields and timing information are useful to record.
  • Use UVM transaction recording APIs such as begin_tr() and end_tr().
  • Record transactions at meaningful architectural boundaries.
  • Understand how transaction recording can expose ordering, correlation, and latency problems.
  • Avoid excessive or misleading recording that makes debug harder or creates unnecessary overhead.
  • Design a recording strategy that remains useful across large regressions.

Step 1: Why record transactions?

A UVM environment processes a large amount of information during simulation: sequence items are generated, drivers send activity to the DUT, monitors observe interfaces, scoreboards correlate transactions, and responses return later.

During debug, the most important question is often not:

"What signal changed?"


but:

"Which transaction caused this behavior,
what happened to it,
and when did it complete?"

Transaction recording provides a higher-level view of simulation activity. Instead of reconstructing every operation from individual signal transitions, the engineer can inspect meaningful protocol transactions.

Sequence


|
v
Driver
|
v
DUT
|
v
Monitor
|
+--------------------+
|                    |
v                    v
Scoreboard          Transaction Recording
|
v
Debug / Analysis
Core idea: Record information that helps answer verification questions, not simply every object that happens to exist in the testbench.

Step 2: Recording is not the same as printing

A common beginner approach is:

`uvm_info("MON",


pkt.sprint(),
UVM_MEDIUM)

This is useful for textual debug, but it is not the same as transaction recording.

Mechanism Primary purpose Best for
UVM report Human-readable messages Errors, warnings, milestones, diagnostics
Transaction recording Structured transaction history Protocol-level debug and timing relationships
Waveform Signal-level activity RTL behavior and cycle-by-cycle debug
Coverage Measure scenario space Verification completeness

These mechanisms complement each other. Transaction recording should not be treated as a replacement for waveforms, reports, assertions, or coverage.

Step 3: Understand a transaction recording lifecycle

UVM transaction recording commonly follows a simple lifecycle:

begin transaction
   |
   v


transaction is active
|
|  fields / events / timing
v
end transaction
|
v
recorded transaction

A component can associate a transaction object with a recorded activity interval. A simplified example is:

int tr_handle;


tr_handle = begin_tr(pkt);

...

end_tr(tr_handle);

The exact recording output depends on the simulator and recording configuration. The important concept is that the recorded transaction has a defined beginning and end.

Step 4: Record at the correct architectural boundary

The same transaction may exist in several places in a verification environment. That does not mean every location should record it.

For protocol verification, a monitor is often a particularly valuable recording point because it represents activity actually observed on the DUT interface.

DUT interface
  |
  v


Monitor
|
+----> analysis_port
|
+----> transaction recording

Recording only the sequence item may tell you what the test intended to send. Recording the monitor transaction tells you what the interface actually observed.

Debug principle: Distinguish intent from observed behavior. A sequence item describes what the test attempted; a monitor transaction describes what the DUT interface actually did.

Step 5: Record meaningful transaction fields

A transaction recording is only as useful as the information it contains.

For a memory-mapped request, useful fields might include:

class bus_transaction extends uvm_sequence_item;


rand bit [31:0] address;
rand bit [31:0] data;
rand bit         write;
rand bit [7:0]   id;
rand bit [3:0]   byte_enable;

bit              error;

`uvm_object_utils(bus_transaction)

endclass

The recorded transaction should expose fields that help answer questions such as:

  • Which transaction was this?
  • Was it a read or write?
  • What address was accessed?
  • What data was transferred?
  • Which transaction ID was used?
  • Did the operation complete successfully?

Avoid recording redundant internal implementation details that do not help explain protocol behavior.

Step 6: Record timing information

Transaction recording becomes especially useful when timing relationships matter.

Consider the latency-aware checking from Lesson 19:

Request ID 27
start cycle = 100


Response ID 27
end cycle = 113

Latency = 13 cycles

If the request and response are recorded with meaningful timing information, a debug tool can make this relationship much easier to inspect.

REQUEST


ID=27
START=100
|
| 13 cycles
|
v
RESPONSE
ID=27
END=113

This is particularly valuable when debugging performance regressions or intermittent timing failures.

Step 7: Record monitor transactions

A monitor typically reconstructs a transaction from signal-level activity. Recording that reconstructed object creates a useful bridge between waveforms and transaction-level verification.

task run_phase(uvm_phase phase);


bus_transaction tr;

forever begin


collect_transaction(tr);

`uvm_info("MON",
  $sformatf(
    "Observed transaction ID=%0d",
    tr.id),
  UVM_HIGH)

ap.write(tr);


end

endtask

The analysis port distributes the transaction to subscribers such as scoreboards and coverage components. Transaction recording provides another observation path for debug.

                    +--> Scoreboard
                |


Monitor --> analysis_port
|
+--> Coverage
|
+--> Other subscribers
|
+--> Recording / debug

Step 8: Record a transaction with begin/end boundaries

A transaction can represent activity that lasts for multiple simulation cycles. In that case, the beginning and end of the recorded transaction should correspond to meaningful protocol events.

task collect_transaction();


bus_transaction tr;
int tr_handle;

tr = bus_transaction::type_id::create("tr");

wait_for_request_start();

tr_handle = begin_tr(tr);

capture_request_fields(tr);

wait_for_request_completion();

capture_response_fields(tr);

end_tr(tr_handle);

ap.write(tr);

endtask

The example is intentionally conceptual. The exact implementation depends on the protocol and on where the monitor determines that a transaction starts and completes.

Important: Do not use arbitrary loop boundaries as transaction boundaries. Recording should represent meaningful protocol activity.

Step 9: Understand recording configuration

UVM provides transaction recording infrastructure, but recording support and visibility also depend on simulator configuration and the selected recording backend.

Therefore, a testbench should not assume that calling a recording API automatically guarantees that a visible database or viewer will contain the expected information.

When recording appears to be missing, check:

  1. Whether transaction recording is enabled for the simulation.
  2. Whether the relevant components are configured to record transactions.
  3. Whether the simulator's recording backend is active.
  4. Whether the transaction actually begins and ends.
  5. Whether the recorded fields are implemented correctly.
  6. Whether the resulting recording database is being opened correctly by the debug tool.

This is a useful distinction: recording API correctness and recording infrastructure configuration are separate problems.

Step 10: Transaction recording and TLM data flow

The previous lessons established how transactions move through a verification environment.

Monitor


|
v
analysis_port
|
+----> analysis_fifo
|          |
|          v
|      Scoreboard
|
+----> Coverage
|
+----> Logger
|
+----> Recording

Recording should not change the transaction's functional path. It is primarily an observability mechanism.

Design rule: Keep recording from becoming a hidden dependency of checking. A scoreboard should still verify correctness when transaction recording is disabled.

Step 11: Recording helps debug ordering problems

Lesson 16 introduced transaction ordering. Recorded transactions can make ordering behavior immediately visible.

Recorded request stream:


T=100   ID=10
T=101   ID=11
T=102   ID=12

Recorded response stream:

T=108   ID=11
T=114   ID=12
T=119   ID=10

From the transaction view, it is immediately clear that the responses are out of order.

Whether this is a failure depends on the protocol contract established in earlier lessons.

Step 12: Recording helps debug correlation problems

Transaction correlation from Lesson 17 becomes much easier to debug when the correlation key is visible in the recorded transaction.

Request:


ID=42
address=0x1000

Response:
ID=42
data=0xABCD

If the response instead contains:

Response:


ID=41
data=0xABCD

The recording makes the mismatch immediately visible before deeper scoreboard debugging begins.

Step 13: Recording helps debug latency problems

Transaction recording can also expose the timing relationships discussed in Lesson 19.

Request


ID=7
cycle=500

Response
ID=7
cycle=526

Observed latency = 26 cycles
Maximum allowed  = 20 cycles 

The recording provides context around the latency violation: which transaction was involved, when it started, and when it completed.

This makes transaction recording particularly valuable when combined with scoreboard diagnostics and waveforms.

Step 14: Recording versus waveform debug

Transaction recording and waveforms answer different questions.

Question Best starting point
Which transaction failed? Transaction recording / scoreboard message
Which ID was involved? Transaction recording
What was the observed latency? Transaction recording / scoreboard
Which RTL signal caused the failure? Waveform
Was a handshake sampled correctly? Waveform + monitor transaction
What scenario was generated? Sequence/test information

A productive debug workflow often moves from high-level evidence toward lower-level detail:

Failure message
  |
  v


Recorded transaction
|
v
Scoreboard / correlation state
|
v
Waveform
|
v
RTL implementation

Step 15: Avoid recording everything

Recording every internal object can create large databases and make debug harder rather than easier.

Before recording a transaction, ask:

  • Will an engineer use this information during debug?
  • Does it represent meaningful protocol activity?
  • Does it help correlate related transactions?
  • Does it expose useful timing information?
  • Is the information duplicated elsewhere?

A small number of meaningful transaction streams are often more valuable than a huge amount of low-level recorded data.

Step 16: Make recording useful in regressions

Interactive debug is not the only use case. Transaction recording can support regression triage when a failure must be understood long after the simulation has completed.

Useful recorded information can include:

  • Transaction type.
  • Transaction ID.
  • Address and data.
  • Request/response relationship.
  • Start and completion time.
  • Status or error information.
  • Protocol channel information.

The goal is not to replace a complete waveform for every failure. The goal is to provide enough high-level context to quickly determine whether a waveform investigation is necessary.

Common mistakes

  • Confusing uvm_info() with transaction recording: A printed transaction is useful text, but it is not equivalent to a structured transaction recording stream.
  • Recording at the wrong boundary: Record meaningful protocol activity rather than arbitrary object lifetimes.
  • Recording only sequence intent: Always consider recording monitor-observed activity for protocol debug.
  • Omitting correlation fields: IDs, channel identifiers, and other matching fields are often essential for debugging concurrent traffic.
  • Omitting timing information: Without useful timestamps or transaction boundaries, latency problems become much harder to analyze.
  • Recording everything: Excessive recording increases storage and can obscure the important information.
  • Making checking depend on recording: Recording should support debug, not become a hidden functional dependency.
  • Ignoring simulator configuration: Recording APIs and recording viewers require appropriate simulator support and configuration.

Debugging strategy

When a scoreboard reports a transaction failure, use a layered debug approach.

  1. Read the UVM failure message.
  2. Identify the transaction ID and type.
  3. Inspect the recorded request and response.
  4. Check transaction ordering.
  5. Check correlation information.
  6. Check request-to-response latency.
  7. Only then move into signal-level waveform analysis if necessary.

For example:

UVM_ERROR [SB]


ID=17
expected_data=32'h12345678
actual_data=32'h12340000

Recorded request:
cycle=840
address=0x2000
ID=17

Recorded response:
cycle=856
ID=17

Latency=16 cycles

This immediately tells the engineer that correlation and latency may be correct, while the response data itself is incorrect. The next step can therefore focus on the DUT data path rather than the TLM architecture.

Connection to the next module

Lesson 20 completes the TLM and Data Flow module by turning the transaction infrastructure built in Lessons 11–19 into something that is observable and debuggable.

Lesson 11  -> TLM interfaces


Lesson 12  -> Analysis fanout
Lesson 13  -> Analysis FIFOs
Lesson 14  -> Blocking/nonblocking behavior
Lesson 15  -> TLM debugging
Lesson 16  -> Transaction ordering
Lesson 17  -> Transaction correlation
Lesson 18  -> Out-of-order responses
Lesson 19  -> Latency-aware checking
Lesson 20  -> Transaction recording

The next module moves from transaction flow into checking architecture: scoreboards, predictors, reference models, ordering strategies, and debug-friendly verification infrastructure.

Practice: Record a monitored transaction

Extend a simple protocol monitor so that it records each observed transaction. Include at least:

  • Transaction ID.
  • Address.
  • Read/write direction.
  • Data.
  • Transaction start.
  • Transaction completion.

Generate five transactions and verify that the recorded stream contains the same transactions observed by the scoreboard.

Then deliberately introduce an incorrect response and use the recorded transaction information to identify the failing ID.

Challenge: Combine recording with latency

Create three requests:

ID 10


ID 11
ID 12

Return the responses in this order:

ID 11


ID 12
ID 10

Give each response a different latency.

Your environment should:

  1. Record every request.
  2. Record every response.
  3. Preserve the transaction ID.
  4. Allow the scoreboard to correlate responses correctly.
  5. Calculate latency for each transaction.
  6. Report any latency violation.
  7. Make the request/response relationship visible during debug.

Advanced challenge: Add a second protocol channel where transaction IDs may be reused. Record both channel ID and transaction ID, and explain why recording only the transaction ID makes the debug information ambiguous.

Self-check

  1. What problem does transaction recording solve that a normal UVM report does not?
  2. Why is a monitor often a useful transaction-recording point?
  3. What is the purpose of begin_tr() and end_tr()?
  4. Why are transaction boundaries important?
  5. Which fields should be recorded for an out-of-order protocol?
  6. How can transaction recording help debug latency violations?
  7. Why should recording remain independent of scoreboard correctness?
  8. Why can recording too much information make debug less effective?
  9. How do transaction recording and waveform debugging complement each other?
Expected understanding: You should be able to design a recording strategy that captures meaningful protocol transactions, preserves correlation and timing information, and provides a useful bridge between high-level scoreboard failures and low-level waveform debug.

Key takeaways

  • Transaction recording provides structured visibility into protocol-level activity.
  • Recording is different from UVM reports, waveforms, and coverage; each serves a different purpose.
  • Record meaningful protocol transactions at well-defined architectural boundaries.
  • Monitor-observed transactions are particularly valuable because they represent what the DUT interface actually did.
  • Transaction IDs, channel information, status, and timing are often essential for debugging concurrent traffic.
  • begin_tr() and end_tr() can define meaningful transaction lifetimes for recording.
  • Transaction recording can make ordering, correlation, out-of-order completion, and latency problems easier to understand.
  • Recording should complement the scoreboard rather than become a dependency of functional checking.
  • More recorded data is not automatically better; prioritize information that accelerates debug.
  • A strong recording strategy helps engineers move efficiently from a high-level failure to the relevant waveform and RTL behavior.