Shared variable for master and slave

In reply to Er. Shipra:

Showing some code might be helpful. Can you use mailbox communication between the two? Or any port connection for OVM/UVM based TB.

Declare your mailbox of appropriate type in environment and pass its handle in both master and slave agents. Master may use blocking put or non-blocking try_put to keep the data into mailbox and slave might have get/try_get depending on the use case.