public class ConfigData
extends java.lang.Object
<Address> <Description> 0..2 Signature "CD0" 3 Kind of FPGA Board, seeboardNames
, e.g. 2 for "ZTEX USB-FPGA Module", 4 FPGA Board series, e.g. 2 5 FPGA Board number (number behind the dot), e.g. 16 6..7 FPGA Board variant (letter), e.g. "b" 8..9 FPGA, seefpgas
, e.g. 12 for X7A200T 10 FPGA package, seepackages
, e.g. 3 for FBG484 11..13 Speed grade + temperature range, e.g. "2C" 14 RAM size, format is ( n & 0xf0 ) << ( (n & 0xf) + 16 ) bytes 15 RAM type, seeramTypes
16..25 Serial number, overwrites SN_STRING of the ZTEX descriptor. If it is equal to "0000000000" (default) it is replaced by a unique address from MAC EEPROM of Flash. 26..27 Actual size of Bitstream in 4K sectors; 0 means Bitstream disabled (default) 28..29 Maximum size of Bitstream in 4K sectors; 0 means that either no Flash is present or that this information is stored in Flash (exchangeable media) 30..31 Start of the Bitstream in 4K sectors 32..33 USB vendor ID, ignored if zero 34..35 USB product ID, ignored if USB vendor ID is zero 36..67 Product string, null-terminated if length is smaller than 32 68 Whether the FPGA can access Flash memory. There are two modes: Mode 1: FPGA does not / is not allowed to access Flash. Default for FX3 based boards. Mode 2: FPGA is allowed to access Flash. Firmware prohibits Flash access after FPGA configuration. Default for FX2 based boards. A value of 168 explicitly sets mode 1. A value of 67 explicitly sets mode 1. Default mode is used in all other cases. 69..79 Reserved, must be 0 80..127 48 bytes user space
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
boardNames
Kinds of FPGA Boards.
|
static java.lang.String[] |
fpgas
FPGA's used on ZTEX FPGA Boards.
|
static java.lang.String[] |
packages
FPGA packages used on ZTEX FPGA boards.
|
static java.lang.String[] |
ramTypes
RAM types and speed used on ZTEX FPGA boards.
|
Constructor and Description |
---|
ConfigData()
Constructs an empty instance.
|
ConfigData(Ztex1v1 z)
Constructs an instance and connects it with z.
|
Modifier and Type | Method and Description |
---|---|
boolean |
connect(Ztex1v1 z)
Reads the configuration data (if existent) from a device and connects it to this instance.
|
byte[] |
data()
Returns a copy of the configuration data array.
|
java.lang.String |
defaultBitstreamPath(java.lang.String name,
int compat)
Returns the bitstream path if the same directory scheme as for the examples is used.
|
boolean |
disconnect()
Disconnects the currently connected device.
|
int |
getBitstreamSize()
Returns actual size of bitstream in bytes sectors.
0 means that no bitstream is stored.
|
int |
getBitstreamStart()
Returns bitstream start position in bytes.
|
java.lang.String |
getFpga()
Returns FPGA information.
|
boolean |
getFPGAFlashAccess()
Returns whether the FPGA can access Flash.
|
byte |
getMajorVersion()
Returns the major version number, e.g. 2 for USB-FPGA Modules 2.14b.
|
int |
getMaxBitstreamSize()
Returns maximum size of bitstream in bytes.
|
byte |
getMinorVersion()
Returns the minor version number, e.g. 14 for USB-FPGA Modules 2.14b.
|
java.lang.String |
getName()
Returns the name of the FPGA Board.
|
int |
getRamSize()
Returns RAM size in bytes.
|
java.lang.String |
getRamType()
Returns RAM type and speed.
|
byte |
getUserData(int i)
Returns user data at index i.
|
java.lang.String |
getVariant()
Returns the variant letter, e.g.
|
boolean |
sendtUserData()
Sends the user data to the FPGA Board.
|
boolean |
setBitstreamSize(int size)
Sets the actual size of bitstream in bytes.
|
void |
setBitstreamStart(int start4k)
Sets the start position of the bitstream in 4 KByte sectors.
|
void |
setFpga(java.lang.String name,
java.lang.String pckg,
java.lang.String sg)
Sets FPGA information.
|
boolean |
setFPGAFlashAccess(boolean b)
Sets whether the FPGA can access Flash.
|
void |
setMaxBitstreamSize(int size4k)
Sets the maximum size of bitstream in 4 KByte sectors.
|
void |
setName(java.lang.String kind,
int series,
int number,
java.lang.String variant)
Sets the name of the FPGA Board.
|
boolean |
setProductString(java.lang.String ps)
Sets the product string.
|
void |
setRam(int size,
java.lang.String type)
Sets RAM information.
|
boolean |
setSN(java.lang.String sn)
Sets the serial number.
|
boolean |
setUsbIDs(int vid,
int pid)
Set the USB vendor vendor and product ID.
|
void |
setUserData(int i,
byte v)
Sets user data at index i to value v.
|
public static final java.lang.String[] boardNames
public static final String boardNames[] = {
"(unknown)" , // 0
"ZTEX FPGA Module" , // 1
"ZTEX USB-FPGA Module" // 2, FX2 based
"ZTEX USB3-FPGA Module" // 3, FX3 based
};
public static final java.lang.String[] fpgas
public static final String fpgas[] = {
"(unknown)" , // 0
"XC6SLX9" , // 1
"XC6SLX16" , // 2
"XC6SLX25" , // 3
"XC6SLX45" , // 4
"XC6SLX75" , // 5
"XC6SLX100" , // 6
"XC6SLX150" , // 7
"XC7A35T", // 8
"XC7A50T", // 9
"XC7A75T", // 10
"XC7A100T", // 11
"XC7A200T", // 12
"Quad-XC6SLX150", // 13
"XC7A15T", // 14
};
public static final java.lang.String[] packages
public static final String packages[] = {
"(unknown)", // 0
"FTG256" , // 1 256 balls, 1.0mm
"CSG324" , // 2 324 balls, 0.8mm
"CSG484" , // 3 484 balls, 0.8mm
"FBG484" // 4 484 balls, 1.0mm
};
public static final java.lang.String[] ramTypes
public static final String ramTypes[] = {
"(unknown)", // 0
"DDR-200 SDRAM", // 1
"DDR-266 SDRAM", // 2
"DDR-333 SDRAM", // 3
"DDR-400 SDRAM", // 4
"DDR2-400 SDRAM", // 5
"DDR2-533 SDRAM", // 6
"DDR2-667 SDRAM", // 7
"DDR2-800 SDRAM", // 8
"DDR2-1066 SDRAM" // 9
};
public ConfigData()
public ConfigData(Ztex1v1 z) throws InvalidFirmwareException, UsbException, CapabilityException
connect(Ztex1v1)
.z
- The ztex device to connect with.InvalidFirmwareException
- if interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public boolean connect(Ztex1v1 z) throws InvalidFirmwareException, UsbException, CapabilityException
z
- The ztex device to connect with.InvalidFirmwareException
- If interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public boolean disconnect()
public byte[] data()
public java.lang.String getName()
public byte getMajorVersion()
public byte getMinorVersion()
public java.lang.String getVariant()
public void setName(java.lang.String kind, int series, int number, java.lang.String variant)
setName("ZTEX USB-FPGA Module", 2, 16, "b"); // denotes "ZTEX USB-FPGA Module 2.16b"This setting is not transferred to the FPGA Board because is should not be altered by the user.
kind
- Kind of FPGA Board, see boardNames
for possible values, e.g. "ZTEX USB-FPGA Module"series
- FPGA Board series, e.g. 2number
- FPGA Board number (number behind the dot), e.g. 16variant
- FPGA Board variant (letter), e.g. "b"public java.lang.String getFpga()
public void setFpga(java.lang.String name, java.lang.String pckg, java.lang.String sg)
setFpga("XC7A200T", "FBG484", "2C"); // denotes Xilinx part number XC7A200T-2FBG484CThis setting is not transferred to the FPGA Board because is should not be altered by the user.
public java.lang.String getRamType()
public int getRamSize()
public void setRam(int size, java.lang.String type)
setRam(128, "DDR2-800 SDRAM"); // sets RAM info to 128 MB DDR2-800 SDRAMThis setting is not transferred to the FPGA Board because is should not be altered by the user.
size
- RAM size in MBytes, e.g. 128type
- RAM type and speed, see ramTypes
for possible values, e.g. "DDR2-800 SDRAM"public int getMaxBitstreamSize()
public void setMaxBitstreamSize(int size4k)
size4k
- Maximum size of bitstream in 4 KByte sectors. E.g. a value of 256 reserves 1 MByte for the bitstream.public int getBitstreamStart()
public void setBitstreamStart(int start4k)
start4k
- Bitstream start position in 4 KByte sectors. E.g. a value of 128 reserves 512 KByte for the bitstream.public int getBitstreamSize()
public boolean setBitstreamSize(int size) throws InvalidFirmwareException, UsbException, CapabilityException
getMaxBitstreamSize()
).size
- Actual size of bitstream in bytes.InvalidFirmwareException
- If interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public boolean getFPGAFlashAccess()
public boolean setFPGAFlashAccess(boolean b) throws InvalidFirmwareException, UsbException, CapabilityException
b
- True if FPGA can access Flash, otherwise false.InvalidFirmwareException
- If interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public boolean setSN(java.lang.String sn) throws InvalidFirmwareException, UsbException, CapabilityException
ZtexDevice1
) by this value.
If it is equal to "0000000000" (default) it is replaced by the unique MAC address. This setting is transferred to the FPGA Board. Change takes effect after the next restart of the firmware.
sn
- Serial number string. Only the first 10 characters are considered.InvalidFirmwareException
- If interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public boolean setUsbIDs(int vid, int pid) throws InvalidFirmwareException, UsbException, CapabilityException
vid
- USB vendor ID.pid
- USB product ID.
This settings are transferred to the FPGA Board. Change takes effect after the next restart of the firmware.
InvalidFirmwareException
- If interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public boolean setProductString(java.lang.String ps) throws InvalidFirmwareException, UsbException, CapabilityException
This setting is transferred to the FPGA Board. Change takes effect after the next restart of the firmware.
ps
- The product string.InvalidFirmwareException
- If interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public byte getUserData(int i)
i
- the index. Valid values are 0 to 47.java.lang.IndexOutOfBoundsException
- If i is smaller than 0 or greater than 47.public void setUserData(int i, byte v) throws java.lang.IndexOutOfBoundsException
getMaxBitstreamSize()
to transfer the data to the FPGA Board.i
- The index. Valid values are 0 to 47.v
- The value.java.lang.IndexOutOfBoundsException
- If i is smaller than 0 or greater than 47.public boolean sendtUserData() throws InvalidFirmwareException, UsbException, CapabilityException
InvalidFirmwareException
- If interface 1 is not supported.UsbException
- If a communication error occurs.CapabilityException
- If no configuration memory is present.public java.lang.String defaultBitstreamPath(java.lang.String name, int compat)
name
- The project name.compat
- Compatibility parameter.
Parameter | Description |
0 | Default behaviour as described above. |
1 | Bitstreams of USB FPGA Modules 2.12 are in top directory "usb-fpga-2.13", e.g. "usb-fpga-2.13/>project name<.runs/impl_2_12b/>project name<.bit" is returned for USB FPGA Modules 2.12b. |
2 | Bitstreams of USB FPGA Modules 2.12 are fully compatible to bitstreams os USB-FPGA modules 2.13, e.g. "usb-fpga-2.13/>project name<.runs/impl_2_13a/>project name<.bit" is returned for USB FPGA Modules 2.12b. (For USB-FPGA Modules 2.12a "usb-fpga-2.13/>project name<.runs/impl_2_12a/>project name<.bit" is returned) |
>2 | Reserved |