Class XilinxDjtg
- java.lang.Object
-
- cbsw.adept.xilinx.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
XilinxDjtg.Family
class
XilinxDjtg.ProgramThread
-
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 eventsjava.lang.String
dna()
Gets the device DNAvoid
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 IDCODEvoid
init()
Called to complete initialisation after constructorvoid
iscDnaSeries7()
Gets the XSC_DNA (Series 7)void
iscDnaSpartan6()
Gets the ISC_DNA (Spartan 6)void
jprogram()
Does JPROGRAMvoid
jshutdown()
Does JSHUTDOWN followed by clocks in RTIvoid
jstart()
Does JSTARTstatic void
main(java.lang.String[] args)
Launch the GUIjavax.swing.JMenu
makeMainMenu(java.lang.String title)
Makes the main menu for a GUI panelGuiJPanel
makePanel()
Makes a GUI panelvoid
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 devicevoid
setConnectedDevice(JniAdeptDepp jniAdept)
Sets the I/O devicevoid
tlr()
Moves to the TLR state (from anywhere)byte[]
unpackData()
Extracts data from the TDI buffer.short
xadc(int ch)
Reads Series 7 XADCdouble
xadcTemperature()
Gets raw ADC and convert to degrees C following ug480double
xadcVoltage(int ch)
Gets raw ADC and convert to volts following ug480
-
-
-
Field Detail
-
prefs
java.util.prefs.Preferences prefs
-
jniAdept
JniAdeptDepp jniAdept
-
chainPosition
int chainPosition
-
pth
XilinxDjtg.ProgramThread pth
-
tap
TapBuilder tap
-
statusTF
javax.swing.JTextField statusTF
-
binTF
javax.swing.JTextField binTF
-
tdi
byte[] tdi
-
txPages
final int txPages
- See Also:
- Constant Field Values
-
txPageSize
final int txPageSize
- See Also:
- Constant Field Values
-
progressBar
javax.swing.JProgressBar progressBar
-
swap
byte[] swap
-
exitAL
java.awt.event.ActionListener exitAL
Action Listener for exit menu button
-
-
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 interfacejava.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
-
-