Updating same dynamic array across different classes

There are multiple instances of a particular class and this class does some processing on an associative array. Now I want to make this array commonly visible by all the classes and want it to be processed in some of the class instances (not all class instances would want to work on same array).

How do I achieve this ?

one way to do this would be to declare the array as static array in the base class. so all the instances would work on the same array. But then it will be same across all the class instances.

In reply to AR:

Any data you want to pass around or share should be wrapped in a class instance. Then you decide who gets to share the class instance. This is what the uvm_pool class does for you.

In reply to dave_59:

Thanks Dave!

If I extend the base class and declare the previously present associative array as static element of the extended class then all the instances of that class will work on same array correct?

In reply to AR:

Correct.

In reply to dave_59:

Hi Dave,

Looks like we cant change declaration of a property in extended class. so making the array static in extended class might not work. Please let me know if I am missing something.

Thanks
Anuradha

In reply to AR:

Sorry, I misunderstood what you were trying to accomplish in your previous reply.

Going back to my original reply, you should not be using static variables at all. Wrap your associative array in a class

class pool #(type KEY, T); // This is uvm_pool
 T m_pool[KEY];
endclass

class particular;
  pool #(stringsnt) aa;
endclass


particular p1,p2,p3,p4;
initial begin
     p1 = new; p2 = new, p3 = new; p4 = new;
     p1.aa = new;
     p2.aa = p1.aal
     p3.aa = new;
     p4.aa = new;
end

Now, objects p1 and p2 share the same aa object, and p3 and p4 share another aa object.

In reply to dave_59:

Thank you so much Dave!

If I pass reference of these array to the constructor of every class , then also I can share the array across various classes and perform actions on its items from different classes right? Please correct me if my understanding is not correct.