Class TapBuilder
java.lang.Object
cbsw.TapBuilder
A utility to build bit sequences for a JTAG TAP
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) int(package private) int(package private) StringBuilder(package private) StringBuilder(package private) StringBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the TMS, TDO and MASK sequencesvoidclock(int clocks) Insert extra clocks with TMS 0 (can be 0)voidDR scan StringBuffer buildervoidIR scan StringBuffer builderintlength()Returns the length of the sequencevoidrti(int clocks) Move from anywhere to RTIvoidsetDebug(boolean dbg) Sets the debug flagvoidsetTapLength(int cl) Sets the TAP lengthvoidsetTapPosition(int pos) Sets the TAP positionvoidshow()Displays the TMS, TDO and MASK sequences on System.errConverts MASK to ByteBufferConverts TDO to ByteBufferConverts TMS/TDO pairs to ByteBuffer (useful for DJTG API)Convert TMS to ByteBufferConverts StringBuilder to ByteBuffer
-
Field Details
-
tapLength
int tapLength -
tapPosition
int tapPosition -
tms
StringBuilder tms -
tdo
StringBuilder tdo -
tdoMask
StringBuilder tdoMask -
debug
boolean debug
-
-
Constructor Details
-
TapBuilder
public TapBuilder(int cl, int pos) Constructor
- Parameters:
cl- The TAP length (number of devices)pos- The position on the TAP of the target device
-
-
Method Details
-
setTapLength
public void setTapLength(int cl) Sets the TAP length
- Parameters:
cl- The TAP length (number of devices)
-
setTapPosition
public void setTapPosition(int pos) Sets the TAP position
- Parameters:
pos- The position on the TAP of the target device
-
setDebug
public void setDebug(boolean dbg) Sets the debug flag
- Parameters:
dbg- true=Enable debug
-
length
public int length()Returns the length of the sequence
- Returns:
- The length (-1 on error)
-
toByteBuffer
Converts StringBuilder to ByteBuffer
- Parameters:
sb- The StringBuilder- Returns:
- The ByteBuffer
-
tdoMaskToByteBuffer
-
tdoToByteBuffer
-
tmsToByteBuffer
-
tmsTdoToByteBuffer
Converts TMS/TDO pairs to ByteBuffer (useful for DJTG API)
- Returns:
- The ByteBuffer
-
clear
public void clear()Clears the TMS, TDO and MASK sequences
-
show
public void show()Displays the TMS, TDO and MASK sequences on System.err
-
ir
IR scan StringBuffer builder
Insert sequence to do IR scan.
Valid from UPDATE-IR, UPDATE-DR or RTI
- Parameters:
ircode- The instruction coderti- If true, insert transitions to RTI
-
dr
DR scan StringBuffer builder
Insert sequence to do DR scan.
Valid from UPDATE-IR, UPDATE-DR or RTI
- Parameters:
tdoData- The datarti- If true, insert transitions to RTI
-
rti
public void rti(int clocks) Move from anywhere to RTI
Stay there for the requested extra number of clocks (can be 0).
- Parameters:
clocks- Number of clocks while in RTI
-
clock
public void clock(int clocks) Insert extra clocks with TMS 0 (can be 0)
- Parameters:
clocks- Number of clocks to insert
-