Lumina Blocks
Data Compression
Preview · v0.1.0

LM-LZS-D

LZ4/Snappy Data Decompressor

  • Up to 8 bytes per clock
  • Automatic format detection
  • Errors that name the failing check
  • Portable to any FPGA

LM-LZS-D is a lossless decompression IP core for FPGA and SoC designs.

The engine decompresses LZ4 and Snappy streams in hardware, with a 64 kB history window and a datapath producing up to eight decompressed bytes per clock. It accepts the LZ4 frame format complete, the Snappy raw stream format, and the Snappy framing format with its masked CRC-32C per chunk. Format detection is automatic.

The core is delivered as vendor-neutral SystemVerilog and builds from one source on AMD, Altera and Efinix devices. It includes AMBA AXI interfaces and a register map, and ANSI C drivers are provided for fast integration into the target platform.

Measured FPGA results

Product top, out of context, constrained at the target clock. AMD and Efinix report LUTs, Altera reports ALMs; the two are never combined.

DeviceConfigurationLogicFFMemoryDSPFmax
Altera Agilex 3A3CW135BM16AE6S · quartus-pro 26.1.1DP_W=64, LZ4_EN=1, SNAPPY_EN=14,527 ALM2,905512 Kb M20K0165.1 MHztarget 165
AMD Kintex UltraScale+xcku3p-ffva676-1-e · vivado 2026.1DP_W=64, LZ4_EN=1, SNAPPY_EN=16,309 LUT2,02416 BRAM0254.2 MHztarget 250
AMD Kintex UltraScale+xcku3p-ffva676-1-e · vivado 2026.1DP_W=64, LZ4_EN=1, SNAPPY_EN=1, SNAPPY_FRAMING_EN=17,208 LUT2,13916 BRAM0250.7 MHztarget 250
Efinix Titanium Ti375Ti375N1156 · efinity 2026.1DP_W=64, LZ4_EN=1, SNAPPY_EN=112,646 LUT5,54064 RAM1232.1 MHztarget 220

Features

Formats

  • LZ4 frame format: magic, descriptor, block sizes, optional content size, header and content checksums, EndMark, skippable and legacy frames
  • Snappy raw stream: preamble varint, literal and copy elements
  • Snappy framing: stream identifier, the full chunk table including all four reserved ranges, and the masked CRC-32C per chunk
  • Automatic format detection, or pinned to one format by register

Checksums

  • xxHash-32 for LZ4 header, block and content checksums
  • CRC-32C, masked, for Snappy framing chunks

Engine

  • Configurable datapath of up to 8 decompressed bytes per clock
  • History window of up to 64 kB, byte-banked for unaligned copies at full rate
  • Optional SECDED error correction on the history window

Error reporting

  • Errors carry a class and a code — which check failed, not merely that one did
  • The error flag travels on the output stream as well as in a register
  • A dictionary frame is refused by name rather than decoded against an absent dictionary

Integration

  • AMBA AXI4-Lite control, AXI4-Stream in and out
  • Independent input and output widths
  • Two delivery tops: complete AXI product, or bare decompressor for a custom fabric
  • ANSI C driver, UVM RAL, IP-XACT, SystemRDL register description

Applications

  • Storage and filesystem decompression offload
  • Network and RPC payload decompression
  • Log and telemetry ingestion
  • Firmware and configuration image expansion
  • Database page and column decompression

Block diagram


Interfaces

InterfaceTypeWidthCarries
s_axilAXI4-Lite slave32-bit data, 7-bit addresscapability, control, command, status, error pair, counters
s_axisAXI4-Stream sinkIN_W, tkeep, tlastthe compressed stream
m_axisAXI4-Stream sourceOUT_W, tkeep, tlastthe decompressed stream
m_axis_tuser[0]source1-bitthe error flag, travelling with the data
irqlevel1-bitcompletion and error events

The error flag rides on the output stream. A decompressor that detects a bad stream has usually already emitted part of it, so a consumer reading only a register would have to poll between beats to know whether the bytes it just took were good. tuser[0] lets a sink discard a failed stream without a bus access and without a race.


Error reporting

Errors carry a class and a code, so a log line names the check that failed:

ClassCodes include
codingnot a recognised stream, bad version, reserved field set, malformed Snappy preamble, trailing bytes
sizedeclared size impossible, block size disagreement, content size mismatch
crcLZ4 header / block / content checksum, Snappy framing chunk CRC-32C
truncationstream ended mid-element
unsupporteddictionary requested

Throughput

throughput  =  DP_W bytes  x  f_clk    for copy-dominated streams

DP_W is configurable up to 8 bytes per clock. Achieved rate depends on the stream's mix of literals and matches; cnt_in, cnt_out and cnt_cycles let a host measure it on its own traffic rather than trusting a datasheet figure.


Configuration

ParameterTypeEffect
DP_Welaborationdecompressed bytes per clock, up to 8
IN_W, OUT_Welaborationstream widths, independent of each other
HIST_KBelaborationhistory window size, up to 64 kB
LZ4_EN, SNAPPY_ENelaborationformats compiled in
SNAPPY_FRAMING_ENelaborationthe Snappy framing layer
CHECKSUM_EN, ECC_ENelaborationchecksum verification, window SECDED
format selectrun timeautomatic, or pinned

Resources and performance

Resource utilisation and maximum clock frequency for each target device are measured out of context and published per target in the measured results on this page. AMD and Efinix rows report LUTs; Altera rows report ALMs, and the two are never combined.


Deliverables

ItemContents
RTLparameterised SystemVerilog, vendor-neutral
Modelbit-accurate C++ model
RegistersSystemRDL source plus six generated exports
VerificationUVM RAL, formal property wrappers, corpus and vector drivers
SoftwareANSI C reference driver with generated header and JSON
PackagingIP-XACT, IEEE 1685-2022
Implementationrunnable flow script per FPGA vendor, file list, SDC
Documentationintegration guide

Privacy settings

Choose what this site may use. You can change your mind at any time from the Privacy settings link at the bottom of every page.

What the site needs to work, and the record of the choice you make here, kept in your browser. No cookies are set.

Always on

Would let us count visits and see which pages are useful, without advertising or cross-site tracking. We do not use any analytics today, so nothing is loaded whichever you choose.

Cookie policy · Privacy policy