IEEE 1149.1 (JTAG) Boundary-Scan Testing For Cyclone II Devices
IEEE 1149.1 (JTAG) Boundary-Scan Testing For Cyclone II Devices
IEEE 1149.1 (JTAG) Boundary-Scan Testing For Cyclone II Devices
1 (JTAG)
Boundary-Scan Testing for
Cyclone II Devices
CII51014-2.1
Introduction As printed circuit boards (PCBs) become more complex, the need for
thorough testing becomes increasingly important. Advances in surface-
mount packaging and PCB manufacturing have resulted in smaller
boards, making traditional test methods (e.g., external test probes and
“bed-of-nails” test fixtures) harder to implement. As a result, cost savings
from PCB space reductions are sometimes offset by cost increases in
traditional testing methods.
In the 1980s, the Joint Test Action Group (JTAG) developed a specification
for boundary-scan testing that was later standardized as the
IEEE Std. 1149.1 specification. This boundary-scan test (BST) architecture
offers the capability to efficiently test components on PCBs with tight lead
spacing.
This BST architecture tests pin connections without using physical test
probes and captures functional data while a device is operating normally.
Boundary-scan cells in a device force signals onto pins or capture data
from pin or logic array signals. Forced test data is serially shifted into the
boundary-scan cells. Captured data is serially shifted out and externally
compared with expected results. Figure 14–1 shows the concept of
boundary-scan testing.
Boundary-Scan Cell
Serial Serial
Data In IC Pin Signal Data Out
Core Core
Logic Logic
Tested
JTAG Device 1 Connection JTAG Device 2
This chapter discusses how to use the IEEE Std. 1149.1 BST circuitry in
Cyclone™ II devices, including:
In addition to BST, you can use the IEEE Std. 1149.1 controller for
Cyclone II device in-circuit reconfiguration (ICR). However, this chapter
only discusses the BST feature of the IEEE Std. 1149.1 circuitry.
IEEE Std. 1149.1 A Cyclone II device operating in IEEE Std. 1149.1 BST mode uses four
required pins, TDI, TDO, TMS and TCK. The optional TRST pin is not
BST Architecture available in Cyclone II devices. TDI and TMS pins have weak internal
pull-up resistors while TCK has weak internal pull-down resistors. All
user I/O pins are tri-stated during JTAG configuration. Table 14–1
summarizes the functions of each of these pins.
The IEEE Std. 1149.1 BST circuitry requires the following registers:
Figure 14–2 shows a functional model of the IEEE Std. 1149.1 circuitry.
TDI
TDO
UPDATEIR
CLOCKIR
SHIFTIR
Instruction Decode
TAP
TMS Controller
TCLK
UPDATEDR Data Registers
CLOCKDR Bypass Register
SHIFTDR
Device ID Register
ICR Registers
operate the TAP controller, and the TDI and TDO pins provide the serial
path for the data registers. The TDI pin also provides data to the
instruction register, which then generates control logic for the data
registers.
IEEE Std. 1149.1 The boundary-scan register is a large serial shift register that uses the TDI
pin as an input and the TDO pin as an output. The boundary-scan register
Boundary-Scan consists of 3-bit peripheral elements that are associated with Cyclone II
Register I/O pins. You can use the boundary-scan register to test external pin
connections or to capture internal data.
Figure 14–3 shows how test data is serially shifted around the periphery
of the IEEE Std. 1149.1 device.
Each peripheral
element is either an
I/O pin, dedicated
input pin, or
Internal Logic dedicated
configuration pin.
TAP Controller
to external device data via the PIN_IN signal, while the update registers
connect to external data through the PIN_OUT and PIN_OE signals. The
global control signals for the IEEE Std. 1149.1 BST registers (for example,
shift, clock, and update) are generated internally by the TAP controller.
The MODE signal is generated by a decode of the instruction register. The
data signal path for the boundary-scan register runs from the serial data
in (SDI) signal to the serial data out (SDO) signal. The scan register begins
at the TDI pin and ends at the TDO pin of the device.
Figure 14–4 shows the Cyclone II device’s user I/O boundary-scan cell.
Figure 14–4. Cyclone II Device's User I/O BSC with IEEE Std. 1149.1 BST Circuitry
Capture Update
Registers Registers
SDO
INJ
PIN_IN
0
0
D Q D Q 1
1
INPUT INPUT
From or OEJ
To Device
I/O Cell 0 0 PIN_OE
Circuitry D Q D Q 0
and/or 1 1
OE OE 1
Logic VCC
Array
OUTJ
0 PIN_OUT
0 Pin
D Q D Q 1
1
Output
OUTPUT OUTPUT
Buffer
SDI
Global
SHIFT CLOCK UPDATE HIGHZ MODE
Signals
Table 14–2 describes the capture and update register capabilities of all
types of boundary-scan cells within Cyclone II devices.
Table 14–2. Cyclone II Device Boundary Scan Cell Descriptions Note (1)
Captures Drives
IEEE Std. 1149.1 Cyclone II devices implement the following IEEE Std. 1149.1 BST
instructions: SAMPLE/PRELOAD, EXTEST, BYPASS, IDCODE, USERCODE,
BST Operation CLAMP, and HIGHZ. The BST instruction length is 10 bits. These
Control instructions are described later in this chapter.
f For summaries of the BST instructions and their instruction codes, see
the Configuration & Testing chapter in Volume 1 of the Cyclone II Device
Handbook.
The IEEE Std. 1149.1 test access port (TAP) controller, a 16-state state
machine clocked on the rising edge of TCK, uses the TMS pin to control
IEEE Std. 1149.1 operation in the device. Figure 14–5 shows the TAP
controller state machine.
TEST_LOGIC/
TMS = 1 RESET
TMS = 1 TMS = 1
RUN_TEST/
TMS = 0 IDLE
TMS = 0 TMS = 0
TMS = 1 TMS = 1
CAPTURE_DR CAPTURE_IR
TMS = 0 TMS = 0
SHIFT_DR SHIFT_IR
TMS = 0 TMS = 0
TMS = 1 TMS = 1
TMS = 1 TMS = 1
EXIT1_DR EXIT1_IR
TMS = 0 TMS = 0
PAUSE_DR PAUSE_IR
TMS = 0 TMS = 0
TMS = 1 TMS = 1
TMS = 0 TMS = 0
EXIT2_DR EXIT2_IR
TMS = 1 TMS = 1
TMS = 1 TMS = 1
UPDATE_DR UPDATE_IR
TMS = 0 TMS = 0
TMS
TDI
tJCP
tJCH tJCL tJPSU tJPH
TCK
TDO
tJSSU tJSH
Signal
to be
Captured
tJSZX tJSCO tJSXZ
Signal
to be
Driven
TMS
TDI
TDO
TAP_STATE SHIFT_IR
RUN_TEST/IDLE SELECT_IR_SCAN
The TDO pin is tri-stated in all states except in the SHIFT_IR and
SHIFT_DR states. The TDO pin is activated at the first falling edge of TCK
after entering either of the shift states and is tri-stated at the first falling
edge of TCK after leaving either of the shift states.
When the SHIFT_IR state is activated, TDO is no longer tri-stated, and the
initial state of the instruction register is shifted out on the falling edge of
TCK. TDO continues to shift out the contents of the instruction register as
long as the SHIFT_IR state is active. The TAP controller remains in the
SHIFT_IR state as long as TMS remains low.
0
0 INJ
In the capture phase, the D Q D Q 1
1
signals at the pin, OEJ and
OUTJ, are loaded into the
capture registers. The CLOCK
signals are supplied by the
OEJ
TAP controller’s CLOCKDR 0
0
output. The data retained in 1
D Q D Q 1
these registers consists of
signals from normal device
operation.
OUTJ
0
0
D Q D Q 1
1
Capture Update
Shift & Update Phases Registers Registers
Capture Update
Registers Registers
TCK
TMS
TDI
TDO
SHIFT_IR SHIFT_DR
TAP_STATE
EXIT1_IR SELECT_DR Data stored in After boundary-scan EXIT1_DR
Instruction Code UPDATE_IR CAPTURE_DR boundary-scan register data has been UPDATE_DR
register is shifted shifted out, data
out of TDO. entered into TDI will
shift out of TDO.
Figure 14–10 shows the capture, shift, and update phases of the EXTEST
mode.
SDO
Capture Phase
0
0 INJ
D Q D Q 1
1
In the capture phase, the
signals at the pin, OEJ and
OUTJ, are loaded into the
capture registers. The CLOCK OEJ
0
signals are supplied by the 0
1
D Q D Q
TAP controller’s CLOCKDR 1
SDO
TCK
TMS
TDI
TDO
SHIFT_IR SHIFT_DR
TAP_STATE
EXIT1_IR SELECT_DR Data stored in After boundary-scan EXIT1_DR
Instruction Code UPDATE_IR CAPTURE_DR boundary-scan register data has been UPDATE_DR
register is shifted shifted out, data
out of TDO. entered into TDI will
shift out of TDO.
TCK
TMS
SHIFT_IR SHIFT_DR
If you are testing the device after configuring it, the programmable weak
pull-up resister or the bus hold feature overrides the CLAMP value (the
value stored in the update register of the boundary-scan cell) at the pin.
If you are testing the device after configuring it, the programmable weak
pull-up resistor or the bus hold feature overrides the HIGHZ value at the
pin.
Devices can interface with each other although they might have different
VCCIO levels. For example, a device with a 3.3-V TDO pin can drive to a
device with a 5.0-V TDI pin because 3.3 V meets the minimum TTL-level
VIH for the 5.0-V TDI pin. JTAG pins on Cyclone II devices can support
2.5- or 3.3-V input levels.
You can also interface the TDI and TDO lines of the devices that have
different VCCIO levels by inserting a level shifter between the devices. If
possible, the JTAG chain should be built such that a device with a higher
VCCIO level drives to a device with an equal or lower VCCIO level. This
way, a level shifter may be required only to shift the TDO level to a level
acceptable to the JTAG tester. Figure 14–13 shows the JTAG chain of
mixed voltages and how a level shifter is inserted in the chain.
Must be
3.3 V
tolerant
Tester
Using IEEE Std. Cyclone II devices have dedicated JTAG pins, and the IEEE Std. 1149.1
BST circuitry is enabled upon device power-up. You can perform BST on
1149.1 BST Cyclone II FPGAs not only before and after configuration, but also during
Circuitry configuration. Cyclone II FPGAs support the BYPASS, IDCODE, and
SAMPLE instructions during configuration without interrupting
configuration. To send all other JTAG instructions, you must interrupt
configuration using the CONFIG_IO instruction.
The CONFIG_IO instruction allows you to configure I/O buffers via the
JTAG port, and when issued, interrupts configuration. This instruction
allows you to perform board-level testing prior to configuring the
Cyclone II FPGA or waiting for a configuration device to complete
configuration. Once configuration has been interrupted and JTAG BST is
complete, the part must be reconfigured via JTAG (PULSE_CONFIG
instruction) or by pulsing nCONFIG low.
f For more information on using the IEEE Std.1149.1 circuitry for device
configuration, see the Configuring Cyclone II Devices chapter in Volume 1
of the Cyclone II Device Handbook.
BST for For a configured device, the input buffers are turned off by default for
I/O pins that are set as output only in the design file. Nevertheless,
Configured executing the SAMPLE instruction will turn on the input buffers for the
Devices output pins. You can set the Quartus II software to always enable the
input buffers on a configured device so it behaves the same as an
unconfigured device for boundary-scan testing, allowing sample
function on output pins in the design. This aspect can cause slight
increase in standby current because the unused input buffer is always on.
In the Quartus II software, do the following:
2. Click Assembler.
4. If you use the default setting with input disabled, you need to
convert the default BSDL file to the design-specific BSDL file using
the BSDLCustomizer script. For more information regarding BSDL
file, refer to “Boundary-Scan Description Language (BSDL)
Support”.
Disabling IEEE The IEEE Std. 1149.1 BST circuitry for Cyclone II devices is enabled upon
device power-up. Because this circuitry may be used for BST or in-circuit
Std. 1149.1 BST reconfiguration, this circuitry must be enabled only at specific times as
Circuitry mentioned in “Using IEEE Std. 1149.1 BST Circuitry” on page 14–16.
If the IEEE Std. 1149.1 circuitry will not be utilized at any time, the
circuitry should be permanently disabled. Table 14–3 shows the pin
connections necessary for disabling the IEEE Std. 1149.1 circuitry in
Cyclone II devices to ensure that the circuitry is not inadvertently enabled
when it is not needed.
Guidelines for Use the following guidelines when performing boundary-scan testing
with IEEE Std. 1149.1 devices:
IEEE Std. 1149.1
■ If the 10-bit checkerboard pattern “1010101010” does not shift out of
Boundary-Scan the instruction register via the TDO pin during the first clock cycle of
Testing the SHIFT_IR state, the TAP controller has not reached the proper
state. To solve this problem, try one of the following procedures:
● Verify that the TAP controller has reached the SHIFT_IR state
correctly. To advance the TAP controller to the SHIFT_IR state,
return to the RESET state and send the code 01100 to the TMS
pin.
● Check the connections to the VCC, GND, JTAG, and dedicated
configuration pins on the device.
Conclusion The IEEE Std. 1149.1 BST circuitry available in Cyclone II devices
provides a cost-effective and efficient way to test systems that contain
devices with tight lead spacing. Circuit boards with Altera and other
IEEE Std. 1149.1-compliant devices can use the EXTEST,
SAMPLE/PRELOAD, BYPASS, IDCODE, USERCODE, CLAMP, and HIGHZ
modes to create serial patterns that internally test the pin connections
between devices and check device operation.
References Bleeker, H., P. van den Eijnden, and F. de Jong. Boundary-Scan Test: A
Practical Approach. Eindhoven, The Netherlands: Kluwer Academic
Publishers, 1993.
Maunder, C. M., and R. E. Tulloss. The Test Access Port and Boundary-Scan
Architecture. Los Alamitos: IEEE Computer Society Press, 1990.
Document Table 14–4 shows the revision history for this document.
Revision History
Date &
Document Changes Made Summary of Changes
Version
February 2007 ● Added document revision history. ● Added infomation about
v2.1 ● Added new section “BST for Configured Devices”. ‘Always Enable Input
Buffer’ option.
July 2005 v2.0 Moved the “JTAG Timing Specifications” section to the DC
Characteristics & Timing Specifications chapter.
June 2004 v1.0 Added document to the Cyclone II Device Handbook.