DescriptionQ901
Q901FWAMDASIC interview problem
Classify ECC counter changes
TechniquesSiliconReliabilityDebugClassifyEcc
DifficultyMedium
TopicPost-Silicon Validation
LanguageC++
Requirements4 checkpoints
01
Problem
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.
Starting declarationC++
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);Example input and output
Use this case to check your interpretationInput
c0 = 10, u0 = 0, c1 = 13, u1 = 0, warn_threshold = 3.Output
ecc_delta returns ECC_OK.Explanation
No counter regresses, the uncorrectable delta is zero, and the correctable delta equals rather than exceeds the warning threshold.
02
Requirements (4)
- If either new counter is less than its old counter, return ECC_BAD.
- If u1-u0 is nonzero, return ECC_FATAL regardless of the correctable delta.
- Otherwise return ECC_WARN when c1-c0 is strictly greater than warn_threshold.
- Return ECC_OK for every remaining case, including a correctable delta equal to the threshold.
