Class XilinxDjtg

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.util.EventListener

    public class XilinxDjtg
    extends java.lang.Object
    implements java.awt.event.ActionListener

    Implements Xilinx FPGA programming and other functionality through the Digilent Adept DJTG interface.

    The programming function should work for both Series7 FPGAs and Spartan6 and probably others.

    Other functions, such as XADC access is only available on some devices.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) javax.swing.JTextField binTF  
      (package private) int chainPosition  
      (package private) java.awt.event.ActionListener exitAL
      Action Listener for exit menu button
      (package private) JniAdeptDepp jniAdept  
      (package private) java.util.prefs.Preferences prefs  
      (package private) javax.swing.JProgressBar progressBar  
      (package private) XilinxDjtg.ProgramThread pth  
      (package private) javax.swing.JTextField statusTF  
      (package private) byte[] swap  
      (package private) TapBuilder tap  
      (package private) byte[] tdi  
      (package private) int txPages  
      (package private) int txPageSize  
    • Constructor Summary

      Constructors 
      Constructor Description
      XilinxDjtg​(int chainLength, int chainPosition)
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)
      ActionListener to handle panel events
      java.lang.String dna()
      Gets the device DNA
      void fuseDnaSeries7()
      Gets the FUSE_DNA (Series 7)
      java.lang.String getSTAT6()
      Gets the configuration status register.
      java.lang.String getSTAT7()
      Gets the configuration status register.
      int idcode()
      Gets the device IDCODE
      void init()
      Called to complete initialisation after constructor
      void iscDnaSeries7()
      Gets the XSC_DNA (Series 7)
      void iscDnaSpartan6()
      Gets the ISC_DNA (Spartan 6)
      void jprogram()
      Does JPROGRAM
      void jshutdown()
      Does JSHUTDOWN followed by clocks in RTI
      void jstart()
      Does JSTART
      static void main​(java.lang.String[] args)
      Launch the GUI
      javax.swing.JMenu makeMainMenu​(java.lang.String title)
      Makes the main menu for a GUI panel
      GuiJPanel makePanel()
      Makes a GUI panel
      void prefsSetFilename​(java.io.File file)
      Updates the configuration file location preferences.
      void program()
      Programs the FPGA.
      void rti()
      Moves to the RTI state (from anywhere)
      java.lang.String s6dna()
      Gets the device DNA (Spartan6)
      void setConnectedDevice()
      Creates dialog to select the I/O device
      void setConnectedDevice​(JniAdeptDepp jniAdept)
      Sets the I/O device
      void tlr()
      Moves to the TLR state (from anywhere)
      byte[] unpackData()
      Extracts data from the TDI buffer.
      short xadc​(int ch)
      Reads Series 7 XADC
      double xadcTemperature()
      Gets raw ADC and convert to degrees C following ug480
      double xadcVoltage​(int ch)
      Gets raw ADC and convert to volts following ug480
      • Methods inherited from class java.lang.Object

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

      • prefs

        java.util.prefs.Preferences prefs
      • chainPosition

        int chainPosition
      • statusTF

        javax.swing.JTextField statusTF
      • binTF

        javax.swing.JTextField binTF
      • tdi

        byte[] tdi
      • progressBar

        javax.swing.JProgressBar progressBar
      • swap

        byte[] swap
      • exitAL

        java.awt.event.ActionListener exitAL

        Action Listener for exit menu button

    • Constructor Detail

      • XilinxDjtg

        public XilinxDjtg​(int chainLength,
                          int chainPosition)

        Constructor

        Parameters:
        chainLength - Chain length (number of devices)
        chainPosition - Position of target device on chain
    • Method Detail

      • init

        public void init()

        Called to complete initialisation after constructor

      • setConnectedDevice

        public void setConnectedDevice​(JniAdeptDepp jniAdept)

        Sets the I/O device

        Parameters:
        jniAdept - The I/O device
      • setConnectedDevice

        public void setConnectedDevice()

        Creates dialog to select the I/O device

      • makePanel

        public GuiJPanel makePanel()

        Makes a GUI panel

        Creates a panel to allow interactive execution of JTAG operations.

        Returns:
        The panel
      • getSTAT7

        public java.lang.String getSTAT7()

        Gets the configuration status register.

        Returns:
        Content of status register (hexadecimal)
      • getSTAT6

        public java.lang.String getSTAT6()

        Gets the configuration status register.

        Returns:
        Content of status register (hexadecimal)
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)

        ActionListener to handle panel events

        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - The ActionEvent
      • prefsSetFilename

        public void prefsSetFilename​(java.io.File file)

        Updates the configuration file location preferences.

        Parameters:
        file - The configuration file.
      • unpackData

        public byte[] unpackData()

        Extracts data from the TDI buffer.

        Returns:
        The data array
      • xadc

        public short xadc​(int ch)

        Reads Series 7 XADC

        The internal ADC channels are (See ug480 for more):

        00: Temperature 01: VCCINT 02: VCCAUX
        Parameters:
        ch - The ADC channel to read
        Returns:
        The ADC value
      • xadcTemperature

        public double xadcTemperature()

        Gets raw ADC and convert to degrees C following ug480

        Returns:
        The ADC value
      • xadcVoltage

        public double xadcVoltage​(int ch)

        Gets raw ADC and convert to volts following ug480

        Parameters:
        ch - The ADC channel
        Returns:
        The ADC value
      • idcode

        public int idcode()

        Gets the device IDCODE

        Returns:
        The IDCODE
      • dna

        public java.lang.String dna()

        Gets the device DNA

        Returns:
        The DNA String
      • s6dna

        public java.lang.String s6dna()

        Gets the device DNA (Spartan6)

        Returns:
        The DNA String
      • fuseDnaSeries7

        public void fuseDnaSeries7()

        Gets the FUSE_DNA (Series 7)

        FUSE_DNA is accessible while the device is running

      • iscDnaSeries7

        public void iscDnaSeries7()

        Gets the XSC_DNA (Series 7)

        XSC_DNA (0x17) requires that ISC_ENABLE (0x10) is loaded first. Follow with ISC_DISABLE (0x16)

      • iscDnaSpartan6

        public void iscDnaSpartan6()

        Gets the ISC_DNA (Spartan 6)

        ISC_DNA (0x30) requires that ISC_ENABLE (0x10) is loaded first. Follow with ISC_DISABLE (0x16)

      • jstart

        public void jstart()

        Does JSTART

      • tlr

        public void tlr()

        Moves to the TLR state (from anywhere)

        TMS: 5 or more 1's take us to TLR

      • rti

        public void rti()

        Moves to the RTI state (from anywhere)

        TMS: 5 or more 1's take us to TLR then 0 to go to RTI

      • jshutdown

        public void jshutdown()

        Does JSHUTDOWN followed by clocks in RTI

        Series7 requires >12 clocks to complete shutdown

        Spartan6 requires 24 clocks to complete shutdown

      • jprogram

        public void jprogram()

        Does JPROGRAM

      • program

        public void program()

        Programs the FPGA.

        The CFG_IN data are shifted MSB first while instructions are LSB first.

      • makeMainMenu

        public javax.swing.JMenu makeMainMenu​(java.lang.String title)

        Makes the main menu for a GUI panel

        Parameters:
        title - The menu title
        Returns:
        The menu
      • main

        public static void main​(java.lang.String[] args)

        Launch the GUI

        Parameters:
        args - Command line parameters