Module 5: Observation and Checking | Lesson 43

TLM Basics

Learn how UVM components communicate using transactions instead of direct signal connections, creating verification environments that are easier to connect, reuse, and debug.

Learning objectives

  • Explain what transaction-level modeling (TLM) means in UVM.
  • Understand why UVM components communicate using transactions instead of raw DUT signals.
  • Distinguish between TLM producers, consumers, ports, exports, and implementations.
  • Trace an observed transaction from a monitor to a checking component.
  • Recognize the difference between blocking and non-blocking TLM communication.
  • Debug common TLM connection and transaction-flow problems.

Step 1: What is TLM?

TLM stands for Transaction-Level Modeling. Instead of connecting verification components directly to individual DUT signals, UVM components communicate using higher-level transaction objects.

For example, the DUT interface may contain signals such as:

valid


ready
write
addr
data

A monitor converts those signals into a meaningful transaction such as:

WRITE


address = 8'h20
data    = 8'hAA

The monitor can then send that transaction to another UVM component without the receiving component needing to know how the DUT's pins work.

Core idea: Pins carry signal activity. TLM carries transactions.

This creates a useful separation:

  • The monitor understands the interface protocol.
  • The transaction represents what happened.
  • The scoreboard or coverage component works with the transaction.

The checker does not need to know whether the transaction came from a valid/ready handshake, a multi-cycle protocol, or some other interface mechanism.

Step 2: Why use TLM?

Imagine connecting a scoreboard directly to every signal in a DUT interface. The scoreboard would need to understand clocks, handshakes, signal timing, and protocol rules.

That creates unnecessary coupling.

With TLM, the architecture becomes:

DUT signals
 |
 v


Monitor
|
| transaction
v
Scoreboard

The monitor handles signal-level details. The scoreboard handles checking.

This separation makes components easier to:

  • reuse with another test,
  • connect to different consumers,
  • test independently,
  • replace without changing unrelated components,
  • debug when transaction flow stops.
Verification principle: communicate at the highest useful abstraction level. The scoreboard usually cares about transactions, not individual DUT pins.

Step 3: Think in terms of producer and consumer

A simple TLM connection has two sides.

Role Typical component Responsibility
Producer Monitor Creates or publishes transactions
Consumer Scoreboard / subscriber Receives and processes transactions
Communication mechanism TLM interface Defines how transactions move between components

UVM provides several TLM mechanisms for different communication patterns. You do not need to memorize every TLM class yet.

For beginner environments, the most important idea is:

Producer


|
| transaction
v
TLM connection
|
v
Consumer

Later lessons will specialize this idea. Lesson 44 will focus specifically on analysis ports, which are especially useful for broadcasting monitor observations to scoreboards and coverage components.

Step 4: Understand ports, exports, and implementations

UVM uses different TLM objects to describe the communication relationship between components.

Port

A port is used by a component that wants to communicate through a TLM interface.

For example, a monitor can publish transactions through an analysis port:

uvm_analysis_port #(bus_transaction) analysis_port;

Export

An export forwards a TLM interface from one component to another. This is useful when a parent component wants to expose or route communication through its hierarchy.

Implementation

An implementation, often represented by a UVM uvm_*_imp class, provides the actual method that handles the transaction.

For example, a component receiving an analysis transaction can implement:

function void write(bus_transaction t);
`uvm_info("CHECK",
    $sformatf("Received:\n%s", t.sprint()),
    UVM_MEDIUM)


endfunction

The important beginner mental model is:

Port     = I want to communicate


Export   = I forward this interface
Imp      = I implement the receiving behavior

Different TLM interfaces use different method names and communication semantics, so always check the specific UVM TLM type you are using.

Step 5: Follow a monitor transaction

Suppose the monitor detects a valid bus transfer.

It reconstructs the transaction:

bus_transaction observed;


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

observed.write = vif.write;
observed.addr  = vif.addr;
observed.data  = vif.data;

The monitor then publishes it:

analysis_port.write(observed);

The transaction is now available to the connected TLM consumer.

The important point is that the scoreboard receives an object representing the operation rather than directly sampling:

vif.valid


vif.ready
vif.addr
vif.data

The monitor has already translated those signals into a transaction.

Remember Lesson 42: the monitor must first determine the correct protocol sampling point. TLM begins after the monitor has correctly reconstructed the transaction.

Step 6: Blocking versus non-blocking communication

Not every TLM communication mechanism behaves the same way.

At a high level, TLM operations can be thought of as either blocking or non-blocking.

Style Basic idea Typical use
Blocking The caller may wait until the operation can complete. Request/response or FIFO-style communication
Non-blocking The caller attempts an operation without waiting indefinitely. Communication where immediate availability matters

For example, FIFO-based TLM commonly uses operations such as:

put()


get()
peek()

A blocking get() can wait until an item is available. A non-blocking operation can instead report whether an item was immediately available.

You do not need to memorize every TLM interface at this stage. First understand the architectural question:

Ask: Does this communication represent a published observation, a request, a response, or a stream of transactions that may need buffering?

That answer helps determine which TLM mechanism is appropriate.

Step 7: TLM versus signal-level communication

Consider the difference between these two architectures.

Signal-level coupling

Scoreboard


|
+-- valid
+-- ready
+-- addr
+-- data
+-- clock
+-- reset

The scoreboard must understand the interface protocol.

Transaction-level communication

DUT interface
  |
  v


Monitor
|
| bus_transaction
v
Scoreboard

The monitor understands the interface. The scoreboard understands the transaction.

This is one of the major architectural benefits of UVM: each component can focus on a clear responsibility.

Step 8: TLM does not replace the monitor

A common beginner misunderstanding is that TLM somehow observes the DUT directly.

It does not.

The physical DUT interface is still sampled by a monitor through a virtual interface:

DUT pins


|
v
virtual interface
|
v
Monitor
|
v
Transaction
|
v
TLM
|
+----> Scoreboard
|
+----> Coverage
|
+----> Subscriber

The monitor remains responsible for converting signal activity into meaningful transactions.

TLM begins at the communication boundary between UVM components.

Step 9: A small monitor-to-consumer example

Here is the basic architecture in code.

class bus_monitor extends uvm_monitor;

`uvm_component_utils(bus_monitor)

virtual bus_if vif;

uvm_analysis_port #(bus_transaction)
    analysis_port;

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

    analysis_port =
        new("analysis_port", this);
endfunction

task run_phase(uvm_phase phase);

    bus_transaction observed;

    forever begin

        @(posedge vif.clk);

        if (vif.reset)
            continue;

        if (vif.valid && vif.ready) begin

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

            observed.write = vif.write;
            observed.addr  = vif.addr;
            observed.data  = vif.data;

            analysis_port.write(observed);

        end

    end

endtask


endclass

The monitor performs three separate jobs:

  1. Observe: sample the interface at the correct protocol event.
  2. Reconstruct: create a meaningful transaction object.
  3. Publish: send the transaction through TLM.

The consumer can then process the transaction without knowing anything about the interface pins.

Step 10: TLM connections belong in connect_phase

Remember the phase ordering from Lessons 21–26.

Components are created during build_phase(). TLM connections are normally established during connect_phase().

The environment therefore follows this pattern:

build_phase()
|
+-- create monitor
+-- create scoreboard
|
v


connect_phase()
|
+-- connect TLM interfaces
|
v
run_phase()
|
+-- monitor observes
+-- transactions flow
+-- scoreboard checks

Keeping creation and connection in their appropriate phases makes the environment easier to understand and debug.

Step 11: Debugging TLM flow

When a scoreboard receives no transactions, do not immediately assume the scoreboard is broken.

Trace the complete path:

1. Did the sequence create stimulus?


2. Did the driver receive the item?
3. Did the driver create valid DUT activity?
4. Did the DUT perform the transfer?
5. Did the monitor detect the transfer?
6. Did the monitor create a transaction?
7. Did the monitor publish it?
8. Is the TLM connection correct?
9. Did the consumer receive it?

This creates a powerful debugging rule:

Debug the producer before blaming the consumer. If the monitor never publishes a transaction, no TLM connection can deliver one.

Add temporary messages at the communication boundaries:

`uvm_info("MON",
$sformatf("Publishing:\n%s",
          observed.sprint()),
UVM_MEDIUM)


`uvm_info("CHECK",
$sformatf("Received:\n%s",
t.sprint()),
UVM_MEDIUM)

If the first message appears but the second does not, investigate the TLM connection.

If neither appears, investigate monitor sampling and DUT activity first.

Common mistakes

  • Connecting components directly to DUT signals: this creates unnecessary coupling when a transaction abstraction is sufficient.
  • Publishing before a transaction is complete: consumers may receive incomplete information.
  • Creating a new transaction too late: avoid accidentally reusing or overwriting an object that a consumer still needs.
  • Forgetting the TLM connection: a valid producer and consumer still need to be connected.
  • Using the wrong TLM type: different TLM interfaces have different semantics and method sets.
  • Putting checking inside the monitor: keep observation and checking separate whenever practical.
  • Debugging only the scoreboard: trace the transaction from its source.
  • Confusing TLM with the DUT handshake: TLM communication between UVM components is separate from valid/ready or other DUT protocol handshakes.

A useful architecture to remember

                    UVM TEST
                   |
                   v
                SEQUENCE
                   |
                   v
               SEQUENCER
                   |
                   v
                DRIVER
                   |
                   v
                  DUT
                   |
             DUT interface
                   |
                   v
                MONITOR
                   |
                   | bus_transaction
                   v
              TLM connection
                   |
          +--------+--------+
          |                 |
          v                 v
     SCOREBOARD          COVERAGE
      / CHECKER           MODEL

Each layer has a different responsibility:

Layer Main question
Sequence What scenario should I generate?
Driver How do I turn that transaction into legal DUT activity?
Monitor What actually happened on the interface?
TLM How should that transaction move between UVM components?
Scoreboard Was the observed behavior correct?
Coverage What behavior have I exercised?

Practical debugging workflow

When learning TLM, use this order:

  1. Confirm the DUT actually performs a transfer.
  2. Confirm the monitor detects the correct protocol event.
  3. Confirm the monitor creates the expected transaction.
  4. Confirm the transaction is published.
  5. Confirm the TLM connection exists.
  6. Confirm the consumer receives the transaction.
  7. Only then debug the checking or coverage logic.

This prevents a common debugging trap: changing the consumer when the real problem is that the producer never sent anything.

Try it yourself

Build a small transaction flow with one monitor and one consumer.

  1. Create a bus_transaction containing write, addr, and data.
  2. Create an analysis port in the monitor.
  3. Detect a valid/ready transfer in the monitor.
  4. Create and populate an observed transaction.
  5. Publish it through the analysis port.
  6. Create a simple consumer that prints the received transaction.
  7. Run three transfers and verify that all three transactions reach the consumer.

Debug challenge: intentionally remove the TLM connection. What evidence do you see? Then restore the connection and confirm that the transactions arrive.

Key takeaways

  • TLM means transaction-level communication between UVM components.
  • Pins carry signal activity; TLM carries higher-level transaction objects.
  • A monitor translates interface activity into transactions before publishing them.
  • TLM helps separate protocol knowledge from checking and coverage logic.
  • Ports, exports, and implementations describe different sides of UVM communication.
  • Blocking and non-blocking TLM mechanisms serve different communication patterns.
  • TLM connections are normally established during connect_phase().
  • When debugging missing transactions, trace the complete producer-to-consumer path.
  • Lesson 44 will build directly on this foundation by focusing on UVM analysis ports.

Core mental model

Observe → Reconstruct → Publish → Consume.
The monitor understands signals. The transaction represents meaning. TLM moves that meaning between UVM components.