JTAG Instructions

The JTAG chain provides a mechanism for moving data to and from the circuit being tested. Each JTAG device then has a set of Instructions (defined in the BSDL file for the device) which can be selected. Each instruction defines a mode in which the device will operate and defines what the device does with JTAG chain data.

The JTAG standards (IEEE 1149.x) define some mandatory instructions which JTAG-compliant devices must implement in their silicon, and also define several optional instructions. Some of the optional instructions are commonly found in JTAG devices, and others are less common.

Device manufacturers can (and do) implement further instructions but because these are not part of the JTAG standard and often are not publicly documented, XJTAG will not automatically use them, although XJTAG does provide a mechanism for users to write tests which use these manufacturer-specific instructions if needed.

Mandatory JTAG instructions

The following instructions are mandatory in all JTAG devices:

BYPASS

The BYPASS instruction causes the device to present a single-bit data register to the JTAG chain in order to minimise the number of clock cycles required to scan data through the chain. The device continues to operate normally in the circuit when in BYPASS mode.

SAMPLE

The SAMPLE instruction also allows the device to operate normally, but allows a snapshot to be taken of the state of the pins. This pin data is sent back to the JTAG controller via the JTAG chain.

PRELOAD

The PRELOAD instruction allows pin data values to be loaded into the boundary scan cells of a device before selecting another instruction that will use those values, such as EXTEST or INTEST.

In many device types, the PRELOAD instruction is combined with SAMPLE into a single instruction which carries out both operations.

XJTAG will automatically use the PRELOAD instruction prior to entering EXTEST in normal situations including XJAnalyser and XJEase/XJRunner testing. The Raw JTAG features of XJEase can be used to switch instruction directly if a more unusual behaviour is required.

EXTEST

The EXTEST instruction tells a device to take the values on the boundary scan cells for outputs and apply them to the circuit. Values from inputs are loaded into the boundary scan cells ready to be sent back to the user via the JTAG chain.

It is usual to use the PRELOAD instruction to prepare values ready to switch the device into EXTEST mode, to prevent random driving of pins. Once the device is in EXTEST mode subsequent EXTEST scans can be used to update pin values without returning to PRELOAD.

Common optional JTAG instructions used automatically by XJTAG

Some of the optional JTAG instructions are both common and very useful, and so XJTAG will automatically make use of them where a device supports them:

CLAMP

Similar to BYPASS in that a single-bit data register is put into the JTAG chain. However the device does not operate, and the pins are not connected to the core functionality. Instead the pins continue to drive at the last value set. This allows significant speed-ups of JTAG operations and XJEase testing will automatically use the CLAMP instruction when some part of a test does not need to either change values on or read values from a device which supports the instruction.

IDCODE

The IDCODE instruction tells a device to identify itself by sending its ID code back in the JTAG chain data, and is therefore useful to make sure that the correct board is being tested and the expected JTAG devices are fitted.

EXTEST_PULSE and EXTEST_TRAIN

These instructions are similar to EXTEST and are used by the 1149.6 version of the JTAG standard. Where devices support them, by default XJTAG will carry out 1149.6 testing as part of Connection Test. These instructions are edge-based rather than level-based because 1149.6 testing is designed to work through coupling capacitors and in other situations where reading static voltage levels is not sufficient. With these instructions setting a pin to a value of "1" corresponds to sending a signal where the last transition is a rising edge.