DescriptionQ1056
Q1056DesignIntelASIC interview problem
Count unique detected faults
TechniquesDesignDFTTestCountUnique
DifficultyMedium
TopicPhysical Design and DFT
LanguageC++
Requirements4 checkpoints
01
Problem
Each test reports a bit mask of detected stuck-at faults. Several tests may detect the same fault. Write a C++ function that computes unique coverage in parts per million.
Starting declarationC++
int fault_coverage(const uint64_t *masks, size_t tests,
unsigned total_faults,
unsigned *detected, unsigned *ppm);Example input and output
Use this case to check your interpretationInput
masks = {0b0011, 0b0110}, tests = 2, total_faults = 4.Output
detected = 3 and ppm = 750000.Explanation
The union mask is 0b0111 with three unique faults, and floor(3 * 1,000,000 / 4) is 750000.
02
Requirements (4)
- Require detected and ppm, total_faults in 1..64, and masks nonnull when tests>0; return -1 and preserve outputs otherwise.
- OR all test masks, then ignore bits at indices total_faults and above.
- Set detected to the population count of the remaining union and ppm=floor(detected*1000000/total_faults).
- Use a wide enough intermediate for the multiplication; on success return 0.
