Array ordering

Hi,

I was reading array ordering methods, i found various answer in different tools can anyone explain please.

module array_orderring ();
int dyn[]=new[15];

initial
begin
for(int i=0;i<15;i++)
begin
dyn[i]=i;
end

dyn.reverse();//reverse the array
$display("%p\n",dyn);

dyn.sort() with (item < 10);//sort the array
$display("%p\n",dyn);

dyn.rsort() with (item <10);//reverse sort the array
$display("%p\n",dyn);

end

final $finish;
endmodule

Answer in various tool:
Cadence INSIVIVE:
'{14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
'{14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
'{9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, 10}
Aldec Riviera Pro:
'{14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
'{11, 10, 12, 14, 13, 3, 4, 2, 0, 1, 8, 9, 7, 5, 6}
'{8, 1, 0, 9, 6, 5, 7, 2, 3, 4, 10, 11, 12, 13, 14}
Synopsys VCS:
'{14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}
'{11, 12, 10, 14, 13, 3, 2, 4, 0, 1, 8, 7, 9, 5, 6}
'{1, 8, 4, 0, 5, 6, 7, 9, 3, 2, 12, 10, 11, 13, 14}

how can i understand this whether this array ordering with clause if different from different tool.

In reply to LOHIHTHA DM:

The ordering is correct for all tools. You are sorting based on the condition (item<10) which has a 1-bit result. That expression is 1’b1 for the first 5 numbers and 1’b0 for the rest. The ordering of array elements where the condition expression is the same is indeterminate.

It’s unclear what your intent is. Perhaps you need to break this up into multiple steps.