This tool generates SystemVerilog code for sorting networks based on a JSON specification. It supports both pipelined and combinational implementations, with configurable data types and widths.
- Median networks: Not working
- Sorter, Low Max, Low Avg: Working
- Feel free to open an issue if you encounter any problems.
python src/main.py --help
--file
: Input JSON file (default: read from stdin)--data-type
: Data type (unsigned
orsigned
, default:unsigned
)--width
: Data width in bits (default: 32)--pipeline
: Pipeline stages in hex format (default: 0x0)--output-file
: Output SystemVerilog file (default: stdout)
The input JSON format follows the specification from SorterHunter.
The generator creates two SystemVerilog modules:
sorting_network
: The main sorting network implementationsort_tb
: Testbench module
- Python 3.x
- SystemVerilog simulator: I have used Cadence Xcelium for testing, but it should work with any simulator that supports SystemVerilog.
Thanks for the inspiration from SorterHunter and SortHDL
MIT License (MIT)