单个对象中可以有两个 'uvm_tlm_b_target_socket' 和两个对应的 'b_transport' 实现吗?

Can there be two 'uvm_tlm_b_target_socket' and two corresponding 'b_transport' implementation in a single object?

我有一个要求,我需要在 class 中有两个 uvm_tlm_b_target_socket,因为它将接收来自两个不同代理的交易。我需要以不同的方式处理从两个套接字接收到的数据,因此我无法单独实现 b_transport 任务。如果我们可以使用 uvm_analysis_imp_decl 宏允许我们对 write 函数进行不同的实现,那么目标套接字是否与分析端口的终止符等效?在 class 参考手册中我可以找到这个宏 uvm_blocking_transport_imp_decl 但找不到如何使用它的示例。总之,我正在尝试这样做

uvm_tlm_b_target_socket A;
umv_tlm_b_target_socket B;

// b_transport task implementation for socket "A"
task b_transport;

// b_transport task implementation for socket "B"
task b_transport;

除了经典的 TLM2 插座外,还有 *_transport_imps。据我所知,这些与套接字做同样的事情。您可以像使用 uvm_analysis_imp_decl:

一样使用 *_decl
class some_class;
  `uvm_blocking_transport_imp_decl(_a)
  `uvm_blocking_transport_imp_decl(_a)

  uvm_transport_imp_a A;
  umv_transport_imp_b B;

  task b_transport_a(...);
  task b_transport_b(...);
endclass

uvm_tlm_b_target_socket实例化时需要提供两个参数。

1) 基础 class 实施所在 - b_transport

2)另一个是数据项本身。

   uvm_tlm_b_target_socket #(receiver, data_item) A;

您的接收器 class 中只能有 1 个 transport_b 功能。 但是您可以使用包装器 class 将接收器中的其他功能 class 连接到其他目标套接字。

typedef class receiver; // name of the parent class processing the transport call.

class connect_transport ; // does not need to be a component but if you need it can - extends uvm_component;
receiver m_parent; // parent class 
   function new(string name = "receiver", receiver parent = null);
        m_parent = parent; // connect the parent class 
   endfunction
   task b_transport(data_item data, uvm_tlm_time delay);
        // transport_b for B.
        m_parent.b_transport_b(data,delay); // call the function in the parent class.
   endtask
endclass

在接收器中 class

class receiver  extends umm_component ; 
`uvm_component_utils(receiver)
    connect_transport    c1;

.....
   uvm_tlm_b_target_socket #(receiver, data_item) A; // connects to the local b_transport function 
   uvm_tlm_b_target_socket #(connect_transport, data_item) B; // connect to the wrapper class

  function new(string name = "receiver", uvm_component parent = null);
      super.new(name, parent);
      A = new("A", this);
      c1 = new ("c1",this); // create the connecting class 
      B = new("B", this,c1); // connect the target socket to the connecting class

  endfunction

  //for socket B
  task b_transport_b(data_item data, uvm_tlm_time delay);
  ......
  end task

  // will be connected to A socket.
  task b_transport(data_item data, uvm_tlm_time delay);
  ......
  end task 
endclass

您可以将其包装到一个宏中,并有一个 _imp_decl 类型的实现。 您也可以直接在 connect_transport.

中执行检查