Modports in interface

Hi,

Why do we need Modports in interface, when we can use inout in the signal declaration itself.

like:
interface if(
input clk
inout wire in_data;
inout wire out_data;
);

Thanks

In reply to Divya V:

Modports have nothing to do with timing - they are access lists. They determine which signals an interface port has access to from within the module they connect to.

Ports in the declaration of an interface are signals that may be shared among other interfaces. For example, you might put clk and reset in ports of the interface, but the data should not be in the port list. When there are multiple instances of the interface, each instance creates another set of internal data signals, but you would want the clocks tied together from a common source.

Then you declare modports that define which signals among the shared and internal signals.

I suggest only using modports for synthesizable code.