File: jtag.fm5, modified 7/25/99
PRELIMINARY INFORMATION
17-1
JTAG Functional Specification
Chapter 17
by Renga Sundararajan, Hans Bouwmeester and Frank Bouwman
17.1
OVERVIEW
The IEEE 1149.1 (JTAG) standard can be used for vari-
ous goals including testing connections between inte-
grated circuits on board level, control over testing the in-
ternal structures of the integrated circuits, and monitoring
and communicating with a running system.
The JTAG standard defines on-chip test logic, four or five
dedicated pins collectively called the Test Access Port
(TAP) and a TAP controller.
The JTAG standard defines instructions that must al-
ways be implemented by a TAP controller, in order to
guarantee correct behavior on board level. Apart from
mandatory instructions, the standard also allows user
defined and private instructions. In TM1100 user defined
and private instructions exist for debug purposes and for
production test. For debug there is communication be-
tween a debug monitor running on the TM1100-
DSPCPU and a debugger front-end running on a host
17.2
TEST ACCESS PORT (TAP)
The Test Access Port includes three or four dedicated in-
put pins and one output pin:
TCK (Test Clock)
TMS (Test Mode Select)
TDI (Test Data In)
TRST (Test Reset, optional!)
TDO (Test Data Out)
TRST is
not present on TM1100.
TCK provides the clock for test logic required by the stan-
dard. TCK is asynchronous to the system clock. Stored
state devices in JTAG controller must retain their state
indefinitely when TCK is stopped at 0 or 1.
The signal received at TMS is decoded by the TAP con-
troller to control test functions. The test logic is required
to sample TMS at the rising edge of TCK.
Serial test instructions and test data are received at TDI.
The TDI signal is required to be sampled at the rising
edge of TCK. When test data is shifted from TDI to TDO,
the data must appear without inversion at TDO after a
number of rising and falling edges of TCK determined by
the length of the instruction or test data register selected.
TDO is the serial output for test instructions and data
from he TAP controller. Changes in the state of TDO
must occur at the falling edge of TCK. This is because
devices connected to TDO are required to sample TDO
at the rising edge of TCK. The TDO driver must be in an
inactive state (i.e., TDO line HIghZ) except when the
scanning of data is in progress.
17.2.1
TAP Controller
The TAP controller is a finite state machine and it syn-
chronously responds to changes in TCK and TMS sig-
nals. The TAP instructions and data are serially scanned
into the TAP controller’s instruction and data registers via
the common input line TDI. The TMS signal tells the TAP
controller to select either the TAP instruction register or
a TAP data registers as the destination for serial input
from the common line TDI. An instruction scanned into
the instruction register selects a data register to be con-
nected between TDI and TDO and hence to be the des-
tination for serial data input.
The TAP controller’s state changes are determined by
the TMS signal. The states are used for scanning in/out
TAP instruction and data, updating instruction, and data
registers, and for executing instructions.
The controller’s state diagram (
Figure 17-1) shows sep-
arate states for “capture”, “shift” and “update” of data and
instructions. The reason is to leave the contents of a data
register or an instruction register undisturbed until serial
scan in is finished and the update state is entered. By
separating the shift and update states, the contents of a
register (by that we mean the parallel stage) is not affect-
ed
during scan in/out.
The TAP controller must be in Test Logic Reset state af-
ter power-up. It remains in that state as long as TMS is
held at 1. The controller transitions to Run-Test/Idle state
from Test Logic Reset state when TMS = 0. The Run-
Test/Idle state is an idle state of the controller in between
scanning in/out an instruction/data register. The “Run-
Test” part of the name refers to start of built-in tests. The
“Idle” part of the name refers to all other cases. Note that
there are two similar sub-structures in the state diagram,
one for scanning in an instruction and another for scan-
ning in data. To scan in/out a data register, one has to
scan in an instruction first.
An instruction or data register must have at least two
stages, the shift register stage and the parallel input/out-
put stage. When an n-bit data register is to be “read”, the
register is selected by an instruction, the registers con-
tents are “captured” first (loaded in parallel into shift reg-
ister stage), n bits are shifted in and at the same time n
bits are shifted out, and finally the register is “updated”
with the new n bits shifted in.