33 "[UNKNOWN TYPE 0]",
"TYPE1",
"TYPE2",
"[UNKNOWN TYPE 3]",
"[UNKNOWN TYPE 4]",
34 "[UNKNOWN TYPE 5]",
"[UNKNOWN TYPE 6]",
"[UNKNOWN TYPE 7]"
39 "[UNKNOWN OP 0]",
"READ",
"WRITE",
"[UNKNOWN OP 3]"
43 "CRC",
"FAR",
"FDRI",
"FDRO",
"CMD",
"CTL",
"MASK",
"STAT",
"LOUT",
"COR",
"[UNKNOWN REG 0]",
"FLR"
47 "[UNKNOWN CMD 0]",
"WCFG",
"",
"LFRM",
"RCFG",
"START",
"RCAP",
"RCRC",
"AGHIGH",
"SWITCH"
50 #define VALUES (const char*[])
54 {0x00000007, 0,
"GSR_cycle",
"GSR_CYCLE", 5,
57 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
58 {0x00000038, 3,
"GWE_cycle",
"GWE_CYCLE", 5,
61 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
62 {0x000001c0, 6,
"GTS_cycle",
"GTS_CYCLE", 4,
65 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
66 {0x00000e00, 9,
"LCK_cycle",
"LCK_CYCLE", 7,
69 VALUES{
"1",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"NoWait", 0}},
70 {0x00007000, 12,
"DONE_cycle",
"DONE_CYCLE", 3,
73 VALUES{
"[UNDEFINED 0]",
"2",
"3",
"4",
"5",
"6",
"[UNDEFINED 6]",
"[UNDEFINED 7]", 0}},
74 {0x00008000, 15,
"",
"SHUTDOWN", 0,
77 {0x000f0000, 16,
"",
"LOCK_WAIT", 0,
79 VALUES{
"1",
"2",
"3",
"4", 0}},
80 {0x00300000, 20,
"StartupClk",
"SSCLKSRC", 0,
83 VALUES{
"Cclk",
"UserClk",
"JtagClk",
"JtagClk", 0}},
84 {0x0fc00000, 22,
"ConfigRate",
"OSCFSEL", 2,
88 "[UNKNOWN 0]",
"[UNKNOWN 1]",
"[UNKNOWN 2]",
"[UNKNOWN 3]",
89 "[UNKNOWN 4]",
"[UNKNOWN 5]",
"[UNKNOWN 6]",
"[UNKNOWN 7]",
90 "[UNKNOWN 8]",
"[UNKNOWN 9]",
"[UNKNOWN 10]",
"[UNKNOWN 11]",
91 "[UNKNOWN 12]",
"[UNKNOWN 13]",
"[UNKNOWN 14]",
"[UNKNOWN 15]",
92 "[UNKNOWN 16]",
"[UNKNOWN 17]",
"[UNKNOWN 18]",
"[UNKNOWN 19]",
93 "[UNKNOWN 20]",
"[UNKNOWN 21]",
"[UNKNOWN 22]",
"[UNKNOWN 23]",
94 "[UNKNOWN 24]",
"[UNKNOWN 25]",
"[UNKNOWN 26]",
"[UNKNOWN 27]",
95 "[UNKNOWN 28]",
"[UNKNOWN 29]",
"[UNKNOWN 30]",
"[UNKNOWN 31]",
97 {0x10000000, 28,
"Capture",
"SINGLE", 0,
100 VALUES{
"Continuous",
"OneShot", 0}},
101 {0x20000000, 29,
"DriveDone",
"DRIVE_DONE", 0,
105 {0x40000000, 30,
"DonePipe",
"DONE_PIPE", 0,
115 {0x00000001, 0,
"CRC_error",
"CRC_ERROR", 0,
119 {0x00000002, 1,
"TR_locked",
"TR_LOCK", 0,
124 {0x00000004, 2,
"TL_locked",
"TL_LOCK", 0,
129 {0x00000008, 3,
"BR_locked",
"BR_LOCK", 0,
134 {0x00000010, 4,
"BL_locked",
"BL_LOCK", 0,
139 {0x00000020, 5,
"IN_error",
"IN_ERROR", 0,
143 {0x00000040, 6,
"GTS_cfg",
"GTS_CFG", 0,
147 {0x00000080, 7,
"GWE_B",
"GWE_B", 0,
151 {0x00000100, 8,
"GSR_B",
"GSR_B", 0,
155 {0x00000200, 9,
"GHIGH_B",
"GHIGH_B", 0,
159 {0x000001c0, 10,
"MODE",
"MODE", 0,
162 VALUES{
"MasterSerial",
"SlaveSelectMap32",
"[UNDEFINED 2]",
"MasterSelectMap",
163 "[UNDEFINED 3]",
"JTAG",
"SlaveSelectMap8",
"[UNDEFINED 6]",
"SlaveSerial", 0}},
164 {0x00002000, 13,
"INIT",
"INIT", 0,
167 VALUES{
"Deasserted",
"Asserted", 0}},
168 {0x00004000, 14,
"DONE",
"DONE", 0,
171 VALUES{
"NotDone",
"Done", 0}},
177 {0x00000001, 0,
"GTS_USER_B",
"GTS_USER_B", 0,
180 VALUES{
"IoDisabled",
"IoActive", 0}},
181 {0x00000040, 6,
"Persist",
"PERSIST", 0,
185 {0x00000180, 7,
"Security",
"SBITS", 0,
189 VALUES{
"None",
"Level1",
"Level2",
"Level2", 0}},
195 {0x00000001, 0,
"GTS_USER_B",
"GTS_USER_B", 0,
VALUES{
"Protected",
"Writable", 0}},
196 {0x00000040, 6,
"Persist",
"PERSIST", 0,
VALUES{
"Protected",
"Writable", 0}},
197 {0x00000180, 7,
"Security",
"SBITS", 0,
198 VALUES{
"Protected",
"[UNKNOWN 1]",
"[UNKNOWN 2]",
"Writable", 0}},
213 for(
uint32_t field = 0; subfields[field].
mMask != 0; field++) {
214 const Subfield& subfield = subfields[field];
217 const char** ptr = subfield.
mValues;
218 for(
uint32_t i = 0; *ptr != 0; i++, ptr++) {
219 if(inSetting == *ptr)
return (i << subfield.
mShift) & subfield.
mMask;
227 #ifndef GENERATE_STATIC_DEVICE_INFO
240 using namespace torc::common;
275 typedef std::map<TileTypeIndex, std::string> TileTypeIndexToName;
276 typedef std::map<std::string, TileTypeIndex> TileTypeNameToIndex;
277 TileTypeIndexToName tileTypeIndexToName;
278 TileTypeNameToIndex tileTypeNameToIndex;
280 for(TileTypeIndex tileTypeIndex(0); tileTypeIndex < tileTypeCount; tileTypeIndex++) {
282 tileTypeIndexToName[tileTypeIndex] = tileTypeName;
283 tileTypeNameToIndex[tileTypeName] = tileTypeIndex;
290 columnTypes.resize(colCount);
293 for(TileCol col; col < colCount; col++) {
297 TileTypeIndexToColumnType::iterator ttwp = ttwe;
298 for(TileRow row; row < rowCount; row++) {
310 columnTypes[col] =
static_cast<EColumnType>(ttwp->second);
318 if(blockType == 2)
break;
323 std::fstream tilemapStream(generatedMap.string().c_str(), std::ios::out);
324 for(TileRow row; row < rowCount; row++) {
325 for(TileCol col; col < colCount; col++) {
330 if(col + 1 < colCount) tilemapStream <<
",";
332 tilemapStream << std::endl;
334 tilemapStream.close();
337 setDeviceInfo(DeviceInfo(tileCount, rowCount, colCount, columnTypes));
367 prepareFrames(col, frameCount, frameIndex, blockType, farMajor, width);
373 for(
int j = 1; j <= numClbs / 2; j++) {
374 for(
int k = -1; k < 2; k += 2) {
375 col = center - (j * k);
376 prepareFrames(col, frameCount, frameIndex, blockType, farMajor, width);
383 if(col == finalColumn) {
393 if(col == finalColumn)
401 for(
int j = center; j < (center + 1); j++) {
402 for(
int k = -1; k < 2; k += 2) {
403 col = center - (j * k);
404 prepareFrames(col, frameCount, frameIndex, blockType, farMajor, width);
411 if(col == finalColumn) {
421 if(col == finalColumn)
429 for(
int j = (center - 1); j < center; j++) {
430 for(
int k = -1; k < 2; k += 2) {
431 col = center - (j * k);
432 prepareFrames(col, frameCount, frameIndex, blockType, farMajor, width);
439 if(col == finalColumn) {
449 if(col == finalColumn)
464 std::cout <<
"Bit Value at index: (" << i <<
", " << j <<
") : " <<
mBitColumnIndexes[i][j] << std::endl;
466 std::cout <<
"Xdl Value at index: (" << i <<
", " << k <<
") : " <<
mXdlColumnIndexes[i][k] << std::endl;
473 if(inWidth == 0)
return;
474 inFrameCount += inWidth;
475 for(
int farMinor = 0; farMinor < inWidth; farMinor++) {
483 if(inWidth > 0) inFarMajor++;
489 boost::shared_array<uint32_t> frameWords;
491 Virtex::iterator p = begin();
492 Virtex::iterator e = end();
513 int32_t bitColumnIndex[inBlockCount];
514 int32_t bitColumnBound[inBlockCount];
516 for(
uint32_t i = 0; i < inBlockCount; i++) {
524 for(
uint32_t i = 0; i < inBlockCount; i++) {
525 int startIndex = bitColumnIndex[i];
526 for(
int j = 0; j < bitColumnBound[i]; j++)
535 int32_t xdlColumnIndex[inBlockCount];
536 int32_t xdlColumnBound[inBlockCount];
537 for(
uint32_t i = 0; i < inBlockCount; i++) {
546 for(
uint32_t i = 0; i < inBlockCount; i++) {
547 int startIndex = xdlColumnIndex[i];
548 for(
int j = 0; j < xdlColumnBound[i]; j++)
ColumnDefVector mColumnDefs
Column type widths.
Encapsulation of a tile row in an unsigned 16-bit integer.
TileTypeNameToColumnType mTileTypeNameToColumnType
uint32_t mFrameIndexBounds
Frame index bounds count.
ERegister
Configuration register enumeration.
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.
VirtexFrameBlocks mFrameBlocks
Input Frame blocks.
IndexVector mXdlColumnIndexes[Virtex::eFarBlockTypeCount]
Vector to store frame indexes of Bitstream columns.
static const char * sOpcodeName[eOpcodeCount]
Packet opcode names.
Frame< uint32_t > VirtexFrame
Virtex frame type.
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
TileTypeIndexToColumnType mTileTypeIndexToColumnType
Static device information class for Xilinx bitstreams. This class facilitates the creation of frame ...
virtual void initializeDeviceInfo(const std::string &inDeviceName)
Initialize the device information.
uint16_t getColCount(void) const
Returns the column count.
static const char * sRegisterName[eRegisterCount]
Configuration register names.
virtual void initializeFrameMaps(void)
Initialize the maps between frame indexes and frame addresses. This is generally only useful for int...
void prepareFrames(ColumnIndex &inCol, int &inFrameCount, int &inFrameIndex, EFarBlockType &inBlockType, int &inFarMajor, int &inWidth)
TileCount getTileCount(void) const
Returns the tile count for this device.
EDevice mDevice
Bitstream device 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.
FrameAddressToIndex mFrameAddressToIndex
Map of frame addressee to frame indexes.
uint32_t mMask
The subfield bit mask.
uint32_t mBlockFrameIndexBounds[Virtex::eFarBlockTypeCount]
Array to hold frame index boundaries for blocks.
IndexVector mBitColumnIndexes[Virtex::eFarBlockTypeCount]
Vector to store frame indexes of XDL columns.
DeviceInfo mDeviceInfo
Device information.
Tile map, tile type, and wire information for the family and device.
std::map< uint32_t, uint32_t > mXdlColumnToBitColumn
Map of XDL column indexes to bitstream column indexes.
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.
static const Subfield sCOR[]
Configuration Options Register (COR) subfields.
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.
static const Subfield sMASK[]
Control Mask Register (MASK) subfields.
VirtexFrameBlocks getBitstreamFrames(uint32_t inBlockCount, uint32_t inBitCol)
Returns frames for queried bitstream coordinates.
boost::filesystem::path path
const TileTypeIndex & getTypeIndex(void) const
Returns the tile type index for this tile.
EFarBlockType
Frame Address Register block type constants.
boost::shared_ptr< VirtexFrame > FrameSharedPtr
Shared pointer encapsulation of a Frame.
const char * mBitgenName
The subfield name documented in bitgen.
static const Subfield sSTAT[]
Status Register (STAT) subfields.
Header for the Virtex class.
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.
Encapsulation of a tile type index in an unsigned 16-bit integer.
boost::uint32_t uint32_t
Imported type name.
static const char * sPacketTypeName[ePacketTypeCount]
Packet type names.
boost::uint16_t uint16_t
Imported type name.
Header for the DDB class.
virtual uint32_t getFrameLength(void) const
Return the frame length for the current device.
Template base for encapsulated integers, to enforce strong typing.
void setDeviceInfo(const DeviceInfo &rhs)
Assign static device information for the current bitstream.
static const Subfield sCTL[]
Control Register (CTL) subfields.
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.
Bitstream packet for Virtex class architectures.
void initializeFullFrameBlocks(void)
Loads full bitstream frames into block data structure.
const char ** mValues
The allowable subfield values.
static const char * sCommandName[eCommandCount]
Configuration command names.
VirtexFrameBlocks getXdlFrames(uint32_t inBlockCount, uint32_t inXdlCol)
Returns frames for queried xdl coordinates.
TileIndex getTileIndex(TileRow inRow, TileCol inCol) const
Returns the tile index for the given [row,column] pair.
EColumnType
Major column types.
FrameIndexToAddress mFrameIndexToAddress
Map of frame indexes to frame addresses.
Device database types for Xilinx architectures.