Created: Dec 19, 2018
Updated: Dec 24, 2018
SVN Updated: Jan 1, 2019
Latest version: download
(might take a bit to start...)
1 reported / 1 solved
Star0you like it: star it!
Other project properties
FPGA implementation of deflate (de)compress RFC 1950/1951
This design is implemented in MyHDL (www.myhdl.org) and can be translated to Verilog or VHDL.
It has been verified in Icarus, Xilinx Vivado and on a physical Xilinx device (Digilent Arty).
Usage should be clear from the test bench in test_deflate.py.
OBSIZE = 8192 # Size of output buffer (BRAM)
IBSIZE = 2048 # Size of input buffer (LUT-RAM)
CWINDOW = 32 # Search window for compression
One can use a sliding window to reduce the size of the input buffer and the LUT-usage.
The optimal value is 4 * CWINDOW (128 bytes), the first decompression in the UnitTest in test_deflate.py uses this strategy.
The compress mode can be disabled by setting COMPRESS to False.
By default the compressor will reduce repeated 3/4/5 byte sequences in the search window to 15 bit. This will result in a decent compression ratio for many real life input data patterns.
At the expense of additional LUTs one can improve this by enlarging the CWINDOW or expanding the matching code to include 6/7/8/9/10 byte matches. Set MATCH10 to True in the top of deflate.py to activate this option.
Another strategy for data sets with just a small set of used byte values would be to use a dedicated pre-computed Huffman tree. I could add this if there is interest, but it is probably better to use a more dense coding in your FPGA application data in the first place.
To reduce LUT usage the default implementation matches each slot in the search window in a dedicated clock cycle. By setting FAST to True it will generate the logic to match the whole window in a single cycle. The effective speed will be around 1 input byte every two cycles.
FAST and MATCH10
Future Improvements (when there is interest)
Improve speed from current 80Mhz to 100Mhz
© copyright 1999-2018 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.