As we discussed in previous chapter, In UVM (Universal Verification Methodology), communication between verification components is done using Transaction Level Modeling (TLM).
TLM-1 is a method-based transaction communication mechanism where data is exchanged using SystemVerilog class methods instead of signals.
- Data is passed as transactions (objects)
- Communication is point-to-point
- Methods can be blocking or non-blocking
TLM-1 Method Types Overview
UVM TLM-1 defines four major interface method types:
- put
- get
- peek
- transport
Each method serves a specific communication purpose. In addition to blocking methods like put(), get(), and peek(), UVM TLM-1 also provides non-blocking variants.
- try_put()
- can_put()
- try_get()
- can_get()
- try_peek()
- can_peek()
- Analysis: write
We will discuss about each methods in detail.
put() Method:
put() is used to send a transaction from a producer to a consumer.
- Producer pushes data
- Consumer receives and processes it
Blocking vs Non-Blocking
- Blocking: Producer waits until consumer accepts data
- Non-Blocking: Producer continues immediately (try_put)
// Blocking put
seq_item_port.put(req);
get() Method
get() is used by a consumer to pull a transaction from a producer.
- Consumer initiates the transfer
- Producer provides the data
item_collected_port.get(tr);
An example is Scoreboard pulling transactions from a FIFO or monitor.
peek() Method
peek() allows a component to look at a transaction without removing it.
- Transaction remains available
- No state change
item_collected_port.peek(tr);
It checks transaction content without consuming it
transport() Method
transport() is a two-way communication method that supports request–response behavior.
- Caller sends request
- Callee returns response
transport(req, rsp);
Modeling master-slave or request-response protocols.
TLM-1 Ports That Use These Methods
| Port Type | Method Used |
|---|---|
uvm_blocking_put_port | put() |
uvm_nonblocking_put_port | try_put() |
uvm_blocking_get_port | get() |
uvm_blocking_peek_port | peek() |
uvm_transport_port | transport() |
Now let’s discuss about non-blocking variants. These methods allow components to check availability and avoid simulation stalls.
Why Non-Blocking Methods Are Needed
Blocking methods:
- Pause execution until the transaction is accepted or available
- Can cause deadlocks if not used carefully
Non-blocking methods:
- Return immediately
- Give the user control over when and how to retry
Rule of thumb:
Use non-blocking methods when you don’t want your component to wait.
Blocking vs Non-Blocking Interfaces
Each method type has blocking and non-blocking variants:
| Method | Blocking | Non-Blocking |
|---|---|---|
| put | put() | try_put() |
| get | get() | try_get() |
| peek | peek() | try_peek() |
| transport | transport() | nb_transport() |
try_put()
Attempts to send a transaction without blocking.
- Returns
1→ transaction accepted - Returns
0→ transaction rejected
if (!put_port.try_put(tr))
$display("Receiver not ready");
can_put()
Checks whether the receiver can accept a transaction.
- Returns
1→ receiver is ready - Returns
0→ receiver is not ready
if (put_port.can_put())
// safe to send transaction
try_get()
Attempts to retrieve a transaction without blocking.
- Returns
1→ transaction received - Returns
0→ no transaction available
if (get_port.try_get(tr))
process(tr);
can_get()
Checks whether a transaction is available to be retrieved.
if (get_port.can_get())
// transaction is available
try_peek()
Looks at the transaction without consuming it and without blocking.
- Returns
1→ peek successful - Returns
0→ no transaction available
if (peek_port.try_peek(tr))
$display("Observed transaction");
can_peek()
Checks whether a transaction is available for peeking.
if (peek_port.can_peek())
// safe to peek
Peek methods do not remove the transaction from the source.
Analysis Port and write() Method
An analysis port is a special type of TLM port used for one-way, broadcast communication.
- One producer → multiple consumers
- No response expected
- Non-blocking by nature
Most common usage in UVM:
Monitor → Scoreboard / Coverage / Logger
The only method used by analysis ports is write().
analysis_port.write(tr);
TLM-1 vs Analysis Port (Quick Comparison)
| Feature | TLM-1 Port | Analysis Port |
|---|---|---|
| Communication | Point-to-point | Broadcast |
| Direction | Two-way / One-way | One-way |
| Blocking | Yes / No | No |
| Method | put/get/peek/transport | write() |
| Typical Use | Driver–Sequencer | Monitor–Scoreboard |