RTL Studio Open IDE

LFSR, PRBS & CRC

8-Bit Parallel Scrambler — L2 Upgrade

8-bit parallel scrambler with LFSR state, shadow register, invalidate, and byte-enable features.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

8-Bit Parallel Scrambler — L2 Upgrade is a Verilog reference block in the LFSR, PRBS & CRC catalog. LFSR, PRBS, CRC, and pseudo-random sequence generators. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements an 8-bit parallel scrambler using a Linear Feedback Shift Register (LFSR) with polynomial x^8 + x^6 + x^5 + x^4 + 1 (Hex: 0x5B). It is designed for applications requiring data whitening with robust state management, including non-destructive state preservation via a shadow register and immediate reset control via an invalidate mechanism.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Parallel Scrambler — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: 8-bit parallel scrambler with LFSR state, shadow register, invalidate, and byte-enable features.
  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.

Features

  • 8-bit Parallel Data Path: Supports full byte processing with XOR scrambling.
  • LFSR Polynomial: x^8 + x^6 + x^5 + x^4 + 1 (Hex: 0x5B).
  • Shadow Register: Allows non-destructive state updates via commit_shadow.
  • Immediate Invalidate: invalidate signal clears state, shadow, and busy flags immediately.
  • Handshaking: busy flag indicates active processing; valid_in/valid_out strobes.
  • Synchronous Reset: Controlled via active-low rst_n.

Architecture

The module consists of a combinational scrambler and a sequential LFSR state machine.

  • Output Logic: data_out is the registered XOR of data_in and the current LFSR state.
  • LFSR Logic: Shifts right; feedback is the LSB XORed with the polynomial.
  • State Management:

- shadow_reg holds a backup of the state. - commit_shadow loads shadow_reg into state. - invalidate forces all state registers to zero.

Interface

Signal NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low synchronous reset
data_inInput8Data to be scrambled
valid_inInput1Input data valid strobe
byte_enInput1Byte enable for shadow update (logic-dependent)
invalidateInput1Force clear state/shadow/busy
commit_shadowInput1Load shadow register into LFSR state
data_outOutput8Scrambled data output
valid_outOutput1Output data valid strobe
busyOutput1Busy indicator during processing

Verification

The testbench tb_scrambler_invalidate_shadow_8b.v covers the following scenarios:

Test CaseDescriptionExpected Result
TC1Basic ScrambleOutput matches input XOR state (e.g., 0x12 ^ 0x00 = 0x12)
TC2InvalidateBusy clears, state resets to 0
TC3Shadow CommitState updates from shadow, valid_out remains high
TC4Byte EnableBusy flag asserts correctly with byte_en
TC5Busy FlagBusy asserts during valid_in and deasserts after

All tests passed in simulation logs.

More in LFSR, PRBS & CRC

All LFSR, PRBS & CRC blocks