# Soring a fixed array

**URL:** <https://verificationacademy.com/forums/t/soring-a-fixed-array/32454>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, array-methods\
**Created:** [October 24, 2016, 7:15am UTC](https://verificationacademy.com/forums/t/soring-a-fixed-array/32454 "2016-10-24T07:15:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iec2013045](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/i/ea666f/32.png) [@iec2013045](https://verificationacademy.com/forums/u/iec2013045)\
**Post date:** [October 24, 2016, 7:15am UTC](https://verificationacademy.com/forums/t/soring-a-fixed-array/32454/1 "2016-10-24T07:15:31Z")

</div>

Why array methods are not working on fixed arrays?

int array[5] = '{10,1,2,3,4};

initial begin  
array.sort();  
$display(“sorted fixed”,array);  
end

---

<div class="post-metadata">

**Author:** ![cgales](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/c/ccd318/32.png) [@cgales](https://verificationacademy.com/forums/u/cgales)\
**Post date:** [October 24, 2016, 12:49pm UTC](https://verificationacademy.com/forums/t/soring-a-fixed-array/32454/2 "2016-10-24T12:49:13Z")

</div>

_In reply to [rakesh reddy](https://verificationacademy.com/forums/t/soring-a-fixed-array/32454):_

Works fine in Questasim:

```verilog

module test;

int array[5] = '{10,1,2,3,4};

initial begin
array.sort();
$display("sorted fixed: %d %d %d %d %d", array[0], array[1], array[2], array[3], array[4]);
end

endmodule

```

# Loading sv\_std.std

# Loading work.test(fast)

# run -all

# sorted fixed: 1 2 3 4 10

# quit -f

# End time: 08:47:00 on Oct 24,2016, Elapsed time: 0:00:01

# Errors: 0, Warnings: 0

Sounds like a tool error that you will need to take up with your vendor support team.
