JTAG Tutorial
JTAG Tutorial
JTAG Tutorial
OVERVIEW
In today's complex systems, testability is an increasing concern in almost every application and in every area of application development. Manufacturers that thoroughly address the issue of testability at the device, board, and system levels deliver more consistently reliable and costeffective products to the marketplace. This means building in test capabilities in every phase of development and deployment, including design verification, hardware and software integration, manufacturing, and in the field.
JTAG ARCHITECTURE
Architecture IEEE Standard 1149.1 is a testing standard. However it is described as a collection of design rules applied principally at the IC level that allow software to alleviate the growing cost of designing and producing digital systems. The primary benefit of the standard is its ability to transform extremely difficult printed circuit board testing problems that could be attacked with ad-hoc testing methods into well-structured problems that software can easily and swiftly deal with. To conform to the boundaryscan standard IEEE 1149.1, a device must contain the following: Test Access Port Controller (TAP), Scan Instruction Register, Scan Data Registers.
INDEX
Overview.............................................................................. 1 index .................................................................................... 1 JTAG History ....................................................................... 1 JTAG Architecture ............................................................... 1 JTAG TAP Controller ........................................................... 2 IEEE Standard 1149.1 Compliant Device ............................ 4 JTAG Signals....................................................................... 5 JTAG Instruction Registers .................................................. 6 JTAG Data registers ............................................................ 6 JTAG Applications ............................................................... 7 Need more detail about JTAG ............................................. 7 Figure and Table index ........................................................ 8 Content Revisions................................................................ 8 Contact Amontec ................................................................. 8
JTAG HISTORY
In the 1980s, the Joint Test-Action Group (JTAG) formed by representatives from makers and users of components and boards, recognized that only a cooperative effort could address the mounting testability problems in a coordinated way. Its mandate was to propose design structures that semiconductor makers would incorporate into device designs to aid in testing boards and systems. In 1990 the IEEE adopted the proposal as IEEE Standard 1149.1. Its stated purpose was to test interconnections between Integrated Circuits (ICs) installed on boards, modules, hybrids, and other substrates. Manufacturers adopting the standard could also test the IC itself.
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
http://www.amontec.com/
1/8 11/16/2005
Amontec
Movement through the state machine is controlled by the value of TMS, a set-up time prior to the rising edge of TCK. The 1s and 0s adjacent to each state transition arc show the value that must be present on TMS at the time of the next rising edge of TCK.
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
2/8 11/16/2005
http://www.amontec.com/
JTAG Interface: Simple Introduction data is shifted serially through the selected data register on each TCK cycle. Exit1-DR, Exit2-DR For a target device, the Exit1-DR and Exit2-DR states are temporary states that end a data-register scan. It is possible to return to the Shift-DR state from either Exit1-DR or Exit2DR without recapturing the data register. On the first falling edge of TCK after entry to Exit1-DR, TDO goes from the active state to the high-impedance state. Pause-DR For a target device, no specific function is performed in the stable Pause-DR state. The Pause-DR state suspends and resumes data-register scan operations without loss of data. Update-DR For a target device, if the current instruction calls for the selected data register to be updated with current data, such update occurs on the falling edge of TCK, following entry to the Update-DR state. Capture-IR For a target device in the Capture-IR state, the instruction register captures its current status value. This capture operation occurs on the rising edge of TCK, upon which the Capture-IR state is exited. Shift-IR For a target device, upon entry to the Shift-IR state, the instruction register is placed in the scan path between TDI and TDO, and on the first falling edge of TCK, TDO goes from the high-impedance state to an active state. TDO outputs the logic level present in the least-significant bit of the instruction register. While in the stable Shift-IR state, instruction data is shifted serially through the instruction register on each TCK cycle. Exit1-IR, Exit2-IR
Amontec
For a target device, the Exit1-IR and Exit2-IR states are temporary states that end an instruction-register scan. It is possible to return to the Shift-IR state from either Exit1-IR or Exit2-IR without recapturing the instruction register. On the first falling edge of TCK after entry to Exit1-IR, TDO goes from the active state to the high-impedance state. Pause-IR For a target device, no specific function is performed in the stable Pause-IR state, in which the TAP controller can remain indefinitely. The Pause-IR state suspends and resumes instruction-register scan operations without loss of data. Update-IR For a target device, the current instruction is updated and takes effect on the falling edge of TCK, following entry to the Update-IR state. All JTAG operations shift data into or out of JTAG instruction and data registers. The TAP Controller provides direct access to all of these registers. There are two classes of JTAG registers: the Instruction register (only one) and Data registers (many). Access to the Instruction Register is provided through the Shift-IR state, while access to the Data Register is provided through the Shift-DR state. To shift data through these registers, the TAP Controller of the target device must be moved to the corresponding state. For example, to shift data into the Instruction Register, the TAP Controller must be moved to the Shift-IR state, and the data shifted in, LSB first.
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
http://www.amontec.com/
3/8 11/16/2005
Amontec
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
4/8 11/16/2005
http://www.amontec.com/
Amontec Selected register contents shift out onto TDO during the TCK's falling edge. Test-Mode select (TMS): this input, which also clocks through on the rising edge of TCK, determines the state of the TAP controller.
JTAG SIGNALS
The Boundary Scan Register and other test features of the device are accessed through a standard interface - the JTAG Test Access Port (TAP). According to the standard, the TAP must contain four signals, each available through a dedicated device pin and they may not be shared with any other function: Test Data Input (TDI): it is used to shift data and instruction tests into the Boundary Scan register. Test Data Output (TDO): this pin provides data from the Boundary Scan register or other internal register. Test Clock (TCK): this input controls test-logic timing independent of clocks that normal system operations employ. The TDI shifts values into the appropriate register on the rising edge of TCK.
Note: An optional active-low Test-Reset Pin (TRST#) permits an asynchronous TAP controller initialization without affecting other device or system logic. Asserting this pin inactivates the boundary-scan register and places the device in normal operating mode. These pins are used with a simple protocol to communicate with on-chip Boundary-Scan logic. The key timing relationships include: TMS and TDI are sampled on the rising edge of TCK. A new TDO value appears after the falling edge of TCK.
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
http://www.amontec.com/
5/8 11/16/2005
Amontec
Several others are described by the standard, such as an Identification Register, but are optional.
Figure 5: Data Register structure The Test Data Register loads the data in parallel on the rising edge of TCK in the TAP Controller state CAPTUREDR (triggering test results), puts the data on the output parallel latch on the falling edge of TCK in the TAP Controller state UPDATE-DR (new test pattern generation), and shifts the serial data through TDI to TDO during the TAP Controller state SHIFT-DR.
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
6/8 11/16/2005
http://www.amontec.com/
Amontec connector access, as well as opens between tester nails and boundary-scan input pins. The EXTEST instruction latches boundary-scan nodes to the state that permits easier incircuit back drive (a logic 1 to TTL). The tester then looks for node movement when it forces non-boundary-scan nodes to their opposite states. Applying this technique to a single conventional node places a 1 on that node and scans out boundary-scan-input states, then injects a 0 onto the test node and scans again. A short between the test node and a boundary-scan node will show up as a failure. An open connection will cause both scanning operations to produce exactly the same output pattern.
JTAG APPLICATIONS
The Boundary-Scan Standard allows for ICs to be linked into chains by linking the TDO pin of one IC with the TDI pin of the next. For example, the 1149.1 ICs on a board may all be linked together by their TDO-TDI pins in succession. Several distinct chains may exist on a board if they do not share any TAP signals.
Figure 7: JTAG Board Application Some shorts other than the one between test and boundaryscan nodes can cause this operation to fail. Only rarely, however, will such a faulty node follow the test node at both the latched-1 and latched-0 states. Changing test-node states several times and declaring a short only when the suspect boundary-scan node exactly follows these transitions further improves the likelihood of a correct diagnosis.
Figure 6: Boundary Scan Cell The 1149.1 Standard allows us to exploit the BoundaryScan to test a board composed of Boundary-Scan chips. Interconnect tests look for shorts between boundary-scan nodes and conventional nodes with bed-of-nails or edge-
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
http://www.amontec.com/
7/8 11/16/2005
Amontec
CONTENT REVISIONS
This V1.0 V1.1 document Date 05-FEB-2005 16-OCT-2005 contains the following Changes First version (by Laurent Gauch) Adding TAP State Denomination changes to content, causing it to differ from previous versions: Version
CONTACT AMONTEC
Amontec, Gauch Logic Road 123 1641 Vuippens Switzerland http://www.amontec.com/ mailto:info@amonte.com
SPECIFICATIONS ARE SUBJECT TO CHANGE WITHOUT NOTICE. Suggested applications (if any) are for standard use. See Important Restrictions for limitations on special applications. See Limited Warranty for Amontecs product warranty. The Limited Warranty is in lieu, and exclusive of, all other warranties, express or implied. ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR USE AND FITNESS FOR A PARTICULAR PURPOSE, ARE SPECIFICALLY EXCLUDED. In no event will Amontec be liable, or in any way responsible, for any incidental or consequential economic or property damage.
2000-2005 Amontec, Inc. All rights reserved. All Amontec registered trademarks, patents, and disclaimers are as listed at http://www.amontec.com/legal.shtml All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice.
8/8 11/16/2005
http://www.amontec.com/