| Info | HW section | SW section | Addr space | Interface | Versions |
| Authors: | Petr Mikusek |
| Martin Mikusek | |
| Tomas Martinek |
The Sort Unit is responsible for sorting of input data records and their sending to the output, in right order. The input data are 16-bits wide and the first word contains the key, which represents position of data record in sorted sequence. (Number of data record words is generic.) The output data are 32-bits wide and they represents sorted records without the first word containing the key.
Sort unit structure
Sort Unit
Input Data Stream Format
{Identification}{LUP record 0}{LUP record 1}{Interface ID}
Output SFIFO Data Stream Format
{LUP record 0, LUP record 1}{Interface ID}
Output PFIFO Data Stream Format
{Interface ID}
SU core
Sort Unit takes data from input interface and sends them to the Output interface in right order. Input data are 16-bits wide and output data are 32-bits wide. Number of data words is given by generic parameter. There can be read out content of bram (for that is needed save_bram, generic parameter SAVE_BRAM must be set to true).
Write part
When SU receive identification, it's base address to BRAM (wr_base_addr). From that base address SU stores next n 16-bit words (where n is generic parameter WORD_COUNT). Lower parity bit is used as identification, if there is stored valid data on current address (1 = valid). Input stream needn't to be in burst.
Read part
FSM reads records from BRAM in order from the lowest to the highest address. Data output (of one record) is in burst (but when DO_RDY signal is not asserted, output is suspended). FSM checks if there are complete record in BRAM (checks parity bit in last item). When record is completely stored in BRAM, FSM sends it to output, clears parity bit, and increase base address (rd_base_addr).


