I have declared associative array of class, but i am not sure how to assign class handles to it and then retrieve the corresponding print method. can any one help?
module tb;
class A;
int aa;
function new();
aa=10;
endfunction
function void printA();
$display ("aa value from A sequence = %d",aa);
endfunction
endclass
class B extends A;
int bb;
function new();
bb=20;
endfunction
function void printB();
$display ("bb value from B sequence = %d",bb);
endfunction
endclass
class C extends B;
int cc;
function new();
cc=30;
endfunction
function void printc();
$display ("cc value from C sequence = %d",cc);
endfunction
endclass
typedef A a;
a a_lib[string];
A a_seq;
B b_seq;
C c_seq;
string sel;
initial begin
a_seq = new();
b_seq = new();
c_seq =new();
// a_lib = '{1:"a_seq",2:"b_seq",3:"c_seq"};
// sel = a_lib.find(index==1);
// aa_seq.printC();
// $display ("Retreived seq is %p",a_lib);
// how do i assign class handles to associative array
// Then retrieve it and then print the method?
end
endmodule