Scan and Atpg
Scan and Atpg
What is scan ?
A) Scan is a DFT technique where the flip-flops in a sequential circuit are replaced with special scan
flip-flops (scan cells).
these scan cells are then connected together to form a scan chain, which allows us to:
Shift test data in (controllability)
Capture circuit response
Shift data out (observability)
so, during test mode, the sequential circuit behaves like a combinational circuit, which makes
Fault detection much easier.
The goal of scan design is to make a difficult-to-test sequential circuit behave like an
easier-to-test combinational circuit. Achieving this goal involves replacing sequential
elements with scannable sequential elements and then stitching the scan cells
together into scan registers, or scan chains.
Types of scans:
1. Full scan
2. Partial scan
3. Partition scan
Full scan:- full scan is a scan design methodology that replaces all memory elements in the
design with their scan-able equivalents and then stitches them into scan chains.
Partial scan:- in partial scan design, only a selected set of filp-flops are converted into scan
flip-flops. This idea is to balance between testability vs overhead. FFs are choosen carefully:-
hard-to-control or hard-to-observe FFs are included in scan. Others are left as normal FFs.
Partition scan:- in partition scan design, the circuit’s FFs are divided into multiple scan chains
(partitions) instead of one very long chain. Each partition forms a separate scan chain.
To reducing scan shift time (parallel loading/unloading possible)
Lower test application time compared to one big chain.
Controllability :- the ability to set a node in a design to a desired state, i.e, logic 0 (or) 1.
Observability :- the ability to observe a change in logic value of a node in a design.
Testability :- if a design is well - controllable & observable it is said to be easily testable.
Scan Architecture :-
When we insert scan, we need to decide how the scan flip-flop is built and how it connects
into scan chains.
We cannot access the D-ff, which is internally sitting in the chip. So, we placed a 2:1
MUX before a D-ff during manufacturing.
If scan_en = 0, then normal D-ff operation takes place.
If scan_en = 1, then scan_data is transferred to D-ff by applying sys_clk that 1?0 is
stored in D-ff, we can access through Q.
Types of scan Models:-
1. MUX-DFF
2. CLOCKED Scan
3. LSSD(level sensitive scan design)
MUX-DFF :- most common scan model (used in almost all modern SoCs).
A 2x1 multiplexer is added at the D input of the flip-flop.
select line = Scan Enable (SE)
Operation:-
SE=0 Functional mode (D FF).
SE=1 Scan mode (SI FF, acts like shift register).
Pros:-
Simple, easy to implement, work with edge-triggered FFs.
Supported by tools like Tessent, Synopsys DFT compiler.
Cons:-
Adds MUX delay on data path.
Clocked Scan:- instead of MUX at data input, scan is enabled by controlling clocks.
uses functional clock + scan clock to load/shift values.
Advantage:- No MUX delay on D path better timing.
Disadvantage:- Needs extra clock control logic design complexity.
The goal of scan insertion is, to make a difficult-to-test sequential circuit behave during
the testing process like an easier-to-test combinational ckt.
It involves replacing sequential elements with scannable sequential elements which are
called the scan cells.
Stitching the scan cells together into scan registers, or scan chains. For small designs, a
single scan chain is fine.
But for large designs, one chain is not support. so, to reduce shift time, FFs are divided
into multiple scan chains.
If chains are uneven, test time is still dominated by the longest chain equal length. This
ensures parallel shifting finishes at the same time reduces total time.
Scan Flow:-
SETUP mode :-
in this step, we need to setup context to dft –scan, read in the Verilog design using
the “read_verilog”0 command, read the cell library using the “read_cell_library”
command.
the main goal is to put tessent into scan/DFT context and local all design assets so it
knows the world (cells, clocks, constraints).
in read_cell_library loads scan cell models (pin names for SI, SO, SE, etc.) and
ATPG timing information. This mapping lets tessent know: “when i insert a scan cell, i
will use this library cell.”
add_input_constraints, add_clock ---- tells the tool about clock domains and IO
timing; crucial for correct grouping of regs into chains and for later ATPG captures.
This input_constraint command tells the DFT/ATPG tool how certain primary inputs or
internal control signals should behave during test mode.
Some inputs or signals in real designs:- cannot toggle freely during test .
should not change during scan shift .
may cause corruption if driven incorrectly.
tessent Scan uses multiple inputs and produces several outputs during the scan
insertion process.
Design (Netlist) – this netlist contains the original design modified with the inserted
test structures. The output netlist format is gate-level Verilog.
TCD (tessent core description) – this file contains all the Scan modes that were
specified during scan insertion. The ATPG tool uses this file to generate patterns. If you
read in any .tcd files from a previous insertion pass or form a lower level core, the scan
modes are appended to the input *.tcd file and written out into the tsdb_outdir
directory.
Adding Clocks:- In order to define and operate scan chains, the appropriate clocks must be
defined.
add_clocks 0 clk
add_clocks 0 set
Set_current_design :- sets the active design to the one just loaded for performing DFT
operations.
Set_design_level sub_block/ chip :- Specifies that scan insertion will be applied at the sub-
block level of the design hierarchy.
Check_design_rules :- checks the design against DFT rules for errors or warnings.
In design rule check :- it performs design rule checks -- that means it verify correct scan
operation – verify controllability flipflops.
in this step, tessent scan performs model flattening, learning analysis, rules
checking, and scannability checking to verify correct scan operations and controllability of
the flipflops.
Design rules checking is performed in the following order: First, the general rules are
checked.
• The General rules check searches for very high-level problems in the information defined
for the design.
• For example, it checks to ensure the scan circuitry, clock, and RAM definitions all make
sense.
• The violations of these rules are errors, and their handling cannot be changed.
• Next comes, the T rules or the scan chain tracing rules.
• The purpose of scan chain tracing is for the tool to identify the scan cells in the chain and
determine how to use them for control and observe points.
• Successful scan chain tracing ensures that the tools can use the cells in the chain as
control and observe points during ATPG.
These checks use the information from the tcd_scan or test procedure file, which has
already been checked for general errors during the procedure rules checks and the defined
scan data.
Following the tessent scan flow, after performing the design rule checks and the tool
transits to the “Analysis mode”.
The command “insert_test_logic” will perform scan elements substitution and scan
cells stitching based on the specified number of chains you have added, the maximum
length of scan chains, how different clock domains are handled, any other insertion
options you have specified, and based on any scan chain ordering you have instructed
the tool to follow.
Tessent scan will add a lockup latch at the transition of the two clock domains which
eliminate skew issues. By default, add a lockup latch at the transition of the two clock
domains. Having this latch would make sure that data is held for a half cycle before the
second flop is pulsed. This is done automatically, as the “-single clock domain chains”
switch is off by default.
Balance scan chains :- by either specifying the maximum length of chains, using the
command “ add_scan_mode ” with the “ –chain_length ” switch, the tool then
calculates the number of chains accordingly.
add_scan_mode – chain_length 200 add_scan_mode – chain_count 25
Multi-mode scan chains :- one of the most important features of the tessent scan tool
is the support for multi-mode scan insertion with optimal scan chain lengths across all
modes. multi – mode scan chains are used for the following:
To bulid bypass,
Single chain bypass
Or multi chain bypass if EDT IP is not built with one.
Pre-scan → better, because tool group chesi scan insertion lo include chestundi.
Wrapped cores unte → post-scan problematic (external scan chains create cheyyali).
Wrapper chains are one type of special scan chain created around a partition/
core/ module.
purpose:- 1. Improve controllability
2. improve observability
How?
at the inputs and outputs of the block (partition), tool adds extra scan flip-
flops .
so, for outside tester direct access it.
Wrapper chains = scan flip-flops placed at partition inputs/outputs to improve test access.
What is a graybox?
A graybox is a simplified scan model of a core. Instead of using the entire core netlist
(all logic, all gates), the graybox model only keeps:
Periphery logic (boundary scan chains, wrapper chains, decompressor/compactor
connections).
Scan chain connectivity inside the core (but not the full internal logic).
Graybox = scan chain + boundary logic representation of the core.
Scan operation:-
Operations :-
1. Loading:- it means loading the patterns for scan chain.
2. Shift in:- patterns should goes to SI (scan-in)
3. Capturing:- when scan enable is ‘0’, capture the functional mode.
4. Shift out:- capture response is seriallyout in scan-out [so]
5. Unloading:- in scan chain after shifting data, it will clean the circuit and prepares for next level.
DRC rules
Rule 1:- All internal clocks must be controlled by a port level clock.
where used?- in clocking logic and scan insertion stages.
when checked? – at RTL linting, dft DRC, scan insertion, and ATPG.
how to implement/fix? – insert a mux controlled by test_mode that selects b/w the functional
Clock (PLL, divider) and a primary test clock input. During scan, always drive ffs with this safe
Test clock.
why needed? If scan flip-flops are driven by uncontrolled internal clocks, ATPG cannot shift or
capture patterns, leading to untestable elements and low coverage.
ATPG process
What is ATPG?
ATPG = automatic test pattern generation
Its purpose is to automatically generate test patterns (set of 1s and 0s) that can detect
manufacturing defects in a chip.
The 1st input of ATPG is scan inserted netlist until and unless your design is purely
combinational logic.
2nd input is SPF (synopsys procedure file or stil procedure file).
3rd input is which fault model you need (stuck at fault, transition).
4th input is design model (compression mode, bypass model).
Compaction:
Outputs of ATPG:
Verification:
👉 Idea: "Take the fault to the output where tester can see it"
Once the fault effect (1 vs 0 difference) is created, it must propagate through the circuit.
For propagation, we need to give inputs that do not block the fault.
To propagate, the other OR input must be 0 (so the output fully depends on faulty signal).
If the other input = 1, fault will be masked (not visible).
o Analog/mixed-signal IP.
When you setup a circuit in tessent scan, you start with a scan – inserted gate-
level netlist, a test procedure file that contains information about the circuitry
tessent scan inserted into the design, an ATPG setup dofile.
Go through the test proc file assignment ..there we can see detailed information about test proc
file. File name scan test files_rajasekhar.
STIL (Standard Test Interface Language) → An IEEE standard format used to describe scan
chains, clocks, timing, and test procedures.
Tessent tools (FastScan, TestKompress) do not work directly on raw STIL. They expect:
o A dofile (with Tessent commands).
o A test procedure file (TPF) (with timing templates).
stil2tessent converts STIL → dofile + TPF.
3. Outputs of stil2tessent
1. Dofile (.do)
o Contains Tessent shell commands.
o Defines:
Clocks.
Scan enable signals.
Pin constraints.
Scan chain grouping.
o Used during ATPG setup to tell Tessent how the design is structured for scan.
2. Test Procedure File (.proc)
o Defines timing sequences (called timeplates) for scan operations.
o Standard scan procedures:
test_setup → put circuit into scan mode.
load_unload → load values into scan chains / unload responses.
shift → shift data inside scan chains.
o Basically, it tells Tessent how to toggle scan_enable, scan_clk, func_clk, etc.
during test.
1. Setup :-
Read scan-inserted netlist.
Load libraries (DFT + standard cells).
Read dofile (clocks, scan chain mapping).
Read test procedure file (timing for scan operations).
3. Configure ATPG:-
Choose fault model: Stuck-at, Transition, Path Delay, etc.
Set constraints (don’t care pins, tie-offs).
Define test mode signals.
4. Generate Patterns:-
ATPG generates a set of test patterns (vectors of 1s/0s).
Each pattern:
o Fault activation → sensitizes a fault.
o Fault propagation → propagates faulty effect to an observable point.
Patterns stored in STIL/WGL formats.
5. Save Results:-
Coverage report (percentage of detected faults).
Pattern count.
Final ATPG database.
Read_verilog <scan_inserted_netlist.v>
Read_cell_library ,dft_library.db>
read_verilog – loads the scan-inserted netlist (already modified by tessent scan to add scan
chains, test points, etc.).
read_cell_library – loads the DFT/technology library:
- Cell timing & logical description.
- Info to map functional flops – scan flops.
- Defines components for ATPG like muxes, clock gating cells, scan cells.
Set_current_design <top_module_name>
tells tessent which module is the top-level design.
this is important because many designs have multiple modules (sub –blocks, IPs).
Dofile atpg_setup.dofile:-
a dofile is just a script with ATPG setup commands.
Contains: [Link] definitions, 2. Scan chain definitions, 3. Test mode & reset handling,
4. Control signals,.
Analyze_control_signals –auto_fix :-
tessent will auto-detect clocks & scan enables.
1. Removes hierarchy
o Instead of modules inside modules, all gates and nets are brought into one level.
o Easier for the ATPG tool to analyze and traverse.
2. Adds scan/test info
o Includes scan chains, scan muxes, control signals.
o Stores trace of how scan cells are connected (scan trace).
3. Stores DRC (Design Rule Check) fixes
o During ATPG setup, if Tessent finds any issues with clocks, resets, test constraints, they
get resolved.
o This info is stored inside the flattened model file.
4. Binary format
o Stored as .bin (compact and efficient).
o Used later for diagnosis (mapping tester failures back to faults in the design).
When you later run diagnosis (post-silicon failure analysis), Tessent needs to know:
o How scan cells are ordered.
o Which gate belongs to which fault site.
o What DRC fixes were applied.
Instead of re-flattening every time, it just loads this flattened binary model quickly.
Which will have high fault coverage – LOC or LOS, and why?
LOS → higher coverage, because it can launch transitions through more paths.
But LOS = more timing violations (hold issues).
LOC → safer, but slightly lower coverage.
In LOS, the launch vector is directly controlled by the scan chain data during shift.
ATPG can easily control the transition at the fault site.
LOC depends on functional clock transitions, so some transitions may be hard to
activate.
1. POs are driven directly by combinational logic, so their valid response is available
immediately after inputs are applied.
2. Capture clock overwrites scan FFs and internal states, which may mask or disturb PO
values.
3. In testproc file, this is defined by placing PO measurement strobes before the capture
clock event, while scan outputs are measured only after capture during shift-out.
👉 This ensures tester records the correct functional response without losing data.
Prior to scan insertion, the tool performs limited rule checks on the design as you switch from setup
to analysis mode. Part of the checking it does is scannability checking. (pg:- 3228 tshell_ref)
Data rules:-
🔹 D1
Rule: Checks for possible disturbance of values loaded/captured into scan cells.
Meaning: After you load a value into a scan flop, it must stay stable until it’s shifted or
captured.
Violation: If something (like uncontrolled clock/reset/glitch) corrupts the value.
🔹 D2
Rule: During system capture, if a scan path from MASTER/SLAVE → COPY is
sensitized, the path must be unique.
Meaning: Each scan flop (MASTER/SLAVE) connects to a COPY. If multiple
conflicting paths exist, capture may corrupt data.
Violation: More than one path drives COPY at the same time → unpredictable captured
value.
🔹 D3
Rule: For SLAVE-based scan cells, master_observe must propagate MASTER →
SLAVE correctly.
Meaning: If a scan flop has MASTER/SLAVE pair, data should flow from MASTER
into SLAVE correctly during observation.
Violation: If master_observe fails to sensitize the path, ATPG cannot check SLAVE
data.
🔹 D4
Rule: In skew load procedure, data from one scan cell must propagate correctly into the
next MASTER.
Meaning: When shifting, each preceding cell’s output must connect properly into the
next scan cell input.
Violation: Broken/miswired chain, incorrect mux, or path blocked.
🔹 D5
Rule: All memory elements (flops/latches) must be scannable.
Meaning: Every storage element must either be in scan chain or flagged as non-scan
(e.g., RAM).
Violation: If tool finds a flop/latch not included in scan chain.
🔹 D6
Rule: All non-scan latches must behave as transparent latches.
Meaning: If a latch is not scannable, it must pass data transparently when needed.
Violation: If latch output is stuck or not transparent when expected → blocks test.
🔹 D7
Rule: At the end of shift, scan flops’ clock inputs must not be 1.
Meaning: After shifting, clock should be low (inactive), otherwise flops may capture
wrong values.
Violation: Tool finds a scan clock still active → risk of corruption.
🔹 D8
Rule: If MASTER → SLAVE only propagates when SLAVE is inactive, MASTER’s
clock must be active.
Meaning: To observe SLAVE correctly, MASTER’s clock must allow propagation.
Violation: If MASTER clock is gated/off, SLAVE becomes unobservable.
🔹 Summary (Simple)
D1 → D4: Ensure scan data paths are stable, unique, and connected properly.
D5 → D6: Ensure all flops/latches are scannable or transparent.
D7 → D8: Ensure scan clocks are inactive when they should be, and observability of
MASTER/SLAVE is not blocked.