AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
DeviceInfo.cc
Go to the documentation of this file.
1 
25 #include "DeviceInfo.h"
26 #include "readZip.h"
27 #include "strPrint.h"
28 #include "stringCheck.h"
29 #include <algorithm>
30 #include <assert.h>
31 
33 {
34  const float eps = 1e-3;
35  if (a->Y() <= b->Y() + eps && a->Y() >= b->Y() - eps)
36  return a->X() < b->X();
37  else if (a->Y() < b->Y() - eps)
38  return true;
39  else if (a->Y() > b->Y() + eps)
40  return false;
41  return true;
42 }
43 
44 DeviceInfo::DeviceInfo(std::map<std::string, std::string> &JSONCfg, std::string _deviceName) : JSONCfg(JSONCfg)
45 {
46  deviceArchievedTextFileName = std::string(JSONCfg["vivado extracted device information file"]);
47  specialPinOffsetFileName = std::string(JSONCfg["special pin offset info file"]);
48 
49  // site=> SLICE_X59Y220 tile=> CLEL_R_X36Y220 sitetype=> SLICEL tiletype=> CLE_R centerx=> 37.25 centery=> 220.15
50  // BELs=>
51  // [SLICE_X59Y220/A5LUT,SLICE_X59Y220/A6LUT,SLICE_X59Y220/AFF,SLICE_X59Y220/AFF2,SLICE_X59Y220/B5LUT,SLICE_X59Y220/B6LUT,SLICE_X59Y220/BFF,SLICE_X59Y220/BFF2,SLICE_X59Y220/C5LUT,SLICE_X59Y220/C6LUT,SLICE_X59Y220/CARRY8,SLICE_X59Y220/CFF,SLICE_X59Y220/CFF2,SLICE_X59Y220/D5LUT,SLICE_X59Y220/D6LUT,SLICE_X59Y220/DFF,SLICE_X59Y220/DFF2,SLICE_X59Y220/E5LUT,SLICE_X59Y220/E6LUT,SLICE_X59Y220/EFF,SLICE_X59Y220/EFF2,SLICE_X59Y220/F5LUT,SLICE_X59Y220/F6LUT,SLICE_X59Y220/F7MUX_AB,SLICE_X59Y220/F7MUX_CD,SLICE_X59Y220/F7MUX_EF,SLICE_X59Y220/F7MUX_GH,SLICE_X59Y220/F8MUX_BOT,SLICE_X59Y220/F8MUX_TOP,SLICE_X59Y220/F9MUX,SLICE_X59Y220/FFF,SLICE_X59Y220/FFF2,SLICE_X59Y220/G5LUT,SLICE_X59Y220/G6LUT,SLICE_X59Y220/GFF,SLICE_X59Y220/GFF2,SLICE_X59Y220/H5LUT,SLICE_X59Y220/H6LUT,SLICE_X59Y220/HFF,SLICE_X59Y220/HFF2]
52  // site=> RAMB18_X7Y88 tile=> BRAM_X36Y220 sitetype=> RAMBFIFO18 tiletype=> CLE_R centerx=> 36.75 centery=>
53  // 221.96249999999998 BELs=> [RAMB18_X7Y88/RAMBFIFO18] site=> RAMB18_X7Y89 tile=> BRAM_X36Y220 sitetype=> RAMB181
54  // tiletype=> CLE_R centerx=> 36.75 centery=> 224.11249999999998 BELs=> [RAMB18_X7Y89/RAMB18E2_U]
55 
56  BELTypes.clear();
57  BELType2BELs.clear();
58  BELs.clear();
59 
60  siteTypes.clear();
61  siteType2Sites.clear();
62  sites.clear();
63 
64  tileTypes.clear();
65  tileType2Tiles.clear();
66  tiles.clear();
67 
68  BELType2FalseBELType.clear();
69  coord2ClockRegion.clear();
70 
71  if (JSONCfg.find("mergedSharedCellType2sharedCellType") != JSONCfg.end())
72  {
73  loadBELType2FalseBELType(JSONCfg["mergedSharedCellType2sharedCellType"]);
74  }
75  deviceName = _deviceName;
76 
77  std::string unzipCmnd = "unzip -p " + deviceArchievedTextFileName;
78  FILEbuf sbuf(popen(unzipCmnd.c_str(), "r"));
79  std::istream infile(&sbuf);
80  // std::ifstream infile(designTextFileName.c_str());
81 
82  std::string line;
83  std::string siteName, tileName, siteType, tileType, strBELs, clockRegionName, fill0, fill1, fill2, fill3, fill4,
84  fill5, fill6, fill7;
85  float centerX, centerY;
86 
87  while (std::getline(infile, line))
88  {
89  std::istringstream iss(line);
90  iss >> fill0 >> siteName >> fill1 >> tileName >> fill7 >> clockRegionName >> fill2 >> siteType >> fill3 >>
91  tileType >> fill4 >> centerX >> fill5 >> centerY >> fill6 >> strBELs;
92  assert(fill0 == "site=>");
93  assert(fill1 == "tile=>");
94  assert(fill7 == "clockRegionName=>");
95  assert(fill2 == "sitetype=>");
96  assert(fill3 == "tiletype=>");
97  std::string tmpFrom = "X";
98  std::string tmpTo = "";
99  replaceAll(clockRegionName, tmpFrom, tmpTo);
100  tmpFrom = "Y";
101  tmpTo = " ";
102  replaceAll(clockRegionName, tmpFrom, tmpTo);
103  std::vector<std::string> coordNumbers(0);
104  strSplit(clockRegionName, coordNumbers, " ");
105  assert(coordNumbers.size() == 2);
106  int clockRegionX = std::stoi(coordNumbers[0]);
107  int clockRegionY = std::stoi(coordNumbers[1]);
108  if (clockRegionX + 1 > clockRegionNumX)
109  clockRegionNumX = clockRegionX + 1;
110  if (clockRegionY + 1 > clockRegionNumY)
111  clockRegionNumY = clockRegionY + 1;
112 
113  std::pair<int, int> clockRegionCoord(clockRegionX, clockRegionY);
114 
115  // print("site=> " + curSite.siteName
116  // + " tile=> " + curSite.tileName
117  // + " clockRegionName=> " + curSite.clockRegionName
118  // + " sitetype=> " + curSite.siteType
119  // + " tiletype=> " + curSite.tileType
120  // + " centerx=> " + str(cx)
121  // + " centery=> " + str(cy)
122  // + " BELs=> " + str(curSite.BELs).replace(" ", "").replace("\'", ""), file=exportfile)
123 
124  if (strContains(fill0, "site=>"))
125  {
126  addTile(tileName, tileType);
127  DeviceTile *curTile = name2Tile[tileName];
128 
129  addSite(siteName, siteType, centerX, centerY, clockRegionX, clockRegionY, curTile);
130  DeviceSite *curSite = name2Site[siteName];
131  if (coord2ClockRegion.find(clockRegionCoord) == coord2ClockRegion.end())
132  {
133  ClockRegion *newCR = new ClockRegion(curSite);
134  coord2ClockRegion[clockRegionCoord] = newCR;
135  }
136  else
137  {
138  coord2ClockRegion[clockRegionCoord]->addSite(curSite);
139  }
140  strBELs = strBELs.substr(1, strBELs.size() - 2); // remove [] in string
141  std::vector<std::string> BELnames;
142  strSplit(strBELs, BELnames, ",");
143 
144  for (std::string BELname : BELnames)
145  {
146  std::vector<std::string> splitedName;
147  strSplit(BELname, splitedName, "/");
148  addBEL(BELname, splitedName[1], curSite);
149  }
150  }
151  else
152  assert(false && "Parser Error");
153  }
154 
155  std::sort(sites.begin(), sites.end(), siteSortCmp);
156 
157  std::map<std::string, std::vector<DeviceSite *>>::iterator tmpIt;
158  for (tmpIt = siteType2Sites.begin(); tmpIt != siteType2Sites.end(); tmpIt++)
159  {
160  std::sort(tmpIt->second.begin(), tmpIt->second.end(), siteSortCmp);
161  }
162 
164 
165  print_info("There are " + std::to_string(clockRegionNumY) + "x" + std::to_string(clockRegionNumX) +
166  "(YxX) clock regions on the device");
167 
169  print_status("New Device Info Created.");
170 }
171 
173 {
174  clockRegions.clear();
175  clockRegions.resize(clockRegionNumY, std::vector<ClockRegion *>(clockRegionNumX, nullptr));
176  for (int i = 0; i < clockRegionNumY; i++)
177  {
178  for (int j = 0; j < clockRegionNumX; j++)
179  {
180  std::pair<int, int> clockRegionCoord(j, i);
181  assert(coord2ClockRegion.find(clockRegionCoord) != coord2ClockRegion.end());
182  clockRegions[i][j] = coord2ClockRegion[clockRegionCoord];
183  }
184  }
185  for (int i = 0; i < clockRegionNumY; i++)
186  {
187  int j = 0;
188  clockRegions[i][j]->setLeft(clockRegions[i][j]->getLeft() - boundaryTolerance);
189  }
190  for (int i = 0; i < clockRegionNumY; i++)
191  {
192  int j = clockRegionNumX - 1;
193  clockRegions[i][j]->setRight(clockRegions[i][j]->getRight() + boundaryTolerance);
194  }
195  for (int j = 0; j < clockRegionNumX; j++)
196  {
197  int i = 0;
198  clockRegions[i][j]->setBottom(clockRegions[i][j]->getBottom() - boundaryTolerance);
199  }
200  for (int j = 0; j < clockRegionNumX; j++)
201  {
202  int i = clockRegionNumY - 1;
203  clockRegions[i][j]->setTop(clockRegions[i][j]->getTop() + boundaryTolerance);
204  }
205 
206  for (int i = 0; i < clockRegionNumY; i++)
207  {
208  for (int j = 0; j < clockRegionNumX; j++)
209  {
210  if (j > 0)
211  {
212  float midX = (clockRegions[i][j - 1]->getRight() + clockRegions[i][j]->getLeft()) / 2;
213  clockRegions[i][j]->setLeft(midX);
214  clockRegions[i][j - 1]->setRight(midX);
215  }
216  if (i > 0)
217  {
218  float midY = (clockRegions[i - 1][j]->getTop() + clockRegions[i][j]->getBottom()) / 2;
219  clockRegions[i - 1][j]->setTop(midY);
220  clockRegions[i][j]->setBottom(midY);
221  }
222  }
223  }
224 
225  clockRegionXBounds.clear();
226  clockRegionYBounds.clear();
227  for (int j = 0; j < clockRegionNumX; j++)
228  {
229  clockRegionXBounds.push_back(clockRegions[0][j]->getLeft());
230  }
231  for (int i = 0; i < clockRegionNumY; i++)
232  {
233  clockRegionYBounds.push_back(clockRegions[i][0]->getBottom());
234  }
235 
236  for (int i = 0; i < clockRegionNumY; i++)
237  {
238  for (int j = 0; j < clockRegionNumX; j++)
239  {
240  assert(clockRegions[i][j]->getLeft() == clockRegionXBounds[j]);
241  assert(clockRegions[i][j]->getBottom() == clockRegionYBounds[i]);
242  // std::cout << "dealing with clock region : X " << j << " Y " << i << "\n";
243  clockRegions[i][j]->mapSiteToClockColumns();
244  }
245  }
246 
247  clockColumns.clear();
248  for (int i = 0; i < clockRegionNumY; i++)
249  {
250  for (int j = 0; j < clockRegionNumX; j++)
251  {
252  for (auto colRow : clockRegions[i][j]->getClockColumns())
253  {
254  for (auto curClockCol : colRow)
255  {
256  curClockCol->setId(clockColumns.size());
257  clockColumns.push_back(curClockCol);
258  }
259  }
260  }
261  }
262 }
263 
265 {
266  assert(sites.size() > 0);
267  std::sort(sites.begin(), sites.end(), [](DeviceSite *a, DeviceSite *b) -> bool {
268  return a->getSiteY() == b->getSiteY() ? (a->getSiteX() < b->getSiteX()) : a->getSiteY() < b->getSiteY();
269  });
270 
271  assert(sites.size() > 0);
272  for (unsigned int i = 0; i < sites.size(); i++)
273  {
274  if (sites[i]->getName().find("SLICE") == 0)
275  {
276  leftSiteX = sites[i]->getSiteX();
277  bottomSiteY = sites[i]->getSiteY();
278  break;
279  }
280  }
281  for (int i = sites.size() - 1; i >= 0; i--)
282  {
283  if (sites[i]->getName().find("SLICE") == 0)
284  {
285  rightSiteX = sites[i]->getSiteX();
286  topSiteY = sites[i]->getSiteY();
287  break;
288  }
289  }
290 
291  for (unsigned int i = 0; i < sites.size(); i++)
292  {
293  if (sites[i]->getTile()->getTileIdX() < leftTileIdX)
294  {
295  leftTileIdX = sites[i]->getTile()->getTileIdX();
296  }
297  if (sites[i]->getTile()->getTileIdX() > rightTileIdX)
298  {
299  rightTileIdX = sites[i]->getTile()->getTileIdX();
300  }
301  if (sites[i]->getName().find("SLICE") == 0)
302  {
303  if (sites[i]->getTile()->getTileIdY() < bottomTileIdY)
304  {
305  bottomTileIdY = sites[i]->getTile()->getTileIdY();
306  }
307  if (sites[i]->getTile()->getTileIdY() > topTileIdY)
308  {
309  topTileIdY = sites[i]->getTile()->getTileIdY();
310  }
311  }
312  }
313 
314  // std::cout << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n";
315  clockColumns = std::vector<std::vector<ClockColumn *>>(
316  columnNumY, std::vector<ClockColumn *>((rightTileIdX - leftTileIdX + 1), nullptr));
317  for (int levelY = 0; levelY < columnNumY; levelY++)
318  {
319  for (unsigned int colOffset = 0; colOffset < clockColumns[levelY].size(); colOffset++)
320  {
321  clockColumns[levelY][colOffset] = new ClockColumn();
322  }
323  }
324  int eachLevelY = (topTileIdY - bottomTileIdY + 1) / columnNumY;
325  for (auto curSite : sites)
326  {
327  if (curSite->getName().find("SLICE") != 0)
328  {
329  // currently, BRAM/DSP slices will not lead to clock utilization overflow
330  continue;
331  }
332  int levelY = (curSite->getSiteY() - bottomSiteY) / eachLevelY;
333  int offsetX = curSite->getTile()->getTileIdX() - leftTileIdX;
334  if (levelY < 0)
335  {
336  std::cout << curSite->getName() << "\n";
337  }
338  assert(levelY >= 0);
339  if (levelY >= (int)clockColumns.size())
340  {
341  std::cout << curSite->getName() << "\n";
342  }
343  assert(levelY < (int)clockColumns.size());
344  assert(offsetX >= 0);
345  assert(offsetX < (int)clockColumns[levelY].size());
346  clockColumns[levelY][offsetX]->addSite(curSite);
347  curSite->setClockHalfColumn(clockColumns[levelY][offsetX]);
348  }
349 
350  assert(clockColumns.size() > 0);
352  colWidth = (rightX - leftX) / clockColumns[0].size();
353 
354  float offsetY = bottomY;
355  // std::cout << "ClockRegionBoundary: l:" << leftX << " r:" << rightX << " b:" << bottomY << " t:" << topY << "\n";
356  for (int levelY = 0; levelY < columnNumY; levelY++)
357  {
358  for (unsigned int colOffset = 0; colOffset < clockColumns[levelY].size(); colOffset++)
359  {
360  if (clockColumns[levelY][colOffset]->getSites().size() == 0)
361  continue;
362  clockColumns[levelY][colOffset]->setBottom(bottomY + levelY * colHeight);
363  clockColumns[levelY][colOffset]->setTop(bottomY + (levelY + 1) * colHeight);
364  if (colOffset == 0)
365  {
366  clockColumns[levelY][colOffset]->setLeft(leftX);
367  }
368  else
369  {
370  clockColumns[levelY][colOffset]->setLeft(clockColumns[levelY][colOffset]->getLeft() - 0.25);
371  }
372  if (colOffset == clockColumns[levelY].size() - 1)
373  {
374  clockColumns[levelY][colOffset]->setRight(rightX);
375  }
376  else
377  {
378  clockColumns[levelY][colOffset]->setRight(clockColumns[levelY][colOffset]->getRight() + 0.25);
379  }
380  // std::cout << " l:" << clockColumns[levelY][colOffset]->getLeft()
381  // << " r:" << clockColumns[levelY][colOffset]->getRight()
382  // << " b:" << clockColumns[levelY][colOffset]->getBottom()
383  // << " t:" << clockColumns[levelY][colOffset]->getTop() << "\n";
384  }
385  }
386 }
387 
388 void DeviceInfo::recordClockRelatedCell(float locX, float locY, int regionX, int regionY, int cellId, int netId)
389 {
390  auto clockRegion = clockRegions[regionY][regionX];
391  clockRegion->addClockAndCell(netId, cellId, locX, locY);
392 }
393 
395 {
396 
397  std::ifstream infile(specialPinOffsetFileName.c_str());
398  assert(infile.good() &&
399  "The file for special pin offset information does not exist and please check your path settings");
400 
401  std::string line;
402  std::string refpinname, fill0, fill1, fill2;
403  float offsetX, offsetY;
404 
405  std::vector<std::string> refPinsName;
406  std::map<std::string, float> name2offsetX;
407  std::map<std::string, float> name2offsetY;
408  refPinsName.clear();
409  name2offsetY.clear();
410  name2offsetX.clear();
411 
412  while (std::getline(infile, line))
413  {
414  std::istringstream iss(line);
415  iss >> fill0 >> refpinname >> fill1 >> offsetX >> fill2 >> offsetY;
416  if (strContains(fill0, "pin=>"))
417  {
418  refPinsName.push_back(refpinname);
419  name2offsetX[refpinname] = offsetX;
420  name2offsetY[refpinname] = offsetY;
421  }
422  else
423  assert(false && "Parser Error");
424  }
425 
426  std::string STR_PCIE_3_1 = "PCIE_3_1";
427  for (DeviceSite *PCIESite : getSitesInType(STR_PCIE_3_1))
428  {
430  sitePins->refPinsName = refPinsName;
431  sitePins->name2offsetX = name2offsetX;
432  sitePins->name2offsetY = name2offsetY;
433  PCIESite->setSitePinInfos(sitePins);
434  }
435 }
436 
438 {
439  DeviceSite *sitePtr = dynamic_cast<DeviceSite *>(parentPtr);
440  assert(sitePtr);
441  site = sitePtr;
442 }
443 
445 {
446  DeviceTile *tilePtr = dynamic_cast<DeviceTile *>(parentTilePtr);
447  assert(tilePtr);
448  parentTile = tilePtr;
449 }
450 
452 {
453 }
454 
456 {
457 }
458 
460 {
461  DeviceSite *childSite = dynamic_cast<DeviceSite *>(sitePtr);
462  assert(childSite);
463  childrenSites.push_back(childSite);
464 }
465 
466 void DeviceInfo::printStat(bool verbose)
467 {
468  print_info("#ExtractedTile= " + std::to_string(tiles.size()));
469  print_info("#ExtractedSite= " + std::to_string(sites.size()));
470  print_info("#ExtractedBEL= " + std::to_string(BELs.size()));
471 
472  std::string existTypes = "";
473  for (std::string tmptype : tileTypes)
474  {
475  existTypes += tmptype + " ";
476  }
477  print_info("Tile(" + std::to_string(tileTypes.size()) + " types): " + existTypes);
478  if (verbose)
479  {
480  for (std::map<std::string, std::vector<DeviceTile *>>::iterator it = tileType2Tiles.begin();
481  it != tileType2Tiles.end(); ++it)
482  {
483  print_info("#" + it->first + ": " + std::to_string(it->second.size()));
484  }
485  }
486 
487  existTypes = "";
488  for (std::string tmptype : siteTypes)
489  {
490  existTypes += tmptype + " ";
491  }
492  print_info("Site(" + std::to_string(siteTypes.size()) + " types): " + existTypes);
493  if (verbose)
494  {
495  for (std::map<std::string, std::vector<DeviceSite *>>::iterator it = siteType2Sites.begin();
496  it != siteType2Sites.end(); ++it)
497  {
498  print_info("#" + it->first + ": " + std::to_string(it->second.size()));
499  }
500  }
501 
502  existTypes = "";
503  for (std::string tmptype : BELTypes)
504  {
505  existTypes += tmptype + " ";
506  }
507  print_info("BEL(" + std::to_string(BELTypes.size()) + " types): " + existTypes);
508  if (verbose)
509  {
510  for (std::map<std::string, std::vector<DeviceBEL *>>::iterator it = BELType2BELs.begin();
511  it != BELType2BELs.end(); ++it)
512  {
513  print_info("#" + it->first + ": " + std::to_string(it->second.size()));
514  }
515  }
516 }
517 
518 void DeviceInfo::addBEL(std::string &BELName, std::string &BELType, DeviceSite *parent)
519 {
520  assert(name2BEL.find(BELName) == name2BEL.end());
521 
522  DeviceBEL *newBEL = new DeviceBEL(BELName, BELType, parent, parent->getChildrenSites().size());
523  BELs.push_back(newBEL);
524  name2BEL[BELName] = newBEL;
525 
526  addBELTypes(newBEL->getBELType());
527 
528  if (BELType2BELs.find(newBEL->getBELType()) == BELType2BELs.end())
529  BELType2BELs[newBEL->getBELType()] = std::vector<DeviceBEL *>();
530  BELType2BELs[newBEL->getBELType()].push_back(newBEL);
531 
532  parent->addChildBEL(newBEL);
533 }
534 
535 void DeviceInfo::addSite(std::string &siteName, std::string &siteType, float locx, float locy, int clockRegionX,
536  int clockRegionY, DeviceTile *parentTile)
537 {
538  assert(name2Site.find(siteName) == name2Site.end());
539 
540  DeviceSite *newSite = new DeviceSite(siteName, siteType, parentTile, locx, locy, clockRegionX, clockRegionY,
541  parentTile->getChildrenSites().size());
542  sites.push_back(newSite);
543  name2Site[siteName] = newSite;
544 
545  addSiteTypes(newSite->getSiteType());
546 
547  if (siteType2Sites.find(newSite->getSiteType()) == siteType2Sites.end())
548  siteType2Sites[newSite->getSiteType()] = std::vector<DeviceSite *>();
549  siteType2Sites[newSite->getSiteType()].push_back(newSite);
550 
551  parentTile->addChildSite(newSite);
552 }
553 
554 void DeviceInfo::addTile(std::string &tileName, std::string &tileType)
555 {
556  if (name2Tile.find(tileName) == name2Tile.end())
557  {
558  DeviceTile *tile = new DeviceTile(tileName, tileType, this, tiles.size());
559  tiles.push_back(tile);
560  name2Tile[tileName] = tile;
561 
562  addTileTypes(tile->getTileType());
563 
564  if (tileType2Tiles.find(tile->getTileType()) == tileType2Tiles.end())
565  tileType2Tiles[tile->getTileType()] = std::vector<DeviceTile *>();
566  tileType2Tiles[tile->getTileType()].push_back(tile);
567  }
568 }
569 
570 void DeviceInfo::loadBELType2FalseBELType(std::string curFileName)
571 {
572  std::string line;
573  std::ifstream infile(curFileName.c_str());
574  assert(infile.good() &&
575  "The mergedSharedCellType2sharedCellType file does not exist and please check your path settings");
576  BELType2FalseBELType.clear();
577  while (std::getline(infile, line))
578  {
579  std::vector<std::string> BELTypePair;
580  strSplit(line, BELTypePair, " ");
581  BELType2FalseBELType[BELTypePair[0]] = BELTypePair[1];
582  print_info("mapping BELType [" + BELTypePair[0] + "] to [" + BELType2FalseBELType[BELTypePair[0]] +
583  "] when creating PlacementBins");
584  }
585 }
readZip.h
DeviceInfo::ClockRegion::bottomSiteY
int bottomSiteY
Definition: DeviceInfo.h:889
exportDeviceLocation.centerY
centerY
Definition: exportDeviceLocation.py:327
DeviceInfo::mapClockRegionToArray
void mapClockRegionToArray()
map recognized clock regions into an array for later clock utilization evaluation
Definition: DeviceInfo.cc:172
DeviceInfo::ClockRegion::rightX
float rightX
Definition: DeviceInfo.h:888
DeviceInfo::clockRegionXBounds
std::vector< float > clockRegionXBounds
Definition: DeviceInfo.h:1294
DeviceInfo::ClockRegion::bottomY
float bottomY
Definition: DeviceInfo.h:888
DeviceInfo::ClockRegion::rightSiteX
int rightSiteX
Definition: DeviceInfo.h:889
DeviceInfo::ClockRegion::getRight
float getRight()
Get the Right boundary of the clock region.
Definition: DeviceInfo.h:748
DeviceInfo::clockRegions
std::vector< std::vector< ClockRegion * > > clockRegions
Definition: DeviceInfo.h:1292
DeviceInfo::boundaryTolerance
float boundaryTolerance
Definition: DeviceInfo.h:1301
DeviceInfo::BELTypes
std::set< std::string > BELTypes
Definition: DeviceInfo.h:1273
removeFailurePartFromTcl.line
line
Definition: removeFailurePartFromTcl.py:32
exportDeviceLocation.siteType
siteType
Definition: exportDeviceLocation.py:357
DeviceInfo::DeviceSite::DeviceSitePinInfos::name2offsetY
std::map< std::string, float > name2offsetY
Definition: DeviceInfo.h:231
DeviceInfo::name2Site
std::map< std::string, DeviceSite * > name2Site
Definition: DeviceInfo.h:1288
DeviceInfo::getSitesInType
std::vector< DeviceSite * > & getSitesInType(std::string &siteType)
Get sites of a specfic type.
Definition: DeviceInfo.h:1043
DeviceInfo::ClockRegion::columnNumY
int columnNumY
Definition: DeviceInfo.h:886
DeviceInfo::BELs
std::vector< DeviceBEL * > BELs
Definition: DeviceInfo.h:1275
DeviceInfo::ClockRegion::colHeight
float colHeight
Definition: DeviceInfo.h:891
DeviceInfo::ClockRegion::topTileIdY
int topTileIdY
Definition: DeviceInfo.h:890
DeviceInfo::getClockColumns
std::vector< ClockColumn * > & getClockColumns()
Definition: DeviceInfo.h:1266
DeviceInfo::clockColumns
std::vector< ClockColumn * > clockColumns
Definition: DeviceInfo.h:1293
FILEbuf
Definition: readZip.h:34
DeviceInfo::ClockColumn
a column of site in clock region
Definition: DeviceInfo.h:475
DeviceInfo::ClockRegion::sites
std::vector< DeviceSite * > sites
Definition: DeviceInfo.h:883
DeviceInfo::DeviceTile::addChildSite
void addChildSite(DeviceElement *sitePtr)
Definition: DeviceInfo.cc:459
DeviceInfo::DeviceTile::getTileType
std::string & getTileType()
Definition: DeviceInfo.h:445
DeviceInfo.h
This header file contains the classes of data for a standalone device.
DeviceInfo::tiles
std::vector< DeviceTile * > tiles
Definition: DeviceInfo.h:1283
strContains
bool strContains(std::string target, std::string substring)
Definition: stringCheck.cc:30
DeviceInfo::DeviceElement
basic class of device element
Definition: DeviceInfo.h:63
DeviceInfo::DeviceSite::DeviceSitePinInfos::refPinsName
std::vector< std::string > refPinsName
Definition: DeviceInfo.h:229
DeviceInfo::ClockRegion::colWidth
float colWidth
Definition: DeviceInfo.h:892
DeviceInfo::deviceArchievedTextFileName
std::string deviceArchievedTextFileName
Definition: DeviceInfo.h:1298
DeviceInfo::DeviceSite::setTile
void setTile(DeviceElement *parentTilePtr)
Definition: DeviceInfo.cc:444
DeviceInfo::name2BEL
std::map< std::string, DeviceBEL * > name2BEL
Definition: DeviceInfo.h:1287
DeviceInfo::clockRegionYBounds
std::vector< float > clockRegionYBounds
Definition: DeviceInfo.h:1295
DeviceInfo::addTile
void addTile(std::string &tileName, std::string &tileType)
Definition: DeviceInfo.cc:554
DeviceInfo::getTile
DeviceTile * getTile(std::string &Name)
Definition: DeviceInfo.h:1116
DeviceInfo::DeviceTile::getChildrenSites
std::vector< DeviceSite * > & getChildrenSites()
Definition: DeviceInfo.h:441
DeviceInfo::printStat
void printStat(bool verbose=false)
Definition: DeviceInfo.cc:466
DeviceInfo::coord2ClockRegion
std::map< std::pair< int, int >, ClockRegion * > coord2ClockRegion
Definition: DeviceInfo.h:1291
DeviceInfo::recordClockRelatedCell
void recordClockRelatedCell(float locX, float locY, int regionX, int regionY, int cellId, int netId)
record the information of cell in a specific clock region
Definition: DeviceInfo.cc:388
DeviceInfo::siteTypes
std::set< std::string > siteTypes
Definition: DeviceInfo.h:1277
stringCheck.h
DeviceInfo::DeviceSite
Site class for site on device.
Definition: DeviceInfo.h:163
DeviceInfo::getSites
std::vector< DeviceSite * > & getSites()
Definition: DeviceInfo.h:1097
DeviceInfo::addSiteTypes
void addSiteTypes(std::string &strSiteType)
add a Site type into the set of the existing site types
Definition: DeviceInfo.h:951
strPrint.h
DeviceInfo::BELType2BELs
std::map< std::string, std::vector< DeviceBEL * > > BELType2BELs
Definition: DeviceInfo.h:1274
DeviceInfo::name2Tile
std::map< std::string, DeviceTile * > name2Tile
Definition: DeviceInfo.h:1289
DeviceInfo::ClockRegion
class for clock regions on FPGA
Definition: DeviceInfo.h:652
print_status
void print_status(std::string tmp_string)
Definition: strPrint.cc:44
DeviceInfo::specialPinOffsetFileName
std::string specialPinOffsetFileName
Definition: DeviceInfo.h:1299
siteSortCmp
bool siteSortCmp(DeviceInfo::DeviceSite *a, DeviceInfo::DeviceSite *b)
Definition: DeviceInfo.cc:32
DeviceInfo::addSite
void addSite(std::string &siteName, std::string &siteType, float locx, float locy, int clockRegionX, int clockRegionY, DeviceTile *parentTile)
add a site into the device information class
Definition: DeviceInfo.cc:535
DeviceInfo::ClockRegion::mapSiteToClockColumns
void mapSiteToClockColumns()
for the clock column constraints, we need to map site to columns.
Definition: DeviceInfo.cc:264
DeviceInfo::DeviceSite::DeviceSitePinInfos
a class record the pin on the site boundary
Definition: DeviceInfo.h:218
DeviceInfo::ClockRegion::rightTileIdX
int rightTileIdX
Definition: DeviceInfo.h:890
DeviceInfo::clockRegionNumY
int clockRegionNumY
Definition: DeviceInfo.h:1303
DeviceInfo::DeviceSite::getSiteType
std::string & getSiteType()
Definition: DeviceInfo.h:273
DeviceInfo::DeviceInfo
DeviceInfo(std::map< std::string, std::string > &JSONCfg, std::string _deviceName)
Construct a new Device Info object.
Definition: DeviceInfo.cc:44
DeviceInfo::siteType2Sites
std::map< std::string, std::vector< DeviceSite * > > siteType2Sites
Definition: DeviceInfo.h:1278
DeviceInfo::ClockRegion::leftSiteX
int leftSiteX
Definition: DeviceInfo.h:889
DeviceInfo::ClockRegion::leftX
float leftX
Definition: DeviceInfo.h:888
DeviceInfo::addTileTypes
void addTileTypes(std::string &strTileType)
Definition: DeviceInfo.h:970
DeviceInfo::DeviceSite::getChildrenSites
std::vector< DeviceSite * > & getChildrenSites()
Definition: DeviceInfo.h:262
strSplit
void strSplit(const std::string &s, std::vector< std::string > &sv, const char *delim)
Definition: stringCheck.cc:35
DeviceInfo::DeviceSite::addChildSite
void addChildSite(DeviceElement *parentSitePtr)
Set the Parent Site object.
Definition: DeviceInfo.cc:455
DeviceInfo::DeviceBEL::setSite
void setSite(DeviceElement *parentPtr)
Definition: DeviceInfo.cc:437
DeviceInfo::addBELTypes
void addBELTypes(std::string &strBELType)
add a BEL type into the set of the existing BEL types
Definition: DeviceInfo.h:932
DeviceInfo::clockRegionNumX
int clockRegionNumX
Definition: DeviceInfo.h:1302
DeviceInfo::DeviceSite::DeviceSitePinInfos::name2offsetX
std::map< std::string, float > name2offsetX
Definition: DeviceInfo.h:230
DeviceInfo::DeviceBEL
BEL(Basic Element of Logic), the smallest undividable element.
Definition: DeviceInfo.h:114
DeviceInfo::ClockRegion::topY
float topY
Definition: DeviceInfo.h:888
DeviceInfo::DeviceSite::X
float X()
Definition: DeviceInfo.h:288
DeviceInfo::ClockRegion::topSiteY
int topSiteY
Definition: DeviceInfo.h:889
DeviceInfo::DeviceSite::setParentSite
void setParentSite(DeviceElement *parentSitePtr)
Set the Parent Site object.
Definition: DeviceInfo.cc:451
DeviceInfo::tileType2Tiles
std::map< std::string, std::vector< DeviceTile * > > tileType2Tiles
Definition: DeviceInfo.h:1282
DeviceInfo::tileTypes
std::set< std::string > tileTypes
Definition: DeviceInfo.h:1281
print_info
void print_info(std::string tmp_string)
Definition: strPrint.cc:39
DeviceInfo::BELType2FalseBELType
std::map< std::string, std::string > BELType2FalseBELType
Definition: DeviceInfo.h:1285
DeviceInfo::JSONCfg
std::map< std::string, std::string > & JSONCfg
Definition: DeviceInfo.h:1297
DeviceInfo::loadPCIEPinOffset
void loadPCIEPinOffset(std::string specialPinOffsetFileName)
load the detailed location information of pins on PCIE IO slot
Definition: DeviceInfo.cc:394
checkHalfColumn.i
int i
Definition: checkHalfColumn.py:5
DeviceInfo::ClockRegion::clockColumns
std::vector< std::vector< ClockColumn * > > clockColumns
Definition: DeviceInfo.h:885
DeviceInfo::DeviceSite::addChildBEL
void addChildBEL(DeviceBEL *child)
Definition: DeviceInfo.h:278
DeviceInfo::ClockRegion::leftTileIdX
int leftTileIdX
Definition: DeviceInfo.h:890
DeviceInfo::loadBELType2FalseBELType
void loadBELType2FalseBELType(std::string curFileName)
load BEL type remapping information since some cell can be placed in sites of different sites....
Definition: DeviceInfo.cc:570
DeviceInfo::addBEL
void addBEL(std::string &BELName, std::string &BELType, DeviceSite *parentSite)
add a BEL element into the device information
Definition: DeviceInfo.cc:518
DeviceInfo::ClockRegion::getLeft
float getLeft()
Get the Left boundary of the clock region.
Definition: DeviceInfo.h:738
DeviceInfo::deviceName
std::string deviceName
Definition: DeviceInfo.h:1272
exportDeviceLocation.centerX
centerX
Definition: exportDeviceLocation.py:325
DeviceInfo::sites
std::vector< DeviceSite * > sites
Definition: DeviceInfo.h:1279
DeviceInfo::DeviceTile
A tile is a combination of sites.
Definition: DeviceInfo.h:416
DeviceInfo::ClockRegion::bottomTileIdY
int bottomTileIdY
Definition: DeviceInfo.h:890
replaceAll
void replaceAll(std::string &str, const std::string from, const std::string to)
Definition: stringCheck.cc:50
DeviceInfo::DeviceBEL::getBELType
std::string & getBELType()
Definition: DeviceInfo.h:139
DeviceInfo::DeviceSite::Y
float Y()
Definition: DeviceInfo.h:292