UVM:驱动程序和程序分配警告的非法组合

ngu*_*rie 3 system-verilog uvm

我的芯片中有一个小块的UVM测试平台.在这里有一个带有驱动程序的代理,可以在虚拟接口上驱动数据,如下所示:

interface my_if (input bit clk);

  logic [3:0] opcode;

  // Clocking block for the driver
  clocking drvClk @(posedge clk);
    output opcode;
  endclocking

  // Clocking block for the monitor      
  clocking monClk @(posedge clk);
    input opcode;
  endclocking

endinterface
Run Code Online (Sandbox Code Playgroud)

我在我的驱动程序中使用此接口,如下所示:

class my_driver extends uvm_driver #(my_tr);
  my_if vif;
  ...
  virtual task run_phase(uvm_phase phase);
    super.run_phase(phase);

    forever begin
      seq_item_port.get_next_item(req);

      // Drive the transaction onto the interface
      // and wait for next clock
      vif.opcode <= req.opcode;
      @(vif.drvClk);

      seq_item_port.item_done();
    end
  endtask
endclass
Run Code Online (Sandbox Code Playgroud)

据我所知,这是推荐的做事方式,效果很好.当我将此代理集成到更高级别的测试平台时,就会出现问题.在这种情况下,代理现在是被动的,并且不构建驱动程序.我将操作码值分配给接口,以便监视器可以观察它.这是我的顶级线束的片段:

module my_top();
  bit clk = 0;

  always #5 clk = !clk;

  // instantiate the interface
  my_if my_if_inst(.clk(clk));

  // instantiate my dut
  my_dut dut(...);

  // pull out the internal opcode signal and assign it
  // to the interface
  assign my_if_inst.opcode = dut.submodule.opcode;

  // Set the virtual interface inside the agent
  initial begin
    uvm_config_db#(virtual my_if)::set(uvm_root::get(),"uvm_test_top.tb.env.my_agent", "vif", my_if_inst);
  end 
endmodule
Run Code Online (Sandbox Code Playgroud)

当我在NC中运行时,我收到一个警告:

ncelab: *W,ICPAVW: Illegal combination of driver and procedural assignment to variable opcode detected (output clockvar found in clocking block)
Run Code Online (Sandbox Code Playgroud)

这是有道理的,因为接口将此信号定义为drvClk块的输出,并且我在顶层进行分配.我可以忽略这个警告(代码工作正常)但我宁愿以一种干净运行的方式对其进行编码.建议的方法是什么?我摆脱了驱动程序的计时块,但是我觉得如果我这样做,我会为竞争条件做好准备.

dav*_*_59 8

简单; wire在您的界面中进行操作码.

像对待双向信号一样对待操作码.请参阅我关于此主题的DVCon论文.