Scan chain testing is a fundamental part of Design for Testability (DFT). It improves the controllability and observability of internal sequential logic by connecting scan flip-flops into shift registers. During test mode, test data is shifted into the scan chain, captured by the circuit, and shifted out for comparison with the expected response.
However, scan testing can fail at different stages. A scan chain may not shift data correctly, scan output may become stuck, or the chain may pass shift testing but fail during capture. These failures can result from scan-cell connectivity problems, incorrect scan-enable control, clock or reset issues, timing violations, scan-chain reordering mistakes, or test-configuration errors.
Debugging requires more than checking whether an ATPG pattern passes or fails. Engineers must first identify the failure signature, isolate the affected chain, inspect the scan architecture, and determine whether the problem is structural, timing-related, or pattern-specific.
This article explains a systematic approach to debugging scan chain failures, including practical examples and the checks commonly performed during DFT implementation and validation.
Understanding How a Scan Chain Works
A scan chain is formed by connecting the scan input (SI) and scan output (SO) terminals of scan flip-flops in a serial path. A scan flip-flop typically has a functional data input and a scan data input selected through a multiplexer controlled by scan enable.
When scan enable is asserted, the flip-flop receives data from the previous scan cell. When scan enable is deasserted, it captures functional data.
For example, consider a scan chain containing four scan flip-flops:
SI → FF1 → FF2 → FF3 → FF4 → SO
If the input sequence is shifted into the chain, each active scan clock moves the stored data by one position. After the required number of shift cycles, the data can be observed at the scan output.
A typical scan test involves three operations:
- Shift-in: Load the test stimulus into the scan chain.
- Capture: Apply the required functional or test clock pulse to capture the circuit response.
- Shift-out: Unload the captured response and compare it with the expected data.
A failure during any of these operations can produce a scan test failure. The first debugging task is therefore to identify whether the problem occurs during shift-in, capture, or shift-out.
Identify the Type of Scan Chain Failure
Before modifying the design or test setup, classify the failure using simulation waveforms, scan reports, ATPG logs, and tester results.
Common scan chain failure signatures include:
Failure type | Typical observation | Possible cause |
Stuck-at failure | Scan output remains at 0 or 1 | Stuck signal, faulty cell, reset or control issue |
Open-chain failure | Data stops propagating beyond a point | Broken connection or incorrect scan stitching |
Shift mismatch | Shifted-out data differs from expected data | SI/SO connectivity, scan-enable or clock issue |
Capture failure | Shift passes but captured response mismatches | Functional logic, capture clock or timing issue |
Intermittent failure | Failure changes across runs or frequencies | Timing, clock integrity or marginal control |
Multiple-chain failure | Several chains fail together | Shared scan control, clock, reset or test configuration |
A constant scan output does not automatically prove that a scan flip-flop is defective. The scan clock may not be reaching the cell, scan enable may be incorrect, or an asynchronous reset may be active. Debugging should follow the signal path before concluding that a particular cell is faulty.
Start with a Scan Chain Flush Test
A scan chain flush test is one of the most useful first checks. It verifies whether data can propagate through the complete chain without involving complex functional logic.
The procedure is straightforward:
- Enable scan mode.
- Apply a known data sequence at scan input.
- Apply the required number of shift-clock pulses.
- Observe scan output.
- Compare the observed sequence with the expected delayed sequence.
For a chain of four flip-flops, suppose the input sequence is 1, 0, 1, 1. After the appropriate number of clock cycles, the same sequence should emerge at scan output in the expected order, subject to the chain's defined shifting convention.
If the chain is functioning correctly, the output should reflect the shifted-in data after the chain latency. If the output remains constant or the sequence becomes corrupted, investigate the chain before debugging ATPG capture patterns.
Practical example:
Assume a scan chain contains 100 scan cells. During a flush test, the first 40 expected output bits match, but subsequent output bits remain at logic 0.
This suggests that the failure may be located around the point where data propagation stops. The exact cell location must be determined using the scan-chain order and the direction in which the chain is counted. Check the scan-chain connectivity report and trace the corresponding SI-to-SO path in the netlist.
Do not assume that the 41st observed bit directly identifies the 41st scan cell. The relationship depends on the chain ordering and observation direction.
If multiple scan chains are present, run the flush test separately for each chain. This helps isolate whether the failure is limited to one chain or caused by a shared test signal.
Check Scan Enable and Scan Control Signals
Scan enable controls whether scan flip-flops operate in scan mode or functional mode. Incorrect scan-enable timing can prevent data from shifting correctly.
Check the following:
- Is scan enable asserted before the first shift-clock edge?
- Does scan enable remain stable throughout the shift operation?
- Is it deasserted at the correct point before capture?
- Is the signal connected to all intended scan cells?
- Are there polarity differences between scan cells or test modes?
- Does the testbench or test procedure drive the correct value?
Example: Scan enable changes during shifting
Consider a chain of 500 scan cells. The first 200 bits shift correctly, but later bits do not match the expected response. Waveform inspection shows that scan enable briefly deasserts during the shift sequence.
When scan enable is low, the scan flip-flops select their functional data inputs instead of their scan inputs. Consequently, the serial scan data path is interrupted.
The corrective action is to check scan-enable generation, testbench sequencing, and any logic that controls scan mode. Also verify that scan enable reaches the relevant cells after synthesis and scan insertion.
Verify Scan Clock Connectivity and Clock Configuration
Clock-related issues are another major source of scan chain failures. Scan cells must receive valid shift-clock pulses with the intended polarity and timing.
Check:
- Scan clock source and frequency.
- Clock mux selection in test mode.
- Clock-gating bypass or test-enable configuration.
- Clock polarity and active edge.
- Clock connectivity to every scan cell.
- Clock-domain mixing and lock-up latch requirements.
- Whether the clock waveform is consistent across simulation and tester procedures.
Example: Clock-gated scan cell
Suppose a design contains two scan chains in different clock-gated blocks. Chain A shifts correctly, while Chain B does not respond to scan-clock pulses.
Waveform inspection shows that the integrated clock-gating cell for Block B is not enabled in test mode. The scan clock is present at the clock-gating input, but no clock pulses reach the scan cells.
The investigation should focus on the clock-gating test-enable connection and the intended test-mode clock architecture. Confirm the implementation against the DFT constraints and the clock-gating cell's supported test behavior.
For designs containing multiple clock domains or different clock edges, inspect the scan architecture for appropriate lock-up latch insertion. A missing or incorrectly configured lock-up latch can lead to race or hold-related problems during shifting.
Inspect Scan Chain Connectivity and Scan Reordering
Scan insertion tools connect scan cells based on the defined DFT architecture. Scan-chain reordering may subsequently change the physical sequence to improve routing.
A mismatch can occur if the scan-chain description used for pattern generation or simulation does not match the final implemented netlist.
Important checks include:
- Scan-in and scan-out port mapping.
- Scan-cell SI and SO connectivity.
- Chain length and chain membership.
- Scan-chain ordering before and after reordering.
- Hierarchical boundary connections.
- Bypass and wrapper configuration.
- Final netlist consistency with the ATPG setup.
Example: Scan reordering mismatch
Assume a chain initially follows this order:
SI → FF1 → FF2 → FF3 → FF4 → SO
After physical optimization, the chain is reordered as:
SI → FF3 → FF1 → FF4 → FF2 → SO
The reordered chain may be valid, but the ATPG patterns and simulation setup must use the updated chain information. If pattern simulation uses the old ordering, the shifted-out data can appear incorrect even though the physical scan path is connected properly.
Compare the final scan-chain report, chain description, and ATPG configuration. Regenerate or update the relevant test data when the implemented chain order has changed.
Check Reset and Set Signals During Scan Operation
Asynchronous reset and set pins can override normal scan-cell behavior. If these controls become active during scan shifting, the affected flip-flops may be forced to a constant value.
For example, suppose a scan chain contains 300 cells and the scan output becomes stuck after a particular section. The corresponding scan cells share an asynchronous reset signal. Waveform inspection shows that reset is briefly asserted during scan shifting.
The reset event can clear those scan cells, destroying the data being shifted through the chain.
Debugging steps:
- Check reset polarity and active level.
- Confirm reset is inactive during scan shifting unless the test procedure intentionally requires otherwise.
- Inspect reset synchronization and test-mode overrides.
- Check whether reset is connected to the intended scan cells.
- Review DFT design-rule-check reports for reset controllability issues.
Also distinguish between a reset-related shift failure and a capture failure. A reset that is incorrectly released around capture can cause functional response mismatches even when the chain shifts correctly.
Distinguish Shift Failures from Capture Failures
A scan chain can pass shift testing and still fail during capture. This distinction is important because the debugging direction changes.
Shift failure: The scan data cannot be loaded or unloaded correctly. Investigate scan connectivity, scan enable, clock delivery, reset behavior, and shift timing.
Capture failure: The scan chain shifts correctly, but the captured functional response differs from the expected value. Investigate functional logic, capture-clock sequencing, constraints, timing, unknown values, and test-mode configuration.
Practical example:
A design contains 2,000 scan cells across several blocks. All chains pass the shift test, but a subset of ATPG patterns fail during capture.
The first step is to inspect the failing pattern and identify the failing observation point. Then check the relevant capture-clock waveform, launch and capture sequence, clock-domain relationships, and functional logic feeding the observed scan cell.
For transition-delay testing, confirm that the intended at-speed launch and capture pulses are applied. Also verify the on-chip clock controller (OCC) configuration where applicable.
Do not attempt to fix a capture mismatch by changing scan-chain connectivity unless the evidence points to a chain-structure problem.
Review Scan Timing and Hold Violations
Scan shifting can expose timing problems that are not visible in functional operation. In particular, short paths between adjacent scan cells can be vulnerable to hold violations.
For example, two scan cells may be driven by clocks with different arrival times. If the capture or shift clock relationship is not handled correctly, data may propagate too quickly from one cell to the next, causing a hold violation or race condition.
Review:
- Scan shift setup and hold reports.
- Clock skew between adjacent scan cells.
- Clock-domain and edge mixing.
- Lock-up latch insertion and placement.
- Shift frequency and duty cycle.
- Timing constraints for test mode.
A chain that passes at a lower shift frequency but fails at a higher frequency may indicate a timing or clock-integrity issue. However, frequency-dependent behavior should be confirmed with timing analysis and waveform evidence rather than treated as proof of a hold violation.
Use ATPG and Simulation Reports to Narrow Down the Failure
ATPG reports provide useful information about pattern generation, fault detection, and test coverage. Simulation reports help establish whether the generated patterns produce the expected response in the implemented design model.
When a scan test fails, review:
- Failing pattern number and test mode.
- Failing scan chain and scan-out channel.
- Expected and observed response.
- Failing cycle and bit position.
- Fault model and fault category.
- Unknown or masked response bits.
- Scan-chain configuration used during pattern generation.
- Simulation warnings and timing violations.
For compressed scan architectures, also inspect decompressor, compactor, masking logic, and channel mapping. A failure in compression logic or an incorrect configuration can affect several internal chains and may not resemble a simple single-chain break.
A useful debugging sequence is to reproduce the failing pattern in simulation, inspect the failing cycle, trace the response back through the scan path, and correlate the result with the final scan-chain and timing reports.
A Practical Scan Chain Debugging Workflow
Use the following sequence to avoid spending time on unrelated parts of the design:
- Confirm the failure stage: Determine whether the failure occurs during shift-in, capture, or shift-out.
- Identify the affected chain: Separate single-chain failures from failures affecting multiple chains.
- Run a flush test: Check basic scan data propagation using a known sequence.
- Inspect scan controls: Verify scan enable, test mode, reset, and scan clock.
- Trace the chain: Compare scan-cell connectivity and ordering against the final netlist.
- Check timing: Review shift-mode setup and hold reports, clock skew, and lock-up latch requirements.
- Reproduce the failure: Simulate the failing pattern and inspect the exact mismatch cycle.
- Check compression and configuration: For compressed designs, verify decompressor, compactor, masking, and channel mapping.
- Apply the correction: Fix the identified design, constraint, or test-configuration issue.
- Revalidate: Repeat chain integrity checks and run the relevant ATPG simulation and regression tests.
Keep a record of the failing chain, pattern, cycle, expected value, observed value, suspected cause, and corrective action. This makes the debugging process easier to review and helps prevent the same issue from recurring.
Common Mistakes to Avoid During Scan Debugging
Some debugging approaches create additional confusion instead of identifying the root cause.
- Starting with ATPG pattern changes: First confirm that the scan chain itself shifts correctly.
- Assuming every constant output is a defective flip-flop: Check clocks, resets, scan enable, and connectivity.
- Ignoring the final netlist: Scan reordering and implementation changes can make earlier chain descriptions outdated.
- Overlooking test-mode clock gating: A clock that works in functional mode may not reach scan cells in test mode.
- Treating shift and capture failures as identical: They involve different signal paths and debugging checks.
- Ignoring compression logic: In compressed scan designs, internal chain failures may be related to decompression or compaction configuration.
Conclusion
Debugging a scan chain failure requires a structured approach that begins with identifying the failure stage and verifying basic scan data propagation. A flush test helps establish chain integrity. Scan enable, clock, reset, connectivity, reordering, and timing checks then help isolate structural and shift-related problems. If shifting passes but ATPG patterns fail during capture, the investigation should move toward functional logic, capture-clock sequencing, timing constraints, and response masking.
For DFT engineers, the ability to interpret scan-chain reports, reproduce failures in simulation, and correlate ATPG results with the implemented netlist is essential. Practical experience with scan insertion, ATPG debugging, test compression, and DFT diagnosis helps develop this systematic problem-solving approach.
Engineers who want to build these skills can explore DFT Training at InSkill, which covers scan insertion, scan-chain validation, ATPG simulation debug, and diagnosis. For additional exposure to scan and ATPG implementation workflows, see DFT Training at VLSIGuru and Advanced DFT Training at VLSIGuru.