在SystemVerilog

时间:2016-05-25 18:47:40

标签: interface system-verilog

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

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 个答案:

答案 0 :(得分:3)

不幸的是,SystemVerilog interface缺乏构图质量,无法分段指定界面。今天实现这一目标的唯一方法是通过将较低级别的接口信号提升到最高级别来平滑组合接口。我会避免将modports完全用于测试平台。

相关问题