3

I have two interfaces with modports and another interface which combines these two interfaces as shown below:

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

I wanted to specify a modport for the combined interface which in turn calls/uses the modport of the individual interfaces. The idea is as shown below.

interface my_combined_interface
  my_interface1 inf1
  my_interface2 inf2

  modport tb_to_dut (
     inf1.tb_to_dut,
     inf2.tb_to_dut
  )
endinterface

This currently results in a syntax error. Is there a way by which I can specify the modport in the combined interface such that it percolates down to the individual interfaces?

1 Answer 1

3

Unfortunately, SystemVerilog interfaces lack compositional qualities and there is no way to specify an interface in pieces. The only way to do this today is to flatten out the combined interface by bringing the lower level interface signals up to the top level. And I would avoid using modports altogether for the testbench.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.