The idea: model each defect as one line stuck at 0 or 1
A new chip can come out of the factory with a short to ground, a short to power or a broken wire. Nobody can look inside, so the chip is tested from its pins: put a vector on the inputs, compare the outputs with the right answer. To decide which vectors to apply, test engineers use a simple fault model, the single stuck-at fault: exactly one line of the circuit is stuck at 0 (written s-a-0, or e/0) or stuck at 1 (s-a-1, e/1), and everything else works.
The canvas uses one small circuit, z = ab + c·(ab)'. Its function is just z = ab + c, which matters later. The right panel holds the fault list, then the coverage results. Press Collapse Faults, pick a fault and press D-Algorithm, or pick a vector and press Simulate Vector.
How the gates themselves work is on Combinational Logic. Here the circuit is fixed and the question is only: is it built right?
The fault list
Every line gets two faults. A line that feeds two gates is a stem with two branches, and each is a line of its own: a break in branch e2 only cuts the path to the OR, while a fault on the stem e hits both paths. With 9 lines the list has 18 faults. A real chip has millions, which is why the next step matters.
Fault collapsing
Two faults are equivalent when every vector sees them the same way. Then one test covers both, and the list keeps one fault of each class. The rules come from the gates. A 0 on any input of an AND forces its output to 0, so "input stuck at 0" and "output stuck at 0" cannot be told apart. 0 is the controlling value of AND (and NAND); 1 is the controlling value of OR (and NOR). A NOT swaps the two: input s-a-0 is output s-a-1. Demo: 18 faults collapse to 10.
| Gate | Equivalent faults | Kept |
|---|---|---|
| G1 AND | a/0 = b/0 = e/0 | e/0 |
| G2 NOT | e1/0 = h/1; e1/1 = h/0 | h/1, h/0 |
| G3 AND | h/0 = c/0 = f/0 (and so e1/1) | f/0 |
| G4 OR | e2/1 = f/1 = z/1 | z/1 |
18 faults become 10 classes: e/0, a/1, b/1, e/1, c/1, h/1, f/0, e2/0, z/1 and z/0. Faults on a stem and its branches are never merged this way. The rules only look at one gate at a time, so a few equivalences are missed: e/1, c/1 and z/1 all make z = 1 for every vector, but they sit on different gates.
Activate, then propagate
A vector detects a fault only if two things happen. First it must activate the fault: to see e stuck at 0, the good circuit must put a 1 on e. Second, it must propagate the difference to an output: every gate on the way needs its other inputs at the non-controlling value, so that the difference decides the gate's output. To write both machines at once the D-algorithm uses five values: 0, 1, x (unknown), D (1 in the good circuit, 0 in the faulty one) and D' (0 good, 1 faulty).
The D-algorithm
The D-algorithm (Roth, 1966) searches for such a vector with four moves:
- Activate: set the faulty line to D (for s-a-0) or D'.
- Imply: let every gate force what it can, forwards and backwards. An AND with output 1 needs both inputs 1; a NOT flips; a branch copies its stem.
- Propagate: the D-frontier is the set of gates with a D or D' on an input and an unknown output. Pick one (the page tries the one closest to the output first) and set its other inputs to the non-controlling value.
- Justify: once z holds D or D', every value set on the way must be explained from the inputs. Where a gate gives a choice (an AND output 0 needs only one input 0), try one option; on a conflict, backtrack and try the next.
For e/0: activation sets e = D, and implication gives a = b = 1, e1 = e2 = D and h = D'. The D-frontier is {G4, G3}. Through G4 the side input f must be 0. f = AND(h, c), and h is 1 in the faulty circuit, so implication sets c = 0. Now z = D, nothing is left to justify, and the test is abc = 110. Demo: D-algorithm, e s-a-0 → abc = 110.
For c/1 the path goes through G3 with h = 1, which forces e = 0. An AND output of 0 can be explained by a = 0 or by b = 0: the algorithm picks a = 0, the test is abc = 0x0, and the x is filled with 0. Demo: D-algorithm with a choice, c s-a-1. The guess, imply, backtrack loop is the same one a SAT solver runs on clauses; see DPLL. Modern test tools (ATPG, automatic test pattern generation) indeed often hand the problem to a SAT solver, or use PODEM, which only ever assigns primary inputs.
Fault simulation and fault coverage
Test generation finds vectors one fault at a time. Fault simulation goes the other way: take a vector, simulate the circuit once with each fault still in the list, and mark every fault whose z differs. Detected faults are dropped, so later vectors simulate fewer of them (fault dropping). Fault coverage = detected faults / faults in the list. Demo: 4 vectors fill the coverage table.
| Vector abc | New faults detected | Coverage of 10 |
|---|---|---|
| 110 | e/0, e2/0, z/0 | 3 = 30% |
| 010 | a/1, c/1, e/1, z/1 | 7 = 70% |
| 100 | b/1 | 8 = 80% |
| 001 | f/0 | 9 = 90% |
Each of the four vectors is the only one that detects some fault (e/0 needs 110, a/1 needs 010, b/1 needs 100, f/0 needs one of 001, 011, 101), so no set of 3 vectors can do it. On the full list of 18 the same vectors detect 16. The coverage stops at 90% because the tenth fault, h/1, cannot be detected by any vector: of the testable faults the coverage is 9/9 = 100%.
Redundant faults
Run the D-algorithm on h s-a-1. Activation needs h = 0 in the good circuit, so e = 1, and then e2 = 1. But 1 is the controlling value of the OR: z is 1 in both circuits whatever f does. Propagating through G3 with c = 1 gives f = D', and the D-frontier is then empty. There is no other choice to undo, so no test exists. Demo: h s-a-1 has no test (redundant).
A fault with no test is redundant (undetectable): the circuit computes the same function with the fault in it. Here h may as well be the constant 1. Then f = AND(1, c) = c, G3 becomes a wire, and the NOT G2 drives nothing. Two gates go and z = ab + c, with the same 8 rows of truth table. Demo: remove the redundant gates.
Redundancy is not always a mistake. A consensus term added to stop a glitch (see the hazard section of Combinational Logic) is redundant on purpose, and its stuck-at faults cannot be tested. Logic tools can also prove such redundancy with binary decision diagrams or SAT.
Where test fits
Test patterns are made after synthesis and technology mapping, on the final gate netlist, as one of the signoff steps of the ASIC design flow. The page's circuit has no flip-flops; a real chip does, and scan chains turn its flip-flops into inputs and outputs the tester can reach, so the same combinational methods apply.
See also Binary Decision Diagrams for finding an input on which two circuits disagree.
See also Scan Chains and Design for Test, which applies test patterns to a state machine through a scan chain and counts the test clocks.
What the page leaves out
- Multiple faults at once, bridging faults, delay (transition) faults, and the cell-aware fault models used for modern processes.
- Fault dominance, a second collapsing rule that shrinks the list further for detection.
- PODEM, FAN and SAT-based ATPG in detail, and the X-path check that prunes the D-algorithm earlier.
- Parallel and deductive fault simulation, which handle many faults per pass.
- Sequential circuits and scan insertion, test compression, and built-in self-test (BIST).
On the mind map
References
J. Paul Roth, "Diagnosis of Automata Failures: A Calculus and a Method", IBM Journal of Research and Development 10(4), 1966: the D-algorithm
Michael L. Bushnell and Vishwani D. Agrawal, Essentials of Electronic Testing for Digital, Memory and Mixed-Signal VLSI Circuits, Springer, 2000, chapters 4–7 (fault models, collapsing, fault simulation, ATPG)
Prabhakar Goel, "An Implicit Enumeration Algorithm to Generate Tests for Combinational Logic Circuits", IEEE Transactions on Computers C-30(3), 1981: PODEM