Class TapBuilder

java.lang.Object
cbsw.TapBuilder

public class TapBuilder extends Object

A utility to build bit sequences for a JTAG TAP

  • Field Details

  • 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

      public ByteBuffer toByteBuffer(StringBuilder sb)

      Converts StringBuilder to ByteBuffer

      Parameters:
      sb - The StringBuilder
      Returns:
      The ByteBuffer
    • tdoMaskToByteBuffer

      public ByteBuffer tdoMaskToByteBuffer()

      Converts MASK to ByteBuffer

      Returns:
      The ByteBuffer
    • tdoToByteBuffer

      public ByteBuffer tdoToByteBuffer()

      Converts TDO to ByteBuffer

      Returns:
      The ByteBuffer
    • tmsToByteBuffer

      public ByteBuffer tmsToByteBuffer()

      Convert TMS to ByteBuffer

      Returns:
      The ByteBuffer
    • tmsTdoToByteBuffer

      public ByteBuffer 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

      public void ir(String ircode, boolean rti)

      IR scan StringBuffer builder

      Insert sequence to do IR scan.

      Valid from UPDATE-IR, UPDATE-DR or RTI

      Parameters:
      ircode - The instruction code
      rti - If true, insert transitions to RTI
    • dr

      public void dr(String tdoData, boolean rti)

      DR scan StringBuffer builder

      Insert sequence to do DR scan.

      Valid from UPDATE-IR, UPDATE-DR or RTI

      Parameters:
      tdoData - The data
      rti - 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