HomeRTL→SiToolsInterview
Chapter 8 of 10
← Ch.7 STA Ch.9 Power →
🧪 Scan Chain Visualizer with Fault Injection inside

Design for Test (DFT)

A chip that works in simulation but cannot be tested in production is worthless. DFT engineers the design to make every gate observable and controllable, enabling high-coverage testing of billions of manufactured devices.

📖 ~35 min read 🎯 Scan · ATPG · BIST · JTAG 🏭 Next: Power Analysis →
In this chapter
  1. Why DFT Matters
  2. Scan Insertion
  3. Fault Models
  4. ATPG — Automatic Test Pattern Generation
  5. BIST — Built-In Self Test
  6. JTAG / Boundary Scan (IEEE 1149.1)
  7. Interactive: Scan Chain Visualizer
  8. Key Takeaways

1. Why DFT Matters

A fabricated chip can fail not because of design errors, but because of manufacturing defects: tiny particles of contamination, variations in oxide thickness, or etch imperfections that create unintended shorts (bridging faults), opens, or incorrect logic levels. These are random and unpredictable — they cannot be simulated before fabrication.

Without DFT, only the primary inputs and outputs of the chip are accessible to an external tester. The internal state of millions of flip-flops is invisible, and the vast majority of gates cannot be exercised to detect defects. Industry targets for test coverage:

Fault modelIndustry targetRisk if under-target
Stuck-at (SA0/SA1)> 98% fault coverageDefective chips shipped to customers
Transition fault (slow-to-rise/fall)> 95% fault coverageMarginal chips fail in field under temperature/voltage stress
Path delay fault> 85% for critical pathsAt-speed failures; chips pass at low speed but fail at rated frequency

2. Scan Insertion

Scan insertion replaces standard D flip-flops with scan flip-flops (SFF), which add two ports: SI (scan input) and SE (scan enable). When SE = 1, the FF's D input is disconnected and replaced by SI, forming a shift register. When SE = 0, the FF operates normally.

All SFFs are chained together into one or more scan chains. During test:

  1. Scan shift in (SE=1): Clock the test pattern into the chain bit by bit through SI
  2. Capture (SE=0, one clock cycle): Apply the loaded pattern functionally, capturing the circuit's response into the SFFs
  3. Scan shift out (SE=1): Shift the captured response out through SO to the tester
  4. Compare captured response to expected values; any difference = detected fault
Why multiple scan chains? A design with 100,000 FFs as a single chain would require 100,000 clock cycles just to shift in one test pattern — an unacceptably long test time. Using 100 parallel chains of 1,000 FFs each reduces shift time by 100×. Modern designs use 64–512 scan chains. Trade-off: more chains = more SI/SO pins needed.

3. Fault Models

A fault model is an abstraction of a physical defect. ATPG generates patterns to detect faults defined by the model:

Fault modelDescriptionPhysical cause
Stuck-at-0 (SA0)Net permanently at logic 0 regardless of inputsShort to GND, broken driver
Stuck-at-1 (SA1)Net permanently at logic 1Short to VDD, open pull-up
Slow-to-rise (STR)Net rises more slowly than specifiedWeak driver, increased resistance
Slow-to-fall (STF)Net falls more slowly than specifiedWeak pull-down, excess capacitance
Bridging faultTwo nets shorted togetherLithography defect, metal shorting
Open faultA connection is brokenVia open, metal crack

4. ATPG — Automatic Test Pattern Generation

ATPG automatically generates the minimum set of test patterns that maximizes fault coverage. The two core operations for any ATPG algorithm are:

Classical ATPG algorithms

# Define DFT scan signals (Synopsys DC / Fusion Compiler)
set_dft_signal -view existing_dft \
  -type ScanEnable \
  -port SE

set_dft_signal -view existing_dft \
  -type ScanDataIn \
  -port scan_in[*]

# Preview DFT insertion (dry run)
preview_dft -show scan_summary

# Insert DFT (replaces FFs with scan FFs)
insert_dft

# Write scan definition file for ATPG tool
write_scan_def -output scan.def

# In Synopsys TetraMAX / Mentor FastScan: run ATPG
run_atpg \
  -fault_type stuck \
  -effort high \
  -target_coverage 98

5. BIST — Built-In Self Test

LBIST (Logic BIST)

LBIST embeds a pseudo-random pattern generator (PRPG) and a multiple-input signature register (MISR) on-chip. The PRPG generates many random patterns (typically 100,000–1,000,000) and feeds them into the scan chains. The MISR compresses all captured responses into a single signature. After the test completes, the signature is compared to the expected golden value. A mismatch means at least one fault was detected.

MBIST (Memory BIST)

SRAMs require dedicated MBIST because standard ATPG cannot access internal memory cells. MBIST runs march algorithms — systematic sequences of read/write operations that detect stuck-at, coupling, transition, and address decoder faults:

6. JTAG / Boundary Scan (IEEE 1149.1)

JTAG (Joint Test Action Group) defines a standardized serial test interface present on almost every modern chip. Four mandatory signals: TCK (test clock), TMS (test mode select), TDI (test data in), TDO (test data out), plus optional TRST (reset).

TAP Controller

The Test Access Port (TAP) controller is a 16-state state machine driven by TCK and TMS. Key states: Test-Logic-Reset, Run-Test/Idle, Shift-DR, Shift-IR, Update-DR, Update-IR. The controller manages routing TDI/TDO to either the instruction register (IR) or data registers (DR).

Boundary scan cells

Each chip I/O pin has a boundary scan cell (BSC) — a small register that can capture the pin's logic value or force it to a specific value. The BSCs form the Boundary Scan Register (BSR), chained from TDI to TDO. JTAG instructions:

🧪 Interactive: Scan Chain Visualizer
8-FF design. Toggle between Functional mode (SE=0) and Scan Shift mode (SE=1). In Scan mode, watch a test pattern shift in. Click any FF to inject a stuck-at fault.
Mode: Functional. Click any FF to inject a stuck-at fault. Toggle SE to enter scan mode.
Functional
Current Mode (SE)
Shift Pattern
None
Injected Fault

✅ Chapter 8 Key Takeaways

Next → Chapter 9
Power Analysis & Signoff
Dynamic and static power components, IR drop analysis, electromigration, UPF power domains, and IR drop heatmap demo.