Problemcore
Automatic test pattern generation
Also called ATPG.
For a fault in a circuit, find an input vector that excites the fault and propagates its effect to an output, or prove the fault untestable.
Automatic test pattern generation, or ATPG, is the problem of finding, for one fault of a circuit, an input vector on which the good and the faulty circuit give different outputs, or of proving that no such vector exists. For the single stuck-at fault model and a combinational circuit, the vector must give the faulty line the value opposite to its stuck value and carry that difference to a primary output. The decision version is NP-complete, so every complete method is exponential in the worst case, but industrial circuits with millions of gates are tested with it every day. With scan design, the circuit seen by ATPG is combinational.
In plain words
A chip comes off the line, and you want to know if one wire inside it is stuck at 0. You cannot look at the wire. You can only set the input pins and read the output pins.
So you look for one input that does two things. It makes the good wire carry a 1, so that the stuck wire is wrong. And it makes the outputs depend on that wire, so that the wrong value shows on some pin. Such an input is a test for the fault.
Sometimes no input works. Then the fault does not change what the circuit computes, and the logic around the wire is redundant. ATPG must find a test, or prove that there is none.
Definition
Instance. A combinational Boolean circuit with primary inputs , primary outputs and lines, and one fault , here a single stuck-at fault . The faulty circuit is with the line fixed to .
Output. A vector with
or the answer that no such exists, in which case is undetectable, or redundant. For a single output , the condition is and , where is the Boolean difference of with respect to the line.
Decision version. Given and , is detectable?
A partial answer is often given as a test cube, a vector over such that every way of filling the entries gives a test. In practice the cubes of many faults are merged before the entries are filled.
Variants
- Test set generation. Given and a fault list , find a set of vectors that detects every detectable fault of , and classify the rest as redundant. A small set is wanted, since tester time grows with it.
- Redundancy identification. Prove that a fault is undetectable. This is the complement of the decision version, and it is used in logic synthesis to remove logic.
- Sequential ATPG. The circuit has flip-flops, and a test is a sequence of vectors from a known or unknown state. The usual model unrolls the circuit into copies, one per clock cycle, and solves a combinational problem with the fault in every copy.
- Other fault models. Transition faults and path delay faults need a pair of vectors, one to set the line and one to launch a change. Bridging faults need values on two lines. Cell-aware faults are given by tables inside each cell.
- -detect tests. Each fault must be detected by at least different vectors, which tends to catch more real defects.
Examples
Take , , , and the fault /0. A test must set in the good circuit, so or . To pass the difference through , the side input must have the non-controlling value , so or . The cube does both: on 000, 001, 100 and 101 the good circuit gives and , and the faulty one gives . The full set of tests is 000, 001, 010, 100, 101. The D-algorithm, PODEM and SAT-based ATPG pages solve this same instance step by step.
Now take , , , , and the fault /0. A test needs , so . To see at the OR gate, the side inputs must be 0: gives , and then . So no vector works, and the fault is redundant. This is the consensus theorem, : the gate can be removed, and the circuit computes the same function.
Known algorithms
- Exhaustive fault simulation. Run fault simulation on all vectors. It is the reference method for small .
- D-algorithm (Roth, 1966). Searches over values of internal lines with five values , with a D-frontier and a J-frontier.
- PODEM (Goel, 1981). Decides values only on primary inputs, with a backtrace from each objective. The FAN rules of Fujiwara and Shimono (1983) are described there.
- SAT-based ATPG (Larrabee, 1992). Writes the good and the faulty circuit as a formula and gives it to a SAT solver.
- Guides for the search. The SCOAP measures estimate how hard each line is to set and to observe. Fault collapsing reduces the fault list first.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| D-algorithm | O(B^(2L) L (L + P)) worst | O(L^2) extra | completedeterministicexactrecursive | 1 language |
| FAN | O(L (L + P) + 2^h (L + P)) worst | O(L + n) extra | completedeterministicexactiterative | 1 language |
| PODEM | O(2^n (L + P)) worst | O(L + n) extra | completedeterministicexactiterative | 1 language |
| SAT-based ATPG | O(2^n (L + P)) worst | O(L + P) extra | completedeterministicexactiterative | 1 language |
Bounds
- NP-complete in general. In the model of Boolean circuits of AND, OR and NOT gates, the decision version is NP-complete (Ibarra and Sahni, 1975). It is in NP since a test is checked by two circuit evaluations. Fujiwara and Toida (1982) showed that it stays NP-complete for monotone circuits with three or more levels of gates, and that it is polynomial for monotone two-level circuits. So no algorithm solves it in polynomial time unless P = NP, and the complement, redundancy identification, is coNP-complete.
- Exhaustive upper bound. Evaluating the good and the faulty circuit on all vectors takes time on a word RAM, with the number of gate input pins. PODEM keeps this bound with decisions on inputs only.
- Fanout-free circuits. If every line feeds at most one gate, every fault of a circuit of AND, OR, NAND, NOR and NOT gates is detectable, and a test is built in time by setting each side input of the path to its non-controlling value. The proof is on the stuck-at fault model page.
- Minimum test sets. Finding a smallest test set for a fault list is NP-hard, since with one fault on the list and the bound it is the decision version. It is a set cover problem over the detecting sets.
- What is only measured. On benchmark and industrial circuits, complete methods find tests for most faults with little backtracking, and a few faults are aborted after a backtrack limit. These are measured results, not bounds, and they depend on the circuit, the method and the limit.
Reductions
- From circuit SAT. Given a circuit with one output , take the fault /0. A vector detects it exactly when in the good circuit, so the fault is detectable exactly when is satisfiable. This shows NP-hardness for general circuits in one line. The proofs of Ibarra and Sahni and of Fujiwara and Toida work for restricted circuits.
- To SAT. Build the miter: the good and the faulty circuit share the inputs, and an OR of the XORs of their outputs is the new output. The fault is detectable exactly when the miter output can be 1. The Tseitin transformation turns the miter into a CNF formula of size , which is the start of SAT-based ATPG.
- Relation to equivalence checking. A fault is redundant exactly when and are equivalent, so redundancy identification is a special case of Boolean equivalence checking, and the same miter is used for both.
- Sequential to combinational. Full scan design makes every flip-flop an input and an output for test, which turns sequential ATPG into the combinational problem above. Without scan, unrolling clock cycles gives a combinational instance of size .
Applications
- Manufacturing test. ATPG with fault simulation produces the vectors that a tester applies to each chip through the scan paths.
- Redundancy removal. In logic synthesis, a redundant fault shows that can be tied to , which removes gates. This uses the observability don't-cares of the line.
- Equivalence checking. Early equivalence checkers used ATPG engines on the miter of two circuits, and SAT-based methods now share the same structure.
- Diagnosis. Tests that tell two faults apart narrow down the place of a defect in a failing chip.
- Built-in self-test. Faults that pseudorandom patterns miss in built-in self-test get stored tests from ATPG, or test points.
References
- O. H. Ibarra and S. K. Sahni, Polynomially complete fault detection problems, IEEE Transactions on Computers C-24(3), 242 to 249, 1975, deciding whether a single stuck-at fault of a combinational circuit is detectable is NP-complete
- H. Fujiwara and S. Toida, The complexity of fault detection problems for combinational logic circuits, IEEE Transactions on Computers C-31(6), 555 to 560, 1982, NP-completeness for monotone circuits of three or more levels, and polynomial time for two levels
- J. P. Roth, Diagnosis of automata failures, a calculus and a method, IBM Journal of Research and Development 10(4), 278 to 291, 1966, the first complete test generation method, with the D-calculus
- T. Larrabee, Test pattern generation using Boolean satisfiability, IEEE Transactions on Computer-Aided Design 11(1), 4 to 15, 1992, the reduction of test generation for one fault to satisfiability of a formula
- Michael L. Bushnell and Vishwani D. Agrawal, Essentials of Electronic Testing for Digital, Memory and Mixed-Signal VLSI Circuits, Kluwer, 2000, the chapter Combinational Circuit Test Generation (the problem, redundancy, and the D-algorithm, PODEM and FAN), and the chapter on sequential circuit test generation
- Miron Abramovici, Melvin A. Breuer and Arthur D. Friedman, Digital Systems Testing and Testable Design, IEEE Press, 1994, the chapters on test generation for combinational and for sequential circuits
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag G9JK72 Edit this page History Report an error Markdown