# Is there any indication from mailbox get/put method?

**URL:** <https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, mailbox, layered-testbench\
**Created:** [August 22, 2019, 6:32am UTC](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439 "2019-08-22T06:32:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [August 22, 2019, 6:32am UTC](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/1 "2019-08-22T06:32:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [August 22, 2019, 7:11am UTC](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/2 "2019-08-22T07:11:56Z")

</div>

_In reply to [mitesh.patel](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439):_

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.

---

<div class="post-metadata">

**Author:** ![Have\_A\_Doubt](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Have\_A\_Doubt](https://verificationacademy.com/forums/u/Have_A_Doubt)\
**Post date:** [August 22, 2019, 12:09pm UTC](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/3 "2019-08-22T12:09:38Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/2):_

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 )

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [August 22, 2019, 12:30pm UTC](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/4 "2019-08-22T12:30:48Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/3):_

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?

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [August 22, 2019, 3:53pm UTC](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/5 "2019-08-22T15:53:58Z")

</div>

_In reply to [Have\_A\_Doubt](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/4):_

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](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/4):_

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.

---

<div class="post-metadata">

**Author:** ![mitesh.patel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@mitesh.patel](https://verificationacademy.com/forums/u/mitesh.patel)\
**Post date:** [August 23, 2019, 9:25am UTC](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/6 "2019-08-23T09:25:55Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/is-there-any-indication-from-mailbox-get-put-method/36439/5):_

Thanks dave. We’ll change driver code.

Thanks and Regards,  
Mitesh Patel
