You’re correct, drain time is the amount of time the simulation will still run after all objections have been dropped. A drain time is set to allow for the DUT to process the last piece of stimulus you sent it. The flow is like this:
- raise objection
- drive stimulus
- drop ojection
- wait for drain time
- stop
You set the drain time based on knowledge about the DUT. You should be able to know about how long it takes for a last packet/transaction/operation/etc. to finish, either from the specification or from talking to your designers.
You don’t need to start raising objections inside your monitor, you could just raise a big objection before you start your sequence (on the active agent) and drop it after.
P.S. Thanks for reading my blog! :)