This class implements capture, shift and update of a value through the instruction register. It has a number of private instance variables.
uint32_t iRegIn
This is the value being shifted in through TDI
. It holds the
remaining bits to be shifted.
int iRegSize
This is the number of bits to be shifted in through TDI
and out
through TDO
uint32_t iRegOut
This is the value being shifted out through TDO
. It holds the
bits shifted out so far.
int bitsShifted
The number of bits shifted in so far.
enum { SHIFT_IR_PREPARING, SHIFT_IR_SHIFTING, SHIFT_IR_UPDATING } iRScanState
This enumeration records where the action is in its process. The
process
method follows a state machine (see
below) whose state is recorded here.
The primary responsibility of the constructor is to initialize all
the instance variables. The input register and size are taken from
the arguments, the output register and count of bits shifted are
zeroed and the IR-Scan process state machine is set to
SHIFT_IR_PREPARING
.
This method generates the appropriate values of TDI
and TMS
to
process the action and capture TDI
. It is controlled by its own
state machine, whose state is recorded in
iRScanState
as shown in Figure 3.2
A subtlety of the implementation is that, because TDO
changes on
the falling edge, its value is always one
step later than that of TDI
. Thus TDO
is not captured on the first
cycle in Shift-IR state and its last bit is captured immediately
after leaving Shift-IR state.