Class XilinxDjtg

java.lang.Object
cbsw.adept.xilinx.XilinxDjtg
All Implemented Interfaces:
ActionListener, EventListener

public class XilinxDjtg extends Object implements 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 Details

  • Constructor Details

    • XilinxDjtg

      public XilinxDjtg(int chainLength, int chainPosition)

      Constructor

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

    • 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 String getSTAT7()

      Gets the configuration status register.

      Returns:
      Content of status register (hexadecimal)
    • getSTAT6

      public String getSTAT6()

      Gets the configuration status register.

      Returns:
      Content of status register (hexadecimal)
    • actionPerformed

      public void actionPerformed(ActionEvent e)

      ActionListener to handle panel events

      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - The ActionEvent
    • prefsSetFilename

      public void prefsSetFilename(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 String dna()

      Gets the device DNA

      Returns:
      The DNA String
    • s6dna

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

    • program

      public void program(String binFileName)

      Programs the FPGA.

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

      Parameters:
      binFileName - File name path of bin configuration.
    • makeMainMenu

      public JMenu makeMainMenu(String title)

      Makes the main menu for a GUI panel

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

      public static void main(String[] args)

      Launch the GUI

      Parameters:
      args - Command line parameters