Design for test, DFT, is the set of structures added to a chip so that each manufactured part can be checked quickly for defects. Manufacturing is never perfect: a speck of dust or a weak via can break a wire or short two together, and some fraction of every wafer is faulty. A chip with billions of transistors can't be tested by running programs on it and hoping, so designers build test access into the hardware. This article explains why test is needed, how scan chains and test patterns find faults in logic, how memories test themselves, how a chip is reached from the test equipment through JTAG, and how test decisions are made for a whole SoC.

12 min read | Intermediate

What You'll Learn

  • Explain why manufactured chips need structured test
  • Describe scan chains, fault models and test coverage
  • Explain memory built-in self-test and repair
  • Describe JTAG and test planning across an SoC

Why Test Is Needed

Verification checks that the design is right; manufacturing test checks that each chip was built as designed. Every chip from the wafer is tested, and faulty ones are thrown away before they are packaged or shipped. The yield is the fraction of chips that pass. For a large chip on a new process, yield may start well below one half and improve as the process matures.

Test time costs money: the test equipment, called automatic test equipment or ATE, is expensive, and every second a chip spends on it adds to the chip's cost. A test must therefore find nearly every defect in as little time as possible. Shipping a faulty chip is far worse than the test cost: customers measure quality in defective parts per million, and car makers ask for numbers close to zero.

Fault Models

Real defects are physical and varied, so tests are written against simple fault models that represent them. The most common is the stuck-at model: any one wire in the logic may be stuck at 0 or stuck at 1. A test pattern detects a stuck-at fault if, with the fault present, some output of the chip has a different value than without it. The model is simple, but tests that catch all stuck-at faults also catch most real shorts and opens.

Some defects only make a path slower, so the logic computes the right answer, just too late. Transition or delay fault tests catch them: they launch a change and capture the result one fast clock later, at the chip's real speed. Other models cover shorts between neighbouring wires and faults inside cells. The share of modelled faults that the patterns detect is the test coverage, and production test usually aims for well above 95 percent stuck-at coverage, often above 99 percent.

Scan Chains

The difficulty with logic is reaching it. A flip-flop deep in a pipeline can only be set to a chosen value by running the right sequence of instructions, and its value can only be seen if it eventually reaches an output pin. Scan solves this. Every flip-flop gets a multiplexer at its input. In normal mode it takes its usual input; in test mode, the flip-flops are joined into long shift registers called scan chains.

Five flip-flops joined in a chain from scan in to scan out, each driving a block of logic; a pattern is shifted in, one capture clock records the logic outputs into the flip-flops, and the result is shifted out to be compared

A test then has three steps. Shift a chosen pattern into all the flip-flops, one bit per clock. Switch to normal mode for one clock, so that each flip-flop captures the output of the logic in front of it. Shift the captured values out and compare them with the expected values. Every flip-flop becomes both an input and an output of the test, so the logic between flip-flops can be tested as if it were simple combinational logic. Tools called ATPG, automatic test pattern generation, compute the patterns that detect the most faults.

Shifting is slow if the chains are long: a chip with a million flip-flops and one chain would need a million clocks per pattern. Designs use hundreds of chains in parallel, and test compression: a small decompressor on chip expands a few input bits into patterns for many chains, and a compactor squeezes the outputs back. This cuts test data and time by a large factor, often ten to a hundred.

Quick Check

Q: A chip has 200,000 flip-flops in 400 equal chains. How many shift clocks does loading one pattern take?

Show Answer

Each chain holds 200,000 / 400 = 500 flip-flops, so loading takes 500 clocks. The previous pattern's results are shifted out at the same time as the next pattern is shifted in.

Testing Memories

Memories are dense arrays of cells that scan can't reach, and they are often the largest part of an SoC's area. They are tested with memory built-in self-test, MBIST: a small controller next to each memory, or shared by a group, writes and reads patterns through the memory's ports and checks the results. The patterns, called march tests, step through every address in a set order, writing and reading 0s and 1s, so that they catch stuck cells, cells that disturb their neighbours, and faults in the address decoder.

Because large memories are so likely to contain a defect somewhere, they are built with spare rows and columns. When MBIST finds a failing cell, the chip's repair logic records which row or column to replace, usually in fuses blown at test, and from then on accesses to the bad row go to the spare. Repair turns many chips that would have failed into good ones, which matters greatly for yield.

JTAG and Test Access

The test equipment needs a way to control all this through a few pins. The standard way is JTAG, named after the group that defined it and standardized as IEEE 1149.1. It uses four or five pins: a clock, a data input, a data output, a mode select and an optional reset. Through them, the tester shifts instructions and data into a small state machine on the chip, the test access port controller, which selects what to do: run scan, start MBIST, read an identification code, or control the pins.

JTAG was first designed for boundary scan: a chain of cells at every I/O pin, which can drive and capture the pins. This lets a board maker check the connections between chips on a board without running any software. The same port is also used to reach on-chip debug, which is why it must be locked in production chips, as Security Architecture explains. Large SoCs connect many internal test features behind the port through a network of switchable chains, so that the tester can reach any block's test controller without passing through all the others.

Where Is This Used?

Every chip shipped in volume goes through scan, MBIST and often at-speed tests on a tester, at the wafer and again after packaging. Chips for cars also run self-tests in the field: logic built-in self-test, LBIST, applies patterns from an on-chip generator at every power-up, so that a fault that develops in the car is found before it matters, which is part of the safety case described in Safety and Reliability. Board makers use boundary scan to find solder faults.

Test at SoC Level

An SoC combines IP from many sources, as Buy, Reuse or Build: Choosing IP describes, and each block comes with its own test structures. Integrating them needs a plan. Blocks are often wrapped, so that each can be tested on its own with its inputs driven and outputs captured by the wrapper, and the tester can test several blocks in parallel. Hard blocks such as PLLs, analog circuits and high-speed interfaces have their own tests, often a loopback in which a transmitter's output is fed back to its own receiver.

The plan decides the test schedule: which blocks are tested together, how many pins and chains each needs, and the power limit. Test patterns switch far more flip-flops at once than normal operation does, so testing everything at the same time can draw more current than the package and the tester can supply, and drop the voltage enough to fail good chips. Schedules split tests into groups that stay within the limit.

DFT also affects the design itself. Scan multiplexers add a small delay and area to every flip-flop. Clocks must be controllable in test mode, so the clock generators need test multiplexers, and the clock domain crossings and resets described in Clock Architecture and Clock Domain Crossings must behave predictably during test. Logic that can't be controlled or observed, for example because a reset is generated internally, lowers coverage and needs test points added. That is why DFT is planned with the architecture, not added at the end.

Quick Check

Q: Why can scan testing draw more power than the chip ever uses in normal operation?

Show Answer

While shifting, a large share of all flip-flops toggle on every clock, since the patterns are close to random. In normal operation, only a small fraction of the logic switches in any cycle, and clock gating keeps idle blocks quiet.

Learning From Failures

Test does more than sort good chips from bad ones. When a chip fails, the failing patterns and the flip-flops that captured wrong values point to where the defect is. Diagnosis tools take these results and list the most likely faulty wires or cells. Across thousands of failing chips, the results show patterns: a certain cell, a certain layer, or a certain area of the wafer failing more often than others. The factory and the design team use this to find the cause, whether a process step that needs tuning or a layout feature that is too hard to make, and yield improves.

The same structures help with chips that fail later, returned from customers. A part that passed every test and failed in the field shows a gap in the test set, and the missing pattern or fault model is added for future production. This feedback is why test engineers watch the defect rates of shipped parts as closely as the yield on the tester.

The Cost of Test

A simple calculation shows why compression and parallel testing matter. Suppose a chip needs 10,000 patterns, each with chains of 500 flip-flops, shifted at 100 MHz. These values are assumptions for this example. Each pattern takes about 500 clocks, so all of them take 10,000 x 500 / 100 MHz = 50 ms. Without compression, with chains ten times longer, the same test would take 0.5 s. At a cost of a few cents per second of tester time, and millions of chips, the difference is large, and memory tests, analog tests and repeats at several voltages add to it.

Common Mistakes

Mistake #1: Adding DFT at the end

Clocks, resets and blocks that can't be controlled in test mode lower coverage, and fixing them late changes the design. Plan test with the architecture.

Mistake #2: Ignoring test power

Scan shifting toggles far more logic than normal operation. Testing too much at once can fail good chips, or damage them.

Mistake #3: Leaving test access open

JTAG and scan can read and set any flip-flop, including those that hold keys. Production chips must lock or protect them.

Practice Exercise

Challenge: Estimate Test Time

A chip has 2 million flip-flops and needs 5,000 scan patterns. The tester supplies 32 scan-in pins and shifts at 50 MHz. These numbers are assumptions for this exercise. (a) Without compression, using one chain per pin, how long does scan test take? (b) With a decompressor feeding 1,600 internal chains from the same 32 pins, how long does it take?

Hint

Chain length = flip-flops / number of chains. Time = patterns x chain length / shift frequency.

Solution

(a) 32 chains of 62,500 flip-flops: 5,000 x 62,500 / 50 MHz = 6.25 s. (b) 1,600 chains of 1,250 flip-flops: 5,000 x 1,250 / 50 MHz = 0.125 s, fifty times faster, which is why compression is used on nearly every large chip.

Summary

  • Manufacturing test checks every chip for defects; yield is the fraction that pass, and test time costs money.
  • Tests target fault models: stuck-at faults, and transition faults at real speed; coverage measures how many are found.
  • Scan chains turn flip-flops into shift registers so ATPG patterns can test the logic between them, with compression to save time.
  • MBIST tests memories with march patterns, and repair replaces bad rows or columns with spares.
  • JTAG gives the tester access through a few pins, and an SoC test plan schedules blocks within power limits.
Did you find what you were looking for?

Quiz

No quiz questions available for this article.