• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. SystemVerilog modport question

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 65
  • Views 17118
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SystemVerilog modport question

SCollins
SCollins over 13 years ago

Hi All,

I'm new to using interfaces and would like to implement an interface that connects a master module to 2 other identical slave modules. The interface simply contains a 2 bit data bus that is driven by the master. I would like the interface to split the bus such that one slave is driven by the LSB and the other slave is driven by the MSB of the bus.

I believe the easiest way of doing this is to use modports - a master modport and a different modport for each slave. The interface code would then look something like this (modports are on single lines for compactness):

interface data_bus_if

logic [1:0] data;

modport master (output data);

modport slave0 (input .data_bit(data[0]));

modport slave1 (input .data_bit(data[1]));

endinterface : data_bus_if

I'd imagine this scenario is quite common but Incisive doesn't appear to support modport expressions. How can I implement the interface so that it compiles with Incisive?

Many thanks!

  • Cancel
Parents
  • SCollins
    SCollins over 12 years ago

    Hi Steve,

    Thanks for responding, your workaround seems a good solution, however, I'm having problems elaborating my example design when I use a generate statement to create the slave sub-interface instances.

    My code for a slave is:

    module slave (slave_sub_if port);

    <slave code>

    endmodule 

    In my top level where I instantiate each slave, I've used the following code:

    slave slave_inst0 (.port data_bus_if_inst.slave_gen[0].slave_sub_if_inst);

    Incisive reports the following error during elaboration (highlighting the slave_sub_if_inst name):

    ncelab: *E,CUIOAI (...etc): Illegal interface port connection through a generate or array instance

    The block within my generate statement is named "slave_gen", which is the same as the block in your code.

    How should I specify the name of my sub-interface instance to ensure that my design elaborates?

    BTW, I should mention that my design elaborated when I simply instantiated 2 instances of my slave (without a generate statement).

    Thanks!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • SCollins
    SCollins over 12 years ago

    Hi Steve,

    Thanks for responding, your workaround seems a good solution, however, I'm having problems elaborating my example design when I use a generate statement to create the slave sub-interface instances.

    My code for a slave is:

    module slave (slave_sub_if port);

    <slave code>

    endmodule 

    In my top level where I instantiate each slave, I've used the following code:

    slave slave_inst0 (.port data_bus_if_inst.slave_gen[0].slave_sub_if_inst);

    Incisive reports the following error during elaboration (highlighting the slave_sub_if_inst name):

    ncelab: *E,CUIOAI (...etc): Illegal interface port connection through a generate or array instance

    The block within my generate statement is named "slave_gen", which is the same as the block in your code.

    How should I specify the name of my sub-interface instance to ensure that my design elaborates?

    BTW, I should mention that my design elaborated when I simply instantiated 2 instances of my slave (without a generate statement).

    Thanks!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information