Randomization of multidimensional dynamic array with dependent-on-other properties

Assume that I have a class include three properties as follows:

rand bit [3:0] A [][];
rand byte num_src[];
rand byte num_users;

Size of num_src and first-dimensional size of A is num_users. Second-dimensional size of each A[i] is num_src[i]. All this means A is an irregular dynamic array with sizes dependent on num_src[i] values.

Here is my full code:

class test_class;

rand bit [3:0] A [][];
rand byte num_src[];
rand byte num_users;

constraint c_1 { num_users>3; num_users<5; }
constraint c_4 {num_src.size==num_users; 
                foreach (num_src[i]) num_src[i]==i+2;
constraint o2 {solve num_users before num_src; solve num_src before A; solve num_users before A;}
constraint c_3 {A.size==num_users;
                foreach (A[i,j]) A[i][j]==i+j;

function void pre_randomize;
    A = new[10];
    foreach (A[i]) A[i]=new[10];


module testtop();
test_class Ac;

initial begin
    Ac = new();
    if (!Ac.randomize()) $error("randomize fail"); else $display("A = %p, num_src = %p, num_users = %p",Ac.A,Ac.num_src, Ac.num_users);

/*reg [250*8-1:0] wave_file;
string LOG_DIR;
                            initial begin
                            if(!$value$plusargs("LOG_DIR=%0s",LOG_DIR)) begin
                            $display("Warning: Cannot get LOG_DIR");
                            $swrite(wave_file,"%0s/wave.shm", LOG_DIR);


When I compile the code assembling these, I got this error:
ncsim> run
if (!Ac.randomize()) $error(“randomize fail”); else $display(“A = %p, num_src = %p, num_users = %p”,Ac.A,Ac.num_src, Ac.num_users);
ncsim: *W,SVRNDF (…/sv/testtop.sv,32|20): The randomize method call failed.
Observed simulation time : 0 FS + 1
ncsim: *W,RNDOCS: These constraints contribute to the set of conflicting constraints:

            A[0].size()==num_src[0]; (../sv/testtop.sv,15)
            foreach (num_src[i]) num_src[i]==i+2; (../sv/testtop.sv,11)

ncsim: *W,RNDOCS: These variables contribute to the set of conflicting constraints:

rand variables:
num_src[4] […/sv/testtop.sv, 6]

I have no idea while there are conflicts so I appreciate help from anyone who knows this issue.

In reply to dqtblldvntd:

The code works just fine for me. Might want to contact your tool vendor. Note that your pre_randomize routine gets completely undone by constraint c_3’s A.size == num_users.