System verilog UVM:驾驶员和程序分配警告的非法组合

System verilog UVM:驾驶员和程序分配警告的非法组合,system-verilog,uvm,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

我有一个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
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
我在我的驱动程序中使用此接口,如下所示:

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
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
当我在NC中运行此命令时,会收到一条警告:

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

这是有意义的,因为接口将此信号定义为drvClk块的输出,并且我正在顶层进行赋值。我可以忽略这个警告(代码运行得很好),但我更愿意以一种干净的方式编写它。推荐的方法是什么?我摆脱了车手的计时装置,这很管用,但如果我这么做的话,我想我正在为比赛条件做好准备。

简单;将操作码设置为界面中的导线


对待操作码就像对待双向信号一样。关于这个问题,请看我的报告。

好吧,这就成功了。我只是抄袭了所有使用“逻辑”的例子,从未质疑过。我假设,因为我在驱动程序中执行非阻塞任务,所以电线是不合法的。在我脑海里“谢谢,戴夫,这份文件很有意义。然而,我有一个问题,在复位条件下,通常驱动器写入驱动接口信号,而不是时钟块信号复位。如何处理驱动程序中的重置条件?我试图避免声明_reg,然后分配signal=signal_reg,是否有其他/更好的方法来实现这一点?(5分钟后无法编辑注释,因此需要一个新注释)对于重置时的常规测试用例,不需要异步驱动信号。您可能需要构建一个特殊的testcase来处理异步计时问题。令人惊讶的是,风投们在编译相同的代码时没有遇到任何问题,但Incisive做到了@戴夫的回答是准确的。不过,对于这一点,在Incisive中有一个覆盖,不知道为什么