【问题标题】:Specifying modport for interface inside an interface in SystemVerilog在 SystemVerilog 中的接口内为接口指定 modport
【发布时间】:2016-05-25 18:47:40
【问题描述】:

我有两个带有 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,使其渗透到各个接口?

【问题讨论】:

    标签: interface system-verilog


    【解决方案1】:

    不幸的是,SystemVerilog interfaces 缺乏组合特性,并且无法分段指定接口。今天唯一能做到这一点的方法是通过将较低级别的接口信号提升到顶层来使组合接口变得平坦。而且我会避免将 modports 完全用于测试平台。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多