Package cbsw

Class TapBuilder


  • public class TapBuilder
    extends java.lang.Object

    A utility to build bit sequences for a JTAG TAP

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean debug  
      (package private) int tapLength  
      (package private) int tapPosition  
      (package private) java.lang.StringBuilder tdo  
      (package private) java.lang.StringBuilder tdoMask  
      (package private) java.lang.StringBuilder tms  
    • Constructor Summary

      Constructors 
      Constructor Description
      TapBuilder​(int cl, int pos)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clears the TMS, TDO and MASK sequences
      void clock​(int clocks)
      Insert extra clocks with TMS 0 (can be 0)
      void dr​(java.lang.String tdoData, boolean rti)
      DR scan StringBuffer builder
      void ir​(java.lang.String ircode, boolean rti)
      IR scan StringBuffer builder
      int length()
      Returns the length of the sequence
      void rti​(int clocks)
      Move from anywhere to RTI
      void setDebug​(boolean dbg)
      Sets the debug flag
      void setTapLength​(int cl)
      Sets the TAP length
      void setTapPosition​(int pos)
      Sets the TAP position
      void show()
      Displays the TMS, TDO and MASK sequences on System.err
      java.nio.ByteBuffer tdoMaskToByteBuffer()
      Converts MASK to ByteBuffer
      java.nio.ByteBuffer tdoToByteBuffer()
      Converts TDO to ByteBuffer
      java.nio.ByteBuffer tmsTdoToByteBuffer()
      Converts TMS/TDO pairs to ByteBuffer (useful for DJTG API)
      java.nio.ByteBuffer tmsToByteBuffer()
      Convert TMS to ByteBuffer
      java.nio.ByteBuffer toByteBuffer​(java.lang.StringBuilder sb)
      Converts StringBuilder to ByteBuffer
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tapLength

        int tapLength
      • tapPosition

        int tapPosition
      • tms

        java.lang.StringBuilder tms
      • tdo

        java.lang.StringBuilder tdo
      • tdoMask

        java.lang.StringBuilder tdoMask
      • debug

        boolean debug
    • Constructor Detail

      • 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 Detail

      • 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 java.nio.ByteBuffer toByteBuffer​(java.lang.StringBuilder sb)

        Converts StringBuilder to ByteBuffer

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

        public java.nio.ByteBuffer tdoMaskToByteBuffer()

        Converts MASK to ByteBuffer

        Returns:
        The ByteBuffer
      • tdoToByteBuffer

        public java.nio.ByteBuffer tdoToByteBuffer()

        Converts TDO to ByteBuffer

        Returns:
        The ByteBuffer
      • tmsToByteBuffer

        public java.nio.ByteBuffer tmsToByteBuffer()

        Convert TMS to ByteBuffer

        Returns:
        The ByteBuffer
      • tmsTdoToByteBuffer

        public java.nio.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​(java.lang.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​(java.lang.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