This is the implementation result of the Insert Sort primitive with Max_sort_number=1024:
Important
The max sort number should be less than 1024 because the array partition can only support an array size smaller then 1024. For an arbitary sort number, the Merge Sort primitive is required Internals of Merge Sort.
Caution
The size of input stream should be larger than the max sort number, otherwise the internal shift register is not fully initialized.
This insertSort
primitive has one port for key input, one port for payload input, one port for key output, one port for payload output, and one boolean sign for indicating an ascending sort or descending sort.