Documente Academic
Documente Profesional
Documente Cultură
TLM put () & TLM get () methods are blocking in nature. In fact, during put () and get ()
method execution, there is a single process running which passes the control from the port to
the export & back again. So, in TLM terminology its called that TLM put () & TLM get ()
methods are blocking in nature.
Now there may be situations where Producers and Consumers both are expected to work
independently.In UVM, TLM provides a channel called uvm_tlm_fifo to facilitate this
feature. Using uvm_tlm_fifo, Producer can work in one process to create the transactions
while Consumer needs to operate on those transactions in another process.
uvm_tlm_fifo implements all the TLM interface methods, so Producer puts the transaction
into the TLM FIFO and Consumer independently extracts the transactions from the TLM
FIFO.
`include "uvm_macros.svh"
import uvm_pkg::*;
`uvm_object_utils(my_txn)
// Constructor
endclass: my_txn
/// Constructor
endclass: producer
/// Constructor
endclass: consumer
/// Constructor
// Connect function
endclass: env
module test;
env e;
initial
begin
e = new();
run_test();
end
endmodule: test
PUT:
Put () is one of the TLM method which can be used to communicate between a Producer& a
Consumer.
Port is the interface which calls put () method and export is the interface which provides the
implementation of put () method. That way, TLM communication is independent of the
Producer and Consumer abstraction level.
import uvm_pkg::*;
`include "uvm_macros.svh"
endclass: txn
endclass: producer
endtask: put
endclass: consumer
producer p1;
consumer c1;
endclass: env
module top;
env e;
initial
begin
e = new();
run_test();
end
endmodule: top
GET:
Get () method performs the same the put() does only difference is that get() pulls the transaction from
the Producer yet put() push the transaction to the Consumer.
`include "uvm_macros.svh"
import uvm_pkg::*;
endclass: my_txn
//// Constructor
endclass: producer
endclass: consumer
producer p1;
consumer c1;
endclass: env
module test;
initial
begin
e = new();
run_test();
end
endmodule: test
UVM_ANALYSIS_PORT:
`include "uvm_macros.svh"
import uvm_pkg::*;
`uvm_object_utils(my_txn)
// Constructor
endclass: my_txn
endclass: producer
endclass
producer p1;
subscriber s0,s1;
/// Constructor
// Connect function
endclass: env
module top;
env e;
initial
begin
e = new();
run_test();
end
endmodule
PORT_EXPORT:
This example illustrates basic TLM connectivity using the blocking put inteface.
port-to-port leaf1s out port is connected to its parents (comp1) out port
port-to-export comp1s out port is connected to comp2s in export
export-to-export comp2s in export is connected to its childs (subcomp2) in export
export-to-imp subcomp2s in export is connected leaf2s in imp port.
imp-to-implementationleaf2s in imp port is connected to its implementation, leaf2
import uvm_pkg:: *;
`include "uvm_macros.svh"
endclass
uvm_blocking_put_port#(Trans) out_l1;
endclass //leaf1
endclass //comp1
endclass //leaf2
leaf2 le2;
endclass //subcomp2
`uvm_component_utils(comp2)
subcomp2 subcomp;
endclass //comp2
comp1 comp1_i;
comp2 comp2_i;
endclass //environment
module tb();
env e = new("env");
initial
run_test();
endmodule