In reply to dave_59:
My apologies.
Here is the link to edaplayground - https://www.edaplayground.com/x/5mNA
Code is here-
module test;
class A;
rand int unsigned aa[int];
constraint c1 {
aa.size() == 10;
unique{aa};
foreach(aa[i]) {
aa[i] < 10;
}
}
function void disp();
$display("%p", aa);
endfunction
endclass
initial begin
A a;
a = new();
assert(a.randomize());
a.disp();
end
endmodule
Output with Synopsys tool-
'{0x0:'h5, 0x1:'h7, 0x2:'h8, 0x3:'h1, 0x4:'h6, 0x5:'h9, 0x6:'h2, 0x7:'h3, 0x8:'h4, 0x9:'h0}
Error with Cadence tool-
aa.size() == 10; (./testbench.sv,5)
ncsim: *E,ASRTST (./testbench.sv,18): (time 0 FS) Assertion test.unmblk1.__assert_1 has failed