How to call the elements of a queue which in one class from some other class?
Actually I am generating randomized values in a class and passing those values to another class and storing them in a queue.I want to access those values in the queue from another class and drive them.
how to do this by using task /function?
This is best done by wrapping the queue in a class and sharing a handle to class object from both the generator and driver classes. This is typically called the Producer/Consumer pattern.
Many people use the SystemVerilog mailbox class for this. Search for examples.