Functional coverage Sample method

Hi,
Can someone please clarify following questions. I would appreciate the help.

1.when to use sample method in Functional coverage ?
2.If we can collect coverage data through DUT interface why to use sample method ?
3.How does Functional coverage is hooked to Test bench ?
4.what are the different ways to collect data needed for functional coverage ?

Thanks
Praveen C

You may want to take a look at our Coverage Cookbook for some examples.

Functional coverage is very design dependent and any “activity” you want to make sure has happened as part of your test usually happens over many clock cycles. So rather than creating an additional signal for a covergroup event and the code to trigger it, you can simply call cg.sample(). Also, your testbench is usually written with a timing information abstracted away in the drivers and monitors. The activity you want to cover is encapsulated in a transaction that is sent out by a monitor. You might call the sample method after receiving one ore more transactions from different monitors, so there is no specific event to trigger the covergroup sample.