Is there any indication from mailbox get/put method?

Hi all,

I have one strange requirement to get indication when my driver calls get() method of mailbox.
Generally, in SV testbench generator and driver are communicated with common mailbox and mailbox is instantiated in agent or environment. Now, i want to add one component between generator and driver to fetch multiple packet items through it. So, I am planning to add one more mailbox in my component. my connection will be as follow:
Earlier

Driver mailbox → generator mailbox

Now,

Driver mailbox → component mailbox1 → component mailbox2 → generator mailbox

Now, when driver mailbox calls get method of component mailbox1, i want to fetch packets from mailbox2. so, is there any indication from mailbox, like when get is called? Is there any better way to add component between driver and generator in SV?

Thanks and Regards,
Mitesh Patel

In reply to mitesh.patel:

The uvm_tlm_fifo provides this functionality with a get_ap (analysis port). If you’re not using the UVM, you will have to wrap or extend the mailbox class and build a notification mechanism into the get() method.

In reply to dave_59:

Hi Dave ,
Is it legal to extend from predefined classes like mailbox and semaphore ?

Although I haven’t seen the same in the LRM anywhere ( might have missed out also )

In reply to dave_59:

Thanks dave. I am having SV environment so, uvm_tlm_fifo can’t be used.
Is there anyway to override get/put method of mailbox. As, i can not change my driver code. so, if get is virtual or some ways so that i can extend and override method?

In reply to Have_A_Doubt:

Section 15.2 explains that these can be used a base classes. Note that you cannot extend an untyped mailbox as this feature is an oddity not supported in the rest of SystemVerilog. It was leftover from another language that did not have parameterization.

In reply to mitesh.patel:

I also say that just because your testebnch is not based on UVM, doesn’t you can’t introduce pieces of it. But your bigger problem is not being able to change your driver code. get() is not virtual for the reason explained above. The only solution is changing your driver code.

In reply to dave_59:

Thanks dave. We’ll change driver code.

Thanks and Regards,
Mitesh Patel