Techniqueadvanced
Static learning
Also called SOCRATES learning, implication learning.
Precomputes indirect implications of each signal value by contraposition, as in SOCRATES, so ATPG and equivalence checking find conflicts earlier.
Static learning is a step that a test generator runs once, before it looks at any fault. For each line of the circuit and each value 0 and 1, it sets the value, makes all the simple implications, and turns what it finds around by contraposition: if implies , then implies . The turned-around implications are often ones that the simple one-gate rules can never find, so the tool stores them and uses them in every later implication step. Schulz, Trischler and Sarfert introduced it in the SOCRATES test generator (1988), which was built on FAN. The method is sound, which this page proves: every stored implication holds for every input vector. It is not complete: some implications need case splits, which is what recursive learning adds.
In plain words
When you set one signal of a circuit, simple rules tell you what other signals must be. Those rules move easily forward through gates but often get stuck going backward. For example, knowing that an OR gate outputs 1 does not tell you which input is 1.
Static learning works around this with an old rule of logic. If "A is true" always makes "B true", then "B false" always makes "A false". The tool tries every signal at 0 and at 1 before the real work starts, writes down every new fact it gets this way, and keeps the list. Later, when the test generator sets values, it reads the list and sees conflicts sooner, so it makes fewer wrong guesses.
When it applies
- The circuit is combinational, or the combinational part of a scan design, with stems and fanout branches as on the PODEM page.
- An implication engine exists, as in PODEM, FAN or the D-algorithm: from a set of values, it applies one-gate rules until nothing changes, or it finds a line that needs both values.
- There is time to run the engine twice per line before the search, and memory to store the learned implications.
- The search will meet the same kinds of situation many times, as in test generation for a long fault list, so a one-time cost pays off.
The template
Write when every input vector that gives line the value also gives line the value . A direct implication comes from one gate: known inputs fix the output, an AND output at 1 sets every input to 1, an AND output at 0 with all inputs but one at 1 sets the last one to 0, and a stem and its branches have one value. IMPLY applies the direct implications and the stored learned implications to a set of values until nothing changes. It returns CONFLICT when a line gets both values.
STATIC-LEARN(circuit)- 1
learned ← empty; constants ← empty - 2
repeat - 3
for each line a and each value v in {0, 1} - 4
S ← IMPLY({(a, v)}) - 5
if S is CONFLICT then add (a, ¬v) to constants; continue - 6
for each (b, w) in S with b ≠ a - 7
if (b, ¬w) ⇒ (a, ¬v) passes the usefulness test then - 8
add (b, ¬w) ⇒ (a, ¬v) to learned - 9
until a whole pass adds nothing - 10
return learned, constants
The holes are the implication engine and the usefulness test at line L7. SOCRATES runs one pass. Later tools repeat the passes, because a learned implication can make IMPLY find more on the next pass.
The usefulness test. Most contrapositives repeat what the direct rules already know. From at the input of an AND gate , IMPLY gives , and the contrapositive is a direct implication. SOCRATES keeps a contrapositive only when it adds something. The idea of its test is to look at the gate that drives . If is the value that the gate gives when all its inputs are at their non-controlling values, for example 0 at an OR output or 1 at an AND output, then is the value that the gate cannot pass back to its inputs, so the direct rules cannot find anything from , and the contrapositive is worth storing. The paper gives the exact conditions.
Why it is sound. Every value in at line L4 holds in every input vector with . Each direct implication follows from the function of one gate, so it holds in every vector where its premises hold. By induction on the order in which values enter , every value of holds in every vector with , as long as every learned implication used by IMPLY is sound too. The learned implications are sound by induction on the order in which they are added, since each one comes from a sound IMPLY run by the following step.
- Contraposition. If , then . Take any input vector with . If it gave , it would give by the first implication, which is false. Lines have only the values 0 and 1, so the vector gives .
- Constants. If IMPLY returns CONFLICT, then no input vector gives , since such a vector would give some line both values. So in every vector, and is a constant line. The fault stuck-at is then redundant, because no vector can activate it.
So every learned implication and every constant holds for all input vectors of the circuit. In a test generator, a situation is a set of values that the search wants, and an implication that holds for every vector also holds for every vector that agrees with . Using the learned implications therefore never removes a test that exists. They only find conflicts earlier.
What it misses. Static learning is not complete. Take inputs and , the gates and , and the output . The line is the constant 0. But setting any one line to any value implies nothing except the values of its stem and branches, because an XOR gate with one input unknown has an unknown output, and an XOR output tells nothing about one input. So static learning learns no implication and finds no constant, and the fault stuck-at 0 looks testable. Recursive learning at depth 2 shows that has no consistent input vector, as its page explains. In general, a contrapositive can only be as good as the forward run it comes from, and the forward run never splits cases.
Cost. Each IMPLY run takes time linear in the number of lines, gate inputs and stored implications, so one pass takes time for lines, gate input pins and learned implications. The learned list can hold up to implications in principle. In practice the usefulness test keeps it much smaller.
Example. Take inputs , and , the AND gates and , and the output . The input fans out to and .
| set | IMPLY gives | contrapositive | kept? |
|---|---|---|---|
| , , | yes: is the value of an OR with all inputs at 0 | ||
| no: direct | |||
| no: direct | |||
| , , | no: direct | ||
| , | no: direct |
The only new implication is . It is true, since , and the direct rules cannot find it: an OR at 1 with two unknown inputs implies nothing. Now say the search sets to propagate a fault effect and later tries . Without learning, the conflict shows only when and are evaluated after more decisions. With the learned implication, sets at once, and the search never tries .
Classic examples
- SOCRATES. The test generator of Schulz, Trischler and Sarfert ran static learning before test generation, together with improved multiple backtrace and unique sensitization. It cut the number of backtracks on the ISCAS benchmark circuits a lot. These are measured results of the paper.
- Redundancy identification. A conflict at line L5 proves at once that a line is constant, so the faults that need the other value are redundant. Learned implications also help the search prove other faults redundant.
- Equivalence checking. In equivalence checking, implications learned between the lines of two circuits show lines that are equal or complementary, which splits the problem into small parts.
- SAT solving. Failed literal probing in SAT preprocessing is the same idea on clauses: set a literal, propagate, and learn its negation if a conflict appears. In clause form contraposition is free, because a two-literal clause gives both and , as in the implication graph of 2-SAT.
Variations
- Several passes. Repeating the loop until it adds nothing finds implications that need an earlier learned one.
- Dynamic learning. Schulz and Auth (1989) also learn during the search, from the current situation and not only from single values, and use it to prove faults redundant.
- Recursive learning. Recursive learning splits each unjustified gate into cases and keeps what all cases share. With enough depth it finds every necessary value, which static learning cannot.
- Sequential circuits. The same idea works across clock cycles in time-frame expansion, where implications can relate a line in one frame to a line in another.
- Cheaper learning. Later work limits learning to fanout stems or to gates near reconvergence, where most useful implications come from.
Pitfalls
- Applying good-circuit facts to the faulty circuit. The learned implications hold for the fault-free circuit. In a five-valued test generator with D and D', they apply to the good-circuit part of each value. The faulty circuit computes a different function near the fault.
- Keeping everything. Without a usefulness test the list grows close to quadratic in the circuit size and slows every implication step, while most entries add nothing.
- Reading an empty result as a proof. If static learning finds no constant, the line can still be constant, as the XOR example shows.
- Changing the circuit. The learned list belongs to one netlist. After any change, such as inserting a test point, it must be learned again.
Exercises
- In the example, add the gate . Which new implications does static learning find from ?
- Build as one AND gate of and , without fanout. Show that is now a direct implication, so the usefulness test rejects it.
- Give a circuit with a constant line that static learning finds by a conflict at line L5.
References
- M. H. Schulz, E. Trischler and T. M. Sarfert, SOCRATES, a highly efficient automatic test pattern generation system, IEEE Transactions on Computer-Aided Design 7(1), 126 to 137, 1988, the section on static learning, with the learning procedure, the contrapositive law and the test that keeps only useful implications
- M. H. Schulz and E. Auth, Improved deterministic test pattern generation with applications to redundancy identification, IEEE Transactions on Computer-Aided Design 8(7), 811 to 816, 1989, the improved implication procedure (dynamic learning during the search) and its use to prove faults redundant
- W. Kunz and D. K. Pradhan, Recursive learning, a new implication technique for efficient solutions to CAD problems (test, verification and optimization), IEEE Transactions on Computer-Aided Design 13(9), 1143 to 1158, 1994, the comparison of static learning with recursive learning, and examples of implications that static learning misses
- 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 (SOCRATES and learning)
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 | W3 standard |
|
Tag 8EB5WS Edit this page History Report an error Markdown