Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Classify ECC counter changes

Hardware interview practice

Classify ECC counter changes

MediumPost-Silicon ValidationC++

A monitor compares two AMD-style reliability, availability, and serviceability (RAS) snapshots with monotonic error-correcting code (ECC) counters. Write the C++ function that validates the samples and returns the required severity.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

enum Sev { ECC_OK, ECC_WARN, ECC_FATAL, ECC_BAD };
Sev ecc_delta(uint64_t c0,uint64_t u0,uint64_t c1,uint64_t u1,
uint64_t warn_threshold);
Reviewed example

Work through one case

Input
c0 = 10, u0 = 0, c1 = 13, u1 = 0, warn_threshold = 3.
Expected output
ecc_delta returns ECC_OK.

No counter regresses, the uncorrectable delta is zero, and the correctable delta equals rather than exceeds the warning threshold.

What to cover

Requirements

  1. If either new counter is less than its old counter, return ECC_BAD.
  2. If u1-u0 is nonzero, return ECC_FATAL regardless of the correctable delta.
  3. Otherwise return ECC_WARN when c1-c0 is strictly greater than warn_threshold.
  4. Return ECC_OK for every remaining case, including a correctable delta equal to the threshold.
Continue practicing

Related questions

Post-Silicon ValidationInterpret SECDED memory errors→
asic.fyi · Learn silicon end to end.info@asic.fyi