B ATPG
B ATPG
Outline
Introduction to ATPG ATPG for Combinational Circuits Advanced ATPG Techniques
ATPG Program
Test vectors
Backtrack statistics
Redundant faults
Undetectable faults can cause performance, power, reliability problems, etc. Faults may be masked by undetectable faults.
# of detected faults Fault coverage= Total # of faults # of detected faults Fault efficiency= Total # of faults- # of undetectable faults
5
0 0 1 1
1 x 1 x
Test Compaction
To reduce the number of test vectors as long as we keep the same detectable fault coverage. Test compaction is important for randomly generated patterns.
Even for vectors generated by an ATPG, since the order of processing faults will decide which vectors are discovered first.
v1 v2 v3 v4
f1 x x x
f2 x x
f3 x x x
f4
f5 x x x
8
v1 v2 v3 v4
10
Dynamic compaction
Process generated vectors on-the-fly After generate a test for a fault, choose a secondary target fault to be tested and try to test the second fault by dont cares (X) not assigned by the first fault.
11
Combinational ATPG
Test Generation (TG) Methods
Exhaustive methods Boolean Equation Structural Analysis Implication Graph
12
f 0 0 0 0 0 1 1 1
f 0 0 0 0 0 1 0 1
a b
stuck-at 0
f c
15
f= ab + ac c
df/da = f(a=0) f(a=1) = 0 (b+c) = (b+c) Test-set for a s-a-0 = {(a,b,c) | a (b+c)=1} = {(11x), (1x1)}.
Fault activation requirement Fault sensitization requirement
Free w F
17
f= ab + ac c
G(i.e., F with h floating ) = h + ac dG/dh = G(h=0) G(h=1) = (ac 1) = (a+c) Test-set for h s-a-1 is { (a,b,c)| h (a'+c')=1 } = { (a,b,c)| (a'+b') (a'+c')=1 } = { (0xx), (x00) }. Test-set for h s-a-0 is {(a,b,c)| h (a'+c')=1} = {(110)}.
For fault activation For fault sensitization
18
Chain Rule
A B C D
19
Key techniques
Find inputs to (1) activate, and (2) propagate the fault through sensitized paths to POs Branch and bounds
20
More targets
Make decisions No Yes Pattern found? Yes End Correct results? No Delete previous decisions If no more decision to be deleted, select new targets.
21
More decisions
Fault propagation
Select propagation paths to POs Inputs to the gates on the propagation paths are set to non-controlling values if the inputs are not on the path.
Side inputs are set to non-controlling values.
Line justification
Find inputs that force certain signals to be 0 or 1.
22
Line justification
To assign d=1, we need (a b)=(1 1). To assign e=0, we need c=0.
a b
On line justification
Given a signal to justify, we need to make a decision on which inputs to set. For example, to set the output of an OR gate to 1, we need to choose which input to set to 1.
Backtrack
If we make a wrong decision (guess), we return and erase the decision (, and make another one). All decisions are recorded.
24
Branch-and-Bound Search
Test Generation is a branch-and-bound search
Every decision point is a branching point If a set of decisions lead to a conflict (or bound), a backtrack is taken to explore other decisions
(1) fault effect is propagated to a PO (2) all internal lines are justified
Since the search is exhaustive, it will find a test if one exists No test is found after all possible decisions are tried
Target fault is undetectable
25
b
0 1
c
0 1
G5
f1
f2
G5
G6
q=1 k=1
backtrack a=1, b=1 c=1, d=1 m=0, n=0 r=0
l=1
Fault activation set h to 0 Fault propagation e=1, f=1 o=0 m=1 n=1 Fault propagation q=1, r=1 To justify q=1 l=1 or k=1 Decision point c=0 (Success) Decision: l =1 c=1, d=1 m=0, n=0 r=0 inconsistency at r backtrack ! Decision: k=1 a=1, b=1 To justify r=1 m=1 or n=1 ( c=0 or d=0) Done !
r=1
28
Implications
Implications
Computation of the values that can be uniquely determined
Local implication: propagation of values from one line to its immediate successors or predecessors Global implication: the propagation involving a larger area of the circuit and re-convergent fanout
29
Fault activation
G1=0 {a=1, b=1, c=1} {G3=0, G2=0} G5=0
30
31
The D-Algebra
Allow the representation of the good and faulty behavior at the same time. Formally define/generate decision points in fault activation and propagation Introduce the symbol D in addition to 0, 1, x D = 1/0 (D 0/1) represents a signal which has value 1 in fault-free circuit and 0 in the faulty circuit.
D D D D D D D D D 0 D D 0 D D D D D D D D 1
32
33
Fault Activation
Specify the minimal input conditions which must be applied to a logic element to produce an error signal at its output.
Stuck-at faults at an AND output: Stuck-at-0 fault: 11D Stuck-at-1 fault: 0xD and x0D More complex fault model, e.g., bridging faults, gate type errors, can also be modeled.
34
{F=0} {Ff=1} or {F=1} {Ff=0} Example: 2-input AND gate output stuck-at 1
{F=0}={00, 01, 10}, {Ff=1}={00, 01, 10, 11}, {F=1}={11}, {Ff=0}={} {F=0} {Ff=1} = {00, 01, 10} {F=1} {Ff=0} = {}
35
Apply 01, we produce a 0/1 (D) at the output Apply 10, we also produce a (D) 0/1.
36
D-frontiers
Where to choose the propagation paths. D-frontiers should not be empty during the search of test patterns.
J-frontiers
Where to perform line justifications. J-frontiers will be empty after a test pattern is found.
37
D-frontiers
D-frontiers are the gates whose output value is X, while one or more inputs are D or D.
d
1 a 1 b c 1
G5 G1
D
f1 G6 X
f2
G3
G4
Fault activation G1=0 { a=1, b=1, c=1 } { G3=0 } Fault propagation can be done through either G5 or G6
D-frontiers={G5, G6}
38
J-frontiers
J-frontier: is the set of gates whose output value is known (i.e., 0 or 1), but is not implied by its input values.
a b c d k q l m n o e f h p r s
Fault activation set h to 0 Fault propagation e=1, f=1 o=0 Fault propagation q=1, r=1 We need to justify both q=1 and r=1: J-frontiers={q, r}.
39
D-drive Function
The D-drive selects a gate in the D-frontier and attempts to propagate the D and/or Dfrom its input(s) to its output by setting side-inputs to non-controlling values.
D X To drive D to the output, we need to set the side-input to 1. D 1 D
For more complex functions, we can use the truth table of 5-value logics.
40
Implication in D-Algorithm
Involve D and D in the implication. Basic principles are guided by the truth table of each logic gate (complex cell). Examples are given in the following pages.
41
After 0 1 0 a 0 a
1 0 D' D
J-frontier={ ... }
D-frontier={ ...,a }
D-frontier={ ... }
42
After 1 0 0 a 1 1 1
x x
J-frontier={ ...,a }
1 x
43
a 1 0 x
b 1 x 0
f 1 0 0
44
0 c
a 0 x 1 x
b x 1 0 0
c 0 x x 1
f 1 1 0 0
In this example, if we want to justify f=0 and we know c=1, then we also obtain the backward implication of ab=X0
45
Checking Consistency
Consistency check for 5-V logic
We might assign different requirements from different decisions. We have to make sure every signal have compatible assignment in the circuit.
0 0 1 X D D 0 0
1 1 1
X 0 1 X D D
D D D
D D D
46
Failure:
(1) D-frontier is empty and fault is not at POs (2) No decision left but J-frontier is not empty
47
No D-frontier left
Backtrack
Consistent? yes
no
Fail
Line justification
(next page)
48
yes
Backtrack
(remove last decisions and implied signals recover J-frontiers)
no
49
D-Algorithm Example
I2
1
I1 1 I4 I3
0 1
G1
G4 G5 G6 G7
1 D 1 1
G2 D
sa1
G9
G3 0
Fault activation set G2 to 0 I2=1, I3=1, D-Frontier={G5, G6}, JFrontier={} Fault propagation select G5 I1=1 G1=0 G4=1, D-Frontier={G6, G9}, J-Frontier={} Fault propagation select G9 G6=1, G7=1 I4=0, G3=0 I4=1 (Contradictory) propagation fails, backtrack to select another Dfrontier from {G6}.
50
I1 1 I4 I3
1 1
G1
G4 G5 G6 G7
1 D D 1
G2 D G3
sa1
0
G9
Fault propagation
select G6
51
9-Value D-Algorithm
Logic values (fault-free / faulty)
{0/0, 0/1, 0/u, 1/0, 1/1, 1/u, u/0, u/1, u/u}, where 0/u={0,D'}, 1/u={D,1}, u/0={0,D}, u/1={D',1}, u/u={0,1,D,D'}.
Advantage:
Automatically considers multiple-path sensitization, thus reducing the amount of search in D-algorithm The speed-up is NOT very significant in practice because most faults are detected through single-path sensitization
h i j
u/1
1/u D
1/1
0/u
e' a b c
0/1 u/1 u/1
u/1 D
u/0
n
D
k
u/1
f'
u/1
l
u/1
u/0
m
u/1
Fault activation set a to 0/u h=1/u, DFrontier={g} Fault propagation select g b=u/1, c=u/1 D-frontier={i, k, m} Fault propagation select i d=1/u Dfrontier={k, m, n} Fault propagation select n h=1; j, k, l, m=u/1 J-frontier={j, k, l, m, h} Justify j e=u/1 e=u/0 (consistent) Similarly f=u/1
54
ECAT Circuits
A B C E F G H sa0 J K L M Q R N P
D-algorithm will exhaustively enumerate all internal signals to confirm that N = Q = 1 is impossible.
56
C=1,E=1 F=1,G=0
57
0 c 0 d F 1 d F
1 c 0 d F 1 d S d F 0 c 1
1 c 0 1 d F
59
d S
d F
Backtrace()
Guide decisions to line justification. Backtrace maps a objective into a PI assignment that is likely to contribute to the achievement of the objective Traverses the circuit back from the objective signal to PIs Involves finding an all-x path from objective site to a PI, i.e., every signal in this path has value x A PI signal-value pair (j, vj) No signal value is actually assigned during backtrace !
62
Objective() Routine
Objective() { /* The target fault is w s-a-v */ if (the value of w is x) obj = (w, v ); else { select a gate (G) from the D-frontier; select an input (j) of G with value x; c = controlling value of G; obj = (j, c); } return (obj); }
63
Backtrace() Routine
Backtrace(w, vw) { /* Maps objective into a PI assignment */ G = w; v = vw; while (G is a gate output) { /* not reached PI yet */ inv = inversion of G; /* inv=1 for INV, NAND, NOR*/ select an input (j) of G with value x; G = j; /* new objective node */ v = vinv; /* new objective value */ } return (G, v); /* G is a PI */ }
64
Backtrace Example
Objective to achieved: (F, 1)
X a b X X X X F=1
F=1
66
Terminating Conditions
Success:
Fault effect seen at an output.
Failure:
D-frontier is empty and fault is not at any POs.
67
Example: PODEM
d'
1 0
h i j
0
1 D
e' a b c
0/1 1 1
0 D
n
X
k
1
f'
X
l
X
m
X
Fault activation set a to 0 h=1, D-Frontier={g} Fault propagation select g b=1, c=1 Dfrontier={i, k, m} Fault propagation select i d=1 D-frontier={k, m, n} Fault propagation select n objective =(k, 1) Backtrace e=0 e=1 j=0 Empty D-frontier and fault not at PO Backtrack to e=1 e=0 j=1, k=D
h i j
1
1 D D-frontier={m, n} Fault propagation select n objective =(m, 1) Backtrace f=0 f=1 l=0 Empty D-frontier and fault not at PO Backtrack to f=1 f=0 l=1, m=D
e' a b c
0/1 1 1
1 D
n
D
k
D
n=D, success!!
f'
1
l
1
m
D
sa0
70
Characteristics of PODEM
A complete algorithm like D-algorithm Will find the test pattern if it exists Use of backtrace() and forward simulation No J-frontier, since there are no values that require justification No consistency check, as conflicts can never occur No backward implication Backtracking is implicitly done by simulation rather than by an explicit and time-consuming save/restore process Experimental results show that PODEM is generally faster than the D-algorithm
71
Selection Principle
Principle 1: among several unsolved problems, attack the hardest one Ex: to justify a 1 at an AND-gate output Principle 2: among several solutions for solving a problem, try the easiest one Ex: to justify a 1 at OR-gate output
Objective (g, 1)
Two unsolved problems e=1 and f=1 Choose the harder one: f=1 (lower probability of being 1).
Objective (g, 0)
Two possible solutions: e=0 or f=0 Choose the easier one: f=0 (higher probability of being 0).
e=3/4 g f=1/4
Probability of being 1
74
Immediate Implications
A B C PODEM Initial objective L = 0 Backtrace to PI: B = 0 Implication: H = 1, K = 1, J = 0, L = 1 Fail backtrack.
75
H K E
J sa1 L
Unique Sensitization
A 1 0 B G1 1 G2 CD E D G3 1 D G4
F 1
Only one path to propagate D on signal C to output H. Set all the off-path inputs to non-controlling values. G1 = 1, E = 1, F = 1, A = 1 B=0
PODEM
Initial objective: set G1 to 1 Backtrace to PI: A = 0 assigning A = 0 will later block the propagation of D
76
Head lines
Output of fanout-free regions with PIs as inputs.
Backtrace in FAN stop at headlines. Reduce search space.
77
11 1
1 0
11 1
0
Set to 0 the input w/ easiest-to-control to 0 input.
PODEMs depth-first search is sometimes inefficient. Breadth-first multiple backtrace identifies possible signal conflicts earlier. Attempts to satisfy a set of objectives simultaneously
78
Multiple Backtrace
Starts from a set of objectives (Current_objectives) Maps these multiple objectives into head-line assignments that is likely to
Contribute to the set of objectives Or show that objectives cannot be simultaneously achieved
0 Multiple objectives may have conflicting requirements at a stem 0 1 1
79
A1 1 A B A2 0 E E1 1 E2 G 0 H 1
I=1
1
Consistent stem C
1 1
Current_objectives
Processed entry
(I,1), (J,0) (J,0), (G,0) (G,0), (H,1) (H,1), (A1,1), (E1,1) (A1,1), (E1,1), (E2,1), (C,1) (E1,1), (E2,1), (C,1) (E2,1), (C,1) (C,1) Empty restart from (E,1) (E,1) (A2,0) empty
(I,1) (J,0) (G,0) (H,1) (A1,1) (E1,1) (E2,1) (C,1) (E,1) (A2,0)
C C C C C
80
81
FAN Algorithm
FAN() begin if Imply_and_check() = FAILURE then return FAILURE if (error at PO and all bound lines are justified) then begin justify all unjustified head lines return SUCCESS end if (error not at PO and D_frontier = ) then return FAILURE /* initialize objectives */ add every unjustified bound line to Current_objectives select one gate (G) from the D-frontier c = controlling value of G (to next page)
83
84
85
Static learning
Start the learning process before ATPG
Dynamic learning
Start the learning process in between ATPG steps when some signal values are known Costly process
87
P Q is true
We can derive
~Q ~P is true
Example:
A B C D 1 F A B C
E (B=1)
E (B=0)
88
(Static Learning)
(Dynamic Learning)
We can derive
Either Q or S is true.
Example:
Both [(a=0) => (i=0)] and [(a=1) => (i=0)] are true. Either (a=0) or (a=1) holds => (i=0)
1 1 1 0 0 1 i=0 1 1 0 a=1 1 1 1 0 i=0
89
a=0
G is true.
Example:
[a=0] and [(a=0) => (f=0)] => (f=0)
90
Recursive Learning
From known signal values, try all possible decisions (recursively). If a certain signals have the same values among all decisions, they are implied values.
91
j=1
For e1, try a1=0 a2=0, e2=0 For e1, try b1=0 b2=0, e2=0 e2=0 g2=0 l=0 k=1 f2=0
For f1, try c1=0 c2=0, f2=0 For f1, try d1=0 d2=0, f2=0
92
93
Step
1 2 3 4 5
Step 1 2 3
Satisfiability-based algorithms are currently the fastest implementation for justification and commonly applied to verification problems.
We have a separate set of slides about SAT.
95
a b
c
c c
Extra implication are found by tracing linked nodes. In this example, a a and b b, hence a=1, b=1. a 0 0 1 1 b 0 1 0 1
1 1 0 1
97
Implication Graph d=0 New paths: a-d-d-a, F-d-d-F, b-d-d-b New conditions: a a, F F, b b Implied logic values: a=1, F=1, b=1
Implication Graph F=1 (i.e., de=0) New paths: b-d-e-b, b-e-d-b New conditions: b b Implied logic values: b=1
98