Hi,
can i assign a associative array to either dynamic array or queue/Fixed array?
Is vice versa is applicable?
For Example:
module top;
class A;
bit[3:0] q[$];
bit[3:0] aa[int];
endclass
initial begin
A A1;
A1 = new();
A1.q[0] = 5;
A1.q[1] = 10;
A1.q.push_back(15);
aa = q; /*-->Getting compilation error like "Incompatible complex type assignment Type of source expression is incompatible with type of target expression. Mismatching types cannot be used in assignments, initializations and instantiations. The type of the target is 'bit[3:0]$[int]', while the type of the source is 'bit[3:0]$[$]'.*/
A A1;
A1 = new();
A1.aa[0] = 5;
A1.aa[1] = 10;
A1.aa[5] = 15;
q = aa;/* --> [b]Getting compilation error like "Incompatible complex type assignment Type of source expression is incompatible with type of target expression. Mismatching types cannot be used in assignments, initializations and instantiations. The type of the target is 'bit[3:0]$[$]', while the type of the source is 'bit[3:0]$[int]'.*/
end
endmodule
May i know how to assign an assoc array to dynamic array or queue/Fixed array in above context.
Thanks and Regards,
koti