Test Data Compression
Test Data Compression
Test Data Compression
Test data compression consists of test vector compression on the input side
and response compaction on the output side. Test data compression involves
adding some additional on-chip hardware before and
after the scan chains. This additional hardware decompresses
the test stimulus coming from the tester; it also
compacts the response after the scan chains and before
it goes to the tester. This permits storing the test data in a
compressed form on the tester. With test data compression,
the tester still applies a precise deterministic
(ATPG-generated) test set to the circuit under test (CUT).
The advantage
of test data compression is that it generates the
complete set of patterns applied to the CUT with ATPG,
and this set of test patterns is optimizable with respect
to the desired fault coverage. Test data compression is
also easier to adopt in industry because it is compatible
with the conventional design rules and test generation
flows for scan testing.
Test data compression provides two benefits. First, it
reduces the amount of data stored on the tester, which
can extend the life of older testers that have limited
memory. Second—and this is the more important benefit,
which applies even for testers with plenty of memory—
it can reduce the test time for a given test data
bandwidth. Doing so typically involves having the
decompressor expand the data from n tester channels
to fill greater than n scan chains. Increasing the number
of scan chains shortens each scan chain, in turn reducing
the number of clock cycles needed to shift in each
test vector.
Test data compression must compress the test vectors
losslessly (that is, it must reproduce all the care bits
after decompression) to preserve fault coverage. The
output response, on the other hand, can use lossy compaction
(which does not reproduce all data, losing
information) with negligible impact on fault coverage.
Ideally, the output response could be compacted using
just a multiple-input signature register (MISR
The subject here is test vector compression techniques.
Test vectors are highly compressible because
typically only 1% to 5% of their bits are specified (care)
bits. The rest are don’t-cares, which can take on any
value with no impact on the fault coverage. A test cube
is a deterministic test vector in which the bits that ATPG
does not assign are left as don’t-cares (that is, the ATPG
does not randomly fill the don’t-cares).
In addition to containing a very high percentage of
don’t-cares, test cubes also tend to be highly correlated
because faults are structurally related in the circuit.
Both of these factors are exploitable to achieve high
amounts of compression.
The focus is on hardware-based test vector compression
techniques for scan architectures;
Test vector compression schemes fall broadly into
three categories:
■ Code-based schemes use data compression codes to
encode test cubes.
■ Linear-decompression-based schemes decompress
the data using only linear operations (that is LFSRs
and XOR networks).
■ Broadcast-scan-based schemes rely on broadcasting
the same values to multiple scan chains.
Linear-decompressor-based schemes:
SEED CALCULATION:
LFSR FEEDBACK:
SEED REGISTER
A linear feedback shift register (LFSR) is a shift register whose input bit is a
linear function of its previous state.
The only linear functions of single bits are xor and inverse-xor; thus it is a shift
register whose input bit is driven by the exclusive-or (xor) of some bits of the
overall shift register value.
The initial value of the LFSR is called the seed, and because the operation of
the register is deterministic, the sequence of values produced by the register
is completely determined by its current (or previous) state. Likewise, because
the register has a finite number of possible states, it must eventually enter a
repeating cycle. However, an LFSR with a well-chosen feedback function can
produce a sequence of bits which appears random and which has a very long
cycle.
Applications of LFSRs include generating pseudo-random numbers, pseudo-
noise sequences, fast digital counters, and whitening sequences. Both
hardware and software implementations of LFSRs are common
An LFSR is a shift register that, when clocked, advances the signal through the register from one bit to the
next most-significant
bit (see Figure 1). Some of the outputs are combined in exclusive-OR configuration to form a feedback
mechanism. A linear
feedback shift register can be formed by performing exclusive-OR on the outputs of two or more of the
flip-flops together and
feeding those outputs back into the input of one of the flip-flops as shown in Figure 2.
A LFSR (linear feedback shift register) is a shift register where the input is a linear
function of two or more bits (taps). There are many possible configurations, the one
presented here is very simple and has the property that it will start from an input of all 0's
and is very easy to implement in software and hardware.
A LFSR of this type will never contain only 1's and would stall if loaded with that value.
Only some taps will generate a maximal sequence with a period of 2^n-1 cycles.
If you need a counter and it does not have to count in a linear way then a LFSR is faster
and requires less hardware resources.
The coefficients gi represent the tap weights, as defined in Figures 1 and 2, and are 1 for taps
that are connected (fed back), and 0 otherwise. The order of the polynomial, m, represents the
number of LFSR stages. Rules of linear algebra apply to the polynomial, but all mathematical
operations are performed in modulo-2:
Modulo-2 addition:
0+0=0
0+1=1
1+1=0
Modulo-2 multiplication:
0*0=0
0*1=0
1*1=1
G(X) = X3 + X1 + 1
The constant 1 in the generator polynomial represents the input connection of the shift register,
g0.
Now, here is the key to determining m-sequence feedback taps: The generator polynomial of
Equation 1 is said to be primitive if it cannot be factored (i.e. it is prime), and if it is a factor of (i.e.
can evenly divide) XN+1, where N = 2m-1 (the length of the m-sequence). It can be shown that an
LFSR represented by a primitive polynomial will produce a maximal length sequence.
Consider again the example of the [3, 1]g LFSR just given. We wish to know if this generator will
produce an m-sequence. First we note that m = 3 and N=23-1=7. It can be shown that its
polynomial, X3+X1+1 , cannot be factored, and it can be shown that its polynomial is a factor of
X7+1. Thus, we conclude that this LFSR will indeed produce a maximal length sequence.
In this example, we went through the process of determining whether or not the given set of
feedback taps would result in a maximal length sequence. Normally, however, we are required to
do just the opposite. That is, we are normally asked to find all sets of feedback taps that will
produce m-sequences for a given register size.
For example, we may be asked to find all sets of maximal-length feedback taps for an LFSR with
m=3 registers. We do this as follows: The length of the m-sequences will be N=23-1=7. We know
that the solution lies in all the primitive factors of polynomial X7+1. We use modulo-2 linear
algebra (perhaps with the aid of a computer algorithm) to find the prime factors to be
The primitive polynomials are those factors whose order is the same as the register size, m = 3.
Of the three prime factors, the last two meet this criterion. Thus we see that there are exactly two
sets of m-sequence feedback taps, [3, 1]g and [3, 2]g.
It is interesting to note that, given any shift register size, there will always be an even number of
m-sequence feedback sets. More specifically, given any one of its m-sequence feedback sets,
whose sequence will be the mirror image of the original set's sequence. Note that subtracting
feedback tap numbers from m for the companion set is equivalent to reversing the order of those
taps. Thus we conclude that, for any given feedback set that produces an m-sequence, the mirror
image of the feedback set will produce the mirror image of the m-sequence. And, of course, the
resulting sequence will also be an m-sequence since all possible states are exhausted. An astute
reader may have noticed in the last example that the two derived sets of m-sequence feedback
taps, [3, 1]g and [3, 2]g, are in fact mirror images of each other.
Tables of m-sequence feedback taps are presented below for the reader's convenience.
SHIFT REGISTER
One of the two main parts of an LFSR is the shift register (the other being the feedback
function). A shift register is a device whose identifying function is to shift its contents
into adjacent positions within the register or, in the case of the position on the end, out of
the register. The position on the other end is left empty unless some new content is shifted
into the register.
The contents of a shift register are usually thought of as being binary, that is, ones and
zeroes. If a shift register contains the bit pattern 1101, a shift (to the right in this case)
would result in the contents being 0110; another shift yields 0011. After two more shifts,
things tend to get boring since the shift register will never contain anything other than
zeroes.
Two uses for a shift register are 1) convert between parallel and serial data and 2) delay a
serial bit stream. The conversion function can go either way -- fill the shift register
positions all at once (parallel) and then shift them out (serial) or shift the contents into the
register bit by bit (serial) and then read the contents after the register is full (parallel). The
delay function simply shifts the bits from one end of the shift register to the other,
providing a delay equal to the length of the shift register.
Some nomenclature:
Clocking) One of the inputs to a shift register is the clock; a shift occurs in the register
when this clock input changes state from one to zero (or from zero to one, depending on
the implementation). From this, the term "clocking" has arisen to mean activating a shift
of the register. Sometimes the register is said to be "strobed" to cause the shift.
Shift direction) A shift register can shift its contents in either direction depending on how
the device is designed. (Some registers have extra inputs that dictate the direction of the
shift.) For the purposes of this discussion, the shift direction will always be from left to
right.
Output) During a shift, the bit on the far right end of the shift register is moved out of the
register. This end bit position is often referred to as the output bit. To confuse matters a
bit, the bits that are shifted out of the register are also often referred to as output bits. To
really muddy the waters, every bit in the shift register is considered to be output during a
serial to parallel conversion. Happily, the context in which the term "output" is used
generally clears things up.
Input) After a shift, the bit on the left end of the shift register is left empty unless a new
bit (one not contained in the original contents) is put into it. This bit is sometimes
referred to as the input bit. As with the output bit, there are several different references to
input that are clarified by context.
FEEDBACK FUNCTION
In an LFSR, the bits contained in selected positions in the shift register are combined in
some sort of function and the result is fed back into the register's input bit. By definition,
the selected bit values are collected before the register is clocked and the result of the
feedback function is inserted into the shift register during the shift, filling the position
that is emptied as a result of the shift.
The feedback function in an LFSR has several names: XOR, odd parity, sum modulo 2.
Whatever the name, the function is simple: 1) Add the selected bit values, 2) If the sum is
odd, the output of the function is one; otherwise the output is zero. Table 1 shows the
output for a 3 input XOR function.
The bit positions selected for use in the feedback function are called "taps". The list of the
taps is known as the "tap sequence". By convention, the output bit of an LFSR that is n
bits long is the nth bit; the input bit of an LFSR is bit 1.
TAP SEQUENCES
An LFSR is one of a class of devices known as state machines. The contents of the
register, the bits tapped for the feedback function, and the output of the feedback function
together describe the state of the LFSR. With each shift, the LFSR moves to a new state.
(There is one exception to this -- when the contents of the register are all zeroes, the
LFSR will never change state.) For any given state, there can be only one succeeding
state. The reverse is also true: any given state can have only one preceding state. For the
rest of this discussion, only the contents of the register will be used to describe the state
of the LFSR.
A state space of an LFSR is the list of all the states the LFSR can be in for a particular tap
sequence and a particular starting value. Any tap sequence will yield at least two state
spaces for an LFSR. (One of these spaces will be the one that contains only one state --
the all zero one.) Tap sequences that yield only two state spaces are referred to as
maximal length tap sequences.
The state of an LFSR that is n bits long can be any one of 2^n different values. The
largest state space possible for such an LFSR will be 2^n - 1 (all possible values minus
the zero state). Because each state can have only once succeeding state, an LFSR with a
maximal length tap sequence will pass through every non-zero state once and only once
before repeating a state.
One corollary to this behavior is the output bit stream. The period of an LFSR is defined
as the length of the stream before it repeats. The period, like the state space, is tied to the
tap sequence and the starting value. As a matter of fact, the period is equal to the size of
the state space. The longest period possible corresponds to the largest possible state
space, which is produced by a maximal length tap sequence. (Hence "maximal length")
Table 2 is a listing of the internal states and the output bit stream of a 4-bit LFSR with tap
sequence [4, 1]. (This is the LFSR shown in Figure 1.)