My UVM understanding is a bit rusty and I am brushing up now to get back into a project.
In case of TLM, is it right to say that ports will always be a caller and export/imports will always be a callee.
To elaborate,
– the component that has a port, will always call the method get or put a transaction
– the component that has an import, will always be the callee of the get or put from the port
In reply to shatrish:
Yes, but it is the implementation or “imp” that is the callee.
In TLM, there are ports, exports, and imps. Ports initiate the request. Exports provide a handle to an implementation that responds to a request
Dave,
Thanks. I am trying to understand how the call called by the caller lands up in the implementer’s callee.
I will use the following snippet to explain my question:
class subscriber_comp extends uvm_subscriber #(seq_item);
seq_item req;
`uvm_component_utils(subscriber_comp)
function new(string name = "subscriber_comp", uvm_component parent = null);
super.new(name, parent);
endfunction
virtual function void write (seq_item t);
req = t;
`uvm_info(get_type_name(), $sformatf("Received value = %0h", req.value), UVM_NONE);
endfunction
endclass
The connection between the producer and the subscriber is done at the top module as follows:
pro.a_put.connect(subscr.analysis_export);
My question is, the caller (pro(ducer)) calls the write function as follows:
a_put.write(req);
As the put port is connected analysis_export in the subscriber, the write method inside the analysis_export or any of its derived classes will be called. In this case, how does the write land up in the class (which is the subscriber in this case) which is actually composing the analysis_import/export. I am trying to see which part in the UVM code does this trick.
In other words, the question because the producer here actually calls the connected TLM class’ method and not very clear how it ends up in subscriber’s write method.