TOPIC 36 — IC Testing

Boundary Scan Test Tutorial

Complete guide to JTAG IEEE 1149.1 boundary scan: TAP controller states, boundary scan register cells, EXTEST/INTEST/BYPASS instructions, BSDL files, and Verilog BSR cell implementation.

JTAG BOUNDARY SCAN CHAIN ATE / TEST CONTROLLER TDI, TDO TCK, TMS (+TRST opt.) TDI TCK/TMS IC 1 TAP Controller BSR Chain ■■■■■■■■■ BSR Core Logic TDO→TDI IC 2 TAP Controller BSR Chain ■■■■■■■■■ BSR Core Logic TDO Shift out BSR data Compare TDO to expected → find faults

01 What is Boundary Scan?

Boundary scan (IEEE 1149.1 — commonly called JTAG) is a hardware testing standard that places a small shift-register cell at every I/O pin of a compliant IC. These cells form a serial chain — the Boundary Scan Register (BSR) — that allows a test controller to:

Capture Pin States

Sample the logic values at every pin simultaneously and shift them out serially via TDO — without physical probes on each pin.

Drive Pin Values

Load test vectors into the BSR via TDI and force them onto device pins — allowing interconnect testing between chips on a PCB.

Test Internal Logic

Using INTEST mode, apply patterns to internal flip-flops while isolating from the board — useful for in-system IC diagnostics.

Program Devices

JTAG is used for FPGA configuration, flash programming, and microcontroller firmware loading in addition to structural testing.

02 The 4 JTAG Pins (TAP Interface)

PinDirectionFunction
TCKInputTest Clock — all TAP state transitions and register shifts happen on TCK edges
TMSInputTest Mode Select — sampled on TCK rising edge to drive the 16-state TAP FSM
TDIInputTest Data In — serial data shifted into the selected register (MSB first)
TDOOutputTest Data Out — serial data shifted out of the selected register (LSB first)
TRSTInputTest Reset (optional) — async reset to Test-Logic-Reset state

Rule: Apply TMS=1 for 5 consecutive TCK cycles from any state — the TAP controller always lands in Test-Logic-Reset. This is the universal recovery sequence used by all ATE tools.

03 TAP Controller — 16-State FSM

The TAP controller is a 16-state finite state machine that interprets TMS pulses to navigate between test states. The states split into two paths: the DR path (data register operations) and the IR path (instruction register operations).

TAP State Explorer — Click a State to See Its Function
SELECT A STATE
Click any state button above to learn what happens in that TAP state.

04 Key JTAG Instructions

InstructionOpcodeFunctionUse Case
EXTESTAll 0sBSR driven onto pins; capture board-level signalsPCB interconnect test
SAMPLE/PRELOADDevice-specificNon-intrusive capture of current pin stateIn-circuit observation
BYPASSAll 1sConnects TDI to TDO through 1-bit bypass registerSkip device in daisy chain
INTESTDevice-specificApply BSR data to internal core logic inputsIn-system IC logic test
IDCODEDevice-specificShift out 32-bit device identification codeDevice discovery/verification
CLAMPDevice-specificDrive BSR preloaded values, bypass activeHold bus while testing neighbors

05 Boundary Scan Cell (BSC) — Verilog

Each I/O pin has a Boundary Scan Cell — a small shift register with capture and update latches. The cell sits between the core logic and the pin, normally transparent in functional mode.

verilog
// IEEE 1149.1 Boundary Scan Cell — Type BC_1 (output with control)
module bsc_cell (
  input  tck,          // JTAG clock
  input  shift_dr,     // Shift-DR TAP state
  input  capture_dr,   // Capture-DR TAP state
  input  update_dr,    // Update-DR TAP state
  input  extest,       // EXTEST instruction active
  input  tdi,          // Serial data in from previous cell
  output reg tdo,      // Serial data out to next cell
  input  core_out,     // Data from core logic (normal operation)
  input  pin_in,       // Signal from I/O pin
  output pin_out       // Signal to I/O pin
);
  reg capture_latch;   // Shift register stage
  reg update_latch;    // Output latch (stable during shift)

  // Shift register: capture or shift
  always @(posedge tck) begin
    if (capture_dr)
      capture_latch <= pin_in;   // Capture current pin value
    else if (shift_dr)
      capture_latch <= tdi;      // Shift test data in
  end

  // TDO is the shift stage output
  always @(negedge tck)
    tdo <= capture_latch;        // Output on falling edge

  // Update latch: stable during shift operations
  always @(posedge tck) begin
    if (update_dr)
      update_latch <= capture_latch;
  end

  // Pin mux: in EXTEST, drive BSR value; otherwise, core drives pin
  assign pin_out = extest ? update_latch : core_out;
endmodule

06 BSDL File — Describing Your Device

Every JTAG-compliant device needs a BSDL (Boundary Scan Description Language) file. It's a VHDL-based description that ATE tools use to generate test vectors automatically.

bsdl
-- Example BSDL snippet for a simple 8-pin device
entity MY_CHIP is

  -- Pin mapping
  attribute PIN_MAP of MY_CHIP : entity is PHYSICAL_PIN_MAP;
  constant CHIP_PKG : PIN_MAP_STRING :=
    "TCK:1, TMS:2, TDI:3, TDO:4, TRST:5, " &
    "IO_A:6, IO_B:7, IO_C:8";

  -- JTAG instruction register length
  attribute INSTRUCTION_LENGTH of MY_CHIP : entity is 4;

  -- Instruction opcodes (4-bit)
  attribute INSTRUCTION_OPCODE of MY_CHIP : entity is
    "EXTEST    (0000), " &
    "SAMPLE    (0001), " &
    "IDCODE    (0010), " &
    "BYPASS    (1111)";

  -- 32-bit IDCODE value
  attribute IDCODE_REGISTER of MY_CHIP : entity is
    "0000" &    -- version
    "0001000000000001" &  -- part number
    "00000001001" &       -- manufacturer (JEDEC)
    "1";                  -- required lsb=1

  -- Boundary scan cell descriptions for each I/O pin
  attribute BOUNDARY_REGISTER of MY_CHIP : entity is
    -- Cell# : cell_type, port_name, function, safe_value
    "0  (BC_1, IO_A, output3, X), " &
    "1  (BC_1, IO_B, output3, X), " &
    "2  (BC_1, IO_C, input,   X)  ";

end MY_CHIP;

07 Detecting Faults — EXTEST Flow

1
Load IR with EXTEST
Shift the EXTEST opcode into the Instruction Register. All BSR cells now control the device pins.
2
Preload test vectors into BSR
Shift test data via TDI into the update latches of all output BSR cells on the driving device.
3
Apply vectors (Update-DR)
Enter Update-DR TAP state — BSR values are driven onto the PCB nets, propagating through connectors and traces.
4
Capture at receiving device
The receiving IC's BSR cells capture the pin values in Capture-DR. These values include any fault effects (stuck-at, open, short).
5
Shift out and compare (TDO)
Shift the captured data out via TDO. Compare to expected. Mismatch = fault. The bit position identifies the faulty net.

08 Fault Types Detected by Boundary Scan

Fault TypeDescriptionDetection Method
Stuck-at-0 (SA0)Net permanently low regardless of driverDrive 1, capture 0 → mismatch
Stuck-at-1 (SA1)Net permanently highDrive 0, capture 1 → mismatch
Open (disconnected)No electrical connection on trace/pinDrive 1/0, capture floating (weak pull → mismatch)
Short to GND/VCCNet shorted to power railDrive opposite level, mismatch confirms short
Bridge (net-to-net short)Two nets shorted togetherDrive different values, both capture same value

FAQ Boundary Scan Questions

What is boundary scan testing? +

Boundary scan testing (IEEE 1149.1 / JTAG) is a method for testing PCB interconnects and IC logic without physical probes. Each I/O pin has a BSR cell that can capture/drive pin values serially, allowing board-level interconnect testing without bed-of-nails fixtures.

What are the 4 JTAG pins? +

TCK (Test Clock), TMS (Test Mode Select), TDI (Test Data In), TDO (Test Data Out). TRST (Test Reset) is optional. TMS+TCK drive the TAP state machine; TDI/TDO form the serial data path through the device.

What is the difference between EXTEST and INTEST? +

EXTEST drives BSR values onto device pins to test PCB interconnects. INTEST applies BSR test patterns to internal core logic while isolating from the board. EXTEST = board-level interconnect; INTEST = IC internal logic.

What is a BSDL file? +

BSDL (Boundary Scan Description Language) is a VHDL-based file describing a device's boundary scan architecture: pin names, IR length, instruction opcodes, and BSR cell types. ATE tools use BSDL files to automatically generate test vectors.

How does boundary scan detect stuck-at faults? +

In EXTEST, force a specific value onto an output pin. The receiving IC's BSR captures the pin value. If driven=1 but captured=0 → SA0. If driven=0 but captured=1 → SA1. The bit position in the BSR chain identifies the exact faulty net.

What is BYPASS instruction used for? +

BYPASS connects TDI directly to TDO through a single 1-bit register, effectively skipping the device's full BSR. Used when you want to test only one device in a multi-device daisy chain without shifting through every device's full register length.

← Mux & Demux K-Map Solver All Digital Topics