RTL Studio Open IDE

LFSR, PRBS & CRC

CRC-32 Generator (lfsr_crc)

Byte-serial CRC-32 generator with Ethernet-style polynomial, init 0xFFFFFFFF, and zlib-compatible output.

About this block

Simulate it in the Verilog IDE

Hardverilogsimsyn

CRC-32 Generator (lfsr_crc) is a Verilog reference block in the LFSR, PRBS & CRC catalog. LFSR, PRBS, CRC, and pseudo-random sequence generators. Marked Hard: a larger reference. Simulate the packaged testbench before you change the RTL.

This IP implements a byte-serial CRC-32 generator using Alex Forencich's parametrizable lfsr_crc wrapper and combinatorial lfsr engine.

Default parameters match Ethernet-style CRC-32: polynomial 0x04C11DB7, initial value 0xFFFFFFFF, LSB-first input (REVERSE=1), and inverted output (INVERT=1).

  • Top module: lfsr_crc
  • Polynomial: 32'h04C11DB7
  • Init state: 32'hFFFFFFFF
  • Data width: 8 bits per clock when data_in_valid is asserted
  • Configuration: Galois, LSB-first, inverted CRC output compatible with zlib.crc32
  1. Choose Open in IDE. RTL Studio loads the packaged workspace for CRC-32 Generator (lfsr_crc).
  2. Read the Verilog module in the editor. The catalog line for this block: Byte-serial CRC-32 generator with Ethernet-style polynomial, init 0xFFFFFFFF, and zlib-compatible output.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Interface

SignalDirectionWidthDescription
clkInput1System clock
rstInput1Synchronous reset; clears output and reloads LFSR init
data_inInput8Input data byte
data_in_validInput1Advance CRC with data_in on rising clock edge
crc_outOutput32Registered CRC result (~state when INVERT=1)

Verification

Run simulation from this directory:

Test vectors include the standard 123456789 CRC-32 value 0xCBF43926.

More in LFSR, PRBS & CRC

All LFSR, PRBS & CRC blocks