AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
PlacementInfo.h
Go to the documentation of this file.
1 
25 #ifndef _PlacementINFO
26 #define _PlacementINFO
27 
28 #include "DesignInfo.h"
29 #include "DeviceInfo.h"
30 #include "Eigen/Core"
31 #include "Eigen/SparseCore"
32 #include "PlacementTimingInfo.h"
33 #include "Rendering/paintDB.h"
34 #include "dumpZip.h"
35 #include <assert.h>
36 #include <fstream>
37 #include <iostream>
38 #include <map>
39 #include <mutex>
40 #include <queue>
41 #include <set>
42 #include <sstream>
43 #include <string>
44 #include <thread>
45 #include <vector>
46 
59 {
60  public:
68  {
71  };
72 
73  class PlacementSiteTypeInfo;
74  class PlacementBinInfo;
75  class CompatiblePlacementTable;
76  class PlacementNet;
77 
94  {
95  public:
112  {
113  }
114 
119  std::vector<std::string> realBELTypes;
120 
125  std::map<std::string, int> realBELTypeName2ID;
126 
135  std::vector<std::string> sharedCellBELTypes;
136 
144  std::map<DesignInfo::DesignCellType, int> cellType2sharedBELTypeOccupation;
145 
153  std::map<DesignInfo::DesignCellType, std::vector<std::string>> cellType2sharedBELTypes;
154 
161  std::map<DesignInfo::DesignCellType, std::vector<int>> cellType2sharedBELTypeIDs;
162 
169  std::map<std::string, std::string> sharedCellType2SiteType;
170 
179  std::map<std::string, std::vector<std::string>> sharedCellType2BELNames;
180 
187  inline std::vector<int> &getPotentialBELTypeIDs(DesignInfo::DesignCell *cell)
188  {
189  // be careful, this function will remap the BELType according to the user configuration
190  // for example, SLICEM_CARRY8 will be mapped to SLICEL_CARRY8, so they will be treated equally during cell
191  // spreading.
192  assert(cell);
193  assert((unsigned int)cell->getCellId() < cellId2SharedCellBELTypeID.size());
194  return cellId2SharedCellBELTypeID[cell->getCellId()];
195  }
196 
203  inline std::vector<int> &getPotentialBELTypeIDs(DesignInfo::DesignCellType cellType)
204  {
205  // be careful, this function will not remap the BELType.
206  return cellType2sharedBELTypeIDs[cellType];
207  }
208 
215  inline int getSharedBELTypeId(std::string tmpStr)
216  {
217  assert(sharedCellBELTypeName2ID.find(tmpStr) != sharedCellBELTypeName2ID.end());
218  return sharedCellBELTypeName2ID[tmpStr];
219  }
220 
228  {
229  return cellType2sharedBELTypeOccupation[cellType];
230  }
231 
243  {
244  return cellId2Occupation[cell->getCellId()] * cellId2InfationRatio[cell->getCellId()];
245  }
246 
254  {
255  return cellId2InfationRatio[cell->getCellId()];
256  }
257 
264  inline float getActualOccupationByCellId(int id)
265  {
266  return cellId2Occupation[id] * cellId2InfationRatio[id];
267  }
268 
274  inline std::vector<float> &getcellId2Occupation()
275  {
276  return cellId2Occupation;
277  }
278 
284  inline std::vector<float> &getcellId2InfationRatio()
285  {
286  return cellId2InfationRatio;
287  }
288 
298 
304 
305  private:
306  std::map<std::string, int> sharedCellBELTypeName2ID;
307  std::vector<std::vector<int>> cellId2SharedCellBELTypeID;
308  std::vector<float> cellId2Occupation;
309  std::vector<float> cellId2InfationRatio;
310  std::vector<float> defaultCellId2Occupation;
313  };
314 
322  {
323  public:
324  typedef struct location
325  {
326  float locX;
327  float locY;
329 
330  PlacementSiteTypeInfo(std::string siteType, std::vector<DeviceInfo::DeviceSite *> &correspondingSites)
332  {
333  assert(correspondingSites.size() > 0);
334 
335  BELNames.clear();
336  for (DeviceInfo::DeviceBEL *curBEL : correspondingSites[0]->getChildrenBELs())
337  {
338  BELNames.insert(curBEL->getBELType());
339  }
340 
341  potentialLocations.clear();
343  {
345  tmploc.locX = curSite->X();
346  tmploc.locY = curSite->Y();
347  potentialLocations.push_back(tmploc);
348  }
349  }
350 
352  {
353  potentialLocations.clear();
354  BELNames.clear();
355  }
356 
357  private:
358  std::string siteType;
359  std::set<std::string> BELNames;
360  std::vector<location> potentialLocations;
361  const std::vector<DeviceInfo::DeviceSite *> &correspondingSites;
362  };
363 
372  {
373  public:
390  PlacementBinInfo(std::string sharedCellType, float leftX, float rightX, float bottomY, float topY, int row,
394 
395  {
396  correspondingSites.clear();
397  cells.clear();
398  }
399 
401  {
402  correspondingSites.clear();
403  cells.clear();
404  }
405 
413  inline float getManhattanDistanceTo(float inX, float inY)
414  {
415  if (leftX < inX && inX <= rightX && bottomY < inY && inY <= topY)
416  {
417  return 0;
418  }
419  if (leftX < inX && inX <= rightX)
420  {
421  return std::min(std::fabs(inY - topY), std::fabs(inY - bottomY));
422  }
423  if (bottomY < inY && inY <= topY)
424  {
425  return std::min(std::fabs(inX - leftX), std::fabs(inX - rightX));
426  }
427  return std::min(std::fabs(inX - leftX), std::fabs(inX - rightX)) +
428  std::min(std::fabs(inY - topY), std::fabs(inY - bottomY));
429  }
430 
439  void addSiteIntoBin(DeviceInfo::DeviceSite *curSite);
440 
449  inline bool inRange(float x, float y)
450  {
451  return (x < rightX && x >= (leftX - 1e-3) && y < topY && y >= (bottomY - 1e-3));
452  }
453 
454  inline bool inRangeY(float y)
455  {
456  return (y < topY && y >= bottomY);
457  }
458 
469  inline void addCell(DesignInfo::DesignCell *cell, int occupationAdded)
470  {
471  mtx.lock();
472  assert(cells.find(cell) == cells.end());
473  cells.insert(cell);
474  assert(occupationAdded >= 0);
475  utilization += occupationAdded;
476  mtx.unlock();
477  }
478 
488  inline void removeCell(DesignInfo::DesignCell *cell, int occupationAdded)
489  {
490  // if (cell)
491  mtx.lock();
492  assert(cells.find(cell) != cells.end());
493  cells.erase(cell);
494  utilization -= occupationAdded;
495  assert(utilization >= 0);
496  mtx.unlock();
497  }
498 
499  inline bool contains(DesignInfo::DesignCell *cell)
500  {
501  // if (cell)
502  return cells.find(cell) != cells.end();
503  }
504 
505  inline void reset()
506  {
507  cells.clear();
508  utilization = 0;
510  overflowCnt = 0;
511  noOverflowCnt = 0;
514  }
515 
521  inline void shrinkBinBy(float r)
522  {
523  binShrinkRatio *= (1 - r);
524  }
525 
531  inline void inflateBinBy(float r)
532  {
533  binShrinkRatio *= (1 + r);
534  }
535 
536  inline void resetBinShrinkRatio()
537  {
539  }
540 
542  {
543  return requiredBinShrinkRatio;
544  }
545 
553  inline void setRequiredBinShrinkRatio(float r)
554  {
556  }
557 
563  inline std::set<DesignInfo::DesignCell *> &getCells()
564  {
565  return cells;
566  }
567 
568  inline float getBinShrinkRatio()
569  {
570  return binShrinkRatio;
571  }
572 
578  inline float getUtilizationRate()
579  {
580  if (capacity == 0)
581  return utilization / 0.01;
582  assert(capacity != 0);
583  return (float)utilization / (capacity * binShrinkRatio);
584  }
585 
592  inline float getRealUtilizationRate()
593  {
594  if (cells.size())
595  {
596  std::vector<DesignInfo::DesignCell *> cellVec;
597  cellVec.clear();
598  for (auto cell : cells)
599  {
600  cellVec.push_back(cell);
601  }
602  if (cellVec[0]->isLUT())
603  {
604  float tmputilization = 0;
605  for (auto cell : cells)
606  {
607  if (cell->isLUT6())
608  tmputilization += 2.0;
609  else
610  tmputilization += 1;
611  }
612  return (float)tmputilization / capacity;
613  }
614  else
615  {
616  return getUtilizationRate();
617  }
618  }
619  return 0;
620  }
621 
622  inline float getUtilization()
623  {
624  return (float)utilization;
625  }
626 
627  inline float getCapacity()
628  {
629  return (float)capacity * binShrinkRatio;
630  }
631 
639  inline bool isOverflow(float overflowThreshold)
640  {
641  if (capacity == 0)
642  {
643  if (utilization == 0)
644  return false;
645  else
646  return true;
647  }
648  assert(utilization >= 0);
649  assert(capacity != 0);
650  return ((float)utilization / (capacity)) > overflowThreshold + eps;
651  // return ((float)utilization / (binShrinkRatio * capacity)) > overflowThreshold + eps;
652  }
653 
661  inline bool canAddMore(int BELAmo)
662  {
663  if (capacity == 0)
664  return false;
665  return ((float)(utilization + BELAmo) / (binShrinkRatio * capacity)) <= 1.00 + eps;
666  }
667 
673  inline int Y()
674  {
675  return row;
676  }
677 
683  inline int X()
684  {
685  return column;
686  }
687 
693  inline float left()
694  {
695  return leftX;
696  }
697 
703  inline float right()
704  {
705  return rightX;
706  }
707 
713  inline float top()
714  {
715  return topY;
716  }
717 
723  inline float bottom()
724  {
725  return bottomY;
726  }
727 
728  inline std::string getType()
729  {
730  return sharedCellType;
731  }
732 
737  inline void countOverflow()
738  {
739  overflowCnt++;
740  }
741 
746  inline void countNoOverflow()
747  {
748  if (noOverflowCnt < 100)
749  {
750  noOverflowCnt++;
751  }
752  }
754  {
755  noOverflowCnt = 0;
756  }
757  inline void resetOverflowCounter()
758  {
759  overflowCnt = 0;
760  }
761  inline int getNoOverflowCounter()
762  {
763  return noOverflowCnt;
764  }
765  inline int getOverflowCounter()
766  {
767  return overflowCnt;
768  }
769 
775  inline std::vector<DeviceInfo::DeviceSite *> &getCorrespondingSites()
776  {
777  return correspondingSites;
778  }
779 
780  inline std::string &getSharedCellType()
781  {
782  return sharedCellType;
783  }
784 
790  inline void increaseSWDemandBy(float additionalDemand)
791  {
792  switchDemandForNets += additionalDemand;
793  }
794 
799  inline float getSwitchDemandForNets() const
800  {
801  return switchDemandForNets;
802  }
803 
809  inline void setClockRegionX(int _x)
810  {
811  clockRegionX = _x;
812  }
813 
818  inline int getClockRegionX()
819  {
820  return clockRegionX;
821  }
822 
823  private:
824  std::string sharedCellType;
825  std::vector<DeviceInfo::DeviceSite *> correspondingSites;
827  std::set<DesignInfo::DesignCell *> cells;
828 
829  int capacity = 0;
830  int utilization = 0;
831  float binShrinkRatio = 1.0;
833 
834  const float leftX;
835  const float rightX;
836  const float topY;
837  const float bottomY;
838 
839  float eps = 1e-5;
840  const int row;
841  const int column;
842 
843  int overflowCnt = 0;
844  int noOverflowCnt = 0;
845 
846  float switchDemandForNets = 0.0;
847  float switchSupplyForNets = 0.0; // only consider the general sites (DSP/BRAM/SLICE)
848  std::mutex mtx;
849 
850  int clockRegionX = -1;
851  };
852 
860  {
861  public:
863  : leftX(curBin->left()), rightX(curBin->right()), topY(curBin->top()), bottomY(curBin->bottom()),
864  row(curBin->Y()), column(curBin->X())
865  {
866  mergedBins.clear();
867  correspondingSites.clear();
868  cells.clear();
869  mergedBins.push_back(curBin);
870  }
871 
873  {
874  correspondingSites.clear();
875  cells.clear();
876  }
877 
878  inline bool inRange(float x, float y)
879  {
880  return (x <= rightX && x > leftX && y <= topY && y > bottomY);
881  }
882 
883  inline bool inRangeY(float y)
884  {
885  return (y <= topY && y > bottomY);
886  }
887 
888  inline void addCell(DesignInfo::DesignCell *cell, int occupationAdded)
889  {
890  // if (cell)
891  cells.insert(cell);
892  utilization += occupationAdded;
893  }
894 
895  inline void removeCell(DesignInfo::DesignCell *cell, int occupationAdded)
896  {
897  // if (cell)
898  assert(cells.find(cell) != cells.end());
899  cells.erase(cell);
900  utilization -= occupationAdded;
901  }
902 
903  inline bool contains(DesignInfo::DesignCell *cell)
904  {
905  // if (cell)
906  return cells.find(cell) != cells.end();
907  }
908 
909  inline void reset()
910  {
911  cells.clear();
912  utilization = 0;
913  }
914 
915  inline std::set<DesignInfo::DesignCell *> &getCells()
916  {
917  return cells;
918  }
919 
920  inline float getUtilizationRate()
921  {
922  if (capacity == 0)
923  return utilization / 0.01;
924  assert(capacity != 0);
925  return (float)binShrinkRatio * utilization / capacity;
926  }
927 
928  inline float getUtilization()
929  {
930  return (float)utilization;
931  }
932 
933  inline float getCapacity()
934  {
935  return (float)capacity / binShrinkRatio;
936  }
937 
938  inline bool isOverflow()
939  {
940  if (capacity == 0)
941  {
942  if (utilization == 0)
943  return false;
944  else
945  return true;
946  }
947  assert(capacity != 0);
948  return ((float)binShrinkRatio * utilization / capacity) > 1.00 + eps;
949  }
950 
951  inline bool canAddMore(int BELAmo)
952  {
953  if (capacity == 0)
954  return false;
955  return ((float)binShrinkRatio * (utilization + BELAmo) / capacity) <= 1.00 + eps;
956  }
957  inline void setYX(int i, int j)
958  {
959  row = i;
960  column = j;
961  }
962 
963  inline int Y()
964  {
965  return row;
966  }
967  inline int X()
968  {
969  return column;
970  }
971 
972  inline float left()
973  {
974  return leftX;
975  }
976  inline float right()
977  {
978  return rightX;
979  }
980  inline float top()
981  {
982  return topY;
983  }
984  inline float bottom()
985  {
986  return bottomY;
987  }
988 
989  private:
990  std::vector<DeviceInfo::DeviceSite *> correspondingSites;
991  std::vector<PlacementBinInfo *> mergedBins;
992  std::set<DesignInfo::DesignCell *> cells;
993  int capacity = 0;
994  int utilization = 0;
995  float binShrinkRatio = 1.0;
996  float leftX;
997  float rightX;
998  float topY;
999  float bottomY;
1000  float eps = 1e-5;
1001  int row;
1002  int column;
1003  };
1004 
1010  {
1011  public:
1013  {
1014  }
1015  virtual ~PlacementUnit()
1016  {
1017  }
1018  void getAnchorLocation(float &x, float &y)
1019  {
1020  x = anchorX;
1021  y = anchorY;
1022  }
1023 
1024  inline float X()
1025  {
1026  return anchorX;
1027  }
1028 
1029  inline float Y()
1030  {
1031  return anchorY;
1032  }
1033 
1034  inline float lastX()
1035  {
1036  return lastAnchorX;
1037  }
1038 
1039  inline float lastY()
1040  {
1041  return lastAnchorY;
1042  }
1043 
1052  inline void setAnchorLocation(float x, float y)
1053  {
1054  assert(!locked);
1055  if (anchorX < -100 && anchorY < -100)
1056  {
1057  lastAnchorX = x;
1058  lastAnchorY = y;
1059  }
1060  else
1061  {
1062  lastAnchorX = anchorX;
1063  lastAnchorY = anchorY;
1064  }
1065  anchorX = x;
1066  anchorY = y;
1067  }
1068 
1076  inline void setSpreadLocation(float x, float y, float forgetRatio)
1077  {
1078  assert(!locked);
1079 
1080  if (lastSpreadX > -100 && lastSpreadY > -100)
1081  {
1082  assert(forgetRatio <= 1);
1083  x = x * forgetRatio + lastSpreadX * (1 - forgetRatio);
1084  y = y * forgetRatio + lastSpreadY * (1 - forgetRatio);
1085  // lastSpreadX = x;
1086  // lastSpreadY = y;
1087  }
1088  lastAnchorX = x;
1089  lastAnchorY = y;
1090  anchorX = x;
1091  anchorY = y;
1092  }
1093 
1102  inline void setSpreadLocation_WithLimitDisplacement(float x, float y, float forgetRatio,
1103  float limitDisplacement)
1104  {
1105  assert(!locked);
1106 
1107  if (lastSpreadX > -100 && lastSpreadY > -100)
1108  {
1109  assert(forgetRatio <= 1);
1110  float disX = std::fabs(x - lastSpreadX) * forgetRatio;
1111  float disY = std::fabs(x - lastSpreadX) * forgetRatio;
1112  float dis = std::sqrt(disX * disX + disY * disY);
1113  if (dis / limitDisplacement > 1)
1114  forgetRatio /= (dis / limitDisplacement);
1115 
1116  x = x * forgetRatio + lastSpreadX * (1 - forgetRatio);
1117  y = y * forgetRatio + lastSpreadY * (1 - forgetRatio);
1118 
1119  // lastSpreadX = x;
1120  // lastSpreadY = y;
1121  }
1122  lastAnchorX = x;
1123  lastAnchorY = y;
1124  anchorX = x;
1125  anchorY = y;
1126  }
1127 
1129  {
1130  assert(!locked);
1131 
1132  lastAnchorX = x;
1133  lastAnchorY = y;
1134  anchorX = x;
1135  anchorY = y;
1136  }
1137 
1138  inline void recordSpreadLocatin()
1139  {
1140  lastSpreadX = anchorX;
1141  lastSpreadY = anchorY;
1142  }
1143 
1144  inline void setFixed()
1145  {
1146  assert(!locked);
1147  fixed = true;
1148  }
1149 
1150  inline void setUnfixed()
1151  {
1152  assert(!locked);
1153  fixed = false;
1154  }
1155 
1156  inline void setLocked()
1157  {
1158  locked = true;
1159  }
1160 
1161  inline void setUnlocked()
1162  {
1163  locked = false;
1164  }
1165 
1166  inline bool isLocked()
1167  {
1168  return locked;
1169  }
1170 
1171  inline void setPlaced()
1172  {
1173  assert(!locked);
1174  placed = true;
1175  }
1176 
1177  inline bool isFixed()
1178  {
1179  return fixed;
1180  }
1181  inline bool isPlaced()
1182  {
1183  return placed;
1184  }
1185 
1186  inline std::string &getName()
1187  {
1188  return name;
1189  }
1190 
1192  {
1193  return unitType;
1194  }
1195 
1196  inline void setWeight(int numCell)
1197  {
1198  weight = numCell;
1199  }
1200 
1201  inline int getWeight()
1202  {
1203  return weight;
1204  }
1205 
1206  inline unsigned int getId()
1207  {
1208  return id;
1209  }
1210 
1211  inline void renewId(int newId)
1212  {
1213  id = newId;
1214  }
1215 
1221  inline void setNetsSetPtr(std::vector<PlacementNet *> *_nets)
1222  {
1223  nets = _nets;
1224  }
1225 
1231  inline std::vector<PlacementNet *> *getNetsSetPtr()
1232  {
1233  return nets;
1234  }
1235 
1237  {
1238  if (numUnitsBeDrivenByThisPU >= 0)
1239  return numUnitsBeDrivenByThisPU;
1241  for (auto tmpNet : *nets)
1242  {
1243  if (tmpNet->getDriverUnits().size() == 1)
1244  {
1245  if (tmpNet->getDriverUnits()[0] == this)
1246  {
1247  numUnitsBeDrivenByThisPU += tmpNet->getUnitsBeDriven().size();
1248  }
1249  }
1250  }
1251  return numUnitsBeDrivenByThisPU;
1252  }
1253 
1254  inline int getUnitsDriveThisPU()
1255  {
1256  if (numUnitsDriveThisPU >= 0)
1257  return numUnitsDriveThisPU;
1258  numUnitsDriveThisPU = 0;
1259  for (auto tmpNet : *nets)
1260  {
1261  if (tmpNet->getDriverUnits().size() == 1)
1262  {
1263  if (tmpNet->getDriverUnits()[0] != this)
1264  {
1265  numUnitsDriveThisPU += 1;
1266  }
1267  }
1268  }
1269  return numUnitsDriveThisPU;
1270  }
1271 
1272  inline void addDSP()
1273  {
1274  DSPcnt++;
1275  }
1276  inline void addBRAM()
1277  {
1278  BRAMcnt++;
1279  }
1280  inline void addLUTRAM()
1281  {
1282  LUTRAMcnt++;
1283  }
1284  inline void addLUT()
1285  {
1286  LUTcnt++;
1287  }
1288  inline void addFF()
1289  {
1290  FFcnt++;
1291  }
1292  inline void addCARRY()
1293  {
1294  CARRYcnt++;
1295  }
1296  inline void addMUX()
1297  {
1298  MUXcnt++;
1299  }
1300  inline bool checkHasDSP()
1301  {
1302  return DSPcnt;
1303  }
1304  inline bool checkHasBRAM()
1305  {
1306  return BRAMcnt;
1307  }
1308  inline bool checkHasLUTRAM()
1309  {
1310  return LUTRAMcnt;
1311  }
1312  inline bool checkHasLUT()
1313  {
1314  return LUTcnt;
1315  }
1316  inline bool checkHasFF()
1317  {
1318  return FFcnt;
1319  }
1320  inline bool checkHasCARRY()
1321  {
1322  return CARRYcnt;
1323  }
1324  inline bool checkHasMUX()
1325  {
1326  return MUXcnt;
1327  }
1328  inline bool hasRegister()
1329  {
1330  return (checkHasFF() || checkHasDSP() || checkHasBRAM() || checkHasLUTRAM());
1331  }
1332  inline bool hasLogic()
1333  {
1334  return (checkHasFF() || checkHasDSP() || checkHasBRAM() || checkHasLUTRAM() || checkHasCARRY() ||
1335  checkHasLUT());
1336  }
1337  inline bool isMCLB()
1338  {
1339  return LUTRAMcnt;
1340  }
1341  inline bool isLCLB()
1342  {
1343  return LUTcnt > 0 && CARRYcnt == 0; // LogicCLB with Carray will be handled by macroLegalizer
1344  }
1345  inline int getDSPNum()
1346  {
1347  return DSPcnt;
1348  }
1349  inline int getBRAMNum()
1350  {
1351  return BRAMcnt;
1352  }
1353  inline int getLUTRAMNum()
1354  {
1355  return LUTRAMcnt;
1356  }
1357  inline int getLUTNum()
1358  {
1359  return LUTcnt;
1360  }
1361  inline int getCARRYNum()
1362  {
1363  return CARRYcnt;
1364  }
1365  inline int getMUXNum()
1366  {
1367  return MUXcnt;
1368  }
1369  inline void setPacked()
1370  {
1371  packed = true;
1372  }
1373  inline void resetPacked()
1374  {
1375  packed = false;
1376  }
1377  inline bool isPacked()
1378  {
1379  return packed;
1380  }
1381 
1382  inline std::set<DesignInfo::DesignNet *> &getClockNets()
1383  {
1384  return clockNets;
1385  }
1386 
1387  protected:
1392  std::set<DesignInfo::DesignNet *> clockNets;
1393 
1394  private:
1395  std::string name;
1396  int id;
1397  float anchorX = -2000, anchorY = -2000;
1398  float lastAnchorX = -2000, lastAnchorY = -2000;
1399  float lastSpreadX = -2000, lastSpreadY = -2000;
1401 
1406  std::vector<PlacementNet *> *nets;
1407 
1412  bool fixed = false;
1413 
1420  bool placed = false;
1421 
1426  bool locked = false;
1427  int weight = 1;
1428 
1429  int DSPcnt = 0;
1430  int BRAMcnt = 0;
1431  int LUTRAMcnt = 0;
1432  int LUTcnt = 0;
1433  int FFcnt = 0;
1434  int CARRYcnt = 0;
1435  int MUXcnt = 0;
1438 
1439  bool packed = false;
1440  };
1441 
1447  {
1448  public:
1458  {
1459  if (cell->isBRAM())
1460  addBRAM();
1461  if (cell->isDSP())
1462  addDSP();
1463  if (cell->isFF())
1464  addFF();
1465  if (cell->isLUTRAM() || cell->originallyIsLUTRAM())
1466  addLUTRAM();
1467  if (cell->isLUT())
1468  addLUT();
1469  if (cell->isCarry())
1470  addCARRY();
1471  if (cell->isMux())
1472  addMUX();
1474  }
1476  {
1477  }
1478 
1479  void setLockedAt(std::string _siteName, std::string _BELName, DeviceInfo *deviceInfo, bool lock = true)
1480  {
1481  setFixed();
1482  setPlaced();
1483  siteName = _siteName;
1484  BELName = _BELName;
1488  if (lock)
1489  setLocked();
1490  }
1491 
1493  {
1494  return lockedSite;
1495  }
1496 
1498  {
1499  return cell;
1500  }
1501 
1502  inline std::string getFixedBELName()
1503  {
1504  return BELName;
1505  }
1506 
1507  inline std::string getFixedSiteName()
1508  {
1509  return siteName;
1510  }
1511 
1512  private:
1514  // DesignInfo::DesignCellType virtualCellType;
1515  std::string siteName;
1516  std::string BELName;
1518  };
1519 
1525  {
1526  public:
1528  {
1529  PlacementMacroType_LUTFFPair = 0, // LUT-FF pair during incremental packing
1530  PlacementMacroType_LUTLUTSeires, // LUT-LUT pair during incremental packing
1531  PlacementMacroType_FFFFPair, // FF-FF pair during incremental packing
1533  PlacementMacroType_LCLB, // vendor defined primitives, like FFs for system reset, have to be placed in
1534  // SLICEL
1535  PlacementMacroType_MCLB, // LUTRAM cells sharing address/data bits or vendor defined primitives have to be
1536  // placed in SLICEM
1537  PlacementMacroType_CARRY, // chained CARRYs, its directly connected LUTs/FFs and routing BELs.
1538  PlacementMacroType_DSP, // Cascaded DSPs
1539  PlacementMacroType_BRAM, // Cascaded BRAMs
1540  PlacementMacroType_MUX7, // MUXF7, its directly connected LUTs/FFs and routing BELs.
1541  PlacementMacroType_MUX8, // MUXF7, its directly connected MUXF7/LUTs/FFs and routing BELs.
1542  PlacementMacroType_MUX9 // MUXF9, its directly connected MUXF7/MUXF8/LUTs/FFs and routing BELs.
1543  };
1544 
1547  {
1548  fixedCells.clear();
1549  cell2IdInMacro.clear();
1550  cellsInMacro.clear();
1551  cellSet.clear();
1552  // siteOccupations.clear();
1553  top = -10000;
1554  bottom = 10000;
1555  left = 10000;
1556  right = -10000;
1557  };
1559  {
1560  }
1561 
1562  inline bool hasCell(DesignInfo::DesignCell *curCell)
1563  {
1564  return cellSet.find(curCell) != cellSet.end();
1565  }
1566 
1576  inline void addCell(DesignInfo::DesignCell *curCell, DesignInfo::DesignCellType cellType, float x, float y)
1577  {
1578  if (curCell)
1579  {
1580  if (curCell->isBRAM())
1581  addBRAM();
1582  if (curCell->isDSP())
1583  addDSP();
1584  if (!curCell->isVirtualCell())
1585  {
1586  if (curCell->isFF())
1587  addFF();
1588  }
1589  if (curCell->isLUTRAM() || curCell->originallyIsLUTRAM())
1590  addLUTRAM();
1591  if (curCell->isLUT())
1592  addLUT();
1593  if (curCell->isCarry())
1594  addCARRY();
1595  if (curCell->isMux())
1596  addMUX();
1597  curCell->setVirtualType(cellType);
1598  cell2IdInMacro[curCell] = offsetX.size();
1599  cellSet.insert(curCell);
1600  for (auto tmpNet : curCell->getClockNets())
1601  {
1602  clockNets.insert(tmpNet);
1603  }
1604  }
1605  else
1606  {
1607  assert(false && "unexpected");
1608  }
1609  cellsInMacro.push_back(curCell);
1610  cells_Type.push_back(cellType);
1611  offsetX.push_back(x);
1612  offsetY.push_back(y);
1613  if (x < left)
1614  left = x;
1615  if (x > right)
1616  right = x;
1617  if (y < bottom)
1618  bottom = y;
1619  if (y > top)
1620  top = y;
1621  }
1622 
1634  inline DesignInfo::DesignCell *addVirtualCell(std::string virtualCellName, DesignInfo *designInfo,
1635  DesignInfo::DesignCellType cellType, float x, float y)
1636  {
1637  DesignInfo::DesignCell *vCell =
1638  new DesignInfo::DesignCell(true, virtualCellName, cellType, designInfo->getNumCells());
1639  designInfo->addCell(vCell); // add the virtual cell to design info for later processing
1640  cells_Type.push_back(cellType);
1641  cellsInMacro.push_back(vCell);
1642  cell2IdInMacro[vCell] = offsetX.size();
1643  cellSet.insert(vCell);
1644  offsetX.push_back(x);
1645  offsetY.push_back(y);
1646  if (x < left)
1647  left = x;
1648  if (x > right)
1649  right = x;
1650  if (y < bottom)
1651  bottom = y;
1652  if (y > top)
1653  top = y;
1654 
1655  if (vCell->isBRAM())
1656  addBRAM();
1657  if (vCell->isDSP())
1658  addDSP();
1659  // if (vCell->isFF())
1660  // addFF();
1661  if (vCell->isLUTRAM() || vCell->originallyIsLUTRAM())
1662  addLUTRAM();
1663  if (vCell->isLUT())
1664  addLUT();
1665  if (vCell->isCarry())
1666  addCARRY();
1667  if (vCell->isMux())
1668  addMUX();
1669  for (auto tmpNet : vCell->getClockNets())
1670  {
1671  clockNets.insert(tmpNet);
1672  }
1673  return vCell;
1674  }
1675 
1685  inline void addVirtualCell(DesignInfo *designInfo, DesignInfo::DesignCellType cellType, float x, float y)
1686  {
1687  DesignInfo::DesignCell *vCell = new DesignInfo::DesignCell(true, cellType, designInfo->getNumCells());
1688  designInfo->addCell(vCell); // add the virtual cell to design info for later processing
1689  cells_Type.push_back(cellType);
1690  cellsInMacro.push_back(vCell);
1691  cell2IdInMacro[vCell] = offsetX.size();
1692  cellSet.insert(vCell);
1693  offsetX.push_back(x);
1694  offsetY.push_back(y);
1695  if (x < left)
1696  left = x;
1697  if (x > right)
1698  right = x;
1699  if (y < bottom)
1700  bottom = y;
1701  if (y > top)
1702  top = y;
1703 
1704  if (vCell->isBRAM())
1705  addBRAM();
1706  if (vCell->isDSP())
1707  addDSP();
1708  // if (vCell->isFF())
1709  // addFF();
1710  if (vCell->isLUTRAM() || vCell->originallyIsLUTRAM())
1711  addLUTRAM();
1712  if (vCell->isLUT())
1713  addLUT();
1714  if (vCell->isCarry())
1715  addCARRY();
1716  if (vCell->isMux())
1717  addMUX();
1718  for (auto tmpNet : vCell->getClockNets())
1719  {
1720  clockNets.insert(tmpNet);
1721  }
1722  }
1723 
1724  inline std::vector<DesignInfo::DesignCell *> &getCells()
1725  {
1726  return cellsInMacro;
1727  }
1728 
1734  {
1737  {
1738  }
1740  std::string siteName;
1741  std::string BELName;
1743 
1751  inline void addFixedCellInfo(DesignInfo::DesignCell *cell, std::string siteName, std::string BELName)
1752  {
1753  fixedCells.emplace_back(cell, siteName, BELName);
1754  }
1755 
1757  {
1758  assert(cell2IdInMacro.find(cell) != cell2IdInMacro.end());
1759  return offsetX[cell2IdInMacro[cell]];
1760  }
1761 
1763  {
1764  assert(cell2IdInMacro.find(cell) != cell2IdInMacro.end());
1765  return offsetY[cell2IdInMacro[cell]];
1766  }
1767 
1768  // bool setFixedCombination(std::vector<DesignInfo::DesignCell *> _cells, std::vector<std::string> _siteNames,
1769  // std::vector<std::string> _BELNames, DeviceInfo *designInfo);
1770 
1779  inline void getVirtualCellInfo(int vId, float &x, float &y, DesignInfo::DesignCellType &cellType)
1780  {
1781  x = offsetX[vId];
1782  y = offsetY[vId];
1783  cellType = cells_Type[vId];
1784  }
1785 
1787  {
1788  return cells_Type[vId];
1789  }
1790 
1791  inline int getNumOfCells()
1792  {
1793  return cells_Type.size();
1794  }
1795 
1797  {
1798  assert(id < cellsInMacro.size());
1799  return cellsInMacro[id];
1800  }
1801 
1802  inline float getTopOffset()
1803  {
1804  return top;
1805  }
1806  inline float getBottomOffset()
1807  {
1808  return bottom;
1809  }
1810  inline float getLeftOffset()
1811  {
1812  return left;
1813  }
1814  inline float getRightOffset()
1815  {
1816  return right;
1817  }
1818 
1827  inline void addOccupiedSite(float siteOffset, float occ)
1828  {
1829  // siteOccupations.push_back(std::pair<float, float>(siteOffset, occ));
1830  }
1831  // inline std::vector<std::pair<float, float>> &getOccupiedSiteInfo()
1832  // {
1833  // return siteOccupations;
1834  // }
1835 
1837  {
1838  return cellSet.find(curCell) != cellSet.end();
1839  }
1840 
1842  {
1843  return macroType;
1844  }
1845 
1846  inline std::vector<fixedPlacementInfo_inMacro> &getFixedCellInfoVec()
1847  {
1848  return fixedCells;
1849  }
1850 
1851  private:
1852  // std::vector<std::string> siteNames;
1853  // std::vector<std::string> BELNames;
1854  std::set<DesignInfo::DesignCell *> cellSet;
1855  std::map<DesignInfo::DesignCell *, int> cell2IdInMacro;
1856  std::vector<DesignInfo::DesignCell *> cellsInMacro;
1857  std::vector<DesignInfo::DesignCellType>
1858  cells_Type; // BELTypeOccupation.size()>=realCells.size() because somtime a cell or a connection net
1859  // can occupy multiple BEL
1860  std::vector<float> offsetX, offsetY; // offsetX.size() == BELTypeOccupation.size()
1861  std::vector<fixedPlacementInfo_inMacro> fixedCells;
1862  // std::vector<std::pair<float, float>> siteOccupations;
1863  float left, right, top, bottom;
1865  };
1866 
1877  {
1878  public:
1886  PlacementNet(DesignInfo::DesignNet *designNet, int id, std::vector<PlacementUnit *> &cellId2PlacementUnitVec,
1889  {
1890  unitsOfNetPins.clear();
1891  unitsOfDriverPins.clear();
1892  unitsOfPinsBeDriven.clear();
1893  PUSet.clear();
1894  for (DesignInfo::DesignPin *curPin : designNet->getPins())
1895  {
1896  PlacementUnit *tmpPU = cellId2PlacementUnitVec[curPin->getCell()->getElementIdInType()];
1897  unitsOfNetPins.push_back(tmpPU);
1898  PUSet.insert(tmpPU);
1899 
1900  if (curPin->isOutputPort())
1901  {
1902  unitsOfDriverPins.push_back(tmpPU);
1903  }
1904  else
1905  {
1906  unitsOfPinsBeDriven.push_back(tmpPU);
1907  }
1908 
1909  if (tmpPU->getType() == PlacementUnitType_UnpackedCell)
1910  {
1911  pinOffset tmpPinOffset = pinOffset(curPin->getOffsetXInCell(), curPin->getOffsetYInCell());
1912  pinOffsetsInUnit.push_back(tmpPinOffset);
1913  }
1914  else if (tmpPU->getType() == PlacementUnitType_Macro)
1915  {
1916  PlacementMacro *tmpM = dynamic_cast<PlacementMacro *>(tmpPU);
1917  assert(tmpM);
1918  pinOffset tmpPinOffset =
1919  pinOffset(curPin->getOffsetXInCell() + tmpM->getCellOffsetXInMacro(curPin->getCell()),
1920  curPin->getOffsetYInCell() + tmpM->getCellOffsetYInMacro(curPin->getCell()));
1921  pinOffsetsInUnit.push_back(tmpPinOffset);
1922  }
1923  }
1924  leftPuId = rightPuId = topPuId = bottomPuId = -1;
1925  }
1927  {
1928  }
1929 
1930  typedef struct _pinOffset
1931  {
1932  _pinOffset(float x, float y) : x(x), y(y)
1933  {
1934  }
1935  float x = 0.0, y = 0.0;
1937 
1943  inline std::vector<PlacementUnit *> &getUnits()
1944  {
1945  return unitsOfNetPins;
1946  }
1947 
1953  inline std::vector<PlacementUnit *> &getDriverUnits()
1954  {
1955  return unitsOfDriverPins;
1956  }
1957 
1963  inline std::vector<PlacementUnit *> &getUnitsBeDriven()
1964  {
1965  return unitsOfPinsBeDriven;
1966  }
1967 
1974  {
1975  return designNet;
1976  }
1977 
1983  inline int getId()
1984  {
1985  return id;
1986  }
1987 
1993  inline std::vector<pinOffset> &getPinOffsetsInUnit()
1994  {
1995  return pinOffsetsInUnit;
1996  }
1997 
2006  inline bool updateNetBounds(bool updateX, bool updateY)
2007  {
2008  if (updateX)
2009  {
2010  leftPUX = 1e5;
2011  rightPUX = -1e5;
2012  leftPinX = 1e5;
2013  rightPinX = -1e5;
2014  for (unsigned int pinId_net = 0; pinId_net < unitsOfNetPins.size(); pinId_net++)
2015  {
2016  auto tmpPU = unitsOfNetPins[pinId_net];
2017  auto tmpPUId = tmpPU->getId();
2018  auto tmpPinOffset = pinOffsetsInUnit[pinId_net];
2019  float cellX = tmpPU->X();
2020  float pinX = tmpPU->X() + tmpPinOffset.x;
2021  if (pinX < leftPinX)
2022  {
2023  leftPinX = pinX;
2024  leftPUX = cellX;
2025  leftPuId = tmpPUId;
2026  leftPinId_net = pinId_net;
2027  }
2028  if (pinX > rightPinX)
2029  {
2030  rightPinX = pinX;
2031  rightPUX = cellX;
2032  rightPuId = tmpPUId;
2033  rightPinId_net = pinId_net;
2034  }
2035  }
2036  }
2037  if (updateY)
2038  {
2039  topPUY = -1e5;
2040  bottomPUY = 1e5;
2041  topPinY = -1e5;
2042  bottomPinY = 1e5;
2043  for (unsigned int pinId_net = 0; pinId_net < unitsOfNetPins.size(); pinId_net++)
2044  {
2045  auto tmpPU = unitsOfNetPins[pinId_net];
2046  auto tmpPUId = tmpPU->getId();
2047  auto tmpPinOffset = pinOffsetsInUnit[pinId_net];
2048  float cellY = tmpPU->Y();
2049  float pinY = tmpPU->Y() + tmpPinOffset.y;
2050  if (pinY < bottomPinY)
2051  {
2052  bottomPinY = pinY;
2053  bottomPUY = cellY;
2054  bottomPuId = tmpPUId;
2055  bottomPinId_net = pinId_net;
2056  }
2057  if (pinY > topPinY)
2058  {
2059  topPinY = pinY;
2060  topPUY = cellY;
2061  topPuId = tmpPUId;
2062  topPinId_net = pinId_net;
2063  }
2064  }
2065  }
2066  return (updateX && (leftPuId != rightPuId)) || (updateY && (topPuId != bottomPuId));
2067  }
2068 
2076  inline float getHPWL(float y2xRatio)
2077  {
2078  return std::fabs(rightPinX - leftPinX) + y2xRatio * std::fabs(topPinY - bottomPinY);
2079  }
2080 
2093  inline float getNewHPWLByTrying(PlacementUnit *curPU, double targetPUX, double targetPUY, float y2xRatio) const
2094  {
2095  float tmp_leftX = 1e5;
2096  float tmp_rightX = -1e5;
2097  float tmp_topY = -1e5;
2098  float tmp_bottomY = 1e5;
2099 
2100  for (unsigned int pinId_net = 0; pinId_net < unitsOfNetPins.size(); pinId_net++)
2101  {
2102  auto tmpPU = unitsOfNetPins[pinId_net];
2103  auto tmpPinOffset = pinOffsetsInUnit[pinId_net];
2104  float pinX;
2105  if (tmpPU == curPU)
2106  {
2107  pinX = targetPUX + tmpPinOffset.x;
2108  }
2109  else
2110  {
2111  pinX = tmpPU->X() + tmpPinOffset.x;
2112  }
2113  if (pinX < tmp_leftX)
2114  {
2115  tmp_leftX = pinX;
2116  }
2117  if (pinX > tmp_rightX)
2118  {
2119  tmp_rightX = pinX;
2120  }
2121  }
2122  for (unsigned int pinId_net = 0; pinId_net < unitsOfNetPins.size(); pinId_net++)
2123  {
2124  auto tmpPU = unitsOfNetPins[pinId_net];
2125  auto tmpPinOffset = pinOffsetsInUnit[pinId_net];
2126  float pinY;
2127  if (tmpPU == curPU)
2128  {
2129  pinY = targetPUY + tmpPinOffset.y;
2130  }
2131  else
2132  {
2133  pinY = tmpPU->Y() + tmpPinOffset.y;
2134  }
2135  if (pinY < tmp_bottomY)
2136  {
2137  tmp_bottomY = pinY;
2138  }
2139  if (pinY > tmp_topY)
2140  {
2141  tmp_topY = pinY;
2142  }
2143  }
2144 
2145  int A_ClockRegionY, A_ClockRegionX;
2146  placementInfo->getDeviceInfo()->getClockRegionByLocation(tmp_rightX, tmp_bottomY, A_ClockRegionX,
2147  A_ClockRegionY);
2148  std::pair<int, int> A_ClockLocYX(A_ClockRegionY, A_ClockRegionX);
2149 
2150  int B_cellClockRegionY, B_cellClockRegionX;
2151  placementInfo->getDeviceInfo()->getClockRegionByLocation(tmp_leftX, tmp_topY, B_cellClockRegionX,
2152  B_cellClockRegionY);
2153  std::pair<int, int> B_ClockLocYX(B_cellClockRegionY, B_cellClockRegionX);
2154 
2155  float clockRegionOverhead = 0;
2156  // if (B_ClockLocYX != A_ClockLocYX)
2157  // {
2158  // clockRegionOverhead = std::abs(B_cellClockRegionX - A_ClockRegionX) * 15;
2159  // }
2160 
2161  return std::fabs(tmp_rightX - tmp_leftX) + y2xRatio * std::fabs(tmp_topY - tmp_bottomY) +
2162  clockRegionOverhead;
2163  }
2164 
2184  inline void updateBound2BoundNetWeight(std::vector<Eigen::Triplet<float>> &objectiveMatrixTripletList,
2185  std::vector<float> &objectiveMatrixDiag,
2186  Eigen::VectorXd &objectiveVector, float generalWeight, float y2xRatio,
2187  bool updateX, bool updateY, bool checkClockRegion = false)
2188  {
2189  assert(updateX ^ updateY);
2190  if (pinOffsetsInUnit.size() <= 1)
2191  return;
2192  float w = 2.0 * generalWeight / (float)(pinOffsetsInUnit.size() - 1);
2193  int nPins = pinOffsetsInUnit.size();
2194 
2195  // adopt netDegree Weight from RippeFPGA
2196  if (nPins < 10)
2197  w *= 1.00;
2198  else if (nPins < 20)
2199  w *= 1.2;
2200  else if (nPins < 50)
2201  w *= 1.6;
2202  else if (nPins < 100)
2203  w *= 1.8;
2204  else if (nPins < 200)
2205  w *= 2.1;
2206  else
2207  w *= 2.5;
2208 
2209  float tmp_rightX = getRightPinX(), tmp_bottomY = getBottomPinY(), tmp_leftX = getLeftPinX(),
2210  tmp_topY = getTopPinY();
2211 
2212  int A_ClockRegionY, A_ClockRegionX;
2213  placementInfo->getDeviceInfo()->getClockRegionByLocation(tmp_rightX, tmp_bottomY, A_ClockRegionX,
2214  A_ClockRegionY);
2215  std::pair<int, int> A_ClockLocYX(A_ClockRegionY, A_ClockRegionX);
2216 
2217  int B_cellClockRegionY, B_cellClockRegionX;
2218  placementInfo->getDeviceInfo()->getClockRegionByLocation(tmp_leftX, tmp_topY, B_cellClockRegionX,
2219  B_cellClockRegionY);
2220  std::pair<int, int> B_ClockLocYX(B_cellClockRegionY, B_cellClockRegionX);
2221 
2222  float clockRegionW = 0;
2223 
2225  if (updateX)
2226  {
2227  if (checkClockRegion && B_cellClockRegionX != A_ClockRegionX)
2228  {
2229  clockRegionW = 1 + std::abs(B_cellClockRegionX - A_ClockRegionX) * 32 /
2230  (float)(pinOffsetsInUnit.size() - 1) * 0.01;
2231  if (clockRegionW > 3)
2232  clockRegionW = 3;
2233  // w *= clockRegionW;
2234  }
2235 
2236  // add net between left node and right node
2237  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, leftPuId, rightPuId,
2239  !unitsOfNetPins[leftPinId_net]->isFixed(), !unitsOfNetPins[rightPinId_net]->isFixed(),
2241  std::max(minDist, rightPinX - leftPinX));
2242 
2243  // add net between internal node and left/right node
2244  for (unsigned int pinId_net = 0; pinId_net < unitsOfNetPins.size(); pinId_net++)
2245  {
2246  auto tmpPU = unitsOfNetPins[pinId_net];
2247  auto tmpPUId = tmpPU->getId();
2248  auto tmpPinOffset = pinOffsetsInUnit[pinId_net];
2249  float curX = tmpPU->X();
2250  bool movable = !tmpPU->isFixed();
2251  if (pinId_net != leftPinId_net && pinId_net != rightPinId_net)
2252  {
2253  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, tmpPUId, leftPuId,
2254  curX, leftPUX, tmpPinOffset.x, pinOffsetsInUnit[leftPinId_net].x, movable,
2255  !unitsOfNetPins[leftPinId_net]->isFixed(),
2257  std::max(minDist, (curX + tmpPinOffset.x) - leftPinX));
2258  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, tmpPUId, rightPuId,
2259  curX, rightPUX, tmpPinOffset.x, pinOffsetsInUnit[rightPinId_net].x, movable,
2260  !unitsOfNetPins[rightPinId_net]->isFixed(),
2262  std::max(minDist, rightPinX - (curX + tmpPinOffset.x)));
2263  }
2264  }
2265  }
2266  if (updateY)
2267  {
2268 
2269  w *= y2xRatio;
2270 
2271  // add net between top node and bottom node
2272  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, bottomPuId, topPuId,
2274  !unitsOfNetPins[bottomPinId_net]->isFixed(), !unitsOfNetPins[topPinId_net]->isFixed(),
2276  std::max(minDist, topPinY - bottomPinY));
2277 
2278  // add net between internal node and top/bottom node
2279  for (unsigned int pinId_net = 0; pinId_net < unitsOfNetPins.size(); pinId_net++)
2280  {
2281  auto tmpPU = unitsOfNetPins[pinId_net];
2282  auto tmpPUId = tmpPU->getId();
2283  auto tmpPinOffset = pinOffsetsInUnit[pinId_net];
2284  float curY = tmpPU->Y();
2285  bool movable = !tmpPU->isFixed();
2286  if (pinId_net != topPinId_net && pinId_net != bottomPinId_net)
2287  {
2288  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, tmpPUId, bottomPuId,
2289  curY, bottomPUY, tmpPinOffset.y, pinOffsetsInUnit[bottomPinId_net].y, movable,
2290  !unitsOfNetPins[bottomPinId_net]->isFixed(),
2292  std::max(minDist, (curY + tmpPinOffset.y) - bottomPinY));
2293  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, tmpPUId, topPuId,
2294  curY, topPUY, tmpPinOffset.y, pinOffsetsInUnit[topPinId_net].y, movable,
2295  !unitsOfNetPins[topPinId_net]->isFixed(),
2296  designNet->getPinPairEnhanceRatio(pinId_net, topPinId_net) * w /
2297  std::max(minDist, topPinY - (curY + tmpPinOffset.y)));
2298  }
2299  }
2300  }
2301  }
2302 
2303  inline void addPseudoNet_enhancePin2Pin(std::vector<Eigen::Triplet<float>> &objectiveMatrixTripletList,
2304  std::vector<float> &objectiveMatrixDiag,
2305  Eigen::VectorXd &objectiveVector, float generalWeight, float y2xRatio,
2306  bool updateX, bool updateY, int PUIdA, int PUIdB, int pinIdA_net,
2307  int pinIdB_net)
2308  {
2309  float w = generalWeight;
2310 
2311  if (updateX)
2312  {
2313  // add net between left node and right node
2314  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, PUIdA, PUIdB,
2315  unitsOfNetPins[pinIdA_net]->X(), unitsOfNetPins[pinIdB_net]->X(),
2316  pinOffsetsInUnit[pinIdA_net].x, pinOffsetsInUnit[pinIdB_net].x,
2317  !unitsOfNetPins[pinIdA_net]->isFixed(), !unitsOfNetPins[pinIdB_net]->isFixed(), w);
2318  }
2319  if (updateY)
2320  {
2321  w *= y2xRatio;
2322 
2323  // add net between top node and bottom node
2324  addB2BNet(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, PUIdA, PUIdB,
2325  unitsOfNetPins[pinIdA_net]->Y(), unitsOfNetPins[pinIdB_net]->Y(),
2326  pinOffsetsInUnit[pinIdA_net].y, pinOffsetsInUnit[pinIdB_net].y,
2327  !unitsOfNetPins[pinIdA_net]->isFixed(), !unitsOfNetPins[pinIdB_net]->isFixed(), w);
2328  }
2329  }
2330 
2331  void drawNet(float generalWeight = 1.0);
2332 
2353  inline void addB2BNet(std::vector<Eigen::Triplet<float>> &objectiveMatrixTripletList,
2354  std::vector<float> &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, int puId0,
2355  int puId1, float pos0, float pos1, float pinOffset0, float pinOffset1, bool movable0,
2356  bool movable1, float w)
2357  {
2358  // min_x 0.5 * x'Px + q'x
2359  // s.t. l <= Ax <= u
2360  if (puId0 == puId1)
2361  return;
2362  if (movable0 && movable1)
2363  {
2364  // x0^2 + x1^2 - 2x0x1 + 2(x0c-x1c)x0 + 2(x1c-x0c)x1
2365  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId0, puId0, w));
2366  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId1, puId1, w));
2367  objectiveMatrixDiag[puId0] += w;
2368  objectiveMatrixDiag[puId1] += w;
2369  objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId0, puId1, -w));
2370  objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId1, puId0, -w));
2371  if (fabs(pinOffset0) > eps || fabs(pinOffset1) > eps)
2372  {
2373  // 2(x0c-x1c)x0 + 2(x1c-x0c)x1
2374  objectiveVector[puId0] += w * (pinOffset0 - pinOffset1);
2375  objectiveVector[puId1] += w * (pinOffset1 - pinOffset0);
2376  }
2377  }
2378  else if (movable0)
2379  {
2380  // x0^2 - 2x0x1 + 2(x0c-x1c)x0
2381  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId0, puId0, w));
2382  objectiveMatrixDiag[puId0] += w;
2383  objectiveVector[puId0] += -w * pos1;
2384  if (fabs(pinOffset0) > eps || fabs(pinOffset1) > eps)
2385  {
2386  // 2(x0c-x1c)x0
2387  objectiveVector[puId0] += w * (pinOffset0 - pinOffset1);
2388  }
2389  }
2390  else if (movable1)
2391  {
2392  // x1^2 - 2x0x1 + 2(x1c-x0c)x1
2393  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId1, puId1, w));
2394  objectiveMatrixDiag[puId1] += w;
2395  objectiveVector[puId1] += -w * pos0;
2396  if (fabs(pinOffset0) > eps || fabs(pinOffset1) > eps)
2397  {
2398  // 2(x1c-x0c)x1
2399  objectiveVector[puId1] += w * (pinOffset1 - pinOffset0);
2400  }
2401  }
2402  }
2403 
2404  inline std::set<PlacementUnit *> &getPUSet()
2405  {
2406  return PUSet;
2407  }
2408 
2409  inline float getLeftPinX()
2410  {
2411  assert(leftPuId >= 0);
2412  return leftPinX;
2413  }
2414 
2415  inline float getRightPinX()
2416  {
2417  assert(rightPuId >= 0);
2418  return rightPinX;
2419  }
2420 
2421  inline float getTopPinY()
2422  {
2423  assert(topPuId >= 0);
2424  return topPinY;
2425  }
2426 
2427  inline float getBottomPinY()
2428  {
2429  assert(bottomPuId >= 0);
2430  return bottomPinY;
2431  }
2432 
2433  inline int getLeftPUId()
2434  {
2435  assert(leftPuId >= 0);
2436  return leftPuId;
2437  }
2438 
2439  inline int getRightPUId()
2440  {
2441  assert(rightPuId >= 0);
2442  return rightPuId;
2443  }
2444 
2445  inline int getTopPUId()
2446  {
2447  assert(topPuId >= 0);
2448  return topPuId;
2449  }
2450 
2451  inline int getBottomPUId()
2452  {
2453  assert(bottomPuId >= 0);
2454  return bottomPuId;
2455  }
2456 
2457  inline bool isGlobalClock()
2458  {
2459  assert(designNet);
2460  return designNet->checkIsGlobalClock();
2461  }
2462 
2463  private:
2465  std::vector<PlacementUnit *> unitsOfNetPins;
2466  std::vector<PlacementUnit *> unitsOfDriverPins;
2467  std::vector<PlacementUnit *> unitsOfPinsBeDriven;
2468  std::vector<pinOffset> pinOffsetsInUnit;
2469  std::set<PlacementUnit *> PUSet;
2470 
2471  int id;
2477  float eps = 1e-5;
2478  float minDist = 1;
2479  };
2480 
2489  {
2490  public:
2491  ClusterUnit(int id) : id(id)
2492  {
2493  PUs.clear();
2494  totalWeight = 0;
2495  totalBRAMNum = 0;
2496  totalDSPNum = 0;
2497  }
2499  inline int getWeight()
2500  {
2501  return totalWeight;
2502  };
2503  inline int getBRAMNum()
2504  {
2505  return totalBRAMNum;
2506  };
2507  inline int getDSPNum()
2508  {
2509  return totalDSPNum;
2510  };
2511 
2513  {
2514  PUs.push_back(curPU);
2515  totalWeight += curPU->getWeight();
2516  totalBRAMNum += curPU->getBRAMNum();
2517  totalDSPNum += curPU->getDSPNum();
2518  }
2519 
2520  inline std::vector<PlacementInfo::PlacementUnit *> &getUnits()
2521  {
2522  return PUs;
2523  }
2524 
2525  inline int getId()
2526  {
2527  return id;
2528  }
2529 
2530  private:
2531  std::vector<PlacementInfo::PlacementUnit *> PUs;
2533  int id;
2534  };
2535 
2541  {
2542  public:
2543  ClusterNet(int id) : id(id)
2544  {
2545  clusterUnits.clear();
2546  }
2548  inline std::vector<ClusterUnit *> &getUnits()
2549  {
2550  return clusterUnits;
2551  }
2552 
2553  inline int getId()
2554  {
2555  return id;
2556  }
2557 
2558  inline void addClusterUnit(ClusterUnit *tmpCU)
2559  {
2560  clusterUnits.push_back(tmpCU);
2561  }
2562 
2563  private:
2564  std::vector<ClusterUnit *> clusterUnits;
2565  int id;
2566  };
2567 
2575  {
2576  public:
2577  PlacementSiteBinInfo(float leftX, float rightX, float bottomY, float topY, int row, int column)
2579 
2580  {
2581  correspondingSites.clear();
2582  macros.clear();
2583  }
2584 
2585  void addSiteIntoBin(DeviceInfo::DeviceSite *curSite);
2586 
2588  {
2589  correspondingSites.clear();
2590  macros.clear();
2591  }
2592 
2593  inline bool inRange(float x, float y)
2594  {
2595  return (x <= rightX && x > leftX && y <= topY && y > bottomY);
2596  }
2597 
2598  inline bool inRangeY(float y)
2599  {
2600  return (y <= topY && y > bottomY);
2601  }
2602 
2603  inline void addMacroSite(PlacementMacro *curMacro, float occupationAdded)
2604  {
2605  if (curMacro)
2606  macros.push_back(curMacro);
2607  utilization += occupationAdded;
2608  }
2609 
2610  inline void reset()
2611  {
2612  macros.clear();
2613  utilization = 0;
2614  }
2615 
2616  inline std::vector<PlacementMacro *> &getMacros()
2617  {
2618  return macros;
2619  }
2620 
2621  inline float getUtilizationRate()
2622  {
2623  if (capacity == 0)
2624  return utilization / 0.01;
2625  assert(capacity != 0);
2626  return (float)binShrinkRatio * utilization / capacity;
2627  }
2628 
2629  inline float getUtilization()
2630  {
2631  return (float)utilization;
2632  }
2633 
2634  inline float getCapacity()
2635  {
2636  return (float)capacity / binShrinkRatio;
2637  }
2638 
2639  inline bool isOverflow()
2640  {
2641  if (capacity == 0)
2642  {
2643  if (utilization == 0)
2644  return false;
2645  else
2646  return true;
2647  }
2648  assert(capacity != 0);
2649  return ((float)binShrinkRatio * utilization / capacity) > 1.00 + eps;
2650  }
2651 
2652  inline bool canAddMore(int BELAmo)
2653  {
2654  if (capacity == 0)
2655  return false;
2656  return ((float)binShrinkRatio * (utilization + BELAmo) / capacity) <= 1.00 + eps;
2657  }
2658 
2659  inline void setYX(int i, int j)
2660  {
2661  row = i;
2662  column = j;
2663  }
2664 
2665  inline int Y()
2666  {
2667  return row;
2668  }
2669  inline int X()
2670  {
2671  return column;
2672  }
2673 
2674  private:
2675  std::vector<DeviceInfo::DeviceSite *> correspondingSites;
2676  std::vector<PlacementMacro *> macros;
2677  int capacity = 0;
2678  float utilization = 0;
2679  float binShrinkRatio = 1.0;
2680  float leftX;
2681  float rightX;
2682  float topY;
2683  float bottomY;
2684  float eps = 1e-5;
2685  int row;
2686  int column;
2687  };
2688 
2696  PlacementInfo(DesignInfo *designInfo, DeviceInfo *deviceInfo, std::map<std::string, std::string> &JSONCfg);
2698  {
2699  delete compatiblePlacementTable;
2700  for (auto typeGrid : SharedBELTypeBinGrid)
2701  for (auto curRow : typeGrid)
2702  for (auto curBin : curRow)
2703  delete curBin;
2704  for (auto curRow : siteGridForMacros)
2705  for (auto curBin : curRow)
2706  delete curBin;
2707  for (auto pn : placementNets)
2708  delete pn;
2709  }
2710 
2711  void printStat(bool verbose = false);
2712 
2733  std::string cellType2sharedCellTypeFileName,
2734  std::string sharedCellType2BELtypeFileName)
2735  {
2738  }
2739 
2741  {
2742  return compatiblePlacementTable;
2743  }
2744 
2746  {
2748  }
2749 
2756  float getMinXFromSites(std::vector<DeviceInfo::DeviceSite *> &sites);
2757 
2764  float getMinYFromSites(std::vector<DeviceInfo::DeviceSite *> &sites);
2765 
2772  float getMaxXFromSites(std::vector<DeviceInfo::DeviceSite *> &sites);
2773 
2780  float getMaxYFromSites(std::vector<DeviceInfo::DeviceSite *> &sites);
2781 
2788  void createGridBins(float binWidth, float binHeight);
2789  void createSiteBinGrid();
2790 
2796  void reloadNets();
2797 
2802  void updateLongPaths();
2803 
2808  void verifyDeviceForDesign();
2809 
2810  inline std::vector<PlacementUnit *> &getPlacementUnits()
2811  {
2812  return placementUnits;
2813  }
2814  inline std::vector<PlacementMacro *> &getPlacementMacros()
2815  {
2816  return placementMacros;
2817  }
2818  inline std::vector<PlacementUnit *> &getFixedPlacementUnits()
2819  {
2820  return fixedPlacementUnits;
2821  }
2822  inline std::vector<PlacementNet *> &getPlacementNets()
2823  {
2824  return placementNets;
2825  }
2826  inline std::set<DesignInfo::DesignCell *> &getCellInMacros()
2827  {
2828  return cellInMacros;
2829  }
2830  inline std::map<int, PlacementUnit *> &getCellId2PlacementUnit()
2831  {
2832  return cellId2PlacementUnit;
2833  }
2834  inline std::vector<PlacementUnit *> &getCellId2PlacementUnitVec()
2835  {
2836  return cellId2PlacementUnitVec;
2837  }
2838  inline std::vector<PlacementUnpackedCell *> &getPlacementUnpackedCells()
2839  {
2840  return placementUnpackedCells;
2841  }
2842  inline int getNumCells()
2843  {
2844  return designInfo->getNumCells();
2845  }
2846 
2852  inline float getGlobalMaxX()
2853  {
2854  return globalMaxX;
2855  }
2856 
2862  inline float getGlobalMaxY()
2863  {
2864  return globalMaxY;
2865  }
2866 
2872  inline float getGlobalMinX()
2873  {
2874  return globalMinX;
2875  }
2876 
2882  inline float getGlobalMinY()
2883  {
2884  return globalMinY;
2885  }
2886 
2892  inline float getGlobalBinMaxLocX()
2893  {
2894  return endX;
2895  }
2896 
2902  inline float getGlobalBinMaxLocY()
2903  {
2904  return endY;
2905  }
2906 
2912  inline float getGlobalBinMinLocX()
2913  {
2914  return startX;
2915  }
2916 
2922  inline float getGlobalBinMinLocY()
2923  {
2924  return startY;
2925  }
2926 
2927  inline float getDeviceMaxEdgeLength()
2928  {
2929  return std::max(endX - startX, endY - startY);
2930  }
2931 
2932  inline std::vector<int> &getPotentialBELTypeIDs(DesignInfo::DesignCell *cell)
2933  {
2935  }
2936 
2937  inline std::vector<int> &getPotentialBELTypeIDs(DesignInfo::DesignCellType cellType)
2938  {
2940  }
2941 
2942  inline int getSharedBELTypeId(std::string tmpStr)
2943  {
2945  }
2946 
2958  {
2960  }
2961 
2969  {
2971  }
2972 
2973  inline std::vector<float> &getcellId2Occupation()
2974  {
2976  }
2977 
2985  {
2986  return compatiblePlacementTable->getOccupation(cellType);
2987  }
2988 
2995  inline float getActualOccupationByCellId(int id)
2996  {
2998  }
2999 
3008  inline std::vector<DesignInfo::DesignCell *> *
3009  findNeiborLUTFFsFromBinGrid(DesignInfo::DesignCell *curCell, float displacementUpperbound, int minNumNeighbor = 10)
3010  {
3011  // please note that the input DesignCell is only used to find the corresponding binGrid for site search.
3012  bool findLUT = curCell->isLUT();
3013  float targetX = cellId2location[curCell->getCellId()].X;
3014  float targetY = cellId2location[curCell->getCellId()].Y;
3015  std::vector<DesignInfo::DesignCell *> *res = new std::vector<DesignInfo::DesignCell *>();
3016  res->clear();
3017 
3018  int binIdX, binIdY;
3019  getGridXY(targetX, targetY, binIdX, binIdY);
3020 
3021  assert(binIdY >= 0);
3022  assert((unsigned int)binIdY < LUTFFBinGrid.size());
3023  assert(binIdX >= 0);
3024  assert((unsigned int)binIdX < LUTFFBinGrid[binIdY].size());
3025  assert(LUTFFBinGrid[binIdY][binIdX]->inRange(targetX, targetY));
3026 
3027  std::queue<std::pair<int, int>> binXYqueue;
3028  std::set<std::pair<int, int>> reachedBinXYs;
3029  binXYqueue.emplace(binIdX, binIdY);
3030  reachedBinXYs.emplace(binIdX, binIdY);
3031 
3032  bool findItself = false;
3033 
3034  while (binXYqueue.size() > 0)
3035  {
3036  std::pair<int, int> curXY = binXYqueue.front();
3037  binXYqueue.pop();
3038  int curbinIdX = curXY.first, curbinIdY = curXY.second;
3039 
3040  PlacementInfo::PlacementBinInfo *curBin = LUTFFBinGrid[curbinIdY][curbinIdX];
3041  float bin2TargetXYDistance = curBin->getManhattanDistanceTo(targetX, targetY);
3042  if (bin2TargetXYDistance > displacementUpperbound)
3043  continue;
3044  for (auto tmpCell : curBin->getCells())
3045  {
3046  if ((tmpCell->isLUT() && findLUT) || (tmpCell->isFF() && !findLUT))
3047  {
3048  float tmpX = cellId2location[tmpCell->getCellId()].X;
3049  float tmpY = cellId2location[tmpCell->getCellId()].Y;
3050  float tmpPUDis = fabs(targetX - tmpX) + y2xRatio * fabs(targetY - tmpY);
3051  if (tmpPUDis <= displacementUpperbound)
3052  {
3053  if (tmpCell == curCell)
3054  {
3055  findItself = true;
3056  }
3057  res->push_back(tmpCell);
3058  }
3059  }
3060  }
3061  assert(findItself);
3062  for (int nextY = curbinIdY - 1; nextY <= curbinIdY + 1; nextY++)
3063  {
3064  for (int nextX = curbinIdX - 1; nextX <= curbinIdX + 1; nextX++)
3065  {
3066  if (!(nextY >= 0))
3067  continue;
3068  if (!((unsigned int)nextY < LUTFFBinGrid.size()))
3069  continue;
3070  if (!(nextX >= 0))
3071  continue;
3072  if (!((unsigned int)nextX < LUTFFBinGrid[binIdY].size()))
3073  continue;
3074  PlacementInfo::PlacementBinInfo *nextBin = LUTFFBinGrid[nextY][nextX];
3075  float nextBin2TargetXYDistance = nextBin->getManhattanDistanceTo(targetX, targetY);
3076  if (nextBin2TargetXYDistance > displacementUpperbound)
3077  continue;
3078  std::pair<int, int> nextXY(nextX, nextY);
3079  if (reachedBinXYs.find(nextXY) == reachedBinXYs.end())
3080  {
3081  reachedBinXYs.insert(nextXY);
3082  binXYqueue.push(nextXY);
3083  }
3084  }
3085  }
3086  }
3087 
3088  assert(findItself);
3089  return res;
3090  }
3091 
3099  inline std::vector<std::vector<PlacementBinInfo *>> &getBinGrid(unsigned int BELTypeId)
3100  {
3101  assert(BELTypeId < SharedBELTypeBinGrid.size());
3102  return SharedBELTypeBinGrid[BELTypeId];
3103  }
3104 
3110  inline std::vector<std::vector<std::vector<PlacementBinInfo *>>> &getBinGrid()
3111  {
3112  return SharedBELTypeBinGrid;
3113  }
3114 
3115  inline std::vector<std::vector<PlacementSiteBinInfo *>> &getSiteBinGrid()
3116  {
3117  return siteGridForMacros;
3118  }
3119 
3121  {
3122  assert(curCell);
3123  assert((unsigned int)curCell->getCellId() < cellId2PlacementUnitVec.size());
3124  return cellId2PlacementUnitVec[curCell->getCellId()];
3125  }
3126 
3128  {
3129  assert(cellId >= 0);
3130  assert((unsigned int)cellId < cellId2PlacementUnitVec.size());
3131  return cellId2PlacementUnitVec[cellId];
3132  }
3133 
3135  {
3136  assert((unsigned int)netId < designNetId2PlacementNet.size());
3137  return designNetId2PlacementNet[netId];
3138  }
3139 
3159  inline void addB2BNetInPlacementInfo(std::vector<Eigen::Triplet<float>> &objectiveMatrixTripletList,
3160  std::vector<float> &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector,
3161  int puId0, int puId1, float pos0, float pos1, float pinOffset0,
3162  float pinOffset1, bool movable0, bool movable1, float w)
3163  {
3164  // min_x 0.5 * x'Px + q'x
3165  // s.t. l <= Ax <= u
3166  if (puId0 == puId1)
3167  return;
3168  if (movable0 && movable1)
3169  {
3170  // x0^2 + x1^2 - 2x0x1 + 2(x0c-x1c)x0 + 2(x1c-x0c)x1
3171  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId0, puId0, w));
3172  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId1, puId1, w));
3173  objectiveMatrixDiag[puId0] += w;
3174  objectiveMatrixDiag[puId1] += w;
3175  objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId0, puId1, -w));
3176  objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId1, puId0, -w));
3177  if (fabs(pinOffset0) > eps || fabs(pinOffset1) > eps)
3178  {
3179  // 2(x0c-x1c)x0 + 2(x1c-x0c)x1
3180  objectiveVector[puId0] += w * (pinOffset0 - pinOffset1);
3181  objectiveVector[puId1] += w * (pinOffset1 - pinOffset0);
3182  }
3183  }
3184  else if (movable0)
3185  {
3186  // x0^2 - 2x0x1 + 2(x0c-x1c)x0
3187  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId0, puId0, w));
3188  objectiveMatrixDiag[puId0] += w;
3189  objectiveVector[puId0] += -w * pos1;
3190  if (fabs(pinOffset0) > eps || fabs(pinOffset1) > eps)
3191  {
3192  // 2(x0c-x1c)x0
3193  objectiveVector[puId0] += w * (pinOffset0 - pinOffset1);
3194  }
3195  }
3196  else if (movable1)
3197  {
3198  // x1^2 - 2x0x1 + 2(x1c-x0c)x1
3199  // objectiveMatrixTripletList.push_back(Eigen::Triplet<float>(puId1, puId1, w));
3200  objectiveMatrixDiag[puId1] += w;
3201  objectiveVector[puId1] += -w * pos0;
3202  if (fabs(pinOffset0) > eps || fabs(pinOffset1) > eps)
3203  {
3204  // 2(x1c-x0c)x1
3205  objectiveVector[puId1] += w * (pinOffset1 - pinOffset0);
3206  }
3207  }
3208  }
3209 
3228  inline void addPseudoNetsInPlacementInfo(std::vector<Eigen::Triplet<float>> &objectiveMatrixTripletList,
3229  std::vector<float> &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector,
3230  PlacementUnit *tmpPU, float targetLoc, float pseudoWeight, float y2xRatio,
3231  bool updateX, bool updateY)
3232  {
3233  assert(updateX ^ updateY);
3234  if (updateY)
3235  {
3236  pseudoWeight *= y2xRatio;
3237  }
3238  bool movable = !tmpPU->isFixed();
3239  if (movable)
3240  {
3241  addB2BNetInPlacementInfo(objectiveMatrixTripletList, objectiveMatrixDiag, objectiveVector, tmpPU->getId(),
3242  -1, targetLoc, targetLoc, 0, 0, true, false, pseudoWeight);
3243  }
3244  }
3245 
3251 
3256  void updateElementBinGrid();
3257 
3263  void adjustLUTFFUtilization_Routability(bool enfore);
3264 
3270 
3277  void adjustLUTFFUtilization_Packablity(float neighborDisplacementUpperbound, bool enfore);
3278 
3285  void adjustLUTFFUtilization(float neighborDisplacementUpperbound, bool enfore = false);
3286 
3292 
3297  void resetElementBinGrid();
3298 
3299  void updateSiteBinGrid();
3300 
3301  void resetSiteBinGrid();
3302 
3304  {
3305  return designInfo;
3306  }
3307 
3309  {
3310  return deviceInfo;
3311  }
3312 
3314  {
3316  }
3317 
3331  inline std::string getBELType2FalseBELType(std::string curBELType)
3332  {
3333  return deviceInfo->getBELType2FalseBELType(curBELType);
3334  }
3335 
3344  inline void getGridXY(float cellX, float cellY, int &binIdX, int &binIdY)
3345  {
3346 
3347  float coord_offsetX = cellX - startX;
3348  float coord_offsetY = cellY - startY;
3349  binIdX = static_cast<int>((coord_offsetX) / binWidth);
3350  binIdY = static_cast<int>((coord_offsetY) / binHeight);
3351  if (binIdY < 0)
3352  binIdY = 0;
3353  if (binIdX < 0)
3354  binIdX = 0;
3355  }
3356 
3364  inline void legalizeXYInArea(PlacementUnit *curPU, float &fX, float &fY)
3365  {
3366  if (curPU->getType() == PlacementUnitType_UnpackedCell)
3367  {
3368  fX = std::max(globalMinX + eps, (std::min(fX, globalMaxX - eps)));
3369  fY = std::max(globalMinY + eps, (std::min(fY, globalMaxY - eps)));
3370  }
3371  else if (auto curMacro = dynamic_cast<PlacementMacro *>(curPU))
3372  {
3373  if (fY + curMacro->getTopOffset() > globalMaxY - eps)
3374  {
3375  fY = (globalMaxY - 2 * eps) - curMacro->getTopOffset();
3376  }
3377  else if (fY + curMacro->getBottomOffset() < globalMinY + eps)
3378  {
3379  fY = (globalMinY + 2 * eps) - curMacro->getBottomOffset();
3380  }
3381 
3382  if (fX + curMacro->getRightOffset() > globalMaxX - eps)
3383  {
3384  fX = (globalMaxX - 2 * eps) - curMacro->getRightOffset();
3385  }
3386  else if (fX + curMacro->getLeftOffset() < globalMinX + eps)
3387  {
3388  fX = (globalMinX + 2 * eps) - curMacro->getLeftOffset();
3389  }
3390  }
3391  else
3392  {
3393  assert(false && "wrong placement unit type");
3394  }
3395  }
3396 
3403  {
3404  float fX = curPU->X();
3405  float fY = curPU->Y();
3406  if (curPU->getType() == PlacementUnitType_UnpackedCell)
3407  {
3408  fX = std::max(globalMinX + eps, (std::min(fX, globalMaxX - eps)));
3409  fY = std::max(globalMinY + eps, (std::min(fY, globalMaxY - eps)));
3410  }
3411  else if (auto curMacro = dynamic_cast<PlacementMacro *>(curPU))
3412  {
3413  if (fY + curMacro->getTopOffset() > globalMaxY - eps)
3414  {
3415  fY = (globalMaxY - 2 * eps) - curMacro->getTopOffset();
3416  }
3417  else if (fY + curMacro->getBottomOffset() < globalMinY + eps)
3418  {
3419  fY = (globalMinY + 2 * eps) - curMacro->getBottomOffset();
3420  }
3421 
3422  if (fX + curMacro->getRightOffset() > globalMaxX - eps)
3423  {
3424  fX = (globalMaxX - 2 * eps) - curMacro->getRightOffset();
3425  }
3426  else if (fX + curMacro->getLeftOffset() < globalMinX + eps)
3427  {
3428  fX = (globalMinX + 2 * eps) - curMacro->getLeftOffset();
3429  }
3430  }
3431  else
3432  {
3433  assert(false && "wrong placement unit type");
3434  }
3435  if (fX != curPU->X() || fY != curPU->Y())
3436  {
3438  }
3439  }
3440 
3452  inline bool isLegalLocation(DesignInfo::DesignCell *curCell, float targetX, float targetY)
3453  {
3454  auto curPU = cellId2PlacementUnit[curCell->getCellId()];
3455 
3456  if (curPU->getType() == PlacementUnitType_UnpackedCell)
3457  {
3458  float fX = targetX;
3459  float fY = targetY;
3460  fX = std::max(globalMinX + eps, (std::min(fX, globalMaxX - eps)));
3461  fY = std::max(globalMinY + eps, (std::min(fY, globalMaxY - eps)));
3462  return (std::fabs(fX - targetX) + std::fabs(fY - targetY)) < eps;
3463  }
3464  else if (auto curMacro = dynamic_cast<PlacementMacro *>(curPU))
3465  {
3466  float offsetX = curMacro->getCellOffsetXInMacro(curCell);
3467  float offsetY = curMacro->getCellOffsetYInMacro(curCell);
3468  float fX = targetX - offsetX;
3469  float fY = targetY - offsetY;
3470  if (fY + curMacro->getTopOffset() > globalMaxY - eps)
3471  {
3472  fY = (globalMaxY - 2 * eps) - curMacro->getTopOffset();
3473  }
3474  else if (fY + curMacro->getBottomOffset() < globalMinY + eps)
3475  {
3476  fY = (globalMinY + 2 * eps) - curMacro->getBottomOffset();
3477  }
3478 
3479  if (fX + curMacro->getRightOffset() > globalMaxX - eps)
3480  {
3481  fX = (globalMaxX - 2 * eps) - curMacro->getRightOffset();
3482  }
3483  else if (fX + curMacro->getLeftOffset() < globalMinX + eps)
3484  {
3485  fX = (globalMinX + 2 * eps) - curMacro->getLeftOffset();
3486  }
3487  return (std::fabs(fX + offsetX - targetX) + std::fabs(fY + offsetY - targetY)) < eps;
3488  }
3489  else
3490  {
3491  assert(false && "should not reach here");
3492  return false;
3493  }
3494  }
3495 
3506  inline bool isLegalLocation(PlacementUnit *curPU, float targetX, float targetY)
3507  {
3508  if (curPU->getType() == PlacementUnitType_UnpackedCell)
3509  {
3510  float fX = targetX;
3511  float fY = targetY;
3512  fX = std::max(globalMinX + eps, (std::min(fX, globalMaxX - eps)));
3513  fY = std::max(globalMinY + eps, (std::min(fY, globalMaxY - eps)));
3514  return (std::fabs(fX - targetX) + std::fabs(fY - targetY)) < eps;
3515  }
3516  else if (auto curMacro = dynamic_cast<PlacementMacro *>(curPU))
3517  {
3518  float fX = targetX;
3519  float fY = targetY;
3520  if (fY + curMacro->getTopOffset() > globalMaxY - eps)
3521  {
3522  fY = (globalMaxY - 2 * eps) - curMacro->getTopOffset();
3523  }
3524  else if (fY + curMacro->getBottomOffset() < globalMinY + eps)
3525  {
3526  fY = (globalMinY + 2 * eps) - curMacro->getBottomOffset();
3527  }
3528 
3529  if (fX + curMacro->getRightOffset() > globalMaxX - eps)
3530  {
3531  fX = (globalMaxX - 2 * eps) - curMacro->getRightOffset();
3532  }
3533  else if (fX + curMacro->getLeftOffset() < globalMinX + eps)
3534  {
3535  fX = (globalMinX + 2 * eps) - curMacro->getLeftOffset();
3536  }
3537  return (std::fabs(fX - targetX) + std::fabs(fY - targetY)) < eps;
3538  }
3539  else
3540  {
3541  assert(false && "should not reach here");
3542  return false;
3543  }
3544  }
3545 
3546  inline void getPULocationByCellLocation(DesignInfo::DesignCell *curCell, float targetX, float targetY, float &PUX,
3547  float &PUY)
3548  {
3549  auto curPU = cellId2PlacementUnit[curCell->getCellId()];
3550 
3551  if (curPU->getType() == PlacementUnitType_UnpackedCell)
3552  {
3553  float fX = targetX;
3554  float fY = targetY;
3555  fX = std::max(globalMinX + eps, (std::min(fX, globalMaxX - eps)));
3556  fY = std::max(globalMinY + eps, (std::min(fY, globalMaxY - eps)));
3557  PUX = fX;
3558  PUY = fY;
3559  }
3560  else if (auto curMacro = dynamic_cast<PlacementMacro *>(curPU))
3561  {
3562  float offsetX = curMacro->getCellOffsetXInMacro(curCell);
3563  float offsetY = curMacro->getCellOffsetYInMacro(curCell);
3564  float fX = targetX - offsetX;
3565  float fY = targetY - offsetY;
3566  if (fY + curMacro->getTopOffset() > globalMaxY - eps)
3567  {
3568  fY = (globalMaxY - 2 * eps) - curMacro->getTopOffset();
3569  }
3570  else if (fY + curMacro->getBottomOffset() < globalMinY + eps)
3571  {
3572  fY = (globalMinY + 2 * eps) - curMacro->getBottomOffset();
3573  }
3574 
3575  if (fX + curMacro->getRightOffset() > globalMaxX - eps)
3576  {
3577  fX = (globalMaxX - 2 * eps) - curMacro->getRightOffset();
3578  }
3579  else if (fX + curMacro->getLeftOffset() < globalMinX + eps)
3580  {
3581  fX = (globalMinX + 2 * eps) - curMacro->getLeftOffset();
3582  }
3583  PUX = fX;
3584  PUY = fY;
3585  }
3586  else
3587  {
3588  PUX = -1;
3589  PUY = -1;
3590  assert(false && "should not reach here.");
3591  }
3592  }
3593 
3594  typedef struct Location
3595  {
3596  float X = -10;
3597  float Y = -10;
3599 
3600  inline std::vector<Location> &getCellId2location()
3601  {
3602  return cellId2location;
3603  }
3604 
3605  inline std::vector<Location> &getPinId2location()
3606  {
3607  return pinId2location;
3608  }
3609 
3615  inline float getBinGridW()
3616  {
3617  return binWidth;
3618  }
3619 
3625  inline float getBinGridH()
3626  {
3627  return binHeight;
3628  }
3629 
3634  typedef struct CellBinInfo
3635  {
3636  int sharedTypeId = -1;
3637  int X = -1;
3638  int Y = -1;
3639  float occupation = -1;
3641 
3648  inline void setPULegalXY(std::map<PlacementInfo::PlacementUnit *, float> &PU2X,
3649  std::map<PlacementInfo::PlacementUnit *, float> &PU2Y)
3650  {
3651  for (auto tmpPair : PU2X) // only update elements in PU2X and PU2Y
3652  {
3653  PULegalXY.first[tmpPair.first] = tmpPair.second;
3654  }
3655  for (auto tmpPair : PU2Y)
3656  {
3657 
3658  PULegalXY.second[tmpPair.first] = tmpPair.second;
3659  }
3660  }
3661 
3667  inline void
3668  setPULegalSite(std::map<PlacementInfo::PlacementUnit *, std::vector<DeviceInfo::DeviceSite *>> &PU2Sites)
3669  {
3670  for (auto tmpPair : PU2Sites) // only update elements in PU2X and PU2Y
3671  {
3672  PU2LegalSites[tmpPair.first] = tmpPair.second;
3673  }
3674  }
3675 
3681  inline std::map<PlacementInfo::PlacementUnit *, std::vector<DeviceInfo::DeviceSite *>> &getPULegalSite()
3682  {
3683  return PU2LegalSites;
3684  }
3685 
3692  inline std::pair<std::map<PlacementInfo::PlacementUnit *, float>, std::map<PlacementInfo::PlacementUnit *, float>> &
3694  {
3695  return PULegalXY;
3696  }
3697 
3703  {
3704  PULegalXY.first = std::map<PlacementInfo::PlacementUnit *, float>();
3705  PULegalXY.second = std::map<PlacementInfo::PlacementUnit *, float>();
3706  PU2LegalSites.clear();
3707  }
3708 
3715  {
3716  if (PU2LegalSites.find(curPU) != PU2LegalSites.end())
3717  PU2LegalSites.erase(curPU);
3718  if (PULegalXY.first.find(curPU) != PULegalXY.first.end())
3719  PULegalXY.first.erase(curPU);
3720  if (PULegalXY.second.find(curPU) != PULegalXY.second.end())
3721  PULegalXY.second.erase(curPU);
3722  }
3723 
3733  inline void setCellBinInfo(int cellId, int sharedTypeId, int X, int Y, float occupation)
3734  {
3735  assert((unsigned int)cellId < cellId2CellBinInfo.size());
3736  cellId2CellBinInfo[cellId].sharedTypeId = sharedTypeId;
3737  cellId2CellBinInfo[cellId].X = X;
3738  cellId2CellBinInfo[cellId].Y = Y;
3739  cellId2CellBinInfo[cellId].occupation = occupation;
3740  }
3741 
3751  inline void transferCellBinInfo(int cellId, float fX, int fY)
3752  {
3753  assert((unsigned int)cellId < cellId2CellBinInfo.size());
3754  int binIdX, binIdY;
3755  getGridXY(fX, fY, binIdX, binIdY);
3756  assert(binIdY >= 0);
3757  assert((unsigned int)binIdY < SharedBELTypeBinGrid[cellId2CellBinInfo[cellId].sharedTypeId].size());
3758  assert(binIdX >= 0);
3759  assert((unsigned int)binIdX < SharedBELTypeBinGrid[cellId2CellBinInfo[cellId].sharedTypeId][binIdY].size());
3760  if (cellId2CellBinInfo[cellId].X == binIdX && cellId2CellBinInfo[cellId].Y == binIdY)
3761  return;
3762 
3763  assert(cellId2CellBinInfo[cellId].occupation >= 0);
3764  SharedBELTypeBinGrid[cellId2CellBinInfo[cellId].sharedTypeId][cellId2CellBinInfo[cellId].Y]
3765  [cellId2CellBinInfo[cellId].X]
3766  ->removeCell(designInfo->getCells()[cellId], cellId2CellBinInfo[cellId].occupation);
3767  SharedBELTypeBinGrid[cellId2CellBinInfo[cellId].sharedTypeId][binIdY][binIdX]->addCell(
3768  designInfo->getCells()[cellId], cellId2CellBinInfo[cellId].occupation);
3769  cellId2CellBinInfo[cellId].X = binIdX;
3770  cellId2CellBinInfo[cellId].Y = binIdY;
3771  }
3772 
3781  inline float getDisplacement(float fX, float fY, DeviceInfo::DeviceSite *curSite)
3782  {
3783  return std::fabs(fX - curSite->X()) + y2xRatio * std::fabs(fY - curSite->Y());
3784  }
3785 
3798  inline std::vector<DeviceInfo::DeviceSite *> *
3799  findNeiborSiteFromBinGrid(DesignInfo::DesignCell *curCell, float targetX, float targetY,
3800  float displacementThreshold, int siteNumThreshold, bool checkClockRegion = false)
3801  {
3802  // please note that the input DesignCell is only used to find the corresponding binGrid for site search.
3803  std::vector<DeviceInfo::DeviceSite *> *res = new std::vector<DeviceInfo::DeviceSite *>(0);
3804 
3805  int binIdX, binIdY;
3806  getGridXY(targetX, targetY, binIdX, binIdY);
3807  auto curPU = getPlacementUnitByCellId(curCell->getCellId());
3808  int targetClockRegionX = -1;
3809  if (PU2ClockRegionColumn.find(curPU) != PU2ClockRegionColumn.end() && checkClockRegion)
3810  {
3811  targetClockRegionX = PU2ClockRegionColumn[curPU];
3812  }
3813 
3814  while (res->size() == 0)
3815  {
3816  auto sharedTypeIds = getPotentialBELTypeIDs(curCell->getCellType());
3817 
3818  for (auto sharedTypeId : sharedTypeIds)
3819  {
3820  assert((unsigned int)curCell->getCellId() < cellId2CellBinInfo.size());
3821  assert(binIdY >= 0);
3822  assert((unsigned int)binIdY < SharedBELTypeBinGrid[sharedTypeId].size());
3823  assert(binIdX >= 0);
3824  assert((unsigned int)binIdX < SharedBELTypeBinGrid[sharedTypeId][binIdY].size());
3825 
3826  std::vector<std::vector<PlacementBinInfo *>> &curBinGrid = SharedBELTypeBinGrid[sharedTypeId];
3827 
3828  std::queue<std::pair<int, int>> binXYqueue;
3829  std::set<std::pair<int, int>> reachedBinXYs;
3830  binXYqueue.emplace(binIdX, binIdY);
3831  reachedBinXYs.emplace(binIdX, binIdY);
3832 
3833  while (binXYqueue.size() > 0)
3834  {
3835  std::pair<int, int> curXY = binXYqueue.front();
3836  binXYqueue.pop();
3837  int curbinIdX = curXY.first, curbinIdY = curXY.second;
3838 
3839  PlacementBinInfo *curBin = curBinGrid[curbinIdY][curbinIdX];
3840  float bin2TargetXYDistance = curBin->getManhattanDistanceTo(targetX, targetY);
3841  if (bin2TargetXYDistance > displacementThreshold)
3842  continue;
3843  int findSiteCnt = 0;
3844  for (auto curSite : curBin->getCorrespondingSites())
3845  {
3846  if (!curSite->isOccupied() && !curSite->isMapped())
3847  {
3848  if (getDisplacement(targetX, targetY, curSite) < displacementThreshold)
3849  {
3850  findSiteCnt++;
3851  if (targetClockRegionX >= 0 && targetClockRegionX != curSite->getClockRegionX())
3852  continue;
3853  res->push_back(curSite);
3854  }
3855  }
3856  }
3857 
3858  if (res->size() < (unsigned int)siteNumThreshold)
3859  {
3860  for (int nextY = curbinIdY - 1; nextY <= curbinIdY + 1; nextY++)
3861  {
3862  for (int nextX = curbinIdX - 1; nextX <= curbinIdX + 1; nextX++)
3863  {
3864  if (!(nextY >= 0))
3865  continue;
3866  if (!((unsigned int)nextY < SharedBELTypeBinGrid[sharedTypeId].size()))
3867  continue;
3868  if (!(nextX >= 0))
3869  continue;
3870  if (!((unsigned int)nextX < SharedBELTypeBinGrid[sharedTypeId][binIdY].size()))
3871  continue;
3872  PlacementBinInfo *nextBin = curBinGrid[nextY][nextX];
3873  float nextBin2TargetXYDistance = nextBin->getManhattanDistanceTo(targetX, targetY);
3874  if (nextBin2TargetXYDistance > displacementThreshold)
3875  continue;
3876  std::pair<int, int> nextXY(nextX, nextY);
3877  if (reachedBinXYs.find(nextXY) == reachedBinXYs.end())
3878  {
3879  reachedBinXYs.insert(nextXY);
3880  binXYqueue.push(nextXY);
3881  }
3882  }
3883  }
3884  }
3885  }
3886  }
3887  displacementThreshold *= 1.5;
3888  }
3889 
3890  return res;
3891  }
3892 
3893  inline std::vector<CellBinInfo> &getCellId2CellBinInfo()
3894  {
3895  return cellId2CellBinInfo;
3896  }
3897 
3898  inline std::vector<DesignInfo::DesignCell *> &getCells()
3899  {
3900  return designInfo->getCells();
3901  }
3902 
3903  inline std::vector<std::vector<PlacementNet *>> &getPlacementUnitId2Nets()
3904  {
3905  return placementUnitId2Nets;
3906  }
3907 
3914  {
3915  double totalHPWL = 0.0;
3916  int numNet = placementNets.size();
3917 
3918 #pragma omp parallel for
3919  for (int netId = 0; netId < numNet; netId++)
3920  {
3921  auto net = placementNets[netId];
3922  net->updateNetBounds(true, true);
3923  }
3924 
3925  //#pragma omp parallel for reduction(+ : totalHPWL)
3926  for (int netId = 0; netId < numNet; netId++)
3927  {
3928  auto net = placementNets[netId];
3929  totalHPWL += net->getHPWL(y2xRatio);
3930  }
3931  return totalHPWL;
3932  }
3933 
3939  double getTotalHPWL()
3940  {
3941  double totalHPWL = 0.0;
3942  int numNet = placementNets.size();
3943  //#pragma omp parallel for reduction(+ : totalHPWL)
3944  for (int netId = 0; netId < numNet; netId++)
3945  {
3946  auto net = placementNets[netId];
3947  totalHPWL += net->getHPWL(y2xRatio);
3948  }
3949  return totalHPWL;
3950  }
3951 
3959  inline void setProgress(float p)
3960  {
3962  }
3963 
3969  inline float getProgress()
3970  {
3971  return placementProressRatio;
3972  }
3973 
3979  void dumpCongestion(std::string dumpFileName);
3980 
3991  void dumpVivadoPlacementTclWithPULegalizationInfo(std::string dumpFile);
3992 
3998  void dumpPlacementUnitInformation(std::string dumpFile);
3999 
4005  void loadPlacementUnitInformation(std::string locationFile);
4006 
4014  inline void setPseudoNetWeight(float weight)
4015  {
4017  }
4018 
4026  inline float getPseudoNetWeight()
4027  {
4028  assert(oriPseudoNetWeight > 0 && "should be set before get");
4029  return oriPseudoNetWeight;
4030  }
4031 
4041  {
4042  if (JSONCfg.find("DirectMacroLegalize") != JSONCfg.end())
4043  {
4044  if (JSONCfg["DirectMacroLegalize"] == "true")
4045  {
4046  return macroPseudoNetEnhanceCnt;
4047  }
4048  }
4049  assert(macroPseudoNetEnhanceCnt > 0 && "should be set before get");
4050  return macroPseudoNetEnhanceCnt;
4051  }
4052 
4061  {
4062  assert(macroLegalizationWeight > 0 && "should be set before get");
4063  return macroLegalizationWeight;
4064  }
4065 
4075  inline void setMacroLegalizationParameters(int cnt, float _macroLegalizationWeight)
4076  {
4078  macroLegalizationWeight = _macroLegalizationWeight;
4079  }
4080 
4088  {
4090  }
4091 
4099  inline int getDeterminedOccupation(int cellId)
4100  {
4101  return designInfo->getDeterminedOccupation(cellId);
4102  }
4103 
4112  inline void setDeterminedOccupation(int cellId, int occupation)
4113  {
4114  designInfo->setDeterminedOccupation(cellId, occupation);
4115  }
4116 
4128  {
4129  if (LUTA->getInputPins().size() == 6 || LUTB->getInputPins().size() == 6 || LUTA->isLUT6() || LUTB->isLUT6())
4130  return 12;
4131 
4132  int pinNumA = 0;
4133  int totalPin = 0;
4134  int netIds[5]; // be aware that a LUT might have pins connected to the same net and they should be treated as
4135  // different inputs.
4136 
4137  for (auto tmpPin : LUTA->getInputPins())
4138  {
4139  if (!tmpPin->isUnconnected())
4140  {
4141  netIds[pinNumA] = tmpPin->getNet()->getElementIdInType();
4142  pinNumA++;
4143  }
4144  }
4145  totalPin = pinNumA;
4146  for (auto tmpPin : LUTB->getInputPins())
4147  {
4148  if (!tmpPin->isUnconnected())
4149  {
4150  bool matched = false;
4151  for (int i = 0; i < pinNumA; i++)
4152  {
4153  if (netIds[i] >= 0 && netIds[i] == tmpPin->getNet()->getElementIdInType())
4154  {
4155  netIds[i] = -1;
4156  matched = true;
4157  break;
4158  }
4159  }
4160  if (!matched)
4161  {
4162  totalPin++;
4163  }
4164  }
4165  }
4166  return totalPin;
4167  }
4168 
4177  {
4178  int manyNetCnt = 0;
4179  for (auto tmpPU : placementUnits)
4180  {
4181  if (tmpPU->getNetsSetPtr()->size() >= 30)
4182  {
4183  manyNetCnt++;
4184  }
4185  }
4186  PUWithManyNetsRatio = (float)manyNetCnt / (float)placementUnits.size();
4187  }
4188 
4194  inline float getPUWithManyNetsRatio()
4195  {
4196  assert(PUWithManyNetsRatio >= 0);
4197  return PUWithManyNetsRatio;
4198  }
4199 
4205  inline void setMinHPWL(float val)
4206  {
4207  minHPWL = val;
4208  }
4209 
4210  inline float getMinHPWL()
4211  {
4212  return minHPWL;
4213  }
4214 
4221  bool checkClockUtilization(bool dump);
4222 
4223  void enhanceRiskyClockNet();
4224 
4225  void enhanceDDRNet();
4226 
4227  void enhanceHighFanoutNet();
4228 
4230 
4243  {
4244  auto clockColumn = curSite->getClockHalfColumn();
4245  auto curSetOfClocks = clockCol2ClockNets[clockColumn];
4246  auto curPUClocks = curPU->getClockNets();
4247  for (auto clockNet : curPUClocks)
4248  curSetOfClocks.insert(clockNet);
4249 
4250  if (curSetOfClocks.size() <= clockColumn->getClockNumLimit())
4251  return true;
4252  else
4253  return false;
4254  }
4255 
4267  {
4268  auto clockColumn = curSite->getClockHalfColumn();
4269  auto curSetOfClocks = clockCol2ClockNets[clockColumn];
4270  int oriClockNum = curSetOfClocks.size();
4271  auto curPUClocks = curPU->getClockNets();
4272  for (auto clockNet : curPUClocks)
4273  curSetOfClocks.insert(clockNet);
4274 
4275  return curSetOfClocks.size() - oriClockNum;
4276  }
4277 
4279  {
4280  auto clockColumn = curSite->getClockHalfColumn();
4281  auto curSetOfClocks = clockCol2ClockNets[clockColumn];
4282  auto curPUClocks = curPU->getClockNets();
4283  for (auto clockNet : curPUClocks)
4284  curSetOfClocks.insert(clockNet);
4285  int i = 0;
4286  for (auto clockNet : curSetOfClocks)
4287  {
4288  std::cout << "clock#" << i << " name: [" << clockNet->getName() << "]\n";
4289  i++;
4290  }
4291  }
4292 
4302  {
4303  auto clockColumn = curSite->getClockHalfColumn();
4304  auto &curSetOfClocks = clockCol2ClockNets[clockColumn];
4305  auto &curPUClocks = curPU->getClockNets();
4306  for (auto clockNet : curPUClocks)
4307  curSetOfClocks.insert(clockNet);
4308  assert(curSetOfClocks.size() <= clockColumn->getClockNumLimit());
4309  }
4310 
4316  inline std::vector<std::vector<PlacementUnit *>> &getLongPaths()
4317  {
4318  return longPaths;
4319  }
4320 
4325  void optimizeLongPaths();
4326 
4332  {
4336  }
4337 
4343  std::map<PlacementUnit *, std::pair<float, float>> &getPU2ClockRegionCenters()
4344  {
4345  return PU2ClockRegionCenters;
4346  }
4347 
4353  std::map<PlacementUnit *, int> &getPU2ClockRegionColumn()
4354  {
4355  return PU2ClockRegionColumn;
4356  }
4357 
4359  {
4360  return longPathThresholdLevel;
4361  }
4362 
4364  {
4365  return mediumPathThresholdLevel;
4366  }
4367 
4368  inline std::map<DeviceInfo::ClockColumn *, std::set<DesignInfo::DesignNet *>> &getClockCol2ClockNets()
4369  {
4370  return clockCol2ClockNets;
4371  }
4372 
4373  inline std::vector<std::vector<PlacementBinInfo *>> &getGlobalBinGrid()
4374  {
4375  return globalBinGrid;
4376  }
4377 
4378  inline void setClusterNum(int _clusterNum)
4379  {
4380  clusterNum = _clusterNum;
4381  }
4382 
4383  inline int getClusterNum()
4384  {
4385  return clusterNum;
4386  }
4387 
4388  inline bool isDensePlacement()
4389  {
4390  return ((float)getClusterNum() / (float)getDeviceInfo()->getClockRegionNumX() /
4391  (float)getDeviceInfo()->getClockRegionNumY()) > 0.6;
4392  }
4393 
4395  {
4396  return clockLegalizationRisky;
4397  }
4398 
4399  inline int getHighFanOutThr()
4400  {
4401  return highFanOutThr;
4402  }
4403 
4404  inline int getNetDistributionByDensity(int density)
4405  {
4406  int ret = 0;
4407  for (int i = 0; i <= 7; i++)
4408  {
4409  if (netPinNumDistribution[i] >= density)
4410  {
4411  ret += netDistribution[i];
4412  }
4413  }
4414 
4415  return ret;
4416  }
4417 
4418  inline float getMacroRatio()
4419  {
4420  return macroRatio;
4421  }
4422 
4423  inline void setPaintDataBase(PaintDataBase *_paintData)
4424  {
4425  assert(_paintData);
4426  paintData = _paintData;
4427  }
4428 
4429  void transferPaintData();
4430 
4431  private:
4433  std::vector<PlacementUnit *> placementUnits;
4434  std::vector<PlacementUnpackedCell *> placementUnpackedCells;
4435  std::vector<PlacementMacro *> placementMacros;
4436  std::vector<PlacementUnit *> fixedPlacementUnits;
4437  std::set<DesignInfo::DesignCell *> cellInMacros;
4438  std::map<int, PlacementUnit *> cellId2PlacementUnit;
4439  std::vector<PlacementUnit *> cellId2PlacementUnitVec;
4440  std::vector<CellBinInfo> cellId2CellBinInfo;
4441  std::vector<Location> cellId2location;
4442  std::vector<Location> pinId2location;
4450  std::pair<std::map<PlacementInfo::PlacementUnit *, float>, std::map<PlacementInfo::PlacementUnit *, float>>
4456  std::map<PlacementInfo::PlacementUnit *, std::vector<DeviceInfo::DeviceSite *>> PU2LegalSites;
4457 
4461  float globalMinX;
4462 
4466  float globalMinY;
4467 
4471  float globalMaxX;
4472 
4476  float globalMaxY;
4477 
4483  float startX;
4484 
4490  float startY;
4491 
4497  float endX;
4498 
4504  float endY;
4505 
4506  float eps = 1e-5;
4507  std::vector<std::vector<std::vector<PlacementBinInfo *>>> SharedBELTypeBinGrid;
4508 
4513  std::vector<std::vector<PlacementBinInfo *>> LUTFFBinGrid;
4514 
4519  std::vector<std::vector<PlacementBinInfo *>> globalBinGrid;
4520  std::vector<std::vector<PlacementSiteBinInfo *>> siteGridForMacros;
4521  float binWidth;
4522  float binHeight;
4523 
4524  std::vector<PlacementNet *> placementNets;
4525  std::vector<std::vector<PlacementNet *>> placementUnitId2Nets;
4526  std::vector<PlacementNet *> designNetId2PlacementNet;
4527 
4528  std::vector<PlacementNet *> clockNets;
4529  std::vector<std::vector<int>> clockRegionUtilization;
4530 
4531  std::set<PlacementUnit *> PUSetContainingFF;
4532  std::vector<PlacementUnit *> PUsContainingFF;
4533  std::vector<std::vector<PlacementUnit *>> longPaths;
4534 
4535  std::map<PlacementUnit *, std::pair<float, float>> PU2ClockRegionCenters;
4536  std::map<PlacementUnit *, int> PU2ClockRegionColumn;
4537  std::map<DeviceInfo::ClockColumn *, std::set<DesignInfo::DesignNet *>> clockCol2ClockNets;
4538  PaintDataBase *paintData = nullptr;
4539 
4540  std::vector<float> PaintXs;
4541  std::vector<float> PaintYs;
4542  std::vector<int> PaintTypes;
4543 
4548  typedef struct _ClockNetCoverage
4549  {
4551 
4557 
4563 
4569 
4576  std::vector<ClockNetCoverage> clockNetCoverages;
4577 
4584 
4585  std::map<std::string, std::string> &JSONCfg;
4589  int netPinNumDistribution[8] = {8, 16, 24, 32, 64, 256, 512, 1000000};
4590  int netDistribution[8] = {0, 0, 0, 0, 0, 0, 0, 0};
4591 
4596  float y2xRatio = 1.0;
4597 
4603 
4609 
4611 
4612  int clusterNum = 1;
4614 
4618 
4621  float minHPWL = 1e8;
4623 
4624  int highFanOutThr = 10000000;
4625 
4626  float macroRatio = 0.0;
4627 
4628  bool guiEnable = false;
4629 };
4630 
4631 std::ostream &operator<<(std::ostream &os, PlacementInfo::PlacementMacro *curMacro);
4632 std::ostream &operator<<(std::ostream &os, PlacementInfo::PlacementUnpackedCell *curUnpackedCell);
4633 std::ostream &operator<<(std::ostream &os, PlacementInfo::PlacementUnit *curPU);
4634 #endif
PlacementInfo::PlacementMacro::getNumOfCells
int getNumOfCells()
Definition: PlacementInfo.h:1791
PlacementInfo::buildSimpleTimingGraph
void buildSimpleTimingGraph()
call timing info to build simple timing graph
Definition: PlacementInfo.h:4331
PlacementInfo::PlacementUnit::getMUXNum
int getMUXNum()
Definition: PlacementInfo.h:1365
DesignInfo::DesignCell::isVirtualCell
bool isVirtualCell()
Definition: DesignInfo.h:1042
PlacementInfo::getNumCells
int getNumCells()
Definition: PlacementInfo.h:2842
PlacementInfo::PlacementNet::minDist
float minDist
Definition: PlacementInfo.h:2478
PlacementInfo::Location
Definition: PlacementInfo.h:3595
PlacementInfo::JSONCfg
std::map< std::string, std::string > & JSONCfg
Definition: PlacementInfo.h:4585
PlacementInfo::PlacementNet::rightPinId_net
unsigned int rightPinId_net
Definition: PlacementInfo.h:2476
PlacementInfo::CompatiblePlacementTable::deviceInfo
DeviceInfo * deviceInfo
Definition: PlacementInfo.h:312
PlacementInfo::getBinGrid
std::vector< std::vector< PlacementBinInfo * > > & getBinGrid(unsigned int BELTypeId)
Get the Bin Grid object.
Definition: PlacementInfo.h:3099
PlacementInfo::PlacementUnit::getWeight
int getWeight()
Definition: PlacementInfo.h:1201
PlacementInfo::PlacementSiteTypeInfo::location::locX
float locX
Definition: PlacementInfo.h:326
PlacementInfo::PlacementBinInfo::X
int X()
return the column of the bin in the grid
Definition: PlacementInfo.h:683
PlacementInfo::CompatiblePlacementTable::cellType2sharedBELTypeOccupation
std::map< DesignInfo::DesignCellType, int > cellType2sharedBELTypeOccupation
the resource demand of specific types. (cost how many slot/BELs)
Definition: PlacementInfo.h:144
PlacementInfo::getClusterNum
int getClusterNum()
Definition: PlacementInfo.h:4383
PlacementInfo::PlacementNet
Placement net, compared to design net, includes information related to placement.
Definition: PlacementInfo.h:1877
DesignInfo::DesignCell::isLUTRAM
bool isLUTRAM()
Definition: DesignInfo.h:938
PlacementInfo::getGlobalBinMinLocY
float getGlobalBinMinLocY()
get bottom boundary of the bin grid
Definition: PlacementInfo.h:2922
PlacementInfo::loadCompatiblePlacementTable
CompatiblePlacementTable * loadCompatiblePlacementTable(std::string cellType2fixedAmoFileName, std::string cellType2sharedCellTypeFileName, std::string sharedCellType2BELtypeFileName)
describes the type mapping from design to device, where a cell can be placed (which BEL in which site...
Definition: PlacementInfo.h:2732
PlacementInfo::calculateNetNumDistributionOfPUs
void calculateNetNumDistributionOfPUs()
calculate the proportion of the PlacementUnit objects with high interconnection density
Definition: PlacementInfo.h:4176
DesignInfo::getNumCells
int getNumCells()
Definition: DesignInfo.h:1600
DesignInfo::DesignCell::isMux
bool isMux()
Definition: DesignInfo.h:959
PlacementInfo::getProgress
float getProgress()
Get the Progress ratio of the placement.
Definition: PlacementInfo.h:3969
PlacementInfo::PlacementUnit::anchorX
float anchorX
Definition: PlacementInfo.h:1397
PlacementInfo::PlacementUnit::checkHasLUT
bool checkHasLUT()
Definition: PlacementInfo.h:1312
DesignInfo::setDeterminedOccupation
void setDeterminedOccupation(int cellId, int occupation)
Set the Determined Occupation of a specific cell.
Definition: DesignInfo.h:1701
PlacementInfo::PlacementUnit::getDSPNum
int getDSPNum()
Definition: PlacementInfo.h:1345
PlacementInfo::PlacementBinInfo::getUtilizationRate
float getUtilizationRate()
Get the Utilization Rate: utilization / (capacity * binShrinkRatio)
Definition: PlacementInfo.h:578
paintPlacement.cnt
int cnt
Definition: paintPlacement.py:155
PlacementInfo::ClusterUnit::addPlacementUnit
void addPlacementUnit(PlacementInfo::PlacementUnit *curPU)
Definition: PlacementInfo.h:2512
PlacementInfo::PlacementNet::_pinOffset::x
float x
Definition: PlacementInfo.h:1935
PlacementInfo::getNetDistributionByDensity
int getNetDistributionByDensity(int density)
Definition: PlacementInfo.h:4404
PlacementInfo::PlacementMacro::getCell
DesignInfo::DesignCell * getCell(unsigned int id)
Definition: PlacementInfo.h:1796
PlacementInfo::PlacementMacro::getVirtualCellType
DesignInfo::DesignCellType getVirtualCellType(int vId)
Definition: PlacementInfo.h:1786
PlacementInfo::PlacementUnit::getUnitsBeDrivenByThisPU
int getUnitsBeDrivenByThisPU()
Definition: PlacementInfo.h:1236
PlacementInfo::setProgress
void setProgress(float p)
Set the progress ratio, indicating the progress of the placement convergence,.
Definition: PlacementInfo.h:3959
PlacementInfo::PlacementUnit::hasLogic
bool hasLogic()
Definition: PlacementInfo.h:1332
PlacementInfo::CompatiblePlacementTable::~CompatiblePlacementTable
~CompatiblePlacementTable()
Definition: PlacementInfo.h:111
exportDeviceLocation.sites
list sites
Definition: exportDeviceLocation.py:216
PlacementInfo::PlacementNet::getUnitsBeDriven
std::vector< PlacementUnit * > & getUnitsBeDriven()
Get the reference of the vector of the PlacementUnits driven by the net.
Definition: PlacementInfo.h:1963
PlacementInfo::PlacementMacro::getBottomOffset
float getBottomOffset()
Definition: PlacementInfo.h:1806
PlacementInfo::CompatiblePlacementTable::cellId2InfationRatio
std::vector< float > cellId2InfationRatio
Definition: PlacementInfo.h:309
PlacementInfo::PlacementUnpackedCell::getLockedSite
DeviceInfo::DeviceSite * getLockedSite()
Definition: PlacementInfo.h:1492
PlacementInfo::getOccupation
float getOccupation(DesignInfo::DesignCellType cellType)
Get the theoratical occupation of a specific cell type.
Definition: PlacementInfo.h:2984
PlacementInfo::PlacementUnit::numUnitsBeDrivenByThisPU
int numUnitsBeDrivenByThisPU
Definition: PlacementInfo.h:1436
PlacementInfo::getPlacementUnits
std::vector< PlacementUnit * > & getPlacementUnits()
Definition: PlacementInfo.h:2810
PlacementInfo::isLegalLocation
bool isLegalLocation(DesignInfo::DesignCell *curCell, float targetX, float targetY)
check whether the PlacementUnit is legalized in the device area when a cell in it is placed at target...
Definition: PlacementInfo.h:3452
PlacementInfo::PlacementUnit::getLUTNum
int getLUTNum()
Definition: PlacementInfo.h:1357
PlacementInfo::PlacementUnit::weight
int weight
Definition: PlacementInfo.h:1427
PlacementInfo::PlacementBinInfo::right
float right()
return the right boundary of the bin
Definition: PlacementInfo.h:703
PlacementInfo::PlacementUnit::setPacked
void setPacked()
Definition: PlacementInfo.h:1369
PlacementInfo::getCells
std::vector< DesignInfo::DesignCell * > & getCells()
Definition: PlacementInfo.h:3898
PlacementInfo::PlacementBinInfo::bottom
float bottom()
return the bottom boundary of the bin
Definition: PlacementInfo.h:723
PlacementInfo::CompatiblePlacementTable::cellId2SharedCellBELTypeID
std::vector< std::vector< int > > cellId2SharedCellBELTypeID
Definition: PlacementInfo.h:307
PlacementInfo::ClusterUnit::totalWeight
int totalWeight
Definition: PlacementInfo.h:2532
PlacementInfo::PlacementUnit::packed
bool packed
Definition: PlacementInfo.h:1439
PlacementInfo::getPlacementUnpackedCells
std::vector< PlacementUnpackedCell * > & getPlacementUnpackedCells()
Definition: PlacementInfo.h:2838
PlacementInfo::PlacementBinInfo
BEL bin for global placement for a specific shared BEL type.
Definition: PlacementInfo.h:372
PlacementInfo::CompatiblePlacementTable::cellId2Occupation
std::vector< float > cellId2Occupation
Definition: PlacementInfo.h:308
PlacementInfo::PlacementUnit::CARRYcnt
int CARRYcnt
Definition: PlacementInfo.h:1434
PlacementInfo::oriPseudoNetWeight
float oriPseudoNetWeight
Definition: PlacementInfo.h:4615
PlacementInfo::CellBinInfo::occupation
float occupation
Definition: PlacementInfo.h:3639
PlacementInfo::PlacementSiteBinInfo::getUtilizationRate
float getUtilizationRate()
Definition: PlacementInfo.h:2621
PlacementInfo::ClusterUnit::totalBRAMNum
int totalBRAMNum
Definition: PlacementInfo.h:2532
PlacementInfo::placementUnits
std::vector< PlacementUnit * > placementUnits
Definition: PlacementInfo.h:4433
PlacementInfo::PlacementSiteBinInfo::rightX
float rightX
Definition: PlacementInfo.h:2681
PlacementInfo::getSharedBELTypeId
int getSharedBELTypeId(std::string tmpStr)
Definition: PlacementInfo.h:2942
PlacementInfo::PlacementUnit::checkHasCARRY
bool checkHasCARRY()
Definition: PlacementInfo.h:1320
PlacementInfo::~PlacementInfo
~PlacementInfo()
Definition: PlacementInfo.h:2697
PlacementInfo::optimizeLongPaths
void optimizeLongPaths()
make the PlacementUnits in the long path closer to each other
Definition: PlacementInfo.cc:723
PlacementInfo::getLongPaths
std::vector< std::vector< PlacementUnit * > > & getLongPaths()
Get the Long Paths in the net list for later optimization.
Definition: PlacementInfo.h:4316
PlacementInfo::PlacementMacro::cellsInMacro
std::vector< DesignInfo::DesignCell * > cellsInMacro
Definition: PlacementInfo.h:1856
PlacementInfo::getPotentialBELTypeIDs
std::vector< int > & getPotentialBELTypeIDs(DesignInfo::DesignCellType cellType)
Definition: PlacementInfo.h:2937
PlacementInfo::PlacementUnit::addLUTRAM
void addLUTRAM()
Definition: PlacementInfo.h:1280
PlacementInfo::PlacementNet::getBottomPUId
int getBottomPUId()
Definition: PlacementInfo.h:2451
PlacementInfo::PlacementUnpackedCell::cell
DesignInfo::DesignCell * cell
Definition: PlacementInfo.h:1513
DesignInfo::getDeterminedOccupation
int getDeterminedOccupation(int cellId)
Definition: DesignInfo.h:1688
PlacementInfo::_ClockNetCoverage::bottomRegionY
int bottomRegionY
the bottom row in the grid of clock regions
Definition: PlacementInfo.h:4574
PlacementInfo::PlacementBinInfo::cells
std::set< DesignInfo::DesignCell * > cells
Definition: PlacementInfo.h:827
PlacementInfo::CompatiblePlacementTable::getActualOccupation
float getActualOccupation(DesignInfo::DesignCell *cell)
Get the actual occupation of a specific cell.
Definition: PlacementInfo.h:242
PlacementInfo::PlacementNet::topPuId
unsigned int topPuId
Definition: PlacementInfo.h:2475
PlacementInfo::PlacementBinInfo::rightX
const float rightX
Definition: PlacementInfo.h:835
PlacementInfo::PlacementNet::unitsOfDriverPins
std::vector< PlacementUnit * > unitsOfDriverPins
Definition: PlacementInfo.h:2466
PlacementInfo::PlacementHybridBinInfo::top
float top()
Definition: PlacementInfo.h:980
PlacementInfo::PlacementNet::eps
float eps
Definition: PlacementInfo.h:2477
PlacementInfo::longPaths
std::vector< std::vector< PlacementUnit * > > longPaths
Definition: PlacementInfo.h:4533
PlacementInfo::CellBinInfo::X
int X
Definition: PlacementInfo.h:3637
PlacementInfo::PULegalXY
std::pair< std::map< PlacementInfo::PlacementUnit *, float >, std::map< PlacementInfo::PlacementUnit *, float > > PULegalXY
a mapping from PlaceuementUnit objects to legalized locations
Definition: PlacementInfo.h:4451
DesignInfo::DesignCell::setVirtualType
void setVirtualType(DesignCellType NewCellType)
Set the Virtual Type object which might override the actual type in later processing.
Definition: DesignInfo.h:1079
PlacementInfo::getCompatiblePlacementTable
CompatiblePlacementTable * getCompatiblePlacementTable()
Definition: PlacementInfo.h:2740
PlacementInfo::PlacementSiteBinInfo::reset
void reset()
Definition: PlacementInfo.h:2610
PlacementInfo::PlacementMacro::addVirtualCell
void addVirtualCell(DesignInfo *designInfo, DesignInfo::DesignCellType cellType, float x, float y)
add a virtual cell without given name into the macro with its offsets in the macro....
Definition: PlacementInfo.h:1685
DesignInfo::DesignNet::getOverallEnhanceRatio
float getOverallEnhanceRatio()
Get the Overall Enhance Ratio (the entire net can be enhanced to a pre-defined extent....
Definition: DesignInfo.h:668
PlacementInfo::PlacementBinInfo::getCells
std::set< DesignInfo::DesignCell * > & getCells()
Get the reference of the set of cells in the bin.
Definition: PlacementInfo.h:563
PlacementInfo::adjustLUTFFUtilization_Clocking
void adjustLUTFFUtilization_Clocking()
adjust the utlization of clock-related elements to mitigate the overflow of clock utilization
Definition: PlacementInfo.cc:1409
PlacementInfo::PlacementSiteTypeInfo::location
Definition: PlacementInfo.h:325
PlacementInfo::PlacementSiteBinInfo::inRangeY
bool inRangeY(float y)
Definition: PlacementInfo.h:2598
PlacementInfo::PlacementMacro
a fixed group of multiple standard cells with constraints of their relative locations
Definition: PlacementInfo.h:1525
PlacementInfo::PlacementNet::rightPinX
float rightPinX
Definition: PlacementInfo.h:2474
DesignInfo::DesignCell::isLUT6
bool isLUT6()
Definition: DesignInfo.h:923
PlacementInfo::_ClockNetCoverage::rightRegionX
int rightRegionX
the right column in the grid of clock regions
Definition: PlacementInfo.h:4562
PlacementInfo::PlacementBinInfo::isOverflow
bool isOverflow(float overflowThreshold)
check whether the resource demand in the bin is higher than the supply.
Definition: PlacementInfo.h:639
PlacementInfo::PlacementSiteBinInfo::eps
float eps
Definition: PlacementInfo.h:2684
PlacementInfo::PlacementUnit::setWeight
void setWeight(int numCell)
Definition: PlacementInfo.h:1196
PlacementInfo::CompatiblePlacementTable::getInflateRatio
float getInflateRatio(DesignInfo::DesignCell *cell)
Get the inflate ratio of a cell.
Definition: PlacementInfo.h:253
PlacementInfo::PlacementSiteBinInfo::topY
float topY
Definition: PlacementInfo.h:2682
PlacementInfo::setBELTypeForCells
void setBELTypeForCells(DesignInfo *designInfo)
Definition: PlacementInfo.h:2745
PlacementInfo::ClusterUnit::id
int id
Definition: PlacementInfo.h:2533
PlacementInfo::PlacementUnpackedCell::getFixedBELName
std::string getFixedBELName()
Definition: PlacementInfo.h:1502
DesignInfo::DesignCell
a DesignCell in design netlist, DesignPin objects of which might connect to DesignNet objects
Definition: DesignInfo.h:782
PlacementInfo::getCellId2CellBinInfo
std::vector< CellBinInfo > & getCellId2CellBinInfo()
Definition: PlacementInfo.h:3893
PlacementInfo::PlacementUnit::LUTcnt
int LUTcnt
Definition: PlacementInfo.h:1432
PlacementInfo::PlacementHybridBinInfo::Y
int Y()
Definition: PlacementInfo.h:963
PlacementInfo::PlacementSiteBinInfo::getCapacity
float getCapacity()
Definition: PlacementInfo.h:2634
PlacementInfo::checkClockColumnLegalization
bool checkClockColumnLegalization(PlacementInfo::PlacementUnit *curPU, DeviceInfo::DeviceSite *curSite)
check whether the given PlacementUnit can be mapped to the site considering the half-column clock leg...
Definition: PlacementInfo.h:4242
PlacementTimingInfo
PlacementTimingInfo is the container which record the timing information related to placement.
Definition: PlacementTimingInfo.h:49
PlacementInfo::PlacementBinInfo::resetOverflowCounter
void resetOverflowCounter()
Definition: PlacementInfo.h:757
PlacementInfo::isLegalLocation
bool isLegalLocation(PlacementUnit *curPU, float targetX, float targetY)
check whether the PlacementUnit is legalized in the device area when it is placed at target location
Definition: PlacementInfo.h:3506
exportDeviceLocation.weight
weight
Definition: exportDeviceLocation.py:274
PlacementInfo::endY
float endY
bottom boundary of the bin grid
Definition: PlacementInfo.h:4504
PlacementInfo::placementUnpackedCells
std::vector< PlacementUnpackedCell * > placementUnpackedCells
Definition: PlacementInfo.h:4434
DesignInfo::DesignNet
a design net (hyperedge) defined in the design, connecting to pins of cells
Definition: DesignInfo.h:525
PlacementInfo::PlacementNet::getTopPinY
float getTopPinY()
Definition: PlacementInfo.h:2421
paintPlacement.y
list y
Definition: paintPlacement.py:153
PlacementInfo::CompatiblePlacementTable::cellType2sharedBELTypeIDs
std::map< DesignInfo::DesignCellType, std::vector< int > > cellType2sharedBELTypeIDs
the mapping from design cell type to device resource type ID
Definition: PlacementInfo.h:161
PlacementInfo::mediumPathThresholdLevel
int mediumPathThresholdLevel
the medium path threshold for timing optimization
Definition: PlacementInfo.h:4608
PlacementInfo::dumpCongestion
void dumpCongestion(std::string dumpFileName)
dump the congestion mesh grid for evaluation
Definition: PlacementInfo.cc:1562
PlacementInfo::PlacementBinInfo::removeCell
void removeCell(DesignInfo::DesignCell *cell, int occupationAdded)
remove a design cell from the bin
Definition: PlacementInfo.h:488
PlacementInfo::PlacementMacro::isCellInMacro
bool isCellInMacro(DesignInfo::DesignCell *curCell)
Definition: PlacementInfo.h:1836
PlacementInfo::PlacementNet::updateBound2BoundNetWeight
void updateBound2BoundNetWeight(std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, float generalWeight, float y2xRatio, bool updateX, bool updateY, bool checkClockRegion=false)
update the weights of 2-pin nets between PlacementUnits in this hyperedge(PlacementNet) according to ...
Definition: PlacementInfo.h:2184
PlacementInfo::PlacementMacro::getCellOffsetYInMacro
float getCellOffsetYInMacro(DesignInfo::DesignCell *cell)
Definition: PlacementInfo.h:1762
PlacementInfo::compatiblePlacementTable
CompatiblePlacementTable * compatiblePlacementTable
Definition: PlacementInfo.h:4432
PlacementInfo::ClusterNet
The net between the objects of ClusterUnit class.
Definition: PlacementInfo.h:2541
PlacementInfo::PlacementMacro::cell2IdInMacro
std::map< DesignInfo::DesignCell *, int > cell2IdInMacro
Definition: PlacementInfo.h:1855
PlacementInfo::PlacementUnpackedCell::lockedSite
DeviceInfo::DeviceSite * lockedSite
Definition: PlacementInfo.h:1517
PlacementInfo::placementUnitId2Nets
std::vector< std::vector< PlacementNet * > > placementUnitId2Nets
Definition: PlacementInfo.h:4525
PlacementInfo::PlacementUnit::setSpreadLocation_WithLimitDisplacement
void setSpreadLocation_WithLimitDisplacement(float x, float y, float forgetRatio, float limitDisplacement)
Set the Spread Location based on forgetting ratio.
Definition: PlacementInfo.h:1102
PlacementInfo::PlacementMacro::PlacementMacroType_LCLB
@ PlacementMacroType_LCLB
Definition: PlacementInfo.h:1533
PlacementInfo::getMacroRatio
float getMacroRatio()
Definition: PlacementInfo.h:4418
PlacementInfo::PlacementBinInfo::noOverflowCnt
int noOverflowCnt
Definition: PlacementInfo.h:844
PlacementInfo::getGlobalBinMinLocX
float getGlobalBinMinLocX()
get left boundary of the bin grid
Definition: PlacementInfo.h:2912
PlacementInfo::PlacementSiteBinInfo::isOverflow
bool isOverflow()
Definition: PlacementInfo.h:2639
PlacementInfo::getGridXY
void getGridXY(float cellX, float cellY, int &binIdX, int &binIdY)
Get the Grid row/column based on given location X,Y.
Definition: PlacementInfo.h:3344
PlacementInfo::PlacementUnit::id
int id
Definition: PlacementInfo.h:1396
PlacementInfo::PlacementUnit::getNetsSetPtr
std::vector< PlacementNet * > * getNetsSetPtr()
Get the Nets Set Ptr object which records the nets connecting to the PlacementUnit.
Definition: PlacementInfo.h:1231
PlacementInfo::PlacementUnit::lastX
float lastX()
Definition: PlacementInfo.h:1034
PlacementInfo::PaintYs
std::vector< float > PaintYs
Definition: PlacementInfo.h:4541
PlacementInfo::PlacementBinInfo::binShrinkRatio
float binShrinkRatio
Definition: PlacementInfo.h:831
PlacementInfo::setPaintDataBase
void setPaintDataBase(PaintDataBase *_paintData)
Definition: PlacementInfo.h:4423
PlacementInfo::ClusterNet::addClusterUnit
void addClusterUnit(ClusterUnit *tmpCU)
Definition: PlacementInfo.h:2558
PlacementInfo::PlacementBinInfo::inRangeY
bool inRangeY(float y)
Definition: PlacementInfo.h:454
DesignInfo::DesignNet::getPins
std::vector< DesignPin * > & getPins()
Get the vector reference of the pins.
Definition: DesignInfo.h:591
PlacementInfo::getGlobalMinY
float getGlobalMinY()
Get the Global Min Y (bottom boundary of the device)
Definition: PlacementInfo.h:2882
PlacementInfo::getLongPathThresholdLevel
int getLongPathThresholdLevel()
Definition: PlacementInfo.h:4358
PlacementInfo::PlacementMacro::PlacementMacroType_CARRY
@ PlacementMacroType_CARRY
Definition: PlacementInfo.h:1537
PlacementInfo::cellId2location
std::vector< Location > cellId2location
Definition: PlacementInfo.h:4441
PlacementInfo::dumpVivadoPlacementTclWithPULegalizationInfo
void dumpVivadoPlacementTclWithPULegalizationInfo(std::string dumpFile)
dump the placement commands to place cells in Vivado (do not use this temporarily)
Definition: PlacementInfo.cc:1696
PlacementInfo::adjustLUTFFUtilization_Routability
void adjustLUTFFUtilization_Routability(bool enfore)
adjust the resource demand of LUTs/FFs according to routing congestion refer to RippleFPGA's implemen...
Definition: PlacementInfo.cc:1273
PlacementInfo::PlacementNet::rightPUX
float rightPUX
Definition: PlacementInfo.h:2473
PlacementInfo::PlacementSiteBinInfo::getUtilization
float getUtilization()
Definition: PlacementInfo.h:2629
PlacementInfo::PlacementHybridBinInfo::column
int column
Definition: PlacementInfo.h:1002
PlacementInfo::PlacementUnit::DSPcnt
int DSPcnt
Definition: PlacementInfo.h:1429
PlacementInfo::PlacementUnit::Y
float Y()
Definition: PlacementInfo.h:1029
PlacementInfo::PlacementSiteBinInfo::capacity
int capacity
Definition: PlacementInfo.h:2677
PlacementInfo::PlacementSiteTypeInfo::BELNames
std::set< std::string > BELNames
Definition: PlacementInfo.h:359
PlacementInfo::getPinId2location
std::vector< Location > & getPinId2location()
Definition: PlacementInfo.h:3605
PlacementInfo::PlacementHybridBinInfo::right
float right()
Definition: PlacementInfo.h:976
PlacementInfo::PlacementUnit::name
std::string name
Definition: PlacementInfo.h:1395
PlacementInfo::minHPWL
float minHPWL
Definition: PlacementInfo.h:4621
PlacementInfo::PlacementBinInfo::reset
void reset()
Definition: PlacementInfo.h:505
PlacementInfo::getCellId2location
std::vector< Location > & getCellId2location()
Definition: PlacementInfo.h:3600
PlacementInfo::PlacementHybridBinInfo::mergedBins
std::vector< PlacementBinInfo * > mergedBins
Definition: PlacementInfo.h:991
PlacementInfo::getCellId2PlacementUnit
std::map< int, PlacementUnit * > & getCellId2PlacementUnit()
Definition: PlacementInfo.h:2830
DesignInfo::DesignCellType
DesignCellType
design cell types
Definition: DesignInfo.h:73
PlacementInfo::getMinHPWL
float getMinHPWL()
Definition: PlacementInfo.h:4210
DeviceInfo::getClockRegionByLocation
void getClockRegionByLocation(float locX, float locY, int &clockRegionX, int &clockRegionY)
Get the clock region ID (X/Y) by a given location (X/Y)
Definition: DeviceInfo.h:1183
PlacementInfo::PlacementUnit::checkHasLUTRAM
bool checkHasLUTRAM()
Definition: PlacementInfo.h:1308
PlacementInfo::cellId2PlacementUnit
std::map< int, PlacementUnit * > cellId2PlacementUnit
Definition: PlacementInfo.h:4438
PlacementInfo::PlacementNet::_pinOffset
Definition: PlacementInfo.h:1931
PlacementInfo::getMinYFromSites
float getMinYFromSites(std::vector< DeviceInfo::DeviceSite * > &sites)
Get the Min Y of sites to identify the boundary of the device.
Definition: PlacementInfo.cc:261
PlacementInfo::getCellId2PlacementUnitVec
std::vector< PlacementUnit * > & getCellId2PlacementUnitVec()
Definition: PlacementInfo.h:2834
paintPlacement.x
list x
Definition: paintPlacement.py:152
PlacementInfo::PlacementHybridBinInfo::leftX
float leftX
Definition: PlacementInfo.h:996
PlacementInfo::PlacementMacro::PlacementMacroType_MUX8
@ PlacementMacroType_MUX8
Definition: PlacementInfo.h:1541
PlacementInfo::ClusterUnit::PUs
std::vector< PlacementInfo::PlacementUnit * > PUs
Definition: PlacementInfo.h:2531
PlacementInfo::PlacementBinInfo::inflateBinBy
void inflateBinBy(float r)
increase the resource capacity by a given ratio
Definition: PlacementInfo.h:531
PlacementInfo::PlacementNet::getPUSet
std::set< PlacementUnit * > & getPUSet()
Definition: PlacementInfo.h:2404
PlacementInfo::PlacementMacro::PlacementMacroType_MUX9
@ PlacementMacroType_MUX9
Definition: PlacementInfo.h:1542
PlacementInfo::PlacementHybridBinInfo::eps
float eps
Definition: PlacementInfo.h:1000
DesignInfo::DesignPin
A design pin on a design cell connected to a net.
Definition: DesignInfo.h:277
DesignInfo::DesignCell::isCarry
bool isCarry()
Definition: DesignInfo.h:963
PlacementInfo::PlacementBinInfo::addCell
void addCell(DesignInfo::DesignCell *cell, int occupationAdded)
add a design cell into the bin
Definition: PlacementInfo.h:469
PlacementInfo::CompatiblePlacementTable::getPotentialBELTypeIDs
std::vector< int > & getPotentialBELTypeIDs(DesignInfo::DesignCell *cell)
Get the Potential BEL Type IDs for a specific cell object.
Definition: PlacementInfo.h:187
PlacementInfo::loadPlacementUnitInformation
void loadPlacementUnitInformation(std::string locationFile)
load the data of the PlacementUnit objects and some placement parameters from a checkpoint file
Definition: PlacementInfo.cc:1752
PlacementInfo::PlacementUnit::setFixed
void setFixed()
Definition: PlacementInfo.h:1144
PlacementInfo::_ClockNetCoverage::leftRegionX
int leftRegionX
the left column in the grid of clock regions
Definition: PlacementInfo.h:4556
PlacementInfo::longPathThresholdLevel
int longPathThresholdLevel
the long path threshold for timing optimization
Definition: PlacementInfo.h:4602
PlacementInfo::PlacementMacro::PlacementMacroType_MCLB
@ PlacementMacroType_MCLB
Definition: PlacementInfo.h:1535
PlacementInfo::PlacementNet::getRightPUId
int getRightPUId()
Definition: PlacementInfo.h:2439
PlacementInfo::PlacementHybridBinInfo
BEL bin for global placement for multiple specific shared BEL types.
Definition: PlacementInfo.h:860
PlacementInfo::PlacementSiteTypeInfo::location::locY
float locY
Definition: PlacementInfo.h:327
PlacementInfo::PlacementUnit::renewId
void renewId(int newId)
Definition: PlacementInfo.h:1211
PlacementInfo::PlacementUnit::lastAnchorY
float lastAnchorY
Definition: PlacementInfo.h:1398
PlacementInfo::_ClockNetCoverage::clockNet
PlacementNet * clockNet
Definition: PlacementInfo.h:4550
PlacementInfo::PlacementMacro::offsetY
std::vector< float > offsetY
Definition: PlacementInfo.h:1860
PlacementInfo::resetSiteBinGrid
void resetSiteBinGrid()
Definition: PlacementInfo.cc:1650
PlacementInfo::PlacementMacro::fixedPlacementInfo_inMacro
struct PlacementInfo::PlacementMacro::_fixedPlacementInfo_inMacro fixedPlacementInfo_inMacro
some constaints of elements' relative locations are defined by the design. We need to record this.
PlacementInfo::PlacementSiteBinInfo::inRange
bool inRange(float x, float y)
Definition: PlacementInfo.h:2593
PlacementInfo::PlacementUnitType
PlacementUnitType
Placement Instance Types.
Definition: PlacementInfo.h:68
PlacementInfo::deleteLegalizationInfoFor
void deleteLegalizationInfoFor(PlacementInfo::PlacementUnit *curPU)
remove the legalization information of a PlacementUnit object
Definition: PlacementInfo.h:3714
PlacementInfo::getPULegalXY
std::pair< std::map< PlacementInfo::PlacementUnit *, float >, std::map< PlacementInfo::PlacementUnit *, float > > & getPULegalXY()
get the locations (pair of X,Y) of the legalized PlacementUnit objects
Definition: PlacementInfo.h:3693
PlacementInfo::macroRatio
float macroRatio
Definition: PlacementInfo.h:4626
PlacementInfo::PlacementMacro::cells_Type
std::vector< DesignInfo::DesignCellType > cells_Type
Definition: PlacementInfo.h:1858
DesignInfo::DesignCell::getCellType
DesignCellType getCellType()
Definition: DesignInfo.h:881
PlacementInfo::PlacementBinInfo::setClockRegionX
void setClockRegionX(int _x)
Set the clock region X for this bin.
Definition: PlacementInfo.h:809
PlacementInfo::PlacementUnit::getClockNets
std::set< DesignInfo::DesignNet * > & getClockNets()
Definition: PlacementInfo.h:1382
PlacementInfo::PlacementUnit::setNetsSetPtr
void setNetsSetPtr(std::vector< PlacementNet * > *_nets)
Set the Nets Set Ptr object which records the nets connecting to the PlacementUnit.
Definition: PlacementInfo.h:1221
PlacementInfo::designInfo
DesignInfo * designInfo
Definition: PlacementInfo.h:4443
PlacementInfo::PlacementBinInfo::utilization
int utilization
Definition: PlacementInfo.h:830
PlacementInfo::addPseudoNetsInPlacementInfo
void addPseudoNetsInPlacementInfo(std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, PlacementUnit *tmpPU, float targetLoc, float pseudoWeight, float y2xRatio, bool updateX, bool updateY)
directly set weight in the quadratic Matrix and vector according to given request.
Definition: PlacementInfo.h:3228
PlacementInfo::PlacementBinInfo::setRequiredBinShrinkRatio
void setRequiredBinShrinkRatio(float r)
Set the Required Bin Shrink Ratio for a bin.
Definition: PlacementInfo.h:553
PlacementInfo::PlacementHybridBinInfo::X
int X()
Definition: PlacementInfo.h:967
PlacementInfo::PlacementNet::leftPUX
float leftPUX
Definition: PlacementInfo.h:2473
PlacementInfo::printStat
void printStat(bool verbose=false)
Definition: PlacementInfo.cc:294
PlacementInfo::updateB2BAndGetTotalHPWL
double updateB2BAndGetTotalHPWL()
update the B2B net model for the placement and get the total HPWL of all the nets in the design
Definition: PlacementInfo.h:3913
PlacementInfo::updateCells2PlacementUnits
void updateCells2PlacementUnits()
update the mapping from Cells to PlacementUnits, since sometime, PlacementUnits might change
Definition: PlacementInfo.cc:1683
PlacementInfo::PlacementHybridBinInfo::left
float left()
Definition: PlacementInfo.h:972
PlacementInfo::clockNets
std::vector< PlacementNet * > clockNets
Definition: PlacementInfo.h:4528
DesignInfo.h
This header file contains the classes of data for a standalone design netlist.
PlacementInfo::PlacementSiteBinInfo::correspondingSites
std::vector< DeviceInfo::DeviceSite * > correspondingSites
Definition: PlacementInfo.h:2675
PlacementInfo::PlacementBinInfo::capacity
int capacity
Definition: PlacementInfo.h:829
PlacementInfo::startY
float startY
bottom boundary of the bin grid
Definition: PlacementInfo.h:4490
PlacementInfo::PlacementMacro::PlacementMacroType_FFFFPair
@ PlacementMacroType_FFFFPair
Definition: PlacementInfo.h:1531
PlacementInfo::PlacementUnit::~PlacementUnit
virtual ~PlacementUnit()
Definition: PlacementInfo.h:1015
PlacementInfo::PlacementUnit::X
float X()
Definition: PlacementInfo.h:1024
PlacementInfo::LUTFFUtilizationAdjusted
bool LUTFFUtilizationAdjusted
Definition: PlacementInfo.h:4622
PlacementInfo::cellId2PlacementUnitVec
std::vector< PlacementUnit * > cellId2PlacementUnitVec
Definition: PlacementInfo.h:4439
PlacementInfo::getMaxYFromSites
float getMaxYFromSites(std::vector< DeviceInfo::DeviceSite * > &sites)
Get the Max Y of sites to identify the boundary of the device.
Definition: PlacementInfo.cc:283
PlacementInfo::getGlobalMaxX
float getGlobalMaxX()
Get the Global Max X (right boundary of the device)
Definition: PlacementInfo.h:2852
PlacementInfo::PlacementBinInfo::bottomY
const float bottomY
Definition: PlacementInfo.h:837
PlacementInfo::getDeviceInfo
DeviceInfo * getDeviceInfo()
Definition: PlacementInfo.h:3308
PlacementInfo::getGlobalBinMaxLocY
float getGlobalBinMaxLocY()
get top boundary of the bin grid
Definition: PlacementInfo.h:2902
PlacementInfo::getPlacementMacros
std::vector< PlacementMacro * > & getPlacementMacros()
Definition: PlacementInfo.h:2814
PlacementInfo::adjustLUTFFUtilization_Routability_Reset
void adjustLUTFFUtilization_Routability_Reset()
reset the inflate ratio of all the cells to be 1, for re-evaluation
Definition: PlacementInfo.cc:1511
PlacementInfo::getPairPinNum
unsigned int getPairPinNum(DesignInfo::DesignCell *LUTA, DesignInfo::DesignCell *LUTB)
Get the Pair Pin Num of two LUTs.
Definition: PlacementInfo.h:4127
PlacementInfo::CellBinInfo
record the bin information for a cell (BELtype, column/row, resource demand)
Definition: PlacementInfo.h:3635
PlacementInfo::PlacementBinInfo::getSharedCellType
std::string & getSharedCellType()
Definition: PlacementInfo.h:780
PlacementInfo::enhanceDDRNet
void enhanceDDRNet()
Definition: PlacementInfo.cc:2073
PlacementInfo::PlacementBinInfo::increaseSWDemandBy
void increaseSWDemandBy(float additionalDemand)
increase the net routing demand of the bin
Definition: PlacementInfo.h:790
PlacementInfo::PlacementNet::getLeftPinX
float getLeftPinX()
Definition: PlacementInfo.h:2409
dumpZip.h
PlacementInfo::getPlacementUnitId2Nets
std::vector< std::vector< PlacementNet * > > & getPlacementUnitId2Nets()
Definition: PlacementInfo.h:3903
PlacementInfo::getBELType2FalseBELType
std::string getBELType2FalseBELType(std::string curBELType)
get the remapped BEL type of a specific BEL type since some cell can be placed in sites of different ...
Definition: PlacementInfo.h:3331
PlacementInfo::PlacementNet::~PlacementNet
~PlacementNet()
Definition: PlacementInfo.h:1926
PlacementInfo::placementMacros
std::vector< PlacementMacro * > placementMacros
Definition: PlacementInfo.h:4435
PlacementInfo::PlacementBinInfo::leftX
const float leftX
Definition: PlacementInfo.h:834
DeviceInfo.h
This header file contains the classes of data for a standalone device.
PlacementInfo::PlacementBinInfo::getOverflowCounter
int getOverflowCounter()
Definition: PlacementInfo.h:765
PlacementInfo::PlacementUnit::checkHasFF
bool checkHasFF()
Definition: PlacementInfo.h:1316
PlacementInfo::Location::X
float X
Definition: PlacementInfo.h:3596
PlacementInfo::CompatiblePlacementTable::resetCellOccupationToDefault
void resetCellOccupationToDefault()
forget the occupation adjustment by packing feasibility and routing congestion
Definition: PlacementInfo.cc:241
PlacementInfo::PlacementMacro::getRightOffset
float getRightOffset()
Definition: PlacementInfo.h:1814
PlacementInfo::PlacementMacro::PlacementMacroType_MUX7
@ PlacementMacroType_MUX7
Definition: PlacementInfo.h:1540
PlacementInfo::PlacementUnit::nets
std::vector< PlacementNet * > * nets
record the nets connected to this PlacementUnit
Definition: PlacementInfo.h:1406
PlacementInfo::PlacementBinInfo::switchDemandForNets
float switchDemandForNets
Definition: PlacementInfo.h:846
PlacementInfo::getMacroLegalizationWeight
float getMacroLegalizationWeight()
Get the Macro Legalization Weight.
Definition: PlacementInfo.h:4060
PlacementInfo::PlacementBinInfo::compatiblePlacementTable
CompatiblePlacementTable * compatiblePlacementTable
Definition: PlacementInfo.h:826
PlacementInfo::resetElementBinGrid
void resetElementBinGrid()
clean the information in bin grid
Definition: PlacementInfo.cc:898
PlacementInfo::cellType2fixedAmoFileName
std::string cellType2fixedAmoFileName
Definition: PlacementInfo.h:4586
PlacementInfo::PlacementUnit::getName
std::string & getName()
Definition: PlacementInfo.h:1186
PlacementInfo::PlacementUnit::FFcnt
int FFcnt
Definition: PlacementInfo.h:1433
PlacementInfo::PlacementMacro::bottom
float bottom
Definition: PlacementInfo.h:1863
PlacementInfo::getTotalHPWL
double getTotalHPWL()
get the total HPWL of all the nets in the design without updating the B2B net model for the placement
Definition: PlacementInfo.h:3939
delayVisualization.X
X
Definition: delayVisualization.py:80
DesignInfo::DesignNet::checkIsGlobalClock
bool checkIsGlobalClock()
check the attribute isGlobalClock
Definition: DesignInfo.h:737
PlacementInfo::PlacementHybridBinInfo::getUtilizationRate
float getUtilizationRate()
Definition: PlacementInfo.h:920
PlacementInfo::PlacementUnpackedCell::PlacementUnpackedCell
PlacementUnpackedCell(std::string name, int id, DesignInfo::DesignCell *cell)
Construct a new Placement Unpacked Cell object.
Definition: PlacementInfo.h:1456
PlacementInfo::PlacementNet::getLeftPUId
int getLeftPUId()
Definition: PlacementInfo.h:2433
PlacementInfo::PlacementUnit::anchorY
float anchorY
Definition: PlacementInfo.h:1397
PlacementInfo::CompatiblePlacementTable::getOccupation
float getOccupation(DesignInfo::DesignCellType cellType)
Get the theoratical occupation of a specific cell type.
Definition: PlacementInfo.h:227
PlacementInfo::getFixedPlacementUnits
std::vector< PlacementUnit * > & getFixedPlacementUnits()
Definition: PlacementInfo.h:2818
PlacementInfo::findNeiborSiteFromBinGrid
std::vector< DeviceInfo::DeviceSite * > * findNeiborSiteFromBinGrid(DesignInfo::DesignCell *curCell, float targetX, float targetY, float displacementThreshold, int siteNumThreshold, bool checkClockRegion=false)
find neibor device sites of a given cell from bin grid
Definition: PlacementInfo.h:3799
DeviceInfo::DeviceSite::getClockHalfColumn
ClockColumn * getClockHalfColumn()
Definition: DeviceInfo.h:377
PlacementInfo::PlacementUnit::checkHasMUX
bool checkHasMUX()
Definition: PlacementInfo.h:1324
PlacementInfo::PlacementUnit::checkHasDSP
bool checkHasDSP()
Definition: PlacementInfo.h:1300
PlacementInfo::PlacementNet::leftPinX
float leftPinX
Definition: PlacementInfo.h:2474
DesignInfo::resetLUTFFDeterminedOccupation
void resetLUTFFDeterminedOccupation()
reset the LUTFFDeterminedOccupation object
Definition: DesignInfo.h:1675
PlacementInfo::getActualOccupationByCellId
float getActualOccupationByCellId(int id)
Get the Actual Occupation By Cell Id.
Definition: PlacementInfo.h:2995
PlacementInfo::PlacementUnit::getUnitsDriveThisPU
int getUnitsDriveThisPU()
Definition: PlacementInfo.h:1254
PlacementInfo::PlacementMacro::PlacementMacroType_LUTLUTSeires
@ PlacementMacroType_LUTLUTSeires
Definition: PlacementInfo.h:1530
PlacementInfo::PlacementNet::pinOffset
struct PlacementInfo::PlacementNet::_pinOffset pinOffset
PlacementInfo::PlacementMacro::PlacementMacroType_DSP
@ PlacementMacroType_DSP
Definition: PlacementInfo.h:1538
PlacementTimingInfo.h
This header file contains the classes of data which record the timing information related to placemen...
PlacementInfo::PlacementMacro::addVirtualCell
DesignInfo::DesignCell * addVirtualCell(std::string virtualCellName, DesignInfo *designInfo, DesignInfo::DesignCellType cellType, float x, float y)
add a virtual cell with a given name into the macro with its offsets in the macro....
Definition: PlacementInfo.h:1634
PlacementInfo::PlacementHybridBinInfo::inRangeY
bool inRangeY(float y)
Definition: PlacementInfo.h:883
PlacementInfo::PlacementBinInfo::eps
float eps
Definition: PlacementInfo.h:839
PlacementInfo::resetPULegalInformation
void resetPULegalInformation()
forget all the legalization information
Definition: PlacementInfo.h:3702
PlacementInfo::PlacementNet::_pinOffset::_pinOffset
_pinOffset(float x, float y)
Definition: PlacementInfo.h:1932
PlacementInfo::highFanOutThr
int highFanOutThr
Definition: PlacementInfo.h:4624
PlacementInfo::PlacementBinInfo::mtx
std::mutex mtx
Definition: PlacementInfo.h:848
PlacementInfo::getPULegalSite
std::map< PlacementInfo::PlacementUnit *, std::vector< DeviceInfo::DeviceSite * > > & getPULegalSite()
get the sites occupied by the legalized PlacementUnit objects
Definition: PlacementInfo.h:3681
PlacementInfo::CompatiblePlacementTable::sharedCellBELTypes
std::vector< std::string > sharedCellBELTypes
some BEL types (design cells should be mapped to the BEL slot on FPGA device)
Definition: PlacementInfo.h:135
PlacementInfo::reloadNets
void reloadNets()
update PlacementNet objects when there are some updates of PlacementUnit objects (e....
Definition: PlacementInfo.cc:507
PlacementInfo::PlacementNet::bottomPinId_net
unsigned int bottomPinId_net
Definition: PlacementInfo.h:2476
PlacementInfo::PlacementMacro::_fixedPlacementInfo_inMacro::_fixedPlacementInfo_inMacro
_fixedPlacementInfo_inMacro(DesignInfo::DesignCell *cell, std::string siteName, std::string BELName)
Definition: PlacementInfo.h:1735
PlacementInfo::PlacementMacro::_fixedPlacementInfo_inMacro
some constaints of elements' relative locations are defined by the design. We need to record this.
Definition: PlacementInfo.h:1734
PlacementInfo::PlacementHybridBinInfo::setYX
void setYX(int i, int j)
Definition: PlacementInfo.h:957
PlacementInfo::PlacementBinInfo::countNoOverflow
void countNoOverflow()
increase one time of non-overflow situation
Definition: PlacementInfo.h:746
getPinOffset.tmploc
tmploc
Definition: getPinOffset.py:43
PlacementInfo::getPlacementNetByDesignNetId
PlacementNet * getPlacementNetByDesignNetId(int netId)
Definition: PlacementInfo.h:3134
PlacementInfo::PlacementUnitType_UnpackedCell
@ PlacementUnitType_UnpackedCell
Definition: PlacementInfo.h:69
PlacementInfo::PlacementUnit::lastSpreadY
float lastSpreadY
Definition: PlacementInfo.h:1399
PlacementInfo::transferPaintData
void transferPaintData()
Definition: PlacementInfo.cc:2219
PlacementInfo::netDistribution
int netDistribution[8]
Definition: PlacementInfo.h:4590
PlacementInfo::updateElementBinGrid
void updateElementBinGrid()
map design cells to the bins in the bin grid.
Definition: PlacementInfo.cc:906
PlacementInfo::ClusterUnit::getDSPNum
int getDSPNum()
Definition: PlacementInfo.h:2507
PlacementInfo::PlacementSiteTypeInfo::PlacementSiteTypeInfo
PlacementSiteTypeInfo(std::string siteType, std::vector< DeviceInfo::DeviceSite * > &correspondingSites)
Definition: PlacementInfo.h:330
DeviceInfo::DeviceSite
Site class for site on device.
Definition: DeviceInfo.h:163
PlacementInfo::PlacementUnit::MUXcnt
int MUXcnt
Definition: PlacementInfo.h:1435
PlacementInfo::ClusterNet::clusterUnits
std::vector< ClusterUnit * > clusterUnits
Definition: PlacementInfo.h:2564
PlacementInfo::ClusterUnit::ClusterUnit
ClusterUnit(int id)
Definition: PlacementInfo.h:2491
delayVisualization.disY
disY
Definition: delayVisualization.py:52
PlacementInfo::PlacementBinInfo::getRealUtilizationRate
float getRealUtilizationRate()
Get the theoratical utilization rate (use LUT theoratical resource utilization without any adjustment...
Definition: PlacementInfo.h:592
PlacementInfo::getBinGrid
std::vector< std::vector< std::vector< PlacementBinInfo * > > > & getBinGrid()
Get the Bin Grid object for all types of BEL.
Definition: PlacementInfo.h:3110
PlacementInfo::CompatiblePlacementTable::CompatiblePlacementTable
CompatiblePlacementTable(std::string cellType2fixedAmoFileName, std::string cellType2sharedCellTypeFileName, std::string sharedCellType2BELtypeFileName, DesignInfo *designInfo, DeviceInfo *deviceInfo)
Construct a new Compatible Placement Table object.
Definition: PlacementInfo.cc:90
PlacementInfo::PlacementNet::unitsOfNetPins
std::vector< PlacementUnit * > unitsOfNetPins
Definition: PlacementInfo.h:2465
PlacementInfo::PlacementNet::bottomPinY
float bottomPinY
Definition: PlacementInfo.h:2474
PlacementInfo::PlacementNet::designNet
DesignInfo::DesignNet * designNet
Definition: PlacementInfo.h:2464
PlacementInfo::PlacementSiteTypeInfo::location
struct PlacementInfo::PlacementSiteTypeInfo::location location
PlacementInfo::ClockNetCoverage
struct PlacementInfo::_ClockNetCoverage ClockNetCoverage
the retangular clock region coverage of a clock net
PlacementInfo::PlacementUnit::LUTRAMcnt
int LUTRAMcnt
Definition: PlacementInfo.h:1431
PlacementInfo::PlacementNet::placementInfo
PlacementInfo * placementInfo
Definition: PlacementInfo.h:2472
PlacementInfo::PlacementSiteBinInfo::X
int X()
Definition: PlacementInfo.h:2669
PlacementInfo::PlacementNet::PUSet
std::set< PlacementUnit * > PUSet
Definition: PlacementInfo.h:2469
PlacementInfo::PlacementUnit::locked
bool locked
if locked, the attributes of the PlacementUnit cannot be changed (more than fixed....
Definition: PlacementInfo.h:1426
PlacementInfo::PUSetContainingFF
std::set< PlacementUnit * > PUSetContainingFF
Definition: PlacementInfo.h:4531
PlacementInfo::ClusterUnit::getId
int getId()
Definition: PlacementInfo.h:2525
DesignInfo::DesignCell::isFF
bool isFF()
Definition: DesignInfo.h:933
PlacementInfo::clockRegionUtilization
std::vector< std::vector< int > > clockRegionUtilization
Definition: PlacementInfo.h:4529
DeviceInfo::getSite
DeviceSite * getSite(std::string &Name)
Definition: DeviceInfo.h:1111
PlacementInfo::findNeiborLUTFFsFromBinGrid
std::vector< DesignInfo::DesignCell * > * findNeiborLUTFFsFromBinGrid(DesignInfo::DesignCell *curCell, float displacementUpperbound, int minNumNeighbor=10)
find neibor LUTs/FFs from bin grid
Definition: PlacementInfo.h:3009
PlacementInfo::PlacementMacro::~PlacementMacro
~PlacementMacro()
Definition: PlacementInfo.h:1558
PlacementInfo::PlacementUnit::setUnlocked
void setUnlocked()
Definition: PlacementInfo.h:1161
PlacementInfo::PlacementBinInfo::addSiteIntoBin
void addSiteIntoBin(DeviceInfo::DeviceSite *curSite)
add a resource site into the bin
Definition: PlacementInfo.cc:308
PlacementInfo::PaintXs
std::vector< float > PaintXs
Definition: PlacementInfo.h:4540
PlacementInfo::createSiteBinGrid
void createSiteBinGrid()
Definition: PlacementInfo.cc:1582
PlacementInfo::verifyDeviceForDesign
void verifyDeviceForDesign()
verify that each cells in the design can be mapped on the resource elements on the device.
Definition: PlacementInfo.cc:790
PlacementInfo::PlacementBinInfo::canAddMore
bool canAddMore(int BELAmo)
check whether we can add some BEL demand to the bin
Definition: PlacementInfo.h:661
PlacementInfo::PlacementNet::getDesignNet
DesignInfo::DesignNet * getDesignNet()
Get the Design Net object.
Definition: PlacementInfo.h:1973
PlacementInfo::ClusterUnit::getBRAMNum
int getBRAMNum()
Definition: PlacementInfo.h:2503
PlacementInfo::designNetId2PlacementNet
std::vector< PlacementNet * > designNetId2PlacementNet
Definition: PlacementInfo.h:4526
PlacementInfo::PlacementHybridBinInfo::correspondingSites
std::vector< DeviceInfo::DeviceSite * > correspondingSites
Definition: PlacementInfo.h:990
PlacementInfo::PlacementMacro::PlacementMacroType_LUTFFPair
@ PlacementMacroType_LUTFFPair
Definition: PlacementInfo.h:1529
PlacementInfo::PU2LegalSites
std::map< PlacementInfo::PlacementUnit *, std::vector< DeviceInfo::DeviceSite * > > PU2LegalSites
a mapping from PlaceuementUnit objects to device sites
Definition: PlacementInfo.h:4456
DesignInfo::DesignCell::isBRAM
bool isBRAM()
Definition: DesignInfo.h:954
PlacementInfo::CompatiblePlacementTable
describes the type mapping from design to device, where a cell can be placed (which BEL in which site...
Definition: PlacementInfo.h:94
PlacementInfo::CompatiblePlacementTable::cellType2sharedBELTypes
std::map< DesignInfo::DesignCellType, std::vector< std::string > > cellType2sharedBELTypes
the mapping from design cell type to device resource type
Definition: PlacementInfo.h:153
PlacementInfo::PlacementMacro::_fixedPlacementInfo_inMacro::siteName
std::string siteName
Definition: PlacementInfo.h:1740
PlacementInfo::sharedCellType2BELtypeFileName
std::string sharedCellType2BELtypeFileName
Definition: PlacementInfo.h:4588
PlacementInfo::adjustLUTFFUtilization_Packablity
void adjustLUTFFUtilization_Packablity(float neighborDisplacementUpperbound, bool enfore)
adjust the resource demand of LUTs/FFs according to packing feasibility
Definition: PlacementInfo.cc:1073
PlacementInfo::ClusterNet::~ClusterNet
~ClusterNet()
Definition: PlacementInfo.h:2547
PlacementInfo::getGlobalMinX
float getGlobalMinX()
Get the Global Min X (left boundary of the device)
Definition: PlacementInfo.h:2872
PlacementInfo::getDisplacement
float getDisplacement(float fX, float fY, DeviceInfo::DeviceSite *curSite)
Get the Displacement from a given location to a device site (y2xRatio is considered....
Definition: PlacementInfo.h:3781
PlacementInfo::PlacementUnit::getAnchorLocation
void getAnchorLocation(float &x, float &y)
Definition: PlacementInfo.h:1018
PlacementInfo::PlacementMacro::getCellOffsetXInMacro
float getCellOffsetXInMacro(DesignInfo::DesignCell *cell)
Definition: PlacementInfo.h:1756
PlacementInfo::enhanceHighFanoutNet
void enhanceHighFanoutNet()
Definition: PlacementInfo.cc:2019
PlacementInfo::PlacementUnit::clockNets
std::set< DesignInfo::DesignNet * > clockNets
record the clock nets connected to this PlacementUnit
Definition: PlacementInfo.h:1392
PlacementInfo::PlacementBinInfo::shrinkBinBy
void shrinkBinBy(float r)
reduce the resource capacity by a given ratio
Definition: PlacementInfo.h:521
PlacementInfo::getInflateRatio
float getInflateRatio(DesignInfo::DesignCell *cell)
Get the inflate ratio of a cell.
Definition: PlacementInfo.h:2968
PlacementInfo::getDeviceMaxEdgeLength
float getDeviceMaxEdgeLength()
Definition: PlacementInfo.h:2927
PlacementTimingInfo::getMediumPathThresholdLevel
int getMediumPathThresholdLevel()
Definition: PlacementTimingInfo.h:860
PlacementInfo::isDensePlacement
bool isDensePlacement()
Definition: PlacementInfo.h:4388
PlacementInfo::PlacementUnit::checkHasBRAM
bool checkHasBRAM()
Definition: PlacementInfo.h:1304
PlacementInfo::setPULegalSite
void setPULegalSite(std::map< PlacementInfo::PlacementUnit *, std::vector< DeviceInfo::DeviceSite * >> &PU2Sites)
set the sites occupied by the PlacementUnit objects
Definition: PlacementInfo.h:3668
PlacementInfo::PlacementSiteTypeInfo::potentialLocations
std::vector< location > potentialLocations
Definition: PlacementInfo.h:360
PlacementInfo::getPlacementUnitByCellId
PlacementUnit * getPlacementUnitByCellId(int cellId)
Definition: PlacementInfo.h:3127
PlacementInfo::getcellId2Occupation
std::vector< float > & getcellId2Occupation()
Definition: PlacementInfo.h:2973
PlacementInfo::PlacementBinInfo::getBinShrinkRatio
float getBinShrinkRatio()
Definition: PlacementInfo.h:568
PlacementInfo::getPseudoNetWeight
float getPseudoNetWeight()
Get the Pseudo Net Weight object.
Definition: PlacementInfo.h:4026
DesignInfo::DesignCell::originallyIsLUTRAM
bool originallyIsLUTRAM()
Definition: DesignInfo.h:945
PlacementInfo::setClusterNum
void setClusterNum(int _clusterNum)
Definition: PlacementInfo.h:4378
PlacementInfo::dumpPlacementUnitLocationCnt
int dumpPlacementUnitLocationCnt
Definition: PlacementInfo.h:4610
PlacementInfo::updateSiteBinGrid
void updateSiteBinGrid()
Definition: PlacementInfo.cc:1657
PlacementInfo::setPULegalXY
void setPULegalXY(std::map< PlacementInfo::PlacementUnit *, float > &PU2X, std::map< PlacementInfo::PlacementUnit *, float > &PU2Y)
set the legalization of some PlacementUnit objects
Definition: PlacementInfo.h:3648
PlacementInfo::PlacementHybridBinInfo::utilization
int utilization
Definition: PlacementInfo.h:994
PlacementInfo::PlacementMacro::getLeftOffset
float getLeftOffset()
Definition: PlacementInfo.h:1810
PlacementInfo::_ClockNetCoverage
the retangular clock region coverage of a clock net
Definition: PlacementInfo.h:4549
PlacementInfo::CompatiblePlacementTable::sharedCellBELTypeName2ID
std::map< std::string, int > sharedCellBELTypeName2ID
Definition: PlacementInfo.h:306
PlacementInfo::PlacementNet::leftPinId_net
unsigned int leftPinId_net
Definition: PlacementInfo.h:2476
PlacementInfo::ClusterUnit::getWeight
int getWeight()
Definition: PlacementInfo.h:2499
PlacementInfo::PlacementUnit
a movement unit in placement with information of location and resource demand
Definition: PlacementInfo.h:1010
PlacementInfo::PlacementHybridBinInfo::binShrinkRatio
float binShrinkRatio
Definition: PlacementInfo.h:995
DesignInfo::DesignCell::getCellId
int getCellId()
Get the Cell Id in the cell list.
Definition: DesignInfo.h:1037
PlacementInfo::PlacementHybridBinInfo::reset
void reset()
Definition: PlacementInfo.h:909
PlacementInfo::PlacementBinInfo::getManhattanDistanceTo
float getManhattanDistanceTo(float inX, float inY)
Get the shortest Manhattan distance from the bin to a specific location.
Definition: PlacementInfo.h:413
PlacementInfo::PlacementUnit::getId
unsigned int getId()
Definition: PlacementInfo.h:1206
PlacementInfo::PlacementUnpackedCell::getCell
DesignInfo::DesignCell * getCell()
Definition: PlacementInfo.h:1497
PlacementInfo::CompatiblePlacementTable::setBELTypeForCells
void setBELTypeForCells(DesignInfo *designInfo)
set the mapping from cells in design netlist to BEL type ID for later processing.
Definition: PlacementInfo.cc:217
PlacementInfo::PlacementBinInfo::~PlacementBinInfo
~PlacementBinInfo()
Definition: PlacementInfo.h:400
PlacementInfo::ClusterUnit::~ClusterUnit
~ClusterUnit()
Definition: PlacementInfo.h:2498
PlacementInfo::PlacementNet::addB2BNet
void addB2BNet(std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, int puId0, int puId1, float pos0, float pos1, float pinOffset0, float pinOffset1, bool movable0, bool movable1, float w)
set weights of the terms in the quadratic problem
Definition: PlacementInfo.h:2353
PlacementInfo::PlacementUnit::isPlaced
bool isPlaced()
Definition: PlacementInfo.h:1181
PlacementInfo::fixedPlacementUnits
std::vector< PlacementUnit * > fixedPlacementUnits
Definition: PlacementInfo.h:4436
PlacementInfo::PlacementNet::addPseudoNet_enhancePin2Pin
void addPseudoNet_enhancePin2Pin(std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, float generalWeight, float y2xRatio, bool updateX, bool updateY, int PUIdA, int PUIdB, int pinIdA_net, int pinIdB_net)
Definition: PlacementInfo.h:2303
DesignInfo::DesignCell::isLUT
bool isLUT()
Definition: DesignInfo.h:927
PlacementInfo::CellBinInfo::Y
int Y
Definition: PlacementInfo.h:3638
PlacementInfo::getSiteBinGrid
std::vector< std::vector< PlacementSiteBinInfo * > > & getSiteBinGrid()
Definition: PlacementInfo.h:3115
PlacementInfo::PlacementUnit::setSpreadLocation
void setSpreadLocation(float x, float y, float forgetRatio)
Set the Spread Location based on forgetting ratio.
Definition: PlacementInfo.h:1076
PlacementInfo::PlacementUnpackedCell::setLockedAt
void setLockedAt(std::string _siteName, std::string _BELName, DeviceInfo *deviceInfo, bool lock=true)
Definition: PlacementInfo.h:1479
PlacementInfo::PlacementUnit::recordSpreadLocatin
void recordSpreadLocatin()
Definition: PlacementInfo.h:1138
PlacementInfo::PlacementHybridBinInfo::getCapacity
float getCapacity()
Definition: PlacementInfo.h:933
PlacementInfo::deviceInfo
DeviceInfo * deviceInfo
Definition: PlacementInfo.h:4444
PlacementInfo::legalizeXYInArea
void legalizeXYInArea(PlacementUnit *curPU, float &fX, float &fY)
move the PlacementUnit to ensure the cells in it are within the device area.
Definition: PlacementInfo.h:3364
PlacementInfo::globalBinGrid
std::vector< std::vector< PlacementBinInfo * > > globalBinGrid
Bin Grid includes all types of sites, mainly for congestion evalution.
Definition: PlacementInfo.h:4519
PlacementInfo::PlacementBinInfo::correspondingSites
std::vector< DeviceInfo::DeviceSite * > correspondingSites
Definition: PlacementInfo.h:825
PlacementInfo::PlacementHybridBinInfo::bottom
float bottom()
Definition: PlacementInfo.h:984
PlacementInfo::getClockCol2ClockNets
std::map< DeviceInfo::ClockColumn *, std::set< DesignInfo::DesignNet * > > & getClockCol2ClockNets()
Definition: PlacementInfo.h:4368
PlacementInfo::PlacementSiteTypeInfo
information for a site, e.g. what BEL in site and where are these kind of sites
Definition: PlacementInfo.h:322
PlacementInfo::PlacementSiteTypeInfo::correspondingSites
const std::vector< DeviceInfo::DeviceSite * > & correspondingSites
Definition: PlacementInfo.h:361
DeviceInfo::DeviceSite::setOccupied
void setOccupied()
Definition: DeviceInfo.h:316
PlacementInfo::resetLUTFFDeterminedOccupation
void resetLUTFFDeterminedOccupation()
reset the LUTFFDeterminedOccupation object
Definition: PlacementInfo.h:4087
PlacementInfo::PaintTypes
std::vector< int > PaintTypes
Definition: PlacementInfo.h:4542
PlacementInfo::macroPseudoNetEnhanceCnt
int macroPseudoNetEnhanceCnt
Definition: PlacementInfo.h:4616
PlacementInfo::PlacementNet::drawNet
void drawNet(float generalWeight=1.0)
Definition: PlacementInfo.cc:760
PlacementInfo::CompatiblePlacementTable::getPotentialBELTypeIDs
std::vector< int > & getPotentialBELTypeIDs(DesignInfo::DesignCellType cellType)
Get the potential BEL Type IDs for a specific cell type.
Definition: PlacementInfo.h:203
PlacementInfo::getTimingInfo
PlacementTimingInfo * getTimingInfo()
Definition: PlacementInfo.h:3313
PlacementInfo::PlacementSiteBinInfo
Site bin for global placement for some specific Site types.
Definition: PlacementInfo.h:2575
PlacementInfo::PlacementUnit::isFixed
bool isFixed()
Definition: PlacementInfo.h:1177
PlacementInfo::PlacementHybridBinInfo::isOverflow
bool isOverflow()
Definition: PlacementInfo.h:938
PlacementInfo::siteGridForMacros
std::vector< std::vector< PlacementSiteBinInfo * > > siteGridForMacros
Definition: PlacementInfo.h:4520
PlacementInfo::dumpOverflowClockUtilization
void dumpOverflowClockUtilization()
Definition: PlacementInfo.cc:2163
PlacementInfo::PlacementMacro::addOccupiedSite
void addOccupiedSite(float siteOffset, float occ)
for site-level cell spreading
Definition: PlacementInfo.h:1827
PlacementInfo::transferCellBinInfo
void transferCellBinInfo(int cellId, float fX, int fY)
update the bin information of a design cell when it is moved to a new location
Definition: PlacementInfo.h:3751
PlacementInfo::PlacementUnpackedCell::getFixedSiteName
std::string getFixedSiteName()
Definition: PlacementInfo.h:1507
PlacementInfo::getMinXFromSites
float getMinXFromSites(std::vector< DeviceInfo::DeviceSite * > &sites)
Get the Min X of sites to identify the boundary of the device.
Definition: PlacementInfo.cc:250
PlacementInfo::PlacementUnit::isPacked
bool isPacked()
Definition: PlacementInfo.h:1377
PlacementInfo::PlacementSiteBinInfo::addMacroSite
void addMacroSite(PlacementMacro *curMacro, float occupationAdded)
Definition: PlacementInfo.h:2603
PlacementInfo::PlacementMacro::cellSet
std::set< DesignInfo::DesignCell * > cellSet
Definition: PlacementInfo.h:1854
PlacementInfo::ClusterNet::getUnits
std::vector< ClusterUnit * > & getUnits()
Definition: PlacementInfo.h:2548
PlacementInfo::CompatiblePlacementTable::defaultCellId2Occupation
std::vector< float > defaultCellId2Occupation
Definition: PlacementInfo.h:310
PlacementInfo::PlacementSiteBinInfo::Y
int Y()
Definition: PlacementInfo.h:2665
PlacementInfo::globalMinX
float globalMinX
left boundary of the device
Definition: PlacementInfo.h:4461
PlacementInfo::PlacementHybridBinInfo::row
int row
Definition: PlacementInfo.h:1001
PlacementInfo::PUsContainingFF
std::vector< PlacementUnit * > PUsContainingFF
Definition: PlacementInfo.h:4532
PlacementInfo::ClusterNet::id
int id
Definition: PlacementInfo.h:2565
PlacementInfo::PlacementMacro::PlacementMacroType
PlacementMacroType
Definition: PlacementInfo.h:1528
PlacementInfo::enhanceRiskyClockNet
void enhanceRiskyClockNet()
Definition: PlacementInfo.cc:2034
PlacementInfo::ClusterUnit
a group of PlacementUnits
Definition: PlacementInfo.h:2489
PlacementInfo::PlacementBinInfo::sharedCellType
std::string sharedCellType
Definition: PlacementInfo.h:824
PlacementInfo::setCellBinInfo
void setCellBinInfo(int cellId, int sharedTypeId, int X, int Y, float occupation)
Set the cell bin Information of a design cell.
Definition: PlacementInfo.h:3733
PlacementInfo::PlacementUnit::setLocked
void setLocked()
Definition: PlacementInfo.h:1156
PlacementInfo::PlacementBinInfo::getRequiredBinShrinkRatio
float getRequiredBinShrinkRatio()
Definition: PlacementInfo.h:541
PlacementInfo::PlacementBinInfo::inRange
bool inRange(float x, float y)
check if the bin covers a given location on the device
Definition: PlacementInfo.h:449
PlacementInfo::PlacementNet::topPinY
float topPinY
Definition: PlacementInfo.h:2474
PlacementInfo::isClockLegalizationRisky
bool isClockLegalizationRisky()
Definition: PlacementInfo.h:4394
PlacementInfo::PlacementNet::updateNetBounds
bool updateNetBounds(bool updateX, bool updateY)
update the bounding box of the net
Definition: PlacementInfo.h:2006
PlacementInfo::PlacementBinInfo::column
const int column
Definition: PlacementInfo.h:841
PlacementInfo::PUWithManyNetsRatio
float PUWithManyNetsRatio
Definition: PlacementInfo.h:4620
PlacementInfo::PlacementHybridBinInfo::topY
float topY
Definition: PlacementInfo.h:998
PlacementInfo::PlacementUnit::addFF
void addFF()
Definition: PlacementInfo.h:1288
PlacementInfo::PlacementUnit::getBRAMNum
int getBRAMNum()
Definition: PlacementInfo.h:1349
PlacementInfo::PlacementSiteBinInfo::binShrinkRatio
float binShrinkRatio
Definition: PlacementInfo.h:2679
PlacementInfo::PlacementUnit::setAnchorLocation
void setAnchorLocation(float x, float y)
Set the Anchor Location for the PlacementUnit.
Definition: PlacementInfo.h:1052
operator<<
std::ostream & operator<<(std::ostream &os, PlacementInfo::PlacementMacro *curMacro)
Definition: PlacementInfo.cc:802
PlacementInfo::eps
float eps
Definition: PlacementInfo.h:4506
PlacementInfo::getBinGridW
float getBinGridW()
Get the width of a bin in grid.
Definition: PlacementInfo.h:3615
PlacementInfo::addPUIntoClockColumn
void addPUIntoClockColumn(PlacementInfo::PlacementUnit *curPU, DeviceInfo::DeviceSite *curSite)
map the given PlacementUnit to the site for later checking of the half-column clock legalization rule...
Definition: PlacementInfo.h:4301
PlacementInfo::endX
float endX
right boundary of the bin grid
Definition: PlacementInfo.h:4497
PlacementInfo::PlacementHybridBinInfo::capacity
int capacity
Definition: PlacementInfo.h:993
PlacementInfo::PlacementUnit::getType
PlacementUnitType getType()
Definition: PlacementInfo.h:1191
DesignInfo::getCells
std::vector< DesignCell * > & getCells()
Definition: DesignInfo.h:1609
PlacementInfo::PlacementHybridBinInfo::cells
std::set< DesignInfo::DesignCell * > cells
Definition: PlacementInfo.h:992
PlacementInfo::getPU2ClockRegionColumn
std::map< PlacementUnit *, int > & getPU2ClockRegionColumn()
get the PlacementUnit Mapping to clock region column for timing optimzation
Definition: PlacementInfo.h:4353
PlacementInfo::PlacementSiteBinInfo::bottomY
float bottomY
Definition: PlacementInfo.h:2683
PlacementInfo::PlacementBinInfo::top
float top()
return the top boundary of the bin
Definition: PlacementInfo.h:713
PlacementInfo::getMaxXFromSites
float getMaxXFromSites(std::vector< DeviceInfo::DeviceSite * > &sites)
Get the Max X of sites to identify the boundary of the device.
Definition: PlacementInfo.cc:272
PlacementInfo::PlacementUnit::isMCLB
bool isMCLB()
Definition: PlacementInfo.h:1337
PlacementInfo::PlacementMacro::hasCell
bool hasCell(DesignInfo::DesignCell *curCell)
Definition: PlacementInfo.h:1562
PlacementInfo::y2xRatio
float y2xRatio
a factor to tune the weights of the net spanning in Y-coordinate relative to the net spanning in X-co...
Definition: PlacementInfo.h:4596
PlacementInfo::checkClockUtilization
bool checkClockUtilization(bool dump)
check the utlization of the clock regions on the device
Definition: PlacementInfo.cc:2087
DeviceInfo::getBELType2FalseBELType
std::string getBELType2FalseBELType(std::string curBELType)
Definition: DeviceInfo.h:1122
PlacementInfo::PlacementMacro::left
float left
Definition: PlacementInfo.h:1863
PlacementInfo::clockLegalizationRisky
bool clockLegalizationRisky
Definition: PlacementInfo.h:4613
PlacementInfo::PlacementUnpackedCell::~PlacementUnpackedCell
~PlacementUnpackedCell()
Definition: PlacementInfo.h:1475
PlacementInfo::printOutClockColumnLegalization
void printOutClockColumnLegalization(PlacementInfo::PlacementUnit *curPU, DeviceInfo::DeviceSite *curSite)
Definition: PlacementInfo.h:4278
PlacementInfo::PlacementUnit::lastSpreadX
float lastSpreadX
Definition: PlacementInfo.h:1399
PlacementInfo::getPULocationByCellLocation
void getPULocationByCellLocation(DesignInfo::DesignCell *curCell, float targetX, float targetY, float &PUX, float &PUY)
Definition: PlacementInfo.h:3546
PlacementInfo::PlacementMacro::macroType
PlacementMacroType macroType
Definition: PlacementInfo.h:1864
PlacementInfo::PlacementMacro::_fixedPlacementInfo_inMacro::cell
DesignInfo::DesignCell * cell
Definition: PlacementInfo.h:1739
DeviceInfo::DeviceBEL
BEL(Basic Element of Logic), the smallest undividable element.
Definition: DeviceInfo.h:114
PlacementInfo::PlacementBinInfo::getClockRegionX
int getClockRegionX()
Get the clock region X for this bin.
Definition: PlacementInfo.h:818
PlacementInfo::CellBinInfo::sharedTypeId
int sharedTypeId
Definition: PlacementInfo.h:3636
PlacementInfo::PlacementUnit::setPlaced
void setPlaced()
Definition: PlacementInfo.h:1171
PlacementInfo::PlacementNet::getDriverUnits
std::vector< PlacementUnit * > & getDriverUnits()
Get the reference of the vector of the driver units that drive the net.
Definition: PlacementInfo.h:1953
PlacementInfo::globalMaxY
float globalMaxY
top boundary of the device
Definition: PlacementInfo.h:4476
PlacementInfo::PlacementNet::PlacementNet
PlacementNet(DesignInfo::DesignNet *designNet, int id, std::vector< PlacementUnit * > &cellId2PlacementUnitVec, PlacementInfo *placementInfo)
Construct a new Placement Net object.
Definition: PlacementInfo.h:1886
PlacementInfo::PlacementUnit::lastAnchorX
float lastAnchorX
Definition: PlacementInfo.h:1398
PlacementInfo::paintData
PaintDataBase * paintData
Definition: PlacementInfo.h:4538
PlacementInfo::PlacementHybridBinInfo::bottomY
float bottomY
Definition: PlacementInfo.h:999
DeviceInfo
Information class related to FPGA device, including the details of BEL/Site/Tile/ClockRegion.
Definition: DeviceInfo.h:43
PlacementInfo::PlacementNet::pinOffsetsInUnit
std::vector< pinOffset > pinOffsetsInUnit
Definition: PlacementInfo.h:2468
PlacementInfo::PlacementUnit::getLUTRAMNum
int getLUTRAMNum()
Definition: PlacementInfo.h:1353
PlacementInfo::PlacementMacro::_fixedPlacementInfo_inMacro::BELName
std::string BELName
Definition: PlacementInfo.h:1741
PlacementInfo::dumpPlacementUnitInformation
void dumpPlacementUnitInformation(std::string dumpFile)
dump the PlacementUnit objects and some placement parameters as a checkpoint
Definition: PlacementInfo.cc:1723
DeviceInfo::DeviceSite::X
float X()
Definition: DeviceInfo.h:288
PlacementInfo::PlacementMacro::PlacementMacro
PlacementMacro(std::string name, int id, PlacementMacroType macroType)
Definition: PlacementInfo.h:1545
PlacementInfo::enforceLegalizeXYInArea
void enforceLegalizeXYInArea(PlacementUnit *curPU)
move the PlacementUnit to ensure the cells in it are within the device area.
Definition: PlacementInfo.h:3402
PlacementInfo::getPlacementNets
std::vector< PlacementNet * > & getPlacementNets()
Definition: PlacementInfo.h:2822
PlacementInfo::PlacementMacro::PlacementMacroType_HALFCLB
@ PlacementMacroType_HALFCLB
Definition: PlacementInfo.h:1532
delayVisualization.Y
Y
Definition: delayVisualization.py:80
PlacementInfo::PlacementInfo
PlacementInfo(DesignInfo *designInfo, DeviceInfo *deviceInfo, std::map< std::string, std::string > &JSONCfg)
Construct a new Placement Info object based on the information of design and device.
Definition: PlacementInfo.cc:36
PlacementInfo::PlacementUnit::BRAMcnt
int BRAMcnt
Definition: PlacementInfo.h:1430
PlacementInfo::PlacementBinInfo::Y
int Y()
return the row of the bin in the grid
Definition: PlacementInfo.h:673
PlacementInfo::PlacementBinInfo::switchSupplyForNets
float switchSupplyForNets
Definition: PlacementInfo.h:847
PlacementInfo::PlacementBinInfo::row
const int row
Definition: PlacementInfo.h:840
PlacementInfo::PlacementHybridBinInfo::inRange
bool inRange(float x, float y)
Definition: PlacementInfo.h:878
PlacementInfo::PlacementBinInfo::getCapacity
float getCapacity()
Definition: PlacementInfo.h:627
PlacementInfo::getGlobalBinGrid
std::vector< std::vector< PlacementBinInfo * > > & getGlobalBinGrid()
Definition: PlacementInfo.h:4373
PlacementInfo::PlacementMacro::getVirtualCellInfo
void getVirtualCellInfo(int vId, float &x, float &y, DesignInfo::DesignCellType &cellType)
Get the virtual cell information, including offsets and cell type.
Definition: PlacementInfo.h:1779
PlacementInfo::getActualOccupation
float getActualOccupation(DesignInfo::DesignCell *cell)
Get the actual occupation of a specific cell.
Definition: PlacementInfo.h:2957
PlacementInfo::PlacementUnitType_Macro
@ PlacementUnitType_Macro
Definition: PlacementInfo.h:70
PlacementInfo::PlacementBinInfo::topY
const float topY
Definition: PlacementInfo.h:836
PlacementInfo::PlacementBinInfo::clockRegionX
int clockRegionX
Definition: PlacementInfo.h:850
PlacementInfo::PlacementMacro::addCell
void addCell(DesignInfo::DesignCell *curCell, DesignInfo::DesignCellType cellType, float x, float y)
add a real cell into the macro with its offsets in the macro
Definition: PlacementInfo.h:1576
PlacementInfo::PlacementUnit::setAnchorLocationAndForgetTheOriginalOne
void setAnchorLocationAndForgetTheOriginalOne(float x, float y)
Definition: PlacementInfo.h:1128
PlacementInfo::PlacementUnpackedCell
the smallest, indivisible, representable component. It will include only one standard cell
Definition: PlacementInfo.h:1447
PlacementInfo::getDeterminedOccupation
int getDeterminedOccupation(int cellId)
Definition: PlacementInfo.h:4099
PlacementInfo::PlacementSiteBinInfo::~PlacementSiteBinInfo
~PlacementSiteBinInfo()
Definition: PlacementInfo.h:2587
PlacementInfo::PlacementHybridBinInfo::~PlacementHybridBinInfo
~PlacementHybridBinInfo()
Definition: PlacementInfo.h:872
PlacementInfo::PlacementUnit::PlacementUnit
PlacementUnit(std::string name, int id, PlacementUnitType unitType)
Definition: PlacementInfo.h:1012
PlacementInfo::PlacementBinInfo::getUtilization
float getUtilization()
Definition: PlacementInfo.h:622
PlacementInfo::PlacementNet::_pinOffset::y
float y
Definition: PlacementInfo.h:1935
PlacementInfo::PlacementNet::getUnits
std::vector< PlacementUnit * > & getUnits()
Get the reference of the vector of PlacementUnits connected to the net The placement units in the vec...
Definition: PlacementInfo.h:1943
PlacementInfo::PlacementBinInfo::getSwitchDemandForNets
float getSwitchDemandForNets() const
get the net routing demand of the bin
Definition: PlacementInfo.h:799
PlacementInfo::PlacementBinInfo::left
float left()
return the left boundary of the bin
Definition: PlacementInfo.h:693
PlacementInfo::setMacroLegalizationParameters
void setMacroLegalizationParameters(int cnt, float _macroLegalizationWeight)
Set the Macro Legalization Parameters.
Definition: PlacementInfo.h:4075
PlacementInfo::getBinGridH
float getBinGridH()
Get the height of a bin in grid.
Definition: PlacementInfo.h:3625
PlacementInfo::PlacementNet::getId
int getId()
Get the Id of the net in current placement procedure.
Definition: PlacementInfo.h:1983
PlacementInfo::CompatiblePlacementTable::getcellId2Occupation
std::vector< float > & getcellId2Occupation()
get the reference of cellId2Occupation for convenience
Definition: PlacementInfo.h:274
PlacementInfo::cellInMacros
std::set< DesignInfo::DesignCell * > cellInMacros
Definition: PlacementInfo.h:4437
PlacementInfo::getMacroPseudoNetEnhanceCnt
int getMacroPseudoNetEnhanceCnt()
Get the Macro Pseudo Net Enhance Counter.
Definition: PlacementInfo.h:4040
PlacementInfo::PlacementBinInfo::countOverflow
void countOverflow()
increase one time of overflow situation
Definition: PlacementInfo.h:737
PlacementInfo::binWidth
float binWidth
Definition: PlacementInfo.h:4521
PlacementInfo::PlacementBinInfo::getNoOverflowCounter
int getNoOverflowCounter()
Definition: PlacementInfo.h:761
PlacementInfo::PlacementHybridBinInfo::canAddMore
bool canAddMore(int BELAmo)
Definition: PlacementInfo.h:951
PlacementInfo::PlacementUnit::lastY
float lastY()
Definition: PlacementInfo.h:1039
PlacementInfo::PU2ClockRegionCenters
std::map< PlacementUnit *, std::pair< float, float > > PU2ClockRegionCenters
Definition: PlacementInfo.h:4535
PlacementInfo::PlacementUnit::numUnitsDriveThisPU
int numUnitsDriveThisPU
Definition: PlacementInfo.h:1437
PlacementInfo::PlacementUnpackedCell::BELName
std::string BELName
Definition: PlacementInfo.h:1516
PlacementInfo::placementProressRatio
float placementProressRatio
the progress ratio, indicating the progress of the placement convergence.
Definition: PlacementInfo.h:4583
PlacementInfo::CompatiblePlacementTable::getSharedBELTypeId
int getSharedBELTypeId(std::string tmpStr)
get the ID of SharedBELType from a string
Definition: PlacementInfo.h:215
PlacementInfo::PlacementMacro::getCells
std::vector< DesignInfo::DesignCell * > & getCells()
Definition: PlacementInfo.h:1724
PlacementInfo::PlacementSiteBinInfo::canAddMore
bool canAddMore(int BELAmo)
Definition: PlacementInfo.h:2652
PlacementInfo::CompatiblePlacementTable::sharedCellType2SiteType
std::map< std::string, std::string > sharedCellType2SiteType
The mapping from shared cell types to device site types.
Definition: PlacementInfo.h:169
PlacementInfo::getHighFanOutThr
int getHighFanOutThr()
Definition: PlacementInfo.h:4399
PlacementInfo::PlacementHybridBinInfo::PlacementHybridBinInfo
PlacementHybridBinInfo(PlacementBinInfo *curBin)
Definition: PlacementInfo.h:862
PlacementInfo::netPinNumDistribution
int netPinNumDistribution[8]
Definition: PlacementInfo.h:4589
PlacementInfo::ClusterNet::ClusterNet
ClusterNet(int id)
Definition: PlacementInfo.h:2543
PlacementInfo::lastProgressWhenLUTFFUtilAdjust
float lastProgressWhenLUTFFUtilAdjust
Definition: PlacementInfo.h:4619
checkHalfColumn.i
int i
Definition: checkHalfColumn.py:5
PlacementInfo::getDesignInfo
DesignInfo * getDesignInfo()
Definition: PlacementInfo.h:3303
DesignInfo::DesignNet::getPinPairEnhanceRatio
float getPinPairEnhanceRatio(int pinIdInNetA, int pinIdInNetB)
Get the Pin Pair Enhance Ratio (placer can customize some 2-pin interconnections to make their weight...
Definition: DesignInfo.h:630
PlacementInfo::PlacementUnit::unitType
PlacementUnitType unitType
Definition: PlacementInfo.h:1400
PlacementInfo::PlacementUnit::setUnfixed
void setUnfixed()
Definition: PlacementInfo.h:1150
PlacementInfo::PlacementHybridBinInfo::rightX
float rightX
Definition: PlacementInfo.h:997
PlacementInfo::updateLongPaths
void updateLongPaths()
update the long path in the design and enhance their net weights
Definition: PlacementInfo.cc:635
PlacementInfo::PlacementBinInfo::resetBinShrinkRatio
void resetBinShrinkRatio()
Definition: PlacementInfo.h:536
PlacementInfo::PlacementUnit::addDSP
void addDSP()
Definition: PlacementInfo.h:1272
PlacementInfo::PlacementUnit::addLUT
void addLUT()
Definition: PlacementInfo.h:1284
PlacementInfo::PlacementNet::rightPuId
unsigned int rightPuId
Definition: PlacementInfo.h:2475
PlacementInfo::getPlacementUnitByCell
PlacementUnit * getPlacementUnitByCell(DesignInfo::DesignCell *curCell)
Definition: PlacementInfo.h:3120
PlacementInfo::PlacementNet::getPinOffsetsInUnit
std::vector< pinOffset > & getPinOffsetsInUnit()
Get the Pin Offsets (x,y) of the Units object.
Definition: PlacementInfo.h:1993
PlacementInfo::CompatiblePlacementTable::sharedCellType2BELNames
std::map< std::string, std::vector< std::string > > sharedCellType2BELNames
The mapping from shared cell types to device BEL types.
Definition: PlacementInfo.h:179
PlacementInfo::PlacementUnit::placed
bool placed
the PlacementUnit is placed to BEL slot.
Definition: PlacementInfo.h:1420
PlacementInfo::PlacementNet::topPinId_net
unsigned int topPinId_net
Definition: PlacementInfo.h:2476
PlacementInfo::globalMinY
float globalMinY
bottom boundary of the device
Definition: PlacementInfo.h:4466
DesignInfo::addCell
DesignCell * addCell(DesignCell *curCell)
add a cell into the design information
Definition: DesignInfo.cc:617
PlacementInfo::CompatiblePlacementTable::getActualOccupationByCellId
float getActualOccupationByCellId(int id)
Get the Actual Occupation By Cell Id.
Definition: PlacementInfo.h:264
PlacementInfo::startX
float startX
left boundary of the bin grid
Definition: PlacementInfo.h:4483
PlacementInfo::CompatiblePlacementTable::getcellId2InfationRatio
std::vector< float > & getcellId2InfationRatio()
get the reference of cellId2InfationRatio for convenience
Definition: PlacementInfo.h:284
PlacementInfo::PlacementUnit::isLCLB
bool isLCLB()
Definition: PlacementInfo.h:1341
PlacementInfo::SharedBELTypeBinGrid
std::vector< std::vector< std::vector< PlacementBinInfo * > > > SharedBELTypeBinGrid
Definition: PlacementInfo.h:4507
PlacementInfo::CellBinInfo
struct PlacementInfo::CellBinInfo CellBinInfo
record the bin information for a cell (BELtype, column/row, resource demand)
PlacementInfo::clockCol2ClockNets
std::map< DeviceInfo::ClockColumn *, std::set< DesignInfo::DesignNet * > > clockCol2ClockNets
Definition: PlacementInfo.h:4537
PlacementInfo::cellType2sharedCellTypeFileName
std::string cellType2sharedCellTypeFileName
Definition: PlacementInfo.h:4587
PlacementInfo::PlacementNet::isGlobalClock
bool isGlobalClock()
Definition: PlacementInfo.h:2457
PlacementInfo::PlacementHybridBinInfo::addCell
void addCell(DesignInfo::DesignCell *cell, int occupationAdded)
Definition: PlacementInfo.h:888
PlacementInfo::getPUWithManyNetsRatio
float getPUWithManyNetsRatio()
get the proportion of the PlacementUnit objects with high interconnection density
Definition: PlacementInfo.h:4194
PlacementInfo::PlacementBinInfo::requiredBinShrinkRatio
float requiredBinShrinkRatio
Definition: PlacementInfo.h:832
PlacementInfo::PlacementSiteBinInfo::addSiteIntoBin
void addSiteIntoBin(DeviceInfo::DeviceSite *curSite)
Definition: PlacementInfo.cc:1634
PlacementInfo::adjustLUTFFUtilization
void adjustLUTFFUtilization(float neighborDisplacementUpperbound, bool enfore=false)
adjust the resource demand of LUTs/FFs according to packing feasibility and routing congestion
Definition: PlacementInfo.cc:1544
PlacementInfo::getPU2ClockRegionCenters
std::map< PlacementUnit *, std::pair< float, float > > & getPU2ClockRegionCenters()
get the PlacementUnit Mapping to clock region centers for timing optimzation
Definition: PlacementInfo.h:4343
DesignInfo::DesignCell::getInputPins
std::vector< DesignPin * > & getInputPins()
Definition: DesignInfo.h:918
PlacementInfo::PlacementUnit::isLocked
bool isLocked()
Definition: PlacementInfo.h:1166
DesignInfo::DesignCell::getClockNets
std::set< DesignNet * > & getClockNets()
Get the clock nets connected to this cell for later legalization.
Definition: DesignInfo.h:1109
PlacementInfo::getMediumPathThresholdLevel
int getMediumPathThresholdLevel()
Definition: PlacementInfo.h:4363
PlacementInfo::CompatiblePlacementTable::designInfo
DesignInfo * designInfo
Definition: PlacementInfo.h:311
PlacementInfo::PlacementNet::getTopPUId
int getTopPUId()
Definition: PlacementInfo.h:2445
PlacementInfo::PlacementNet::unitsOfPinsBeDriven
std::vector< PlacementUnit * > unitsOfPinsBeDriven
Definition: PlacementInfo.h:2467
PlacementInfo::PlacementUnit::addCARRY
void addCARRY()
Definition: PlacementInfo.h:1292
PlacementInfo::guiEnable
bool guiEnable
Definition: PlacementInfo.h:4628
PlacementInfo::PlacementMacro::addFixedCellInfo
void addFixedCellInfo(DesignInfo::DesignCell *cell, std::string siteName, std::string BELName)
add information of a fixed cell
Definition: PlacementInfo.h:1751
PlacementInfo::placementNets
std::vector< PlacementNet * > placementNets
Definition: PlacementInfo.h:4524
PlacementInfo::PlacementNet::getHPWL
float getHPWL(float y2xRatio)
get current HPWL of the net
Definition: PlacementInfo.h:2076
PlacementInfo::PlacementUnit::addMUX
void addMUX()
Definition: PlacementInfo.h:1296
PlacementInfo::PU2ClockRegionColumn
std::map< PlacementUnit *, int > PU2ClockRegionColumn
Definition: PlacementInfo.h:4536
PlacementInfo::pinId2location
std::vector< Location > pinId2location
Definition: PlacementInfo.h:4442
PlacementInfo::PlacementBinInfo::overflowCnt
int overflowCnt
Definition: PlacementInfo.h:843
PlacementInfo::PlacementNet::getNewHPWLByTrying
float getNewHPWLByTrying(PlacementUnit *curPU, double targetPUX, double targetPUY, float y2xRatio) const
Get the New HPWL By Trying to move a PlacementUnit object.
Definition: PlacementInfo.h:2093
PlacementInfo::setMinHPWL
void setMinHPWL(float val)
record the minimum HPWL during placement procedure
Definition: PlacementInfo.h:4205
PlacementInfo::PlacementNet::getBottomPinY
float getBottomPinY()
Definition: PlacementInfo.h:2427
PlacementInfo::PlacementHybridBinInfo::getCells
std::set< DesignInfo::DesignCell * > & getCells()
Definition: PlacementInfo.h:915
PlacementInfo::PlacementMacro::top
float top
Definition: PlacementInfo.h:1863
PlacementInfo::simplePlacementTimingInfo
PlacementTimingInfo * simplePlacementTimingInfo
Definition: PlacementInfo.h:4445
PlacementInfo::PlacementMacro::PlacementMacroType_BRAM
@ PlacementMacroType_BRAM
Definition: PlacementInfo.h:1539
PlacementInfo::PlacementSiteBinInfo::getMacros
std::vector< PlacementMacro * > & getMacros()
Definition: PlacementInfo.h:2616
PlacementInfo::PlacementMacro::getMacroType
PlacementMacroType getMacroType()
Definition: PlacementInfo.h:1841
PlacementInfo::PlacementNet::id
int id
Definition: PlacementInfo.h:2471
PlacementInfo::PlacementUnit::resetPacked
void resetPacked()
Definition: PlacementInfo.h:1373
PlacementInfo::getClockColumnUtilizationIncrease
int getClockColumnUtilizationIncrease(PlacementInfo::PlacementUnit *curPU, DeviceInfo::DeviceSite *curSite)
check the clock resource increase extent if the given PlacementUnit can be mapped to the site conside...
Definition: PlacementInfo.h:4266
PlacementInfo::PlacementSiteBinInfo::PlacementSiteBinInfo
PlacementSiteBinInfo(float leftX, float rightX, float bottomY, float topY, int row, int column)
Definition: PlacementInfo.h:2577
PlacementInfo::PlacementNet::getRightPinX
float getRightPinX()
Definition: PlacementInfo.h:2415
PlacementInfo::PlacementNet::bottomPUY
float bottomPUY
Definition: PlacementInfo.h:2473
PlacementInfo::PlacementMacro::fixedCells
std::vector< fixedPlacementInfo_inMacro > fixedCells
Definition: PlacementInfo.h:1861
PlacementInfo::PlacementMacro::getFixedCellInfoVec
std::vector< fixedPlacementInfo_inMacro > & getFixedCellInfoVec()
Definition: PlacementInfo.h:1846
PlacementInfo::PlacementUnpackedCell::siteName
std::string siteName
Definition: PlacementInfo.h:1515
PlacementInfo::PlacementMacro::offsetX
std::vector< float > offsetX
Definition: PlacementInfo.h:1860
PlacementInfo::binHeight
float binHeight
Definition: PlacementInfo.h:4522
PlacementInfo::PlacementNet::leftPuId
unsigned int leftPuId
Definition: PlacementInfo.h:2475
PlacementInfo::PlacementBinInfo::PlacementBinInfo
PlacementBinInfo(std::string sharedCellType, float leftX, float rightX, float bottomY, float topY, int row, int column, CompatiblePlacementTable *compatiblePlacementTable)
Construct a new Placement Bin Info object.
Definition: PlacementInfo.h:390
PlacementInfo::PlacementSiteTypeInfo::~PlacementSiteTypeInfo
~PlacementSiteTypeInfo()
Definition: PlacementInfo.h:351
PlacementInfo::PlacementUnit::getCARRYNum
int getCARRYNum()
Definition: PlacementInfo.h:1361
PlacementInfo::CompatiblePlacementTable::realBELTypeName2ID
std::map< std::string, int > realBELTypeName2ID
each actual BEL type gets an integer ID for checking
Definition: PlacementInfo.h:125
DesignInfo
Information related to FPGA designs, including design cells and their interconnections.
Definition: DesignInfo.h:51
PlacementInfo::PlacementSiteBinInfo::leftX
float leftX
Definition: PlacementInfo.h:2680
PlacementInfo::addB2BNetInPlacementInfo
void addB2BNetInPlacementInfo(std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, int puId0, int puId1, float pos0, float pos1, float pinOffset0, float pinOffset1, bool movable0, bool movable1, float w)
directly set weight in the quadratic Matrix and vector according to given request.
Definition: PlacementInfo.h:3159
PlacementInfo::PlacementBinInfo::contains
bool contains(DesignInfo::DesignCell *cell)
Definition: PlacementInfo.h:499
PlacementInfo::PlacementSiteBinInfo::setYX
void setYX(int i, int j)
Definition: PlacementInfo.h:2659
PlacementInfo::PlacementNet::topPUY
float topPUY
Definition: PlacementInfo.h:2473
PlacementInfo::setPseudoNetWeight
void setPseudoNetWeight(float weight)
Set the Pseudo Net Weight according to a given value.
Definition: PlacementInfo.h:4014
PlacementInfo::setDeterminedOccupation
void setDeterminedOccupation(int cellId, int occupation)
Set the Determined Occupation of a specific cell.
Definition: PlacementInfo.h:4112
PlacementInfo::Location::Y
float Y
Definition: PlacementInfo.h:3597
PlacementInfo::cellId2CellBinInfo
std::vector< CellBinInfo > cellId2CellBinInfo
Definition: PlacementInfo.h:4440
PlacementInfo::clusterNum
int clusterNum
Definition: PlacementInfo.h:4612
delayVisualization.disX
disX
Definition: delayVisualization.py:51
PlacementInfo::getCellInMacros
std::set< DesignInfo::DesignCell * > & getCellInMacros()
Definition: PlacementInfo.h:2826
PlacementInfo::PlacementHybridBinInfo::removeCell
void removeCell(DesignInfo::DesignCell *cell, int occupationAdded)
Definition: PlacementInfo.h:895
PlacementInfo::createGridBins
void createGridBins(float binWidth, float binHeight)
Create a grid of bins on the device.
Definition: PlacementInfo.cc:325
PlacementInfo::CompatiblePlacementTable::realBELTypes
std::vector< std::string > realBELTypes
the actual BEL types according to the definition file
Definition: PlacementInfo.h:119
PlacementInfo::PlacementHybridBinInfo::contains
bool contains(DesignInfo::DesignCell *cell)
Definition: PlacementInfo.h:903
PlacementTimingInfo::buildSimpleTimingGraph
void buildSimpleTimingGraph()
build a simple timing graph, where the inner delay between pin paris for an element will be identical
Definition: PlacementTimingInfo.cc:92
PlacementInfo::PlacementUnit::hasRegister
bool hasRegister()
Definition: PlacementInfo.h:1328
PlacementInfo::globalMaxX
float globalMaxX
right boundary of the device
Definition: PlacementInfo.h:4471
PlacementInfo::PlacementSiteBinInfo::utilization
float utilization
Definition: PlacementInfo.h:2678
PlacementInfo::PlacementUnit::fixed
bool fixed
fixed simply means the PlacementUnit cannot be moved.
Definition: PlacementInfo.h:1412
PlacementInfo::clockNetCoverages
std::vector< ClockNetCoverage > clockNetCoverages
Definition: PlacementInfo.h:4576
PlacementInfo::PlacementBinInfo::getType
std::string getType()
Definition: PlacementInfo.h:728
PlacementTimingInfo::getLongPathThresholdLevel
int getLongPathThresholdLevel()
Definition: PlacementTimingInfo.h:855
PlacementInfo::getPotentialBELTypeIDs
std::vector< int > & getPotentialBELTypeIDs(DesignInfo::DesignCell *cell)
Definition: PlacementInfo.h:2932
PlacementInfo::PlacementSiteBinInfo::row
int row
Definition: PlacementInfo.h:2685
PlacementInfo::getGlobalBinMaxLocX
float getGlobalBinMaxLocX()
get right boundary of the bin grid
Definition: PlacementInfo.h:2892
PlacementInfo::PlacementSiteBinInfo::column
int column
Definition: PlacementInfo.h:2686
PlacementInfo::PlacementUnit::addBRAM
void addBRAM()
Definition: PlacementInfo.h:1276
PlacementInfo::getGlobalMaxY
float getGlobalMaxY()
Get the Global Max Y (top boundary of the device)
Definition: PlacementInfo.h:2862
PlacementInfo::LUTFFBinGrid
std::vector< std::vector< PlacementBinInfo * > > LUTFFBinGrid
Bin Grid for LUTs and FFs, mainly for searching neighbor elements during packing.
Definition: PlacementInfo.h:4513
PlacementInfo::macroLegalizationWeight
float macroLegalizationWeight
Definition: PlacementInfo.h:4617
PlacementInfo::PlacementSiteTypeInfo::siteType
std::string siteType
Definition: PlacementInfo.h:358
PlacementInfo::PlacementBinInfo::getCorrespondingSites
std::vector< DeviceInfo::DeviceSite * > & getCorrespondingSites()
Get the reference of the set of sites in the bin.
Definition: PlacementInfo.h:775
PlacementInfo::PlacementNet::bottomPuId
unsigned int bottomPuId
Definition: PlacementInfo.h:2475
PlacementInfo::PlacementSiteBinInfo::macros
std::vector< PlacementMacro * > macros
Definition: PlacementInfo.h:2676
DeviceInfo::DeviceSite::Y
float Y()
Definition: DeviceInfo.h:292
PlacementInfo
Information related to FPGA placement (wirelength optimization, cell spreading, legalization,...
Definition: PlacementInfo.h:59
PlacementInfo::Location
struct PlacementInfo::Location Location
PlacementInfo::ClusterUnit::getUnits
std::vector< PlacementInfo::PlacementUnit * > & getUnits()
Definition: PlacementInfo.h:2520
PlacementInfo::PlacementHybridBinInfo::getUtilization
float getUtilization()
Definition: PlacementInfo.h:928
PlacementInfo::_ClockNetCoverage::topRegionY
int topRegionY
the top row in the grid of clock regions
Definition: PlacementInfo.h:4568
PlacementInfo::ClusterNet::getId
int getId()
Definition: PlacementInfo.h:2553
PlacementInfo::PlacementMacro::right
float right
Definition: PlacementInfo.h:1863
PlacementInfo::PlacementMacro::getTopOffset
float getTopOffset()
Definition: PlacementInfo.h:1802
PlacementInfo::ClusterUnit::totalDSPNum
int totalDSPNum
Definition: PlacementInfo.h:2532
PlacementInfo::PlacementBinInfo::resetNoOverflowCounter
void resetNoOverflowCounter()
Definition: PlacementInfo.h:753
DesignInfo::DesignCell::isDSP
bool isDSP()
Definition: DesignInfo.h:971