Implementation of Queue to mimic mailbox in SV testbench

In reply to kb646bits:

You have three unconnected gen2driv queues. The generator::new just copies the queue as it exists when the constructor get called, and is probably empty. Same problem with driver::new().

What you need to do is encapsulate the queue in a class mymailbox, construct it in your environment, and pass a handle to that class into your generator and driver. And while you are at it, add put/get methods to your mymailbox.

This is exactly how you would connect up the built-in mailbox class.