19 static size_t nullTypeIndex;
20 static size_t tTermIntDTypeIndex;
21 static size_t clkTermTopTypeIndex;
22 static size_t intTypeIndex;
23 static size_t intInterfaceTypeIndex;
26 static size_t getTileTypeIndex(
const char* tileTypeName,
const TileTypes& types)
28 size_t tileTypeCount = types.size();
29 for (
size_t i = 0; i < tileTypeCount; ++i)
31 const std::string& typeName = (types[i]).name();
32 if (0 == typeName.compare(tileTypeName))
return i;
38 static size_t getTileTypeIndex(
unsigned row,
unsigned column,
const TileLookup2D& tileLookup)
40 const Tile* tile = tileLookup.
lookup(row, column);
51 for (
unsigned column = 0; column < columnCount; ++column)
53 for (
unsigned row = 0; row < rowCount; ++row)
71 unsigned char cfgColIndex = 0;
72 bool firstTTermIntD =
true;
75 unsigned rowCount = tileLookup.
rowCount();
77 for (
unsigned column = 0; column < columnCount; ++column)
83 size_t tileTypeIndex = getTileTypeIndex(0, column, tileLookup);
84 if (tileTypeIndex != nullTypeIndex)
86 if (tileTypeIndex == tTermIntDTypeIndex)
89 if (!firstTTermIntD) ++cfgColIndex;
90 firstTTermIntD =
false;
92 else if (tileTypeIndex == clkTermTopTypeIndex) ++cfgColIndex;
96 for (
unsigned row = 0; row < rowCount; ++row)
106 unsigned upperCfgRows,
unsigned lowerCfgRows)
109 unsigned rowCount = tileLookup.
rowCount();
111 for (
unsigned column = 0; column < columnCount; ++column)
113 size_t frameIndexBegin;
114 size_t frameIndexEnd;
119 size_t tileTypeIndex = getTileTypeIndex(5, column, tileLookup);
120 if (tileTypeIndex == intTypeIndex)
139 bool lowerHalf =
false;
140 size_t cfgRowIndex = upperCfgRows - 1;
142 for (
unsigned row = 0; row < rowCount; ++row)
147 entry.
rowIndex =
static_cast<unsigned char>(cfgRowIndex);
149 entry.
frameEndIndex =
static_cast<unsigned char>(frameIndexEnd);
175 if (lowerCfgRows > cfgRowIndex) ++cfgRowIndex;
180 if (0 != cfgRowIndex) --cfgRowIndex;
181 else lowerHalf =
true;
203 intTypeIndex = getTileTypeIndex(
INT_TYPENAME, tileTypes);
207 tileLookup.
reset(device);
210 unsigned rowCount = tileLookup.
rowCount();
211 if (0 == rowCount)
return;
213 if (0 == columnCount)
return;
216 map.
resize(rowCount, columnCount);
220 writeCfgColumnIndices(map, tileLookup);