Interface vs module

Hi All,

While TB development, we can implement the same functionality in interface whatever we can implement in module. Even Interface can also be passed dynamically also.

then why do we need module or where should we use module/interface in testbench?

Please reply.

Thanks

A module is used to specify the functionality of the logic. For example if you are building a counter you would use a module to define the functionality (up behavior/down behavior/reset behavior) of the counter.

An interface as the name suggests is used to specify the interface behaviour. If your counter can be configured using an AHB interface, then you would specify the AHB behavior in the interface construct. An interface can be used as I/O for the module.

An interface is used to model the interactions of the testbench to the module.

Hope this hrlps

In reply to logie:

interfaces, by themselves, are not simulatable; you need a module for that.
Ben systemverilog.us

In reply to ben@SystemVerilog.us:

Hi ,
Could you please elaborate what is the meaning of it as we can see interface signals in waveform.

In reply to srbeeram:

You need a module instance to instantiate an interface instance. An interface instance cannot be a top-level instance.

In reply to dave_59:

Thanks Dave for providing clarifications.