RTL Studio Open IDE

Parity

Sticky Parity Error Flag 8-Bit — L1 Upgrade

Sticky Parity Error Flag 8-Bit — L1 Upgrade

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

Sticky Parity Error Flag 8-Bit — L1 Upgrade is a Verilog reference block in the Parity catalog. Even/odd parity generators, checkers, and error-detection helpers. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This IP implements a sticky parity error flag for 8-bit data buses. It detects odd parity errors on the input data bus (i.e., an odd number of 1s is considered an error for even parity requirements). The error flag remains set until explicitly cleared by a scrub signal or a reset.

This module is suitable for error detection in systems where data integrity is critical, such as communication interfaces or memory buses.

This IP provides a robust sticky parity error detection mechanism for 8-bit data buses. It is fully verified with Icarus Verilog simulation. The design is simple, lightweight, and suitable for integration in systems requiring data integrity checks. It supports synchronous scrubbing for error recovery and asynchronous reset for system initialization.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Sticky Parity Error Flag 8-Bit — L1 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Sticky Parity Error Flag 8-Bit — L1 Upgrade.
  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.

Architecture

The design uses a reduction XOR tree to compute even parity.

  • Even Parity: An even number of 1s results in a valid parity state (parity_ok = 1).
  • Odd Parity: An odd number of 1s triggers the parity error condition (error_flag sets to 1).

The error flag is a register that latches the error state. It can be cleared synchronously via a scrub signal or asynchronously via rst_n.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
data_inInput8Data bus for parity check
scrubInput1Active-high synchronous scrub to clear error
parity_okOutput1High if even parity is detected
error_flagOutput1Sticky error flag (latches on odd parity)

Verification

The testbench covers reset behavior and parity checks. It verifies that even parity does not trigger the error flag, while odd parity sets the sticky error flag. It confirms the flag persists when valid data follows an error and checks that the scrub signal clears the error flag. It ensures new errors are detected after a scrub operation.

Test CaseDescriptionResult
TC1Reset state checkPASS
TC2Even parity checkPASS
TC3Odd parity checkPASS
TC4Sticky behavior checkPASS
TC5Scrub clear checkPASS
TC6New error after scrubPASS

More in Parity

All Parity blocks