Package for Quicksort Routine(Package Declaration)
PACKAGE qsort_resources IS
CONSTANT maxarray : INTEGER := 100;
TYPE integer_array IS ARRAY (NATURAL RANGE 0 to maxarray) OF integer;
PROCEDURE quicksort(VARIABLE a : INOUT integer_array;
Notes:
The final example is the coding of a quicksort routine in sequential VHDL. This is the package for the quicksort code. It includes a constant for the array size (to avoid dynamic allocation), and integer array that will be sorted, and the declaration of the quicksort procedure.
In the example code for the modules, there is a C code implementation of quicksort that shadows the VHDL implementation.