Electronics Guide

Boundary Scan and JTAG

Boundary scan is a method for testing the interconnections on a printed circuit board, and for accessing the pins of integrated circuits, through a small, standardized serial interface rather than through physical contact with each net. The technique was developed by the Joint Test Action Group, whose initials gave rise to the name JTAG that is used informally for the same interface. It was standardized as IEEE Standard 1149.1, and the term JTAG today refers loosely both to the test methodology and to the four-wire port through which it operates.

The need for boundary scan arose as surface-mount assembly, fine-pitch packaging, ball grid arrays, and dense multilayer boards eliminated the physical test access that older methods relied upon. When a device's connections lie hidden beneath its body, a test probe cannot reach them, and the bed-of-nails fixtures of traditional in-circuit test lose coverage. Boundary scan answers this by building the test access into the silicon itself: dedicated logic cells placed at the boundary of each compliant device can observe and control its pins under the command of a serial protocol, so that nets buried under packages remain testable and programmable without mechanical contact.

IEEE 1149.1 and the JTAG Standard

IEEE Standard 1149.1, titled "Standard Test Access Port and Boundary-Scan Architecture," defines the hardware and protocol that make boundary scan interoperable across devices from many manufacturers. First published in 1990 and revised since, it specifies the test access port, the state machine that governs it, a small set of mandatory instructions, and the boundary-scan register that surrounds the device's functional logic. Any device that conforms to the standard can be linked with others into a common scan path and controlled by the same tools, which is the property that makes the technique practical at board level.

Although the group's name, the Joint Test Action Group, is the origin of the colloquial term JTAG, the physical interface has proven so convenient that chip designers have reused it well beyond its original purpose. The same four-wire port now commonly serves as the conduit for processor debugging, for programming flash and configuration memories, and for in-system configuration of programmable logic. These additional uses are layered onto the standardized port; the boundary-scan architecture defined by IEEE 1149.1 remains the formal subject of the standard, while "JTAG" in everyday usage often denotes whichever of these capabilities a particular tool exercises.

Related Standards

Several companion standards extend the original. IEEE 1149.4 adds an analog boundary-scan capability for measuring analog interconnections. IEEE 1149.6 addresses testing of alternating-current-coupled and differential nets that the original digital scheme handles poorly. IEEE 1149.7 defines a compact, two-wire variant suited to space-constrained devices while preserving compatibility with the four-wire port. IEEE 1532 builds on 1149.1 to standardize in-system configuration of programmable devices, and IEEE 1687, often called IJTAG, standardizes access to the many embedded instruments inside modern chips through the same port. These extensions share the architectural foundation of 1149.1 and are accessed through the same test access port.

The Test Access Port

The test access port, or TAP, is the serial interface through which all boundary-scan operations pass. It comprises four mandatory signals and one optional signal. Test Clock (TCK) provides the clock that advances the test logic independently of the device's functional clocks. Test Mode Select (TMS) steers the internal state machine. Test Data In (TDI) carries serial data into the device, and Test Data Out (TDO) carries serial data out. The optional Test Reset (TRST) asynchronously initializes the test logic; where it is absent, the logic can always be reset through a defined sequence on TMS.

Devices are connected so that the TDO of one feeds the TDI of the next, forming a single serial chain through which data flows from the tester, through every device in turn, and back to the tester. TCK and TMS are shared in parallel across all devices on the chain, so a common clock and a common state-machine command sequence drive the entire chain at once. This arrangement lets a single four-wire connection reach every compliant device on a board, and even span multiple boards, with the total chain length growing as devices are added in series.

The TAP Controller State Machine

Behind the port sits a sixteen-state finite state machine, the TAP controller, whose transitions are governed entirely by the value of TMS sampled on the rising edge of TCK. The machine has two principal branches, one for manipulating the instruction register and one for manipulating the selected data register, each with states to capture a value, shift it serially, and update the result. From a defined reset state, a fixed sequence of TMS values navigates to any operation, so the tester controls the device purely by clocking TMS and TDI. Because the same TMS sequence drives every device on the chain in lockstep, all devices move through the state machine together, which is what allows their registers to be treated as one long concatenated shift path.

The Boundary-Scan Register

The defining feature of the architecture is the boundary-scan register, a chain of cells placed between each functional pin of the device and its internal core logic. In normal operation these cells are transparent, passing signals between the pins and the core without effect. When boundary scan is invoked, the cells take control of the pins: they can drive a chosen value onto an output pin and can capture the value present at an input pin, all under serial command. In effect, the boundary-scan register gives the tester a virtual set of probes positioned exactly at the device's boundary, reachable through the serial port rather than by physical contact.

Several other registers complete the architecture. The instruction register holds the current instruction, which selects what the port does and which data register lies between TDI and TDO. A mandatory single-bit bypass register provides a one-clock shortcut through a device that is not currently of interest, shortening the path through the chain. An optional device identification register holds a code that names the manufacturer and part, allowing tools to confirm that the expected device is present. The instruction in force determines which of these registers, or the boundary-scan register, is connected into the serial path at any moment.

Mandatory Instructions

The standard requires a minimum set of instructions. BYPASS selects the one-bit bypass register so that data passes through the device in a single clock. SAMPLE and PRELOAD, often combined, capture the signals at the device's pins for observation and load values into the boundary cells in preparation for driving them. EXTEST is the instruction at the heart of interconnect testing: it disconnects the core from the pins and lets the boundary-scan register drive output pins and read input pins, so that the wiring between devices can be exercised. Optional instructions such as INTEST, which tests the device's own logic, and CLAMP, which holds pins at preloaded values, extend the repertoire. The exact behavior and encoding of each instruction for a given device are described in its formal description file.

Boundary-Scan Description Language

For a tool to use a device's boundary-scan facilities, it must know the device's specific implementation: how many boundary cells it has, the order in which they appear in the chain, which cell controls or observes which pin, the length and opcodes of the instruction register, and the identification code. This information is supplied by the manufacturer in a standardized, machine-readable file written in the Boundary-Scan Description Language, or BSDL.

BSDL is defined as part of the IEEE 1149.1 standard and is expressed as a subset of the VHDL hardware-description language. A BSDL file is essentially a contract that tells boundary-scan software everything it needs to operate a particular part correctly. Its main sections name the device and its package, map logical signal names to physical pins, declare the test access port signals, specify the instruction register and the opcodes of supported instructions, give the device identification register contents, and, most extensively, define the boundary-scan register cell by cell. The cell description states for each cell its position in the chain, its function as input, output, control, or bidirectional, and its relationship to the device pins.

Role in the Test Flow

Boundary-scan development tools read the BSDL files for every device on a chain, together with the board's netlist describing how the device pins are wired together, and from these two inputs they automatically generate the test patterns and analyze the results. Because the BSDL file accurately models the silicon, the tool can predict exactly which serial bits drive which pins and which captured bits report which nets, and can therefore both create the stimulus and interpret the response without manual bit-level programming. An incorrect or missing BSDL file is a common source of trouble, since the tool's model of the device would then disagree with the hardware.

Interconnect Testing

The original and still central application of boundary scan is interconnect testing: verifying that the nets connecting compliant devices on a board are wired correctly and are free of manufacturing defects. The method exploits the boundary-scan register's ability to both drive and observe pins. To test a net joining an output cell on one device to an input cell on another, the tool shifts a known value into the driving cell, lets it appear on the net, and then captures and shifts out the value seen by the receiving cell. If the captured value matches what was driven, the net is intact; if it does not, a fault is indicated.

By driving carefully chosen patterns across all the boundary cells at once and reading back the results, boundary scan detects the classic manufacturing defects of board assembly. An open circuit, such as an unsoldered or broken connection, prevents the driven value from reaching the receiver, so the captured value does not follow the stimulus. A short circuit between two nets forces them to a common value, which a suitable test pattern reveals by making the affected receivers report values inconsistent with their intended drivers. Stuck-at faults, where a net is held permanently high or low, appear as receivers that never change. To distinguish many nets efficiently and to identify which specific nets are shorted together, the tool assigns each net a unique sequence of values across successive test steps, an approach known as a counting or walking pattern, so that the response uniquely identifies the fault. Because all of this occurs through the serial port, the test reaches nets that lie entirely beneath packages and require no physical probe.

Testing Non-Scan Devices

Boundary scan can also test connections to devices that themselves contain no boundary-scan logic, provided those devices sit between two scan-capable devices or can be otherwise stimulated and observed. By driving values from the boundary cells of a compliant device into the inputs of a simple non-scan component, such as a buffer, a memory, or a logic gate, and observing the result at the inputs of another compliant device, the tool can infer whether the intervening connections and, to a limited degree, the device's behavior are correct. This technique, sometimes called a cluster test or a boundary-scan-based functional test of surrounding logic, extends coverage beyond the strictly compliant devices, although it requires the test engineer to describe the expected behavior of the non-scan parts.

In-System Programming

Beyond testing, the test access port has become a primary channel for programming devices after they are soldered onto the board, a process known as in-system programming or in-circuit programming. Because the JTAG chain already reaches the pins of compliant devices, and because many programmable parts implement programming access through the same port, a single connection can configure a board's logic and load its memories without removing any components or pre-programming them before assembly.

Several classes of device are commonly programmed this way. Field-programmable gate arrays and complex programmable logic devices accept their configuration bitstreams through the test access port, with the relevant standard for this being IEEE 1532, which formalizes in-system configuration on top of 1149.1. Flash memories and microcontrollers with embedded flash are frequently loaded through JTAG, the tool driving the device's pins or its internal programming interface to write the firmware. Configuration and serial memories adjacent to a programmable device can be programmed indirectly, with the device acting as a bridge between the JTAG chain and the memory. Programming many parts through one shared interface during board assembly simplifies the manufacturing flow, allowing components to be placed blank and configured in place, which avoids handling pre-programmed parts and supports late-stage firmware updates.

Debug Access

The same port also serves as the standard debug interface for many microprocessors and microcontrollers. Through it a debugger can halt the processor, read and write registers and memory, set breakpoints, and single-step execution. This use, while not part of the boundary-scan test architecture itself, is layered onto the test access port and is one of the most common reasons a JTAG connector appears on a board. It illustrates how thoroughly the standardized port has been adopted as a general-purpose maintenance and development channel.

Limitations and Coverage

Boundary scan is powerful but not complete, and understanding its coverage is essential to using it well. Its reach is bounded by which devices on the board implement the boundary-scan architecture. A net is fully testable by boundary scan only when both ends connect to compliant devices, or at least when one compliant device can drive or observe it. Nets that join only non-scan components, analog circuitry, or connectors lie outside direct boundary-scan access and must be covered by other means or by the cluster-test techniques described earlier, which add coverage but require additional modeling.

Several specific limitations shape the achievable coverage. Power and ground connections are generally not testable by digital boundary scan, since the boundary cells do not control or sense the supply pins. Analog nets, and high-speed differential or alternating-current-coupled signals, are poorly served by the original digital scheme and motivated the 1149.4 and 1149.6 extensions. The quality of coverage depends directly on the accuracy of the BSDL files and the board netlist supplied to the tool, and on the integrity of the chain itself: a single broken link in the serial path, or a device whose test logic is held in reset, can render the whole chain inaccessible until the problem is found. Coverage analysis tools report, net by net and pin by pin, what fraction of the board the boundary-scan test can actually exercise, and this figure typically falls short of complete because of the non-scan portions of any realistic design. The practical conclusion is that boundary scan provides excellent, probe-free coverage of the digital interconnect among compliant devices, but it is one contributor to overall test coverage rather than a stand-alone guarantee.

Integration with In-Circuit and Functional Test

Because no single method covers an entire board, boundary scan is most effective as part of a layered test strategy that combines it with in-circuit test and functional test. Each method has a domain in which it is strong, and a well-designed test plan assigns each portion of the board to the method best suited to it, using boundary scan to recover the access that shrinking physical probe points have taken away.

Combination with In-Circuit Test

In-circuit test uses a bed-of-nails fixture to contact individual nets and measure components directly, verifying resistor and capacitor values, checking for shorts and opens on accessible nets, and powering up portions of the board. Its weakness is precisely the access problem that boundary scan solves: fine-pitch and area-array packages deny it the probe points it needs. Modern in-circuit testers therefore incorporate a boundary-scan controller, so that the fixture probes the analog and accessible portions of the board while the JTAG chain reaches the hidden digital interconnect. The two techniques are complementary, and combining them on one platform yields higher coverage than either alone while reducing the number of physical test points the fixture must provide.

Combination with Functional Test

Functional test exercises the assembled board as a working product, applying realistic inputs and verifying that the outputs and behavior conform to specification. It confirms that the design operates correctly as a whole, including the analog and high-speed behavior that structural methods do not address, but it is generally poorer at localizing a fault to a specific net or component. Boundary scan complements functional test by providing structural fault diagnosis: when a board fails functionally, the boundary-scan interconnect test can pinpoint an open or short to a particular net, and the in-system programming capability can load the firmware the functional test requires. In production, structural tests such as boundary scan and in-circuit test are typically run first to catch and localize manufacturing defects, after which functional test confirms overall operation, so that defects are found at the stage where they are cheapest to diagnose and repair.

Summary

Boundary scan, standardized as IEEE 1149.1 and known informally as JTAG after the Joint Test Action Group, builds test and access logic into integrated circuits so that board interconnections can be tested and devices programmed through a four-wire serial port rather than by physical probing. The test access port, with its TCK, TMS, TDI, and TDO signals and its sixteen-state controller, links compliant devices into a serial chain. The boundary-scan register places a cell at each device pin that can drive and observe that pin under serial command, giving the tester virtual probes exactly where physical access has been lost to dense, fine-pitch packaging.

A device's specific implementation is described in a BSDL file, which boundary-scan tools combine with the board netlist to generate interconnect tests automatically. Those tests detect opens, shorts, and stuck-at faults on the nets among compliant devices, while the same port supports in-system programming of programmable logic, flash, and configuration memory, governed in part by IEEE 1532, as well as processor debugging. Coverage is bounded by which devices are scan-capable and excludes power, most analog, and high-speed nets that the 1149.4 and 1149.6 extensions address, so boundary scan delivers strong but partial coverage. For this reason it is deployed within a layered strategy, combined with in-circuit test, which probes accessible analog nets and components, and with functional test, which verifies whole-board operation, the structural methods localizing manufacturing defects and the functional method confirming that the finished assembly performs as designed.

Related Topics