Need of modport after having clocking block

Hello,
if we can declare directions(inputs and outputs) in clocking blocks then why do we need to write modport even after writing clocking blocks?
The clocking blocks alone should be sufficient, right?
(this question was asked in interview)

In reply to mritunjay_singh:

Modports are mostly required by synthesis tools when using interfaces. They are used to declare the direction of data flow through module ports, which many simulation tools ignore.

Clocking blocks are used by testbenches, but not widely. The “directions” indicate sampling and driving variables.

There is not always a one-to-one correspondence between clocking block directions and modport directions. And it is rare that both modports and clocking blocks are used in the same interface.

To add to Dave’s answer .

Via clocking block the TB samples and drives with respect to a clocking event relative to input and output skews
whereas via modport the DUT may drive / sample the modport signals either synchronously or asynchronously .

In reply to Have_A_Doubt:

This question was addressed before
https://verificationacademy.com/forums/systemverilog/assigning-interface-net-type-signals-class
Quote:
1800-2012 14.3 Clocking block declaration

  • A clockvar whose clocking_direction is inout shall behave as if it were two clockvars, one input and one output, having the same name and the same clocking_signal.
  • Reading the value of such an inout clockvar shall be equivalent to reading the corresponding input clockvar.
  • Writing to such an inout clockvar shall be equivalent to writing to the corresponding output clockvar.
    Code example provided,

Also, see
https://verificationacademy.com/forums/systemverilog/clocking-block-interface

In reply to ben@SystemVerilog.us:

Thanks Ben for the reference .

Since output clockvars which are net types can be assigned procedurally , it does help to drive them within a class .

This is an additional point which can be used to answer the question .

Thank you everyone, my doubt was cleared.