public class Bitstream
extends Object
Constructor and Description |
---|
Bitstream(String designName,
String partName)
Creates an empty bitstream with the design and part name information added to
the header.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkIfDeviceSupported(String partName)
Check if RapidWright has bitstream support for this part
|
ConfigArray |
configureArray()
Applies the bitstream packets and data to the configuration array.
|
static Packet |
createPacket1(OpCode opCode,
RegisterType regType,
int data)
Convenience method to create a new type 1 packet
|
static List<Packet> |
createPacketList(Device device,
int configArrayWordSize)
Creates a new (empty) list of configuration packets to fully program a
device.
|
static Packet |
createWrCmdPacket1(CMDCode cmdCode)
Convenience method to create a new type 1 packet writing to the command
register
|
ConfigArray |
getConfigArray()
Gets the current configuration layout for this bitstream.
|
static List<Integer> |
getDebugBitstreamFARWrites(Bitstream b)
When given a debug bitstream (see UG908 - Table A-1,
BITSTREAM.GENERAL.DEBUGBITSTREAM), this method will extract the LOUT writes
that provide the consecutive list of FAR addresses of the device.
|
String |
getDesignName()
Gets the design name from the header
|
Device |
getDevice()
Gets the target device using part name information from the header.
|
BitstreamHeader |
getHeader()
Gets the stored header of the bitstream
|
List<Packet> |
getPackets()
Gets the list of packets within this bitstream
|
Part |
getPart()
Gets the target part from header part name information.
|
String |
getPartName()
Gets the target part name from the header.
|
static List<Integer> |
getPerFrameCRCFARWrites(Bitstream b)
When given a per frame CRC bitstream (see UG908 - Table A-1,
BITSTREAM.GENERAL.PERFRAMECRC YES), this method will extract the FAR writes
that provide the consecutive list of FAR addresses of the device.
|
Series |
getSeries()
Gets the series as derived from the part name stored in the header
|
static Bitstream |
readBitstream(Path fileName)
Reads and parses a bitstream file (*.bit) into packets
|
static Bitstream |
readBitstream(String fileName)
Reads and parses a bitstream file (*.bit) into packets
|
void |
setHeader(BitstreamHeader header)
Updates the bitstream header with a new header
|
void |
setPackets(List<Packet> packets)
Updates the list of packets in this bitstream
|
void |
updateCRCPackets()
Updates the CRC packets in the current packet list to be consistent with any
recent changes.
|
void |
updatePacketsFromConfigArray()
Updates the bitstream packets from the current state of the configuration
array.
|
boolean |
writeBitstream(Path path)
Writes a bitstream file (*.bit) from the current state of this bitstream.
|
boolean |
writeBitstream(String fileName)
Writes a bitstream file (*.bit) from the current state of this bitstream.
|
public Bitstream(String designName, String partName)
designName
- Name of the designpartName
- Name of the target partpublic static List<Packet> createPacketList(Device device, int configArrayWordSize)
device
- The target device.configArrayWordSize
- The number of configuration words in the array
(See: ConfigArray.getWordSize()
public static Packet createWrCmdPacket1(CMDCode cmdCode)
cmdCode
- The command code to write to the command register, see
CMDCode
public static Packet createPacket1(OpCode opCode, RegisterType regType, int data)
opCode
- The op code for the packet, see OpCode
regType
- The target register of the packet, see RegisterType
data
- The data word to be written (if writing)public static void checkIfDeviceSupported(String partName)
partName
- The part name to checkpublic static Bitstream readBitstream(Path fileName)
fileName
- Path of the bitstream file (*.bit)public static Bitstream readBitstream(String fileName)
fileName
- Name of the bitstream file (*.bit)public boolean writeBitstream(Path path)
path
- File path of the bitstream file to write out.public boolean writeBitstream(String fileName)
fileName
- Name of the bitstream file to write out.public BitstreamHeader getHeader()
public void setHeader(BitstreamHeader header)
header
- The new headerpublic List<Packet> getPackets()
public void setPackets(List<Packet> packets)
packets
- The desired list of packets to be set for this bitstreampublic static List<Integer> getDebugBitstreamFARWrites(Bitstream b)
b
- The bitstream parsed from a debug bitstreampublic static List<Integer> getPerFrameCRCFARWrites(Bitstream b)
b
- The bitstream parsed from a debug bitstreampublic String getDesignName()
public Part getPart()
public String getPartName()
public Device getDevice()
public Series getSeries()
public ConfigArray getConfigArray()
public ConfigArray configureArray()
Bitstream.updatePacketsFromConfigArray()
public void updatePacketsFromConfigArray()
Bitstream#configArray()
public void updateCRCPackets()