33 "[UNKNOWN TYPE 0]",
"TYPE1",
"TYPE2",
"[UNKNOWN TYPE 3]",
"[UNKNOWN TYPE 4]",
34 "[UNKNOWN TYPE 5]",
"[UNKNOWN TYPE 6]",
"[UNKNOWN TYPE 7]"
38 "NOP",
"READ",
"WRITE",
"RESERVED"
42 "CRC",
"FAR",
"FDRI",
"FDRO",
"CMD",
"CTL",
"MASK",
"STAT",
"LOUT",
"COR",
"MFWR",
"FLR",
"KEY",
47 "[UNKNOWN COMMAND 0]",
"WCFG",
"MFWR",
"LFRM",
"RCFG",
"START",
"RCAP",
"RCRC",
"AGHIGH",
"SWITCH",
48 "GRESTORE",
"SHUTDOWN",
"GCAPTURE",
"DESYNCH"
51 #define VALUES (const char*[])
55 {0x00000007, 0,
"GWE_cycle",
"GWE_CYCLE", 5,
58 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
59 {0x00000038, 3,
"GTS_cycle",
"GTS_CYCLE", 4,
62 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
63 {0x000001c0, 6,
"LCK_cycle",
"LOCK_CYCLE", 7,
66 VALUES{
"1",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"NoWait", 0}},
67 {0x00000E00, 9,
"Match_cycle",
"MATCH_CYCLE", 7,
70 VALUES{
"1",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"NoWait", 0}},
71 {0x00007000, 12,
"DONE_cycle",
"DONE_CYCLE", 3,
74 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
75 {0x00018000, 15,
"StartupClk",
"SSCLKSRC", 0,
78 VALUES{
"Cclk",
"UserClk",
"JtagClk",
"JtagClk", 0}},
79 {0x007e0000, 17,
"ConfigRate",
"OSCFSEL", 0,
83 "[UNKNOWN 0]",
"[UNKNOWN 1]",
"[UNKNOWN 2]",
"[UNKNOWN 3]",
84 "[UNKNOWN 4]",
"[UNKNOWN 5]",
"[UNKNOWN 6]",
"[UNKNOWN 7]",
85 "[UNKNOWN 8]",
"[UNKNOWN 9]",
"[UNKNOWN 10]",
"[UNKNOWN 11]",
86 "[UNKNOWN 12]",
"[UNKNOWN 13]",
"[UNKNOWN 14]",
"[UNKNOWN 15]",
87 "[UNKNOWN 16]",
"[UNKNOWN 17]",
"[UNKNOWN 18]",
"[UNKNOWN 19]",
88 "[UNKNOWN 20]",
"[UNKNOWN 21]",
"[UNKNOWN 22]",
"[UNKNOWN 23]",
89 "[UNKNOWN 24]",
"[UNKNOWN 25]",
"[UNKNOWN 26]",
"[UNKNOWN 27]",
90 "[UNKNOWN 28]",
"[UNKNOWN 29]",
"[UNKNOWN 30]",
"[UNKNOWN 31]",
92 {0x00800000, 23,
"Capture",
"SINGLE", 0,
95 VALUES{
"Continuous",
"OneShot", 0}},
96 {0x01000000, 24,
"DriveDone",
"DRIVE_DONE", 0,
100 {0x02000000, 25,
"DonePipe",
"DONE_PIPE", 0,
104 {0x04000000, 26,
"DCMShutDown",
"SHUT_RST_DCM", 0,
109 {0x20000000, 29,
"CRC",
"CRC_BYPASS", 0,
112 VALUES{
"Enable",
"Disable", 0}},
119 {0x00000001, 0,
"CRC_error",
"CRC_ERROR", 0,
123 {0x00000002, 1,
"DecryptorSecuritySet",
"PART_SECURED", 0,
127 {0x00000004, 2,
"DCM_locked",
"DCM_LOCK", 0,
131 {0x00000008, 3,
"DCI_matched",
"DCI_MATCH", 0,
135 {0x00000010, 4,
"IN_error",
"IN_ERROR", 0,
139 {0x00000020, 5,
"GTS_CFG_B",
"GTS_CFG_B", 0,
142 VALUES{
"IoDisabled",
"IoEnabled", 0}},
143 {0x00000040, 6,
"GWE",
"GWE", 0,
147 VALUES{
"WriteDisabled",
"WriteEnabled", 0}},
148 {0x00000080, 7,
"GHIGH_B",
"GHIGH_B", 0,
151 VALUES{
"InterconnectDisabled",
"InterconnectEnabled", 0}},
152 {0x00000700, 8,
"Mode",
"MODE", 0,
155 VALUES{
"MasterSerial",
"SlaveSelectMap32",
"[UNDEFINED 2]",
"MasterSelectMap",
156 "[UNDEFINED 3]",
"JTAG",
"SlaveSelectMap8",
"[UNDEFINED 6]",
"SlaveSerial", 0}},
157 {0x00000800, 11,
"INIT",
"INIT", 0,
160 VALUES{
"Deasserted",
"Asserted", 0}},
161 {0x00001000, 12,
"Done",
"DONE", 0,
164 VALUES{
"Deasserted",
"Asserted", 0}},
165 {0x00002000, 13,
"ID_error",
"ID_ERROR", 0,
169 {0x00004000, 14,
"Decrypt_error",
"DEC_ERROR", 0,
172 VALUES{
"NoError",
"Error", 0}},
173 {0x00008000, 15,
"BAD_KEY_SEQ",
"BAD_KEY_SEQ", 0,
177 VALUES{
"NoError",
"Error", 0}},
183 {0x00000001, 0,
"GTS_USER_B",
"GTS_USER_B", 0,
186 VALUES{
"IoDisabled",
"IoActive", 0}},
187 {0x00000008, 3,
"Persist",
"PERSIST", 0,
191 {0x00000030, 4,
"Security",
"SBITS", 0,
195 VALUES{
"None",
"Level1",
"Level2",
"Level2", 0}},
201 {0x00000001, 0,
"GTS_USER_B",
"GTS_USER_B", 0,
VALUES{
"Protected",
"Writable", 0}},
202 {0x00000008, 3,
"Persist",
"PERSIST", 0,
VALUES{
"Protected",
"Writable", 0}},
203 {0x00000080, 4,
"Security",
"SBITS", 0,
204 VALUES{
"Protected",
"[UNKNOWN 1]",
"[UNKNOWN 2]",
"Writable", 0}},
219 for(
uint32_t field = 0; subfields[field].
mMask != 0; field++) {
220 const Subfield& subfield = subfields[field];
223 const char** ptr = subfield.
mValues;
224 for(
uint32_t i = 0; *ptr != 0; i++, ptr++) {
225 if(inSetting == *ptr)
return (i << subfield.
mShift) & subfield.
mMask;
234 while(cumulativeWordLength < bitstreamWordLength) {
236 uint32_t wordSize = back().getWordSize();
237 cumulativeWordLength += wordSize;
241 inStream.read((
char*) &autoCrc,
sizeof(autoCrc));
242 autoCrc = ntohl(autoCrc);
244 cumulativeWordLength++;
249 #ifndef GENERATE_STATIC_DEVICE_INFO
264 using namespace torc::common;
302 typedef std::map<TileTypeIndex, std::string> TileTypeIndexToName;
303 typedef std::map<std::string, TileTypeIndex> TileTypeNameToIndex;
304 TileTypeIndexToName tileTypeIndexToName;
305 TileTypeNameToIndex tileTypeNameToIndex;
307 for(TileTypeIndex tileTypeIndex(0); tileTypeIndex < tileTypeCount; tileTypeIndex++) {
309 tileTypeIndexToName[tileTypeIndex] = tileTypeName;
310 tileTypeNameToIndex[tileTypeName] = tileTypeIndex;
317 columnTypes.resize(colCount);
320 for(TileCol col; col < colCount; col++) {
323 TileTypeIndexToColumnType::iterator ttwp = ttwe;
324 for(TileRow row; row < rowCount; row++) {
336 columnTypes[col] =
static_cast<EColumnType>(ttwp->second);
342 if(blockType == 2)
break;
347 std::fstream tilemapStream(generatedMap.string().c_str(), std::ios::out);
348 for(TileRow row; row < rowCount; row++) {
349 for(TileCol col; col < colCount; col++) {
354 if(col + 1 < colCount) tilemapStream <<
",";
356 tilemapStream << std::endl;
358 tilemapStream.close();
361 setDeviceInfo(DeviceInfo(tileCount, rowCount, colCount, columnTypes));
371 bool clockColumn =
true;
390 for(
uint32_t farMinor = 0; farMinor < width; farMinor++) {
395 blockFrameIndexBounds++;
397 if(width > 0) farMajor++;
405 for(
uint32_t farMinor = 0; farMinor < width; farMinor++) {
410 blockFrameIndexBounds++;
412 if(width > 0) farMajor++;
421 if(col == finalColumn) {
431 if(col == finalColumn)
445 std::cout <<
"Bit Value at index: (" << i <<
", " << j <<
") : " <<
mBitColumnIndexes[i][j] << std::endl;
447 std::cout <<
"Xdl Value at index: (" << i <<
", " << k <<
") : " <<
mXdlColumnIndexes[i][k] << std::endl;
454 boost::shared_array<uint32_t> frameWords;
456 Virtex2::iterator p = begin();
457 Virtex2::iterator e = end();
478 int32_t bitColumnIndex[inBlockCount];
479 int32_t bitColumnBound[inBlockCount];
481 for(
uint32_t i = 0; i < inBlockCount; i++) {
489 for(
uint32_t i = 0; i < inBlockCount; i++) {
490 int startIndex = bitColumnIndex[i];
491 for(
int j = 0; j < bitColumnBound[i]; j++)
500 int32_t xdlColumnIndex[inBlockCount];
501 int32_t xdlColumnBound[inBlockCount];
502 for(
uint32_t i = 0; i < inBlockCount; i++) {
511 for(
uint32_t i = 0; i < inBlockCount; i++) {
512 int startIndex = xdlColumnIndex[i];
513 for(
int j = 0; j < xdlColumnBound[i]; j++)
ColumnDefVector mColumnDefs
Column type widths.
VirtexFrameBlocks getBitstreamFrames(uint32_t inBlockCount, uint32_t inBitCol)
Returns frames for queried bitstream coordinates.
Encapsulation of a tile row in an unsigned 16-bit integer.
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
TileTypeNameToColumnType mTileTypeNameToColumnType
Encapsulation of a tile column in an unsigned 16-bit integer.
Device database, including complete wiring and logic support.
TileTypeCount getTileTypeCount(void) const
Returns the tile type count for this device.
TileRow getRowCount(void) const
Returns the row count for this device.
Header for the DirectoryTree class.
virtual void initializeFrameMaps(void)
Initialize the maps between frame indexes and frame addresses. This is generally only useful for int...
VirtexFrameBlocks mFrameBlocks
Input Frame blocks.
Frame< uint32_t > VirtexFrame
Virtex frame type.
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
VirtexFrameBlocks getXdlFrames(uint32_t inBlockCount, uint32_t inXdlCol)
Returns frames for queried xdl coordinates.
TileTypeIndexToColumnType mTileTypeIndexToColumnType
Static device information class for Xilinx bitstreams. This class facilitates the creation of frame ...
uint16_t getColCount(void) const
Returns the column count.
TileCount getTileCount(void) const
Returns the tile count for this device.
EDevice mDevice
Bitstream device enumeration.
ERegister
Configuration register enumeration.
uint32_t mShift
The subfield LSB position.
const char * mConfigGuideName
The subfield name documented in the configuration guide.
boost::uint32_t uint32_t
Imported type name.
static const Subfield sSTAT[]
Status Register (STAT) subfields.
virtual void readPackets(std::istream &inStream)
uint32_t mMask
The subfield bit mask.
virtual uint32_t getFrameLength(void) const
DeviceInfo mDeviceInfo
Device information.
Tile map, tile type, and wire information for the family and device.
IndexVector mBitColumnIndexes[Virtex2::eFarBlockTypeCount]
Vector to store frame indexes of XDL columns.
FrameSet< FRAME_TYPE > mBlock[Bitstream::eBlockTypeCount]
FrameSets for each of the eight block types.
Encapsulation of a tile count in an unsigned 32-bit integer.
Encapsulation of a tile within a device tile map.
const char * getTileTypeName(TileTypeIndex inTileTypeIndex) const
Returns the tile type name for the given tile type index.
const ColumnTypeVector & getColumnTypes(void) const
Returns the column type vector.
void initializeFullFrameBlocks(void)
Loads full bitstream frames into block data structure.
boost::filesystem::path path
const TileTypeIndex & getTypeIndex(void) const
Returns the tile type index for this tile.
uint32_t mBitstreamByteLength
Bitstream packet length in bytes.
boost::shared_ptr< VirtexFrame > FrameSharedPtr
Shared pointer encapsulation of a Frame.
const char * mBitgenName
The subfield name documented in bitgen.
uint32_t mBlockFrameIndexBounds[Virtex2::eFarBlockTypeCount]
Array to hold frame index boundaries for blocks.
static const boost::filesystem::path & getWorkingPath(void)
Returns the absolute path to the working directory.
Encapsulation of a tile type count in an unsigned 16-bit integer.
const WordSharedArray getWords(void) const
brief Returns the raw packet words, including the header word.
TileCol getColCount(void) const
Returns the column count for this device.
static const char * sCommandName[eCommandCount]
Configuration command names.
Encapsulation of a tile type index in an unsigned 16-bit integer.
EFarBlockType
Frame Address Register block type constants.
static VirtexPacket read(std::istream &inStream)
Read a packet.
boost::uint16_t uint16_t
Imported type name.
boost::uint32_t uint32_t
Imported type name.
Header for the DDB class.
Header for the Virtex2 class.
EColumnType
Major column types.
Template base for encapsulated integers, to enforce strong typing.
std::map< uint32_t, uint32_t > mXdlColumnToBitColumn
Map of XDL column indexes to bitstream column indexes.
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
static uint32_t makeSubfield(ERegister inRegister, const std::string &inSubfield, const std::string &inSetting)
Return the masked value for a subfield of the specified register.
void setDeviceInfo(const DeviceInfo &rhs)
Assign static device information for the current bitstream.
Bitstream packet for Virtex class architectures.
const char ** mValues
The allowable subfield values.
static const char * sRegisterName[eRegisterCount]
Configuration register names.
IndexVector mXdlColumnIndexes[Virtex2::eFarBlockTypeCount]
Vector to store frame indexes of Bitstream columns.
FrameIndexToAddress mFrameIndexToAddress
Map of frame indexes to frame addresses.
static const Subfield sCTL[]
Control Register (CTL) subfields.
TileIndex getTileIndex(TileRow inRow, TileCol inCol) const
Returns the tile index for the given [row,column] pair.
static const Subfield sCOR[]
Configuration Options Register (COR) subfields.
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
virtual void initializeDeviceInfo(const std::string &inDeviceName)
Initialize the device information.
FrameAddressToIndex mFrameAddressToIndex
Map of frame addressee to frame indexes.
Device database types for Xilinx architectures.