代码之家  ›  专栏  ›  技术社区  ›  Pulimon

在SystemVerilog中为接口内的接口指定modport

  •  3
  • Pulimon  · 技术社区  · 9 年前

    我有两个带modports的接口和另一个结合了这两个接口的接口,如下所示:

    interface my_interface1
     // Some signals
     modport tb_to_dut (
        // Signal directions specified
     )
    endinterface
    
    interface my_interface2
     // Some signals
     modport tb_to_dut (
        // Signal directions specified
     )
    endinterface
    
    interface my_combined_interface
      my_interface1 inf1
      my_interface2 inf2
    endinterface
    

    我想为组合接口指定一个modport,它反过来调用/使用各个接口的modport。想法如下所示。

    interface my_combined_interface
      my_interface1 inf1
      my_interface2 inf2
    
      modport tb_to_dut (
         inf1.tb_to_dut,
         inf2.tb_to_dut
      )
    endinterface
    

    这当前会导致语法错误。有没有一种方法可以让我在组合接口中指定modport,这样它就可以渗透到各个接口中?

    1 回复  |  直到 9 年前
        1
  •  3
  •   dave_59    9 年前

    很遗憾,SystemVerilog interface s缺乏合成特性,无法以片段形式指定接口。今天,唯一的方法是通过将较低级别的接口信号提升到最高级别来平坦组合接口。我会避免在测试台上使用modports。