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.ActionListenerImplements 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 classXilinxDjtg.FamilyclassXilinxDjtg.ProgramThread
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JTextFieldbinTF(package private) intchainPosition(package private) java.awt.event.ActionListenerexitALAction Listener for exit menu button(package private) JniAdeptDeppjniAdept(package private) java.util.prefs.Preferencesprefs(package private) javax.swing.JProgressBarprogressBar(package private) XilinxDjtg.ProgramThreadpth(package private) javax.swing.JTextFieldstatusTF(package private) byte[]swap(package private) TapBuildertap(package private) byte[]tdi(package private) inttxPages(package private) inttxPageSize
-
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 voidactionPerformed(java.awt.event.ActionEvent e)ActionListener to handle panel eventsjava.lang.Stringdna()Gets the device DNAvoidfuseDnaSeries7()Gets the FUSE_DNA (Series 7)java.lang.StringgetSTAT6()Gets the configuration status register.java.lang.StringgetSTAT7()Gets the configuration status register.intidcode()Gets the device IDCODEvoidinit()Called to complete initialisation after constructorvoidiscDnaSeries7()Gets the XSC_DNA (Series 7)voidiscDnaSpartan6()Gets the ISC_DNA (Spartan 6)voidjprogram()Does JPROGRAMvoidjshutdown()Does JSHUTDOWN followed by clocks in RTIvoidjstart()Does JSTARTstatic voidmain(java.lang.String[] args)Launch the GUIjavax.swing.JMenumakeMainMenu(java.lang.String title)Makes the main menu for a GUI panelGuiJPanelmakePanel()Makes a GUI panelvoidprefsSetFilename(java.io.File file)Updates the configuration file location preferences.voidprogram()Programs the FPGA.voidrti()Moves to the RTI state (from anywhere)java.lang.Strings6dna()Gets the device DNA (Spartan6)voidsetConnectedDevice()Creates dialog to select the I/O devicevoidsetConnectedDevice(JniAdeptDepp jniAdept)Sets the I/O devicevoidtlr()Moves to the TLR state (from anywhere)byte[]unpackData()Extracts data from the TDI buffer.shortxadc(int ch)Reads Series 7 XADCdoublexadcTemperature()Gets raw ADC and convert to degrees C following ug480doublexadcVoltage(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:
actionPerformedin 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
-
-