Skip to content

olo_ft_ecc_decode

Back to Entity List

Status Information

VHDL Source: olo_ft_ecc_decode

Description

Note

ft entities protect only RAM storage contents (by ECC). All regular logic (LUTs and flip-flops, including control logic, counters and pipeline registers) is written under the assumption that TMR (Triple Modular Redundancy) is enabled in synthesis. Without TMR, upsets in this logic are not covered. See Protection Scope for details.

This entity provides a reusable, optionally pipelined SECDED decoder. It wraps the package functions eccSyndromeAndParity, eccCorrectData, eccSecError and eccDedError into a single standalone entity exposing an AXI4-Stream handshake (In_Valid / In_Ready, Out_Valid / Out_Ready). Single-bit errors (SEC) are corrected before Out_Data is driven. Double-bit errors (DED) are detected via Out_EccDed but cannot be corrected. Out_Data, Out_EccSec and Out_EccDed are time-aligned.

A codeword-wide error-injection side channel is also provided. The injection pattern is latched on ErrInj_Valid and XORed into the codeword on the next accepted beat (simulating an in-transit corruption — useful for FEC scenarios). See Open Logic Fault-Tolerance Principles - Error Injection for the latched-injection semantics shared across the ft area.

Pipeline structure

The Pipeline_g generic inserts register stages on the decode datapath. The range is 0..2 and the pipeline is explicitly distributed across the SECDED stages rather than relying on register-retiming:

Pipeline_g Structure
0 Combinational decode (no register).
1 Combinational syndrome + correction + SEC/DED → register near the output. Breaks the path from the decoder to downstream logic.
2 Combinational syndrome → register {InjectedCw, SynPar} → combinational correction + SEC/DED → register {Out_Data, Out_EccSec, Out_EccDed}. Breaks both the syndrome path and the correction path - use this when both halves of the SECDED logic need their own clock cycle to close timing.

For background on the SECDED scheme and codeword layout, see Open Logic Fault-Tolerance Principles.

Generics

Name Type Default Description
Width_g positive - Number of uncoded data bits
Pipeline_g natural 0 Number of register stages (range 0..2). See Pipeline structure above.
UseReady_g boolean true If true, In_Ready honours back-pressure from Out_Ready (shadow-register pipeline). If false, In_Ready is hard-wired to '1' and the pipeline is a plain register chain.

Interfaces

Clock and Reset

Name In/Out Length Default Description
Clk in 1 - Clock
Rst in 1 - Reset (high-active, synchronous to Clk). Clears the injection latch and the pipeline valid register(s).

Input

Name In/Out Length Default Description
In_Valid in 1 '1' AXI4-Stream handshaking signal for In_Codeword
In_Ready out 1 N/A AXI4-Stream handshaking signal for In_Codeword
In_Codeword in eccCodewordWidth(Width_g) - SECDED codeword to decode

Output

Name In/Out Length Default Description
Out_Valid out 1 N/A AXI4-Stream handshaking signal for Out_Data / Out_EccSec / Out_EccDed
Out_Ready in 1 '1' AXI4-Stream handshaking signal for Out_Data / Out_EccSec / Out_EccDed
Out_Data out Width_g N/A Decoded data word (corrected if a single-bit error was detected)
Out_EccSec out 1 N/A Single error corrected flag
Out_EccDed out 1 N/A Double error detected flag (data unreliable in this case)

Error Injection

Name In/Out Length Default Description
ErrInj_BitFlip in eccCodewordWidth(Width_g) all 0 Codeword-wide bit-flip pattern. XORed into In_Codeword before the syndrome calculation.
ErrInj_Valid in 1 '0' Strobe that latches ErrInj_BitFlip. The latched pattern is applied to the next accepted data beat, then cleared.