Top K Sort is a sorting algorithm, which is used to calculate the maximum or the minimum K number of elements in the input stream. The algorithm is quite easy, and you can only get one data per clock due to the design requirements in L2 API. So in the design, use a simple insert sort with adjustable maximum sorting number to get much better performance.