This class is for internal use by JtagSC
and
the various TAP action classes. It maintains the interface's model
of the state machine in the TAP Controller.
The header defining this class also defines
enum TapState
for the various states of
the TAP state machine.
TapStateMachine
has a number of private
instance variables.
TapState state
The current state.
bool resetDone
The TAP state machine is only of use if it correctly reflects
the state machine in the TAP Controller of the target. This
flag may be set and read by users to reflect whether the two are
in synchrony (for example having gone through a sequence of 5 or
more TMS
=1 transitions).
The constructor initializes the state to Test-Logic-Reset and clears the flag indicating the TAP controller has been reset. Until a reset has been completed, there can be no confidence that the state is a correct reflection of reality.
The functions getState
is provided to get the
current state. The functions getResetDone
and
setResetDone
are provided to access the flag
indicating whether a reset has been completed. Although
initialized to false, it is the responsibility of users to set
this flag to its correct value.
This function returns through its second argument a value of TMS
which will move from the current state to the specified target
state most efficiently (i.e. smallest number of steps). Table
lookup makes this an efficient function.
The return value indicates if the state machine was already in the target state.
This function is used by the instruction and data scan TAP
action classes to get to the correct state during their
process
functions.