Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
    • SRAM and ROM
    • Register Files
    • Valid/Ready Handshake
    • AXI-Lite
    • AXI-Stream
    • Bus Integration
    • Synchronous FIFO
    • Register-Map and CSR RTL
    • Memory Reliability
      • Failure Model and Protection Choice
      • Parity Datapath
      • SECDED Encode and Syndrome
      • Correction and Reporting
      • Partial Writes and Scrubbing
      • Initialization, Injection, and Signoff
      • SECDED on a 32-bit Word, Worked
    • Peripheral RTL Integration
    • Full AXI4: RTL Roadmap
  • Advanced RTL28
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹Memory & Buses
  1. Topics
  2. RTL Design
  3. Memory & Buses
  4. Memory Reliability

Part 7 · Memory & Buses · Intermediate

Memory Reliability

Parity and SECDED protection, syndrome handling, partial writes, scrubbing, error injection, initialization, and repair hooks.

  • 7topics
  • 7lessons

Topics in this section

  1. 1Failure Model and Protection Choice1 lesson
  2. 2Parity Datapath1 lesson
  3. 3SECDED Encode and Syndrome1 lesson
  4. 4Correction and Reporting1 lesson
  5. 5Partial Writes and Scrubbing1 lesson
  6. 6Initialization, Injection, and Signoff1 lesson
  7. 7SECDED on a 32-bit Word, Worked1 lesson
On this page

    Memories hold most of a modern block's state, so a rare bit upset can become a persistent architectural error. Protection adds redundant bits, checking logic, reporting, and a policy for correction and repair.

    A planned 32-bit, 1024-word control SRAM is the running integration exercise. The supplied snippets explain parity, SECDED, byte-write read-modify-write, scrub, injection and diagnostic contracts; this topic does not supply a complete protected-memory implementation or executed integration harness.

    Lessons in this topic

    7 lessons, about 28 min

    1. 1Failure Model and Protection ChoiceYou can separate transient, permanent and latent faults, and pick parity, SECDED or another scheme from the availability requirement.2 min
    2. 2Parity DatapathYou can write the even-parity store and check path for a 32-bit memory, and say exactly what it covers.3 min
    3. 3SECDED Encode and SyndromeYou can derive extended Hamming check bits for 32 data bits, compute the syndrome, and classify clean, correctable and uncorrectable words.5 min
    4. 4Correction and ReportingYou can return corrected data, flag uncorrectable reads as poison or error, and capture the failing address and syndrome with the same response.3 min
    5. 5Partial Writes and ScrubbingYou can build an atomic read-modify-write for a byte write, and compute a scrub revisit time from the arbitration budget.4 min
    6. 6Initialization, Injection, and SignoffYou can make uninitialised memory safe, inject transient and persistent faults for tests, and list the evidence needed for ECC signoff.4 min
    7. 7SECDED on a 32-bit Word, WorkedYou can encode a 32-bit word into the 39-bit layout by hand, compute a syndrome and overall parity, and classify a read as clean, corrected, parity-only or uncorrectable.7 min

    Tip

    Write the protection contract beside the memory interface: detected fault classes, correction policy, latency, partial writes, reporting, and uncorrectable-error behavior.

    Check yourself Why is SECDED not simply 'better parity'?

    It changes the interface contract: SECDED can correct one bad bit, detect two, needs syndrome logic and wider storage, and requires policy for reporting and scrubbing corrected words.

    Revision sheet

    The whole topic on one page, taken from each lesson's Remember box. Read it before an interview, or print it.

    Failure Model and Protection Choice

    • Parity detects. SECDED corrects single bits and detects double bits.

    • A transient error clears on rewrite. A permanent fault recurs at the same cell and needs repair or retirement.

    • Latent faults accumulate until the word is read or scrubbed.

    Rule of thumb: pick the weakest protection that meets the requirement on what happens after an error.

    Parity Datapath

    • Store 32 data bits plus one even-parity bit. Check the XOR on read.

    • Parity detects any odd number of flips. Two flips cancel.

    • On an error, latch the address and context, count with a saturating counter, and never return the data without an error indication.

    Rule of thumb: state the exact fault coverage in the claim, not just the word protected.

    SECDED Encode and Syndrome

    • 32 data bits need six Hamming check bits and one overall parity bit, 39 bits in all.

    • Nonzero syndrome with odd overall parity is a single-bit error: correct it, and reject a position beyond 38.

    • Nonzero syndrome with even overall parity is a double-bit error: report it and never correct.

    Rule of thumb: freeze the bit layout in one package that encoder, decoder, injection and tests all use.

    Correction and Reporting

    • Carry the request address and tag with the word, and raise one event per decoded read, even when the response is held.

    • An uncorrectable read must never look like normal data.

    • Define first-error or last-error capture, and keep it from being overwritten before software reads it.

    Rule of thumb: report every correction: a rising rate is the early warning.

    Partial Writes and Scrubbing

    • Read and decode the old word, merge the strobed bytes, re-encode the whole word, then write it back, atomically for that address.

    • Stop on an uncorrectable old word. Use the corrected data otherwise.

    • Revisit time = words x slot spacing + any bounded sleep. Starvation or unbounded sleep removes the bound.

    Rule of thumb: a scrubber narrows the window for a second upset. It does not close it.

    Initialization, Injection, and Signoff

    • Initialise data and check bits together, track line validity separately from the syndrome, or block reads until written.

    • A read-path XOR tests the decoder only. A persistent fault needs a test-only raw-codeword write, or a backdoor or MBIST write.

    • Lock injection controls in production and verify sticky flags, counters and first-error capture through the CSR interface.

    Rule of thumb: treat the protection as unproven until every syndrome and response path has been injected.

    SECDED on a 32-bit Word, Worked

    • Check bit 2^b covers every position with bit b set and makes that group even. P at 39 covers all 38 others and is in no check.

    • Odd parity with syndrome 1 to 38 corrects that position; syndrome 0 with odd parity is P alone; even parity with a nonzero syndrome is UE.

    • Odd parity with a syndrome above 38 is UE too. Position k lives at vector bit k-1.

    Rule of thumb: trust the syndrome only when overall parity is odd and the syndrome names a real position.

    Practise it

    • Mini project: a two-master bus with decoder, default slave and timeout

    • Practice question: ECC memory RTL design

    • Code lab: Even parity generator

    • Code lab: SECDED encode

    • Practice question: Byte-enable RAM design with partial write support

    • Interview: run a mock interview on this topic

    PreviousNext: Failure Model and Protection Choice

    Up next

    Up nextFailure Model and Protection Choice

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • SRAM and ROM
    • Register Files
    • Valid/Ready Handshake