Overriding queue with packed array, but why the queue is holding the elements in reverse order?

Hi,

I am trying to override queue with my packed array, but queue is holding the elements of packed array in reverse order.

In the below function i am trying to override adec_array, with packed array ‘row’, but adec_array is holding the elements in reverse order.

function int check_reserved_bits(logic[5:0] adec_array[$], input string array_type);
     
     //adec_array.reverse;         

endfunction

Calling check_reserved_bits from check_config

function int check_config();
   check_reserved_bits(row, "ROW");
endfunction

for eg:- The elements of row are row[0]=15, row[1]=16;
but adec_array is holding the values in adec_array[0]=16, adec_array[1] = 15 ?

Whether this is due to the last element of row will become the first elements of the adec_array.

Thanks
Kunal

In reply to Somu:
You have not shown enough information, like declarations for all variables involved. Please try to put your question in the form of a minimal complete example.