Class XilS7Control


  • public class XilS7Control
    extends java.lang.Object

    This class encapsulates JTAG interactions with a Xilinx Series 7 FPGA including programming.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) ScaDepp sca  
    • Constructor Summary

      Constructors 
      Constructor Description
      XilS7Control()
      No-argument constructor called by the unmarshaller.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String dna()
      Reads the device DNA.
      java.lang.String getSTAT()
      Gets the FPGA configuration status register.
      java.util.HashMap<java.lang.String,​java.lang.String> getStatus()
      Reads FPGA id, temperature and voltage.
      int idcode()
      Reads the IDCODE.
      void init​(ScaDepp sca)
      Completes inititialisation after unmarshalling.
      void jshutdown()
      Does JSHUTDOWN followed by >12 clocks in RTI.
      void jstart()
      Does JSTART.
      GuiJPanel makePanel()
      Convenience method to build a GUI panel.
      void packAndGo()
      Launches a transaction.
      (package private) void prefsSetFilename​(java.io.File file)
      Updates the configuration file location preferences.
      (package private) void prefsSetFilename​(java.lang.String fileName)
      Updates the configuration file location preferences.
      void program()
      Programs the FPGA.
      void rti()
      Moves to the RTI state (from anywhere).
      void setTapLength​(int tapLength)  
      void setTapPosition​(int tapPosition)  
      void showStatus()
      Displays a string containing FPGA status.
      void tlr()
      Moves to the TLR state (from anywhere).
      byte[] unpackData()
      Unpacks the data from the SCA responses.
      short xadc​(int ch)
      Performs FPGA XADC conversion.
      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
    • Constructor Detail

      • XilS7Control

        public XilS7Control()

        No-argument constructor called by the unmarshaller.

    • Method Detail

      • setTapLength

        public void setTapLength​(int tapLength)
      • setTapPosition

        public void setTapPosition​(int tapPosition)
      • init

        public void init​(ScaDepp sca)

        Completes inititialisation after unmarshalling.

        Parameters:
        sca - The SCA interface.
      • prefsSetFilename

        void prefsSetFilename​(java.io.File file)

        Updates the configuration file location preferences.

        Parameters:
        file - The configuration file.
      • prefsSetFilename

        void prefsSetFilename​(java.lang.String fileName)

        Updates the configuration file location preferences.

        Parameters:
        fileName - The configuration file name.
      • makePanel

        public GuiJPanel makePanel()

        Convenience method to build a GUI panel.

        Returns:
        The panel.
      • packAndGo

        public void packAndGo()

        Launches a transaction.

        Transaction is limited to max 128 bits for now.

      • unpackData

        public byte[] unpackData()

        Unpacks the data from the SCA responses.

        Returns:
        Array containing extracted data.
      • xadc

        public short xadc​(int ch)

        Performs FPGA XADC conversion.

        The FPGA reserved channels are:

        00
        Temperature
        01
        VCCINT
        02
        VCCAUX

        See ug480 for more.

        Parameters:
        ch - The XADC channel number.
        Returns:
        The raw converted ADC value.
      • xadcTemperature

        public double xadcTemperature()

        Gets raw ADC and convert to degrees C following ug480.

        Returns:
        The converted ADC value.
      • xadcVoltage

        public double xadcVoltage​(int ch)

        Gets raw ADC and convert to volts following ug480.

        Parameters:
        ch - The XADC channel number.
        Returns:
        The converted ADC value.
      • idcode

        public int idcode()

        Reads the IDCODE.

        Returns:
        IDCODE.
      • dna

        public java.lang.String dna()

        Reads the device DNA.

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

        A few clocks in RTI at the beginning are used to byte-align the DNA.

        Returns:
        The device DNA string.
      • jstart

        public void jstart()

        Does JSTART.

        Starts the FPGA after configuration.

      • 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 >12 clocks in RTI.

      • getSTAT

        public java.lang.String getSTAT()

        Gets the FPGA configuration status register.

        The CFG_IN data are shifted MSB first while instructions are LSB first so this uses a mixture of SCA-JTAG MSB and LSB modes.

        The default ByteOrder.BIG_ENDIAN for the ByteBuffer is used so that getInt() retrieves each 32-bit word in the correct byte order for infoTx() with the SCA JTAG MSB mode.

        Returns:
        The status register content.
      • program

        public void program()

        Programs the FPGA.

        The CFG_IN data are shifted MSB first while instructions are LSB first so this uses a mixture of SCA-JTAG MSB and LSB modes.

        The default ByteOrder.BIG_ENDIAN for the ByteBuffer is used so that getInt() retrieves each 32-bit word in the correct byte order for infoTx() with the SCA JTAG MSB mode.

      • showStatus

        public void showStatus()

        Displays a string containing FPGA status.

        Calls getStatus(), formats the retrieved data and sets the status text field text.

      • getStatus

        public java.util.HashMap<java.lang.String,​java.lang.String> getStatus()

        Reads FPGA id, temperature and voltage.

        Returns:
        A map with keys: idcode, dna, temperature, vccInt, vccAux.