TLM-1 Implementation
TLM-1 Implementation
2.3.1 Basics
● Transactions:
○ Represent a unit of communication between components.
○ Encapsulate data (e.g.,data,addr,kind), constraints,and
methods.
○ Can becomposed, decomposed, or extendedfor
higher-level or detailed models.
T
● LM Port: Defines methods (API) for communication.
● TLM Export: Supplies the implementation of the methods.
● Connection: Port connects to export, enabling modularityand
reuse.
1. put()Method:
○ Producer sends transactions to a consumer.
xample:
E
put_port.put(t); // Producer calls put
task put(simple_trans t); // Consumer implements put
2. get()Method:
TLM Concepts:
B
● locking: Operations likeput()andget()halt untilcompleted.
● Modularity: Components (producer/consumer) can bereplaced or
reused easily.
● Independent Implementation: Producer and consumeroperate
independently, connected by a well-defined interface.
xample:
E
if (get_port.try_get(t)) { // Do something with t }
● connect()method:
○ Used in theparent environmentto connect ports and
exports.
Example:
producer.blocking_put_port.connect(fifo.put_export);
get_consumer.get_port.connect(fifo.get_export);
P
● orts and exports are connected at thesame levelof hierarchy.
● Connections are defined in theparent's connect()method.
● H
ierarchical connections: Used for crossing boundariesin
complex designs.
ort-to-Port: Imports a port to the outer component.
P
Example:
c.put_port.connect(put_port); // Connection C
ort-to-Expo c omp1.port.connect(comp2.e P
P eer-to-peer
rt xport); connection.
xport-to-Ex export.connect(subcomponen E
E xport implementation
port t.export); upwards.
Key Notes
● U
sed todistribute collected transactions(e.g., forscoreboards,
coverage).
● A
llows amonitor to produce a transaction stream
independently of the number of connected components.
● uvm_analysis_port:
○ Specialized TLM port with a singlewrite()function.
○ Can connect tozero, one, or many analysis_exports.
○ If nothing is connected,write()simply returns.
○ Executes insame delta cycle, regardless of connections.
Example:
ap = new("analysis_port", this);
● C
onnected components must implementwrite()via
uvm_analysis_export.
// Perform operation
endfunction
endclass
Example:
g.ap.connect(s1.analysis_export);
Additional Features
● uvm_analysis_fifo:
○ Acts as a buffer withanalysis_export.
○ Ensureswrite()always succeeds immediately.
○ Downstream components process transactions at their
convenience.
Key Notes
**********************************************************************************