【问题标题】:how to connect DV code embedded inside an RTL module to the testbench如何将嵌入在 RTL 模块中的 DV 代码连接到测试台
【发布时间】:2017-11-08 02:16:38
【问题描述】:

出于验证目的,我必须在 RTL 模块中嵌入 DV 代码。这个 RTL 模块有很多(1000 个)实例。如何通过测试使其在每个实例的基础上可控?测试台在 SystemVerilog UVM 中。我想远离 CDPI?

任何建议将不胜感激

-Hawki

【问题讨论】:

    标签: system-verilog


    【解决方案1】:

    您使用bind 构造将模块或接口插入到您的RTL 模块中。在这个绑定的模块中,您构建了一个类,其中包含与您的 RTL 模块交互的方法。类对象被设置到每个实例的 uvm_config_db 中。然后您的测试平台从 uvm_config_db 获取这些对象,您可以从测试平台调用这些对象方法。

    我写了一篇 DVCon 2012 论文The Missing Link: The Testbench to DUT Connection,其中包含一个完整的示例。

    【讨论】:

      【解决方案2】:

      正如 Dave 在他的回答中所描述的,bind 语句通常是最好的方法。

      虽然还有其他方法,但在某些情况下可能更方便。它们基于参数化模块。

      1) 带参数直接实例化

       module rtl #(bit dvflag = 0) ();
          ...
          if (dvflag)
             dv_module dv_instance(...);
          ...
      endmodule
      
      
      module dut;
         rtl  rtl1();
         rtl #(.dvflag(1)) rtl2();
         ...
      endmodule
      

      2) 使用 v2k 配置语句覆盖实例。

      module dut;
         rtl rtl1();
         rtl rtl2();
      endmodule
      ...
      
      config dv_cfg;
           instance dut.rtl2 use #(.dvflag(1));
           ...
       endocnfig
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-09-16
        • 1970-01-01
        • 2018-07-27
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多