AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
DesignInfo.h
Go to the documentation of this file.
1 
25 #ifndef _DESIGNINFO
26 #define _DESIGNINFO
27 
28 #include "DeviceInfo.h"
29 #include <assert.h>
30 #include <fstream>
31 #include <iostream>
32 #include <map>
33 #include <sstream>
34 #include <string>
35 #include <vector>
36 
37 #define CELLTYPESTRS \
38  "LUT1", "LUT2", "LUT3", "LUT4", "LUT5", "LUT6", "LUT6_2", "FDCE", "FDPE", "FDRE", "FDSE", "LDCE", "AND2B1L", \
39  "CARRY8", "DSP48E2", "MUXF7", "MUXF8", "SRL16E", "SRLC32E", "RAM32M16", "RAM64M", "RAM64X1D", "RAM32M", \
40  "RAM32X1D", "RAM32X1S", "RAM64X1S", "RAM64M8", "RAM256X1D", "FIFO36E2", "FIFO18E2", "RAMB18E2", "RAMB36E2", \
41  "BUFGCE", "BUFG_GT", "BUFG_GT_SYNC", "BUFGCE_DIV", "BUFGCTRL", "GTHE3_CHANNEL", "GTHE3_COMMON", "IOBUF", \
42  "IBUF", "IBUFDS", "IOBUFDS", "IBUFDS_GTE3", "IBUF_ANALOG", "IOBUFE3", "MMCME3_ADV", "OBUF", "OBUFT", \
43  "PCIE_3_1", "BSCANE2", "SYSMONE1", "RXTX_BITSLICE", "BITSLICE_CONTROL", "TX_BITSLICE_TRI", "OSERDESE3", \
44  "RIU_OR", "PLLE3_ADV", "HPIO_VREF", "OBUFDS_DUAL_BUF"
45 
51 {
52  public:
59  {
64  };
65 
72  enum DesignCellType // have to have the the same order with CELLTYPESTRS macro
73  {
80  CellType_LUT6_2, // these are LUTs
81 
87  CellType_AND2B1L, // these are FFs
88 
91 
94 
96  CellType_SRLC32E, // these are shifters
97 
106  CellType_RAM256X1D, // these are LUTRAMs
107 
111  CellType_RAMB36E2, // these are BRAMs
112 
117  CellType_BUFGCTRL, // clock-related types
118 
128 
130 
134 
141 
146  };
147 
148  inline static bool FFSRCompatible(DesignCellType typeA, DesignCellType typeB)
149  {
150  // CellType_FDCE,
151  // CellType_FDPE,
152  // CellType_FDRE,
153  // CellType_FDSE,
154  // CellType_LDCE,
155  // CellType_AND2B1L, // these are FFs
156  int AClass = -1;
157  if (typeA == CellType_FDCE || typeA == CellType_FDPE)
158  AClass = 0;
159  else if (typeA == CellType_FDRE || typeA == CellType_FDSE)
160  AClass = 1;
161  else if (typeA == CellType_LDCE)
162  AClass = 2;
163  else if (typeA == CellType_AND2B1L)
164  AClass = 3;
165  assert(AClass != -1);
166  int BClass = -1;
167  if (typeB == CellType_FDCE || typeB == CellType_FDPE)
168  BClass = 0;
169  else if (typeB == CellType_FDRE || typeB == CellType_FDSE)
170  BClass = 1;
171  else if (typeB == CellType_LDCE)
172  BClass = 2;
173  else if (typeB == CellType_AND2B1L)
174  BClass = 3;
175  assert(BClass != -1);
176  return AClass == BClass;
177  }
178 
179  inline static bool getFFSRType(DesignCellType typeA)
180  {
181  int AClass = -1;
182  if (typeA == CellType_FDCE || typeA == CellType_FDPE)
183  AClass = 0;
184  else if (typeA == CellType_FDRE || typeA == CellType_FDSE)
185  AClass = 1;
186  else if (typeA == CellType_LDCE)
187  AClass = 2;
188  else if (typeA == CellType_AND2B1L)
189  AClass = 3;
190  assert(AClass != -1);
191  return AClass;
192  }
193 
194  std::vector<std::string> DesignCellTypeStr{CELLTYPESTRS};
195 
197  {
200  PinType_CLK, // FF clk
203  PinType_E, // FF enable
204  PinType_SR, // FF reset/set
206  };
207 
215  {
216  public:
219  {
220  }
221 
222  DesignElement(const std::string &name, DesignElementType type, int id)
223  : name(name), parentPtr(nullptr), type(type), id(id)
224  {
225  }
226  DesignElement(bool isVirtual, DesignElementType type, int id) : parentPtr(nullptr), type(type), id(id)
227  {
228  assert(isVirtual);
229  name = std::to_string(id);
230  }
231 
232  DesignElement(bool isVirtual, const std::string &_name, DesignElementType type, int id)
233  : parentPtr(nullptr), type(type), id(id)
234  {
235  assert(isVirtual);
236  name = _name + "(" + std::to_string(id) + ")";
237  }
238 
239  virtual ~DesignElement()
240  {
241  }
242 
243  inline const std::string &getName() const
244  {
245  return name;
246  }
248  {
249  return parentPtr;
250  }
252  {
253  return type;
254  }
255  inline int getElementIdInType()
256  {
257  return id;
258  }
259 
260  private:
261  std::string name;
264  int id;
265  };
266 
267  class DesignPin;
268  class DesignNet;
269  class DesignCell;
270  class ControlSetInfo;
271 
276  class DesignPin : public DesignElement
277  {
278  public:
290  DesignPin(std::string &name, std::string &refpinname, DesignPinType pinType, bool inputOrNot,
291  DesignElement *parentPtr, int id)
294  {
295  }
296 
298  {
299  }
300 
310  static DesignPinType checkPinType(DesignCell *cell, std::string &refpinname, bool isInput);
311 
318  {
319  return pinType;
320  }
321 
327  inline std::string &getNetName()
328  {
329  return netName;
330  }
331 
337  inline void connectToNetName(std::string &_netName)
338  {
339  netName = _netName;
340  }
341 
342  inline int getAliasNetId()
343  {
344  return aliasNetId;
345  }
346 
347  inline void setAliasNetId(int _aliasNetId)
348  {
349  aliasNetId = _aliasNetId;
350  }
351 
357  inline void connectToNetVariable(DesignNet *_netPtr)
358  {
359  netPtr = _netPtr;
360  }
361 
362  inline bool isOutputPort()
363  {
364  return !inputOrNot;
365  }
366 
367  inline bool isInputPort()
368  {
369  return inputOrNot;
370  }
371 
377  inline void setDriverPinName(std::string &_driverPinName)
378  {
379  driverPinName = _driverPinName;
380  }
381 
387  inline void setDriverPin(DesignPin *_driverPinPtr)
388  {
389  driverPin = _driverPinPtr;
390  }
391 
399  {
400  return driverPin;
401  }
402 
408  inline DesignNet *getNet()
409  {
410  return netPtr;
411  };
412 
418  inline DesignCell *getCell()
419  {
420  DesignElement *tmpElement = getParentPtr();
421  DesignCell *parentCell = dynamic_cast<DesignCell *>(tmpElement);
422  assert(parentCell);
423  return parentCell;
424  }
425 
431  std::string &getRefPinName()
432  {
433  return refpinname;
434  }
435 
440  inline void setUnconnected()
441  {
442  unconnected = true;
443  }
444 
452  inline bool isUnconnected()
453  {
454  return unconnected;
455  }
456 
463  inline void setOffsetInCell(float x, float y)
464  {
465  offsetXInCell = x;
466  offsetYInCell = y;
467  }
468 
474  inline float getOffsetXInCell()
475  {
476  return offsetXInCell;
477  }
478 
484  inline float getOffsetYInCell()
485  {
486  return offsetYInCell;
487  }
488 
489  inline bool isFixed()
490  {
491  return fixed;
492  }
493 
494  inline void setFixed()
495  {
496  fixed = true;
497  }
498 
499  private:
507  std::string netName;
508  std::string refpinname;
509  DesignNet *netPtr = nullptr;
511  bool unconnected = false;
512  bool fixed = false;
513  std::string driverPinName;
514  DesignPin *driverPin = nullptr;
515  float offsetXInCell = 0.0;
516  float offsetYInCell = 0.0;
517  int aliasNetId = -1;
518  };
519 
524  class DesignNet : public DesignElement
525  {
526  public:
536  DesignNet(std::string &name, int id, bool virtualNet = false)
538  {
539  if (name == "<const0>" || name == "<const1>")
540  {
541  isPowerNet = true;
542  }
545  }
546 
548  {
549  }
550 
556  void connectToPinName(const std::string &_pinName);
564  void connectToPinVariable(DesignPin *_pinPtr);
565 
571  inline std::vector<DesignPin *> &getDriverPins()
572  {
573  return driverPinPtrs;
574  }
575 
581  inline std::vector<DesignPin *> &getPinsBeDriven()
582  {
583  return BeDrivenPinPtrs;
584  }
585 
591  inline std::vector<DesignPin *> &getPins()
592  {
593  return pinPtrs;
594  }
595 
596  inline bool isVirtual()
597  {
598  return virtualNet;
599  }
600 
609  inline void enhance(int pinIdInNetA, int pinIdInNetB, float ratio)
610  {
611  std::pair<int, int> tmpPair(pinIdInNetA, pinIdInNetB);
613  {
614  pinIdPinIdInNet2EnhanceRatio[tmpPair] = ratio;
615  }
616  else
617  {
618  pinIdPinIdInNet2EnhanceRatio[tmpPair] *= ratio;
619  }
620  }
621 
630  inline float getPinPairEnhanceRatio(int pinIdInNetA, int pinIdInNetB)
631  {
632  std::pair<int, int> tmpPair(pinIdInNetA, pinIdInNetB);
634  {
635  return 1.0;
636  }
637  else
638  {
639  return pinIdPinIdInNet2EnhanceRatio[tmpPair];
640  }
641  }
642 
649  {
651  }
652 
659  {
661  }
662 
668  inline float getOverallEnhanceRatio()
669  {
671  }
672 
678  inline void setOverallClusterNetEnhancement(float r)
679  {
681  }
682 
688  inline void setOverallTimingNetEnhancement(float r)
689  {
691  }
692 
699  {
701  }
702 
709  {
711  }
712 
713  inline void resetEnhanceRatio()
714  {
718  }
719 
726  inline void setGlobalClock()
727  {
728  isGlobalClock = true;
729  }
730 
737  inline bool checkIsGlobalClock()
738  {
739  return isGlobalClock;
740  }
741 
748  inline bool checkIsPowerNet()
749  {
750  return isPowerNet;
751  }
752 
753  inline bool checkContainFixedPins()
754  {
755  return containFixedPins;
756  }
757 
758  inline void setContainFixedPins()
759  {
760  containFixedPins = true;
761  }
762 
763  private:
764  std::vector<std::string> pinNames;
765  std::vector<DesignPin *> pinPtrs;
766  std::vector<DesignPin *> driverPinPtrs;
767  std::vector<DesignPin *> BeDrivenPinPtrs;
768  bool containFixedPins = false;
769  std::map<std::pair<int, int>, float> pinIdPinIdInNet2EnhanceRatio;
773  bool isGlobalClock = false;
774  bool isPowerNet = false;
775  };
776 
781  class DesignCell : public DesignElement
782  {
783  public:
794  {
795  pinPtrs.clear();
796  inputPinPtrs.clear();
797  outputPinPtrs.clear();
798  pinNames.clear();
799  netPtrs.clear();
800  inputNetPtrs.clear();
801  outputNetPtrs.clear();
802  netNames.clear();
803  }
804 
812  DesignCell(const std::string &name, DesignCellType cellType, int id)
814  {
816  pinPtrs.clear();
817  inputPinPtrs.clear();
818  outputPinPtrs.clear();
819  pinNames.clear();
820  netPtrs.clear();
821  inputNetPtrs.clear();
822  outputNetPtrs.clear();
823  netNames.clear();
824  }
825 
835  {
837  pinPtrs.clear();
838  inputPinPtrs.clear();
839  outputPinPtrs.clear();
840  pinNames.clear();
841  netPtrs.clear();
842  inputNetPtrs.clear();
843  outputNetPtrs.clear();
844  netNames.clear();
845  assert(isVirtual);
846  }
847 
856  DesignCell(bool isVirtual, const std::string &name, DesignCellType cellType, int id)
858  {
860  pinPtrs.clear();
861  inputPinPtrs.clear();
862  outputPinPtrs.clear();
863  pinNames.clear();
864  netPtrs.clear();
865  inputNetPtrs.clear();
866  outputNetPtrs.clear();
867  netNames.clear();
868  assert(isVirtual);
869  }
870 
876  {
877  for (auto pin : pinPtrs)
878  delete pin;
879  }
880 
882  {
883  return cellType;
884  }
885 
891  void addPin(DesignPin *_pinPtr);
892 
893  inline std::vector<DesignPin *> &getPins()
894  {
895  return pinPtrs;
896  }
897 
904  void addNetForPin(DesignPin *_pinPtr, DesignNet *_netPtr);
905 
906  inline std::vector<DesignNet *> &getOutputNets()
907  {
908  return outputNetPtrs;
909  }
910  inline std::vector<DesignNet *> &getInputNets()
911  {
912  return inputNetPtrs;
913  }
914  inline std::vector<DesignPin *> &getOutputPins()
915  {
916  return outputPinPtrs;
917  }
918  inline std::vector<DesignPin *> &getInputPins()
919  {
920  return inputPinPtrs;
921  }
922 
923  inline bool isLUT6()
924  {
926  }
927  inline bool isLUT()
928  {
932  }
933  inline bool isFF()
934  {
937  }
938  inline bool isLUTRAM()
939  {
944  }
945  inline bool originallyIsLUTRAM()
946  {
953  }
954  inline bool isBRAM()
955  {
958  }
959  inline bool isMux()
960  {
962  }
963  inline bool isCarry()
964  {
965  return cellType == CellType_CARRY8;
966  }
967  inline bool isShift()
968  {
970  }
971  inline bool isDSP()
972  {
973  return cellType == CellType_DSP48E2;
974  }
975  inline bool checkHasDSPReg()
976  {
977  return hasDSPReg;
978  }
979  inline bool isIO()
980  {
985 
987 
989 
993 
996  }
997 
998  inline bool isClockBuffer()
999  {
1002  }
1003 
1004  inline bool isShifter()
1005  {
1007  }
1008 
1015  inline bool isTimingEndPoint()
1016  {
1017  return (isFF() || isLUTRAM() || originallyIsLUTRAM() || isBRAM() || isDSP() || isIO() || isClockBuffer() ||
1018  isShifter());
1019  }
1020 
1027  inline bool isLogicRelated()
1028  {
1029  return (isLUT() || isFF() || isLUTRAM() || originallyIsLUTRAM() || isBRAM() || isDSP() || isShifter());
1030  }
1031 
1037  inline int getCellId()
1038  {
1039  return getElementIdInType();
1040  }
1041 
1042  inline bool isVirtualCell()
1043  {
1044  return isVirtual;
1045  }
1046 
1055  {
1056  return controlSetInfo;
1057  }
1058 
1066  inline void setControlSetInfo(ControlSetInfo *_controlSetInfo)
1067  {
1068  controlSetInfo = _controlSetInfo;
1069  }
1070 
1079  inline void setVirtualType(DesignCellType NewCellType)
1080  {
1081  cellType = NewCellType;
1082  }
1083 
1090  {
1091  return oriCellType;
1092  }
1093 
1099  inline void addClockNet(DesignNet *aClockNet)
1100  {
1101  clockNetPtrs.insert(aClockNet);
1102  }
1103 
1109  inline std::set<DesignNet *> &getClockNets()
1110  {
1111  return clockNetPtrs;
1112  }
1113 
1114  inline void setHasDSPReg(bool _hasDSPReg)
1115  {
1116  hasDSPReg = _hasDSPReg;
1117  }
1118 
1119  inline void setTimingLength(int _timingLength)
1120  {
1121  timingLength = _timingLength;
1122  }
1123 
1124  inline int getTimingLength()
1125  {
1126  return timingLength;
1127  }
1128 
1129  private:
1130  std::vector<DesignPin *> pinPtrs;
1131  std::vector<DesignPin *> inputPinPtrs;
1132  std::vector<DesignPin *> outputPinPtrs;
1133  std::vector<std::string> pinNames;
1134  std::vector<DesignNet *> netPtrs;
1135  std::vector<DesignNet *> inputNetPtrs;
1136  std::vector<DesignNet *> outputNetPtrs;
1137  std::set<DesignNet *> clockNetPtrs;
1138  std::vector<std::string> netNames;
1141  bool isVirtual = false;
1142  bool hasDSPReg = false;
1144  int timingLength = 0;
1145  };
1146 
1152  {
1153  public:
1161  {
1162  FFs.clear();
1163  setControlSetInfoAs(curFF);
1164  };
1165 
1167 
1179  {
1180  for (auto inputPin : curFF->getInputPins())
1181  {
1182  if (inputPin->getPinType() == DesignInfo::PinType_CLK)
1183  {
1184  if (inputPin->isUnconnected() && CLK)
1185  return false;
1186  if (inputPin->getNet() != CLK)
1187  return false;
1188  }
1189  else if (inputPin->getPinType() == DesignInfo::PinType_E)
1190  {
1191  if (inputPin->isUnconnected() && CE)
1192  return false;
1193  if (inputPin->getNet() != CE)
1194  return false;
1195  }
1196  else if (inputPin->getPinType() == DesignInfo::PinType_SR)
1197  {
1198  if (inputPin->isUnconnected() && SR)
1199  return false;
1200  if (inputPin->getNet() != SR)
1201  return false;
1202  }
1203  else if (inputPin->getPinType() == DesignInfo::PinType_D)
1204  {
1205  // bypass
1206  }
1207  else
1208  {
1209  assert(false && "undefined FF input pin type.");
1210  }
1211  }
1212  if (FFSRCompatible(curFF->getOriCellType(), FFType))
1213  return false;
1214  return true;
1215  }
1216 
1223  {
1224  for (auto inputPin : curFF->getInputPins())
1225  {
1226  if (inputPin->getPinType() == DesignInfo::PinType_CLK)
1227  {
1228  if (inputPin->isUnconnected())
1229  CLK = nullptr;
1230  CLK = inputPin->getNet();
1231  }
1232  else if (inputPin->getPinType() == DesignInfo::PinType_E)
1233  {
1234  if (inputPin->isUnconnected())
1235  CE = nullptr;
1236  CE = inputPin->getNet();
1237  }
1238  else if (inputPin->getPinType() == DesignInfo::PinType_SR)
1239  {
1240  if (inputPin->isUnconnected())
1241  SR = nullptr;
1242  SR = inputPin->getNet();
1243  }
1244  else if (inputPin->getPinType() == DesignInfo::PinType_D)
1245  {
1246  // bypass
1247  }
1248  else
1249  {
1250  assert(false && "undefined FF input pin type.");
1251  }
1252  }
1253  FFType = curFF->getOriCellType();
1254  }
1255 
1257  {
1258  return CLK;
1259  }
1261  {
1262  return SR;
1263  }
1265  {
1266  return CE;
1267  }
1268 
1270  {
1271  return FFType;
1272  }
1278  inline const int getId() const
1279  {
1280  return id;
1281  }
1282 
1288  inline void addFF(DesignInfo::DesignCell *curFF)
1289  {
1290  FFs.push_back(curFF);
1291  }
1292 
1298  inline std::vector<DesignInfo::DesignCell *> &getFFs()
1299  {
1300  return FFs;
1301  }
1302 
1303  inline void display()
1304  {
1305  if (CLK)
1306  std::cout << "CLK: " << CLK->getName() << "\n";
1307  if (SR)
1308  std::cout << "SR: " << SR->getName() << "\n";
1309  if (CE)
1310  std::cout << "CE: " << CE->getName() << "\n";
1311  std::vector<std::string> DesignCellTypeStr{CELLTYPESTRS};
1312  std::cout << "CellType: " << DesignCellTypeStr[(int)FFType] << "\n";
1313  }
1314 
1315  private:
1320  std::vector<DesignInfo::DesignCell *> FFs;
1321  int id = -1;
1322  };
1323 
1324  inline static bool isLUT(DesignCellType cellType)
1325  {
1326  return cellType == CellType_LUT6_2 || cellType == CellType_LUT6 || cellType == CellType_LUT5 ||
1327  cellType == CellType_LUT4 || cellType == CellType_LUT3 || cellType == CellType_LUT2 ||
1328  cellType == CellType_LUT1;
1329  }
1330 
1331  inline static bool isCarry(DesignCellType cellType)
1332  {
1333  return cellType == CellType_CARRY8;
1334  }
1335 
1336  inline static bool isDSP(DesignCellType cellType)
1337  {
1338  return cellType == CellType_DSP48E2;
1339  }
1340 
1341  inline static bool isBRAM(DesignCellType cellType)
1342  {
1343  return cellType == CellType_RAMB36E2 || cellType == CellType_RAMB18E2 || cellType == CellType_FIFO18E2 ||
1344  cellType == CellType_FIFO36E2;
1345  }
1346 
1347  inline static bool isMux(DesignCellType cellType)
1348  {
1349  return cellType == CellType_MUXF7 || cellType == CellType_MUXF8;
1350  }
1351 
1352  inline static bool isLUTRAM(DesignCellType cellType)
1353  {
1354  return (cellType == CellType_RAM32M16 || cellType == CellType_RAM32X1D || cellType == CellType_RAM64X1S ||
1355  cellType == CellType_RAM64M || cellType == CellType_RAM64X1D || cellType == CellType_RAM32M ||
1356  cellType == CellType_RAM32X1D || cellType == CellType_RAM32X1S || cellType == CellType_RAM64X1S ||
1357  cellType == CellType_RAM64M8 || cellType == CellType_RAM256X1D);
1358  }
1359 
1360  inline static bool isFF(DesignCellType cellType)
1361  {
1362  return cellType == CellType_FDCE || cellType == CellType_FDPE || cellType == CellType_FDSE ||
1363  cellType == CellType_LDCE || cellType == CellType_FDRE || cellType == CellType_AND2B1L;
1364  }
1365 
1366  inline static bool isIO(DesignCellType cellType)
1367  {
1368  return cellType == CellType_GTHE3_CHANNEL || cellType == CellType_GTHE3_COMMON || cellType == CellType_IOBUF ||
1369  cellType == CellType_IBUF || cellType == CellType_IBUFDS || cellType == CellType_IOBUFDS ||
1370  cellType == CellType_IBUFDS_GTE3 || cellType == CellType_IBUF_ANALOG || cellType == CellType_IOBUFE3 ||
1371 
1372  cellType == CellType_MMCME3_ADV ||
1373 
1374  cellType == CellType_OBUF || cellType == CellType_OBUFT || cellType == CellType_PCIE_3_1 ||
1375 
1376  cellType == CellType_BSCANE2 || cellType == CellType_SYSMONE1 || cellType == CellType_RXTX_BITSLICE ||
1377  cellType == CellType_BITSLICE_CONTROL || cellType == CellType_TX_BITSLICE_TRI ||
1378  cellType == CellType_OSERDESE3 ||
1379 
1380  cellType == CellType_RIU_OR || cellType == CellType_PLLE3_ADV || cellType == CellType_HPIO_VREF ||
1381  cellType == CellType_OBUFDS_DUAL_BUF;
1382  }
1383 
1384  inline bool isClockBuffer(DesignCellType cellType)
1385  {
1386  return cellType == CellType_BUFGCE || cellType == CellType_BUFG_GT || cellType == CellType_BUFG_GT_SYNC ||
1387  cellType == CellType_BUFGCE_DIV || cellType == CellType_BUFGCTRL;
1388  }
1389  inline bool isShifter(DesignCellType cellType)
1390  {
1391  return cellType == CellType_SRL16E || cellType == CellType_SRLC32E;
1392  }
1393 
1401  inline bool isLogicRelated(DesignCellType cellType)
1402  {
1403  return (isLUT(cellType) || isFF(cellType) || isLUTRAM(cellType) || isBRAM(cellType) || isDSP(cellType) ||
1404  isShifter(cellType));
1405  }
1406 
1407  // clang-format off
1430  // clang-format on
1431  DesignInfo(std::map<std::string, std::string> &JSONCfg, DeviceInfo *deviceInfo);
1432 
1434  {
1435  for (auto net : netlist)
1436  delete net;
1437  for (auto cell : cells)
1438  delete cell;
1439  for (auto CS : controlSets)
1440  delete CS;
1441  }
1442 
1448  void addPinToNet(DesignPin *curPin);
1449 
1457  DesignCellType fromStringToCellType(std::string &cellName, std::string &typeName);
1458 
1465  DesignCell *addCell(DesignCell *curCell);
1466 
1475  inline void getCLKSRCENetId(DesignInfo::DesignCell *curFF, int &CLKId, int &SRId, int &CEId)
1476  {
1477  assert(curFF->isFF());
1478  CLKId = -1;
1479  SRId = -1;
1480  CEId = -1;
1481  for (auto inputPin : curFF->getInputPins())
1482  {
1483  if (inputPin->getPinType() == DesignInfo::PinType_CLK)
1484  {
1485  if (!inputPin->isUnconnected())
1486  CLKId = inputPin->getNet()->getElementIdInType();
1487  }
1488  else if (inputPin->getPinType() == DesignInfo::PinType_E)
1489  {
1490  if (!inputPin->isUnconnected())
1491  CEId = inputPin->getNet()->getElementIdInType();
1492  }
1493  else if (inputPin->getPinType() == DesignInfo::PinType_SR)
1494  {
1495  if (!inputPin->isUnconnected())
1496  SRId = inputPin->getNet()->getElementIdInType();
1497  }
1498  else if (inputPin->getPinType() == DesignInfo::PinType_D)
1499  {
1500  // bypass
1501  }
1502  else
1503  {
1504  assert(false && "undefined FF input pin type.");
1505  }
1506  }
1507  }
1508 
1517  inline void getCLKSRCENet(DesignInfo::DesignCell *curFF, DesignNet **CLK, DesignNet **SR, DesignNet **CE)
1518  {
1519  assert(curFF->isFF());
1520  *CLK = nullptr;
1521  *SR = nullptr;
1522  *CE = nullptr;
1523  for (auto inputPin : curFF->getInputPins())
1524  {
1525  if (inputPin->getPinType() == DesignInfo::PinType_CLK)
1526  {
1527  if (!inputPin->isUnconnected())
1528  *CLK = inputPin->getNet();
1529  }
1530  else if (inputPin->getPinType() == DesignInfo::PinType_E)
1531  {
1532  if (!inputPin->isUnconnected())
1533  *CE = inputPin->getNet();
1534  }
1535  else if (inputPin->getPinType() == DesignInfo::PinType_SR)
1536  {
1537  if (!inputPin->isUnconnected())
1538  *SR = inputPin->getNet();
1539  }
1540  else if (inputPin->getPinType() == DesignInfo::PinType_D)
1541  {
1542  // bypass
1543  }
1544  else
1545  {
1546  assert(false && "undefined FF input pin type.");
1547  }
1548  }
1549  }
1550 
1556  void loadClocks(std::string clockFileName);
1557 
1562  void updateFFControlSets();
1563 
1568  void enhanceFFControlSetNets();
1569 
1575  inline std::vector<ControlSetInfo *> &getControlSets()
1576  {
1577  return controlSets;
1578  }
1579 
1586  inline int getFFControlSetId(DesignCell *curFF)
1587  {
1588  assert(curFF->isFF());
1589  assert(FFId2ControlSetId[curFF->getCellId()] >= 0);
1590  return FFId2ControlSetId[curFF->getCellId()];
1591  }
1592 
1599 
1600  inline int getNumCells()
1601  {
1602  return cells.size();
1603  };
1604  inline int getNumNets()
1605  {
1606  return netlist.size();
1607  };
1608 
1609  inline std::vector<DesignCell *> &getCells()
1610  {
1611  return cells;
1612  };
1613  inline std::vector<DesignNet *> &getNets()
1614  {
1615  return netlist;
1616  };
1617  inline std::vector<DesignPin *> &getPins()
1618  {
1619  return pins;
1620  };
1621 
1627  {
1628  for (auto net : netlist)
1629  net->resetEnhanceRatio();
1630  }
1631 
1632  void printStat(bool verbose = false);
1633 
1634  inline DesignCell *getCell(std::string &tmpName)
1635  {
1636  if (name2Cell.find(tmpName) == name2Cell.end())
1637  {
1638  std::cout << "cannot find cell:" << tmpName << "\n";
1639  return nullptr;
1640  }
1641  return name2Cell[tmpName];
1642  }
1643 
1644  inline DesignNet *getNet(std::string &tmpName)
1645  {
1646  if (name2Net.find(tmpName) == name2Net.end())
1647  {
1648  std::cout << "cannot find net:" << tmpName << "\n";
1649  return nullptr;
1650  }
1651  return name2Net[tmpName];
1652  }
1653 
1659  inline std::vector<std::vector<DesignCell *>> &getPredefinedClusters()
1660  {
1661  return predefinedClusters;
1662  }
1663 
1664  inline std::map<DesignCellType, std::vector<DesignCell *>> &getType2Cells()
1665  {
1666  return type2Cells;
1667  }
1668 
1676  {
1677  LUTFFDeterminedOccupation.clear();
1678  LUTFFDeterminedOccupation.resize(cells.size(), -1);
1679  }
1680 
1688  inline int getDeterminedOccupation(int cellId)
1689  {
1690  return LUTFFDeterminedOccupation[cellId];
1691  }
1692 
1701  inline void setDeterminedOccupation(int cellId, int occupation)
1702  {
1703  LUTFFDeterminedOccupation[cellId] = occupation;
1704  }
1705 
1713  inline bool isDesignClock(DesignNet *tmpNet)
1714  {
1715  return clockSet.find(tmpNet) != clockSet.end();
1716  }
1717 
1723  inline std::vector<DesignNet *> &getClocksInDesign()
1724  {
1725  return clocks;
1726  }
1727 
1734  inline std::set<DesignCell *> &getCellsUnderClock(DesignNet *clock)
1735  {
1736  assert(clock2Cells.find(clock) != clock2Cells.end());
1737  return clock2Cells[clock];
1738  }
1739 
1740  private:
1741  std::vector<DesignNet *> netlist;
1742  std::vector<DesignCell *> cells;
1743  std::vector<DesignPin *> pins;
1744  std::map<std::string, DesignNet *> name2Net;
1745  std::map<std::string, int> aliasNet2AliasNetId;
1746  std::map<std::string, DesignCell *> name2Cell;
1747 
1752  std::vector<std::vector<DesignCell *>> predefinedClusters;
1753  std::map<DesignCellType, std::vector<DesignCell *>> type2Cells;
1754 
1759  std::set<std::pair<DesignPin *, DesignPin *>> connectedPinsWithSmallNet;
1760 
1765  std::vector<int> LUTFFDeterminedOccupation;
1766 
1771  std::map<std::tuple<int, int, int, int>, int> CLKSRCEFFType2ControlSetInfoId;
1772 
1777  std::vector<int> FFId2ControlSetId;
1778 
1779  std::vector<ControlSetInfo *> controlSets;
1780  std::vector<DesignNet *> clocks;
1781  std::set<DesignNet *> clockSet;
1782 
1787  std::map<DesignNet *, std::set<DesignCell *>> clock2Cells;
1788 
1789  std::map<std::string, std::string> &JSONCfg;
1791 };
1792 
1793 std::ostream &operator<<(std::ostream &os, DesignInfo::DesignCell *cell);
1794 std::ostream &operator<<(std::ostream &os, DesignInfo::DesignPin *pin);
1795 #endif
DesignInfo::name2Net
std::map< std::string, DesignNet * > name2Net
Definition: DesignInfo.h:1744
DesignInfo::isBRAM
static bool isBRAM(DesignCellType cellType)
Definition: DesignInfo.h:1341
DesignInfo::DesignCell::isVirtualCell
bool isVirtualCell()
Definition: DesignInfo.h:1042
DesignInfo::getFFControlSetId
int getFFControlSetId(DesignCell *curFF)
get the id of the control set of a given FF
Definition: DesignInfo.h:1586
DesignInfo::~DesignInfo
~DesignInfo()
Definition: DesignInfo.h:1433
DesignInfo::ControlSetInfo::CLK
DesignInfo::DesignNet * CLK
Definition: DesignInfo.h:1316
DesignInfo::DesignCell::isLUTRAM
bool isLUTRAM()
Definition: DesignInfo.h:938
DesignInfo::DesignElement::name
std::string name
Definition: DesignInfo.h:261
DesignInfo::DesignPin::driverPinName
std::string driverPinName
Definition: DesignInfo.h:513
DesignInfo::printStat
void printStat(bool verbose=false)
Definition: DesignInfo.cc:635
DesignInfo::CellType_TX_BITSLICE_TRI
@ CellType_TX_BITSLICE_TRI
Definition: DesignInfo.h:139
DesignInfo::getNumCells
int getNumCells()
Definition: DesignInfo.h:1600
DesignInfo::DesignCell::isMux
bool isMux()
Definition: DesignInfo.h:959
DesignInfo::CellType_LUT6_2
@ CellType_LUT6_2
Definition: DesignInfo.h:80
DesignInfo::DesignElement::type
DesignElementType type
Definition: DesignInfo.h:263
DesignInfo::setDeterminedOccupation
void setDeterminedOccupation(int cellId, int occupation)
Set the Determined Occupation of a specific cell.
Definition: DesignInfo.h:1701
DesignInfo::PinType_Others
@ PinType_Others
Definition: DesignInfo.h:205
DesignInfo::DesignPin::connectToNetName
void connectToNetName(std::string &_netName)
bind the pin to the net by the net name
Definition: DesignInfo.h:337
DesignInfo::ControlSetInfo::CE
DesignInfo::DesignNet * CE
Definition: DesignInfo.h:1318
DesignInfo::clockSet
std::set< DesignNet * > clockSet
Definition: DesignInfo.h:1781
DesignInfo::aliasNet2AliasNetId
std::map< std::string, int > aliasNet2AliasNetId
Definition: DesignInfo.h:1745
DesignInfo::ControlSetInfo::setControlSetInfoAs
void setControlSetInfoAs(DesignInfo::DesignCell *curFF)
Set the control set information accoridng to a given FF.
Definition: DesignInfo.h:1222
DesignInfo::DesignCell::isShift
bool isShift()
Definition: DesignInfo.h:967
DesignInfo::CellType_RAMB36E2
@ CellType_RAMB36E2
Definition: DesignInfo.h:111
DesignInfo::CellType_FDSE
@ CellType_FDSE
Definition: DesignInfo.h:85
DesignInfo::DesignCell::~DesignCell
~DesignCell()
Destroy the Design Cell object and its binded DesignPin objects.
Definition: DesignInfo.h:875
DesignInfo::DesignNet::~DesignNet
~DesignNet()
Definition: DesignInfo.h:547
DesignInfo::DesignPin::getOffsetXInCell
float getOffsetXInCell()
Get the offset X of the pin In the cell.
Definition: DesignInfo.h:474
DesignInfo::pins
std::vector< DesignPin * > pins
Definition: DesignInfo.h:1743
DesignInfo::DesignCell::isVirtual
bool isVirtual
Definition: DesignInfo.h:1141
DesignInfo::DesignCell::hasDSPReg
bool hasDSPReg
Definition: DesignInfo.h:1142
DesignInfo::DesignNet::pinNames
std::vector< std::string > pinNames
Definition: DesignInfo.h:764
DesignInfo::DesignCell::isTimingEndPoint
bool isTimingEndPoint()
check whether the cell is an endpoint in timing graph
Definition: DesignInfo.h:1015
DesignInfo::DesignCell::addNetForPin
void addNetForPin(DesignPin *_pinPtr, DesignNet *_netPtr)
add a net and assign it into output/input net list
Definition: DesignInfo.cc:95
DesignInfo::DesignNet::connectToPinVariable
void connectToPinVariable(DesignPin *_pinPtr)
bind the net to a pin's pointer
Definition: DesignInfo.cc:86
DesignInfo::DesignPin::isUnconnected
bool isUnconnected()
check if the attribute unconnected is true
Definition: DesignInfo.h:452
DesignInfo::clock2Cells
std::map< DesignNet *, std::set< DesignCell * > > clock2Cells
the mapping from clocks to their corresponding cells driven by the clock net
Definition: DesignInfo.h:1787
DesignInfo::DesignCell::inputNetPtrs
std::vector< DesignNet * > inputNetPtrs
Definition: DesignInfo.h:1135
DesignInfo::DesignElement::DesignElement
DesignElement(bool isVirtual, const std::string &_name, DesignElementType type, int id)
Definition: DesignInfo.h:232
DesignInfo::addPinToNet
void addPinToNet(DesignPin *curPin)
bind a pin to an existing net. If the net does not exist, new one.
Definition: DesignInfo.cc:130
DesignInfo::CellType_GTHE3_COMMON
@ CellType_GTHE3_COMMON
Definition: DesignInfo.h:120
DesignInfo::DesignCell::getOutputPins
std::vector< DesignPin * > & getOutputPins()
Definition: DesignInfo.h:914
DesignInfo::getDeterminedOccupation
int getDeterminedOccupation(int cellId)
Definition: DesignInfo.h:1688
DesignInfo::DesignPin::netName
std::string netName
Definition: DesignInfo.h:507
DesignInfo::DesignPin::setFixed
void setFixed()
Definition: DesignInfo.h:494
DesignInfo::DesignNet::enhanceOverallTimingNetEnhancement
void enhanceOverallTimingNetEnhancement(float r)
increase the Overall Net Enhancement (the entire net can be enhanced to a pre-defined extent....
Definition: DesignInfo.h:708
DesignInfo::DesignCell::isLogicRelated
bool isLogicRelated()
check whether the cell is related to logic computation
Definition: DesignInfo.h:1027
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
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
DesignInfo::DesignElement::DesignElement
DesignElement(const std::string &name, DesignElement *parentPtr, DesignElementType type, int id)
Definition: DesignInfo.h:217
DesignInfo::getNets
std::vector< DesignNet * > & getNets()
Definition: DesignInfo.h:1613
DesignInfo::DesignElementType
DesignElementType
types of the elements in a design
Definition: DesignInfo.h:59
DesignInfo::DesignPin::unconnected
bool unconnected
Definition: DesignInfo.h:511
DesignInfo::DesignNet::DesignNet
DesignNet(std::string &name, int id, bool virtualNet=false)
Construct a new Design Net object.
Definition: DesignInfo.h:536
DesignInfo::DesignCell::isLUT6
bool isLUT6()
Definition: DesignInfo.h:923
DesignInfo::DesignPin::refpinname
std::string refpinname
Definition: DesignInfo.h:508
DesignInfo::CellType_BUFG_GT_SYNC
@ CellType_BUFG_GT_SYNC
Definition: DesignInfo.h:115
DesignInfo::DesignCell
a DesignCell in design netlist, DesignPin objects of which might connect to DesignNet objects
Definition: DesignInfo.h:782
DesignInfo::getCellsUnderClock
std::set< DesignCell * > & getCellsUnderClock(DesignNet *clock)
Get the cells driven by a given clock net.
Definition: DesignInfo.h:1734
DesignInfo::CellType_FIFO18E2
@ CellType_FIFO18E2
Definition: DesignInfo.h:109
DesignInfo::DesignNet::pinPtrs
std::vector< DesignPin * > pinPtrs
Definition: DesignInfo.h:765
DesignInfo::ControlSetInfo::FFs
std::vector< DesignInfo::DesignCell * > FFs
Definition: DesignInfo.h:1320
DesignInfo::DesignCell::clockNetPtrs
std::set< DesignNet * > clockNetPtrs
Definition: DesignInfo.h:1137
DesignInfo::DesignNet
a design net (hyperedge) defined in the design, connecting to pins of cells
Definition: DesignInfo.h:525
paintPlacement.y
list y
Definition: paintPlacement.py:153
DesignInfo::DesignNet::isVirtual
bool isVirtual()
Definition: DesignInfo.h:596
DesignInfo::ElementType_graph
@ ElementType_graph
Definition: DesignInfo.h:63
DesignInfo::CellType_IBUF_ANALOG
@ CellType_IBUF_ANALOG
Definition: DesignInfo.h:126
DesignInfo::DesignCell::timingLength
int timingLength
Definition: DesignInfo.h:1144
DesignInfo::DesignNet::checkContainFixedPins
bool checkContainFixedPins()
Definition: DesignInfo.h:753
DesignInfo::getType2Cells
std::map< DesignCellType, std::vector< DesignCell * > > & getType2Cells()
Definition: DesignInfo.h:1664
DesignInfo::loadUserDefinedClusterNets
void loadUserDefinedClusterNets()
for user-defined-cluster-based optimization, load the nets in a user-defined cluster for later proces...
Definition: DesignInfo.cc:484
DesignInfo::isLogicRelated
bool isLogicRelated(DesignCellType cellType)
check whether the cell is related to logic computation
Definition: DesignInfo.h:1401
DesignInfo::CellType_RAM64M8
@ CellType_RAM64M8
Definition: DesignInfo.h:105
DesignInfo::DesignCell::inputPinPtrs
std::vector< DesignPin * > inputPinPtrs
Definition: DesignInfo.h:1131
DesignInfo::getCell
DesignCell * getCell(std::string &tmpName)
Definition: DesignInfo.h:1634
DesignInfo::CellType_FDRE
@ CellType_FDRE
Definition: DesignInfo.h:84
DesignInfo::controlSets
std::vector< ControlSetInfo * > controlSets
Definition: DesignInfo.h:1779
DesignInfo::DesignNet::driverPinPtrs
std::vector< DesignPin * > driverPinPtrs
Definition: DesignInfo.h:766
DesignInfo::netlist
std::vector< DesignNet * > netlist
Definition: DesignInfo.h:1741
DesignInfo::DesignNet::getPins
std::vector< DesignPin * > & getPins()
Get the vector reference of the pins.
Definition: DesignInfo.h:591
DesignInfo::DesignPin::pinType
DesignPinType pinType
pin type could be:
Definition: DesignInfo.h:506
DesignInfo::DesignPin::fixed
bool fixed
Definition: DesignInfo.h:512
DesignInfo::ControlSetInfo::getCE
DesignInfo::DesignNet * getCE() const
Definition: DesignInfo.h:1264
DesignInfo::CellType_LDCE
@ CellType_LDCE
Definition: DesignInfo.h:86
DesignInfo::DesignCell::outputPinPtrs
std::vector< DesignPin * > outputPinPtrs
Definition: DesignInfo.h:1132
DesignInfo::CellType_BUFGCE
@ CellType_BUFGCE
Definition: DesignInfo.h:113
DesignInfo::isDesignClock
bool isDesignClock(DesignNet *tmpNet)
check if a net is a global clock indicated by input design files
Definition: DesignInfo.h:1713
DesignInfo::DesignCell::pinNames
std::vector< std::string > pinNames
Definition: DesignInfo.h:1133
DesignInfo::DesignCellType
DesignCellType
design cell types
Definition: DesignInfo.h:73
DesignInfo::DesignElement::~DesignElement
virtual ~DesignElement()
Definition: DesignInfo.h:239
paintPlacement.x
list x
Definition: paintPlacement.py:152
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
DesignInfo::PinType_LUTOutput
@ PinType_LUTOutput
Definition: DesignInfo.h:199
DesignInfo::DesignElement::getParentPtr
DesignElement * getParentPtr()
Definition: DesignInfo.h:247
DesignInfo::isCarry
static bool isCarry(DesignCellType cellType)
Definition: DesignInfo.h:1331
DesignInfo::DesignPin::getNet
DesignNet * getNet()
Definition: DesignInfo.h:408
DesignInfo::DesignCell::setTimingLength
void setTimingLength(int _timingLength)
Definition: DesignInfo.h:1119
DesignInfo::getCLKSRCENet
void getCLKSRCENet(DesignInfo::DesignCell *curFF, DesignNet **CLK, DesignNet **SR, DesignNet **CE)
extract the pointers of CLK, SR, and CE for a given FF
Definition: DesignInfo.h:1517
DesignInfo::ControlSetInfo::addFF
void addFF(DesignInfo::DesignCell *curFF)
add a FF into the set of FFs which are compatible to this control set
Definition: DesignInfo.h:1288
DesignInfo::FFSRCompatible
static bool FFSRCompatible(DesignCellType typeA, DesignCellType typeB)
Definition: DesignInfo.h:148
DesignInfo::DesignCell::getCellType
DesignCellType getCellType()
Definition: DesignInfo.h:881
DesignInfo::DesignPin::isInputPort
bool isInputPort()
Definition: DesignInfo.h:367
DesignInfo::PinType_CLK
@ PinType_CLK
Definition: DesignInfo.h:200
DesignInfo::isLUTRAM
static bool isLUTRAM(DesignCellType cellType)
Definition: DesignInfo.h:1352
DesignInfo::ControlSetInfo::getFFType
DesignInfo::DesignCellType getFFType() const
Definition: DesignInfo.h:1269
DesignInfo::DesignPin::getRefPinName
std::string & getRefPinName()
Get the reference pin name of the pin.
Definition: DesignInfo.h:431
DesignInfo::isDSP
static bool isDSP(DesignCellType cellType)
Definition: DesignInfo.h:1336
DesignInfo::getClocksInDesign
std::vector< DesignNet * > & getClocksInDesign()
Get the all the clock nets in the design.
Definition: DesignInfo.h:1723
DesignInfo::CellType_RAM32M
@ CellType_RAM32M
Definition: DesignInfo.h:101
DesignInfo::DesignCell::DesignCell
DesignCell(const std::string &name, DesignElement *parentPtr, DesignCellType cellType, int id)
Construct a new Design Cell object.
Definition: DesignInfo.h:792
DesignInfo::updateFFControlSets
void updateFFControlSets()
go through the FF cells to extract control sets for later processing
Definition: DesignInfo.cc:425
DesignInfo::DesignElement::getElementType
DesignElementType getElementType()
Definition: DesignInfo.h:251
DesignInfo::DesignNet::enhance
void enhance(int pinIdInNetA, int pinIdInNetB, float ratio)
placer can customize some 2-pin interconnections to make their weights enhanced during wirelength opt...
Definition: DesignInfo.h:609
DesignInfo::DesignElement
basic class of element in a design.
Definition: DesignInfo.h:215
DesignInfo::ControlSetInfo::getCLK
DesignInfo::DesignNet * getCLK() const
Definition: DesignInfo.h:1256
DesignInfo::isIO
static bool isIO(DesignCellType cellType)
Definition: DesignInfo.h:1366
DesignInfo::cells
std::vector< DesignCell * > cells
Definition: DesignInfo.h:1742
DesignInfo::CellType_OSERDESE3
@ CellType_OSERDESE3
Definition: DesignInfo.h:140
DesignInfo::DesignCell::getTimingLength
int getTimingLength()
Definition: DesignInfo.h:1124
DesignInfo::ControlSetInfo::compatibleWith
bool compatibleWith(DesignInfo::DesignCell *curFF)
check if a FF is compatible with the control set
Definition: DesignInfo.h:1178
DesignInfo::isShifter
bool isShifter(DesignCellType cellType)
Definition: DesignInfo.h:1389
DeviceInfo.h
This header file contains the classes of data for a standalone device.
DesignInfo::getNet
DesignNet * getNet(std::string &tmpName)
Definition: DesignInfo.h:1644
DesignInfo::DesignPin::offsetYInCell
float offsetYInCell
Definition: DesignInfo.h:516
DesignInfo::ElementType_net
@ ElementType_net
Definition: DesignInfo.h:62
DesignInfo::DesignCell::netNames
std::vector< std::string > netNames
Definition: DesignInfo.h:1138
DesignInfo::DesignNet::setContainFixedPins
void setContainFixedPins()
Definition: DesignInfo.h:758
DesignInfo::getCLKSRCENetId
void getCLKSRCENetId(DesignInfo::DesignCell *curFF, int &CLKId, int &SRId, int &CEId)
extract the ids of CLK, SR, and CE for a given FF
Definition: DesignInfo.h:1475
DesignInfo::CellType_BUFGCTRL
@ CellType_BUFGCTRL
Definition: DesignInfo.h:117
DesignInfo::getControlSets
std::vector< ControlSetInfo * > & getControlSets()
Get the control sets in the design.
Definition: DesignInfo.h:1575
DesignInfo::DesignInfo
DesignInfo(std::map< std::string, std::string > &JSONCfg, DeviceInfo *deviceInfo)
Construct a new Design Info object based on user-defined settings and device information.
Definition: DesignInfo.cc:144
DesignInfo::CellType_GTHE3_CHANNEL
@ CellType_GTHE3_CHANNEL
Definition: DesignInfo.h:119
DesignInfo::ControlSetInfo::SR
DesignInfo::DesignNet * SR
Definition: DesignInfo.h:1317
DesignInfo::DesignNet::checkIsGlobalClock
bool checkIsGlobalClock()
check the attribute isGlobalClock
Definition: DesignInfo.h:737
DesignInfo::DesignCell::getOriCellType
DesignCellType getOriCellType()
Get the Original Cell Type object defined in the design netlist.
Definition: DesignInfo.h:1089
DesignInfo::resetLUTFFDeterminedOccupation
void resetLUTFFDeterminedOccupation()
reset the LUTFFDeterminedOccupation object
Definition: DesignInfo.h:1675
DesignInfo::DesignPin::getPinType
DesignPinType getPinType()
Get the Pin Type of the pin.
Definition: DesignInfo.h:317
DesignInfo::CellType_OBUFDS_DUAL_BUF
@ CellType_OBUFDS_DUAL_BUF
Definition: DesignInfo.h:145
DesignInfo::CellType_RAM64X1D
@ CellType_RAM64X1D
Definition: DesignInfo.h:100
DesignInfo::DesignCell::pinPtrs
std::vector< DesignPin * > pinPtrs
Definition: DesignInfo.h:1130
DesignInfo::CellType_OBUFT
@ CellType_OBUFT
Definition: DesignInfo.h:132
DesignInfo::enhanceFFControlSetNets
void enhanceFFControlSetNets()
intend to enhance the nets between FFs in a control set to make later packing easier
Definition: DesignInfo.cc:464
DesignInfo::DesignCell::DesignCell
DesignCell(const std::string &name, DesignCellType cellType, int id)
Construct a new Design Cell object.
Definition: DesignInfo.h:812
DesignInfo::CellType_RAMB18E2
@ CellType_RAMB18E2
Definition: DesignInfo.h:110
DesignInfo::DesignNet::getPinsBeDriven
std::vector< DesignPin * > & getPinsBeDriven()
Get the vector reference of the pins driven by the net.
Definition: DesignInfo.h:581
DesignInfo::CellType_IBUFDS_GTE3
@ CellType_IBUFDS_GTE3
Definition: DesignInfo.h:125
DesignInfo::DesignCell::isClockBuffer
bool isClockBuffer()
Definition: DesignInfo.h:998
DesignInfo::ControlSetInfo
A control set is a combination of CLK, CE and SR signal. It could be nullptr (not related to control ...
Definition: DesignInfo.h:1152
DesignInfo::CellType_LUT1
@ CellType_LUT1
Definition: DesignInfo.h:74
DesignInfo::CellType_SYSMONE1
@ CellType_SYSMONE1
Definition: DesignInfo.h:136
CELLTYPESTRS
#define CELLTYPESTRS
Definition: DesignInfo.h:37
DesignInfo::CellType_FIFO36E2
@ CellType_FIFO36E2
Definition: DesignInfo.h:108
DesignInfo::ControlSetInfo::display
void display()
Definition: DesignInfo.h:1303
DesignInfo::ControlSetInfo::getSR
DesignInfo::DesignNet * getSR() const
Definition: DesignInfo.h:1260
DesignInfo::getPredefinedClusters
std::vector< std::vector< DesignCell * > > & getPredefinedClusters()
Get the predefined clusters which are defined in design configuration files.
Definition: DesignInfo.h:1659
DesignInfo::CellType_IOBUFDS
@ CellType_IOBUFDS
Definition: DesignInfo.h:124
DesignInfo::isFF
static bool isFF(DesignCellType cellType)
Definition: DesignInfo.h:1360
DesignInfo::DesignNet::getDriverPins
std::vector< DesignPin * > & getDriverPins()
Get the vector reference of the driver pins of the net.
Definition: DesignInfo.h:571
DesignInfo::DesignCell::setControlSetInfo
void setControlSetInfo(ControlSetInfo *_controlSetInfo)
Set the Control Set Info object of this cell.
Definition: DesignInfo.h:1066
DesignInfo::ControlSetInfo::getFFs
std::vector< DesignInfo::DesignCell * > & getFFs()
get the set of FFs which are compatible to this control set
Definition: DesignInfo.h:1298
DesignInfo::DesignCell::isFF
bool isFF()
Definition: DesignInfo.h:933
DesignInfo::DesignElement::parentPtr
DesignElement * parentPtr
Definition: DesignInfo.h:262
DesignInfo::DesignPin::getDriverPin
DesignPin * getDriverPin()
Get the driver pin of the pin (nullptr indicates that the pin connects to some global signal like VGG...
Definition: DesignInfo.h:398
DesignInfo::CellType_RAM32X1D
@ CellType_RAM32X1D
Definition: DesignInfo.h:102
DesignInfo::CellType_IOBUF
@ CellType_IOBUF
Definition: DesignInfo.h:121
DesignInfo::ControlSetInfo::ControlSetInfo
ControlSetInfo(DesignInfo::DesignCell *curFF, int id)
Construct a new Control Set Info object with signals of a given FF and a given ID.
Definition: DesignInfo.h:1160
DesignInfo::CellType_RIU_OR
@ CellType_RIU_OR
Definition: DesignInfo.h:142
DesignInfo::DesignCell::isBRAM
bool isBRAM()
Definition: DesignInfo.h:954
DesignInfo::DesignNet::virtualNet
bool virtualNet
Definition: DesignInfo.h:772
DesignInfo::DesignPin::inputOrNot
bool inputOrNot
Definition: DesignInfo.h:510
DesignInfo::FFId2ControlSetId
std::vector< int > FFId2ControlSetId
the mapping from FF IDs to a unique defined control set id
Definition: DesignInfo.h:1777
DesignInfo::DesignElement::getName
const std::string & getName() const
Definition: DesignInfo.h:243
DesignInfo::CellType_LUT5
@ CellType_LUT5
Definition: DesignInfo.h:78
DesignInfo::JSONCfg
std::map< std::string, std::string > & JSONCfg
Definition: DesignInfo.h:1789
DesignInfo::DesignPin::connectToNetVariable
void connectToNetVariable(DesignNet *_netPtr)
bind the pin to the net's pointer for later processing
Definition: DesignInfo.h:357
DesignInfo::DesignCell::DesignCell
DesignCell(bool isVirtual, const std::string &name, DesignCellType cellType, int id)
Construct a new Design Cell object.
Definition: DesignInfo.h:856
DesignInfo::CLKSRCEFFType2ControlSetInfoId
std::map< std::tuple< int, int, int, int >, int > CLKSRCEFFType2ControlSetInfoId
the mapping from the tuple of CLK/SR/CE ids and FF type to a unique defined control set id
Definition: DesignInfo.h:1771
DesignInfo::CellType_MMCME3_ADV
@ CellType_MMCME3_ADV
Definition: DesignInfo.h:129
DesignInfo::CellType_LUT4
@ CellType_LUT4
Definition: DesignInfo.h:77
DesignInfo::DesignNet::setOverallClusterNetEnhancement
void setOverallClusterNetEnhancement(float r)
Set the Overall Net Enhancement (the entire net can be enhanced to a pre-defined extent....
Definition: DesignInfo.h:678
DesignInfo::DesignPin::driverPin
DesignPin * driverPin
Definition: DesignInfo.h:514
DesignInfo::ElementType_pin
@ ElementType_pin
Definition: DesignInfo.h:61
DesignInfo::PinType_LUTInput
@ PinType_LUTInput
Definition: DesignInfo.h:198
DesignInfo::CellType_AND2B1L
@ CellType_AND2B1L
Definition: DesignInfo.h:87
operator<<
std::ostream & operator<<(std::ostream &os, DesignInfo::DesignCell *cell)
Definition: DesignInfo.cc:686
DesignInfo::DesignCell::originallyIsLUTRAM
bool originallyIsLUTRAM()
Definition: DesignInfo.h:945
DesignInfo::DesignPin::netPtr
DesignNet * netPtr
Definition: DesignInfo.h:509
DesignInfo::DesignPin::~DesignPin
~DesignPin()
Definition: DesignInfo.h:297
DesignInfo::CellType_RAM32X1S
@ CellType_RAM32X1S
Definition: DesignInfo.h:103
DesignInfo::DesignCell::getCellId
int getCellId()
Get the Cell Id in the cell list.
Definition: DesignInfo.h:1037
DesignInfo::CellType_OBUF
@ CellType_OBUF
Definition: DesignInfo.h:131
DesignInfo::CellType_BUFGCE_DIV
@ CellType_BUFGCE_DIV
Definition: DesignInfo.h:116
DesignInfo::DesignCellTypeStr
std::vector< std::string > DesignCellTypeStr
Definition: DesignInfo.h:194
DesignInfo::DesignCell::isLUT
bool isLUT()
Definition: DesignInfo.h:927
DesignInfo::DesignCell::DesignCell
DesignCell(bool isVirtual, DesignCellType cellType, int id)
Construct a new Design Cell object without given name. The cell name will be its id string.
Definition: DesignInfo.h:833
DesignInfo::CellType_HPIO_VREF
@ CellType_HPIO_VREF
Definition: DesignInfo.h:144
DesignInfo::CellType_IOBUFE3
@ CellType_IOBUFE3
Definition: DesignInfo.h:127
DesignInfo::DesignCell::getControlSetInfo
ControlSetInfo * getControlSetInfo()
Get the Control Set Info object of this cell.
Definition: DesignInfo.h:1054
DesignInfo::CellType_RAM64X1S
@ CellType_RAM64X1S
Definition: DesignInfo.h:104
DesignInfo::DesignPin::setDriverPinName
void setDriverPinName(std::string &_driverPinName)
Set the driver Pin Name of the pin.
Definition: DesignInfo.h:377
DesignInfo::resetNetEnhanceRatio
void resetNetEnhanceRatio()
disable enhancement of all the nets in the design (reset extra weight to be 1)
Definition: DesignInfo.h:1626
DesignInfo::CellType_SRL16E
@ CellType_SRL16E
Definition: DesignInfo.h:95
DesignInfo::CellType_IBUF
@ CellType_IBUF
Definition: DesignInfo.h:122
DesignInfo::DesignNet::getOverallTimingEnhanceRatio
float getOverallTimingEnhanceRatio()
Get the Overall Enhance Ratio (the entire net can be enhanced to a pre-defined extent....
Definition: DesignInfo.h:658
DesignInfo::CellType_MUXF8
@ CellType_MUXF8
Definition: DesignInfo.h:93
DesignInfo::connectedPinsWithSmallNet
std::set< std::pair< DesignPin *, DesignPin * > > connectedPinsWithSmallNet
connected pin pairs by nets with a small number of pins
Definition: DesignInfo.h:1759
DesignInfo::DesignPin::setUnconnected
void setUnconnected()
Set the attribute unconnected to be true, indicating the pin connect to no net.
Definition: DesignInfo.h:440
DesignInfo::DesignCell::controlSetInfo
ControlSetInfo * controlSetInfo
Definition: DesignInfo.h:1143
DesignInfo::DesignPin::getOffsetYInCell
float getOffsetYInCell()
Get the offset Y of the pin In the cell.
Definition: DesignInfo.h:484
DesignInfo::DesignCell::netPtrs
std::vector< DesignNet * > netPtrs
Definition: DesignInfo.h:1134
DesignInfo::CellType_DSP48E2
@ CellType_DSP48E2
Definition: DesignInfo.h:90
DesignInfo::ElementType_cell
@ ElementType_cell
Definition: DesignInfo.h:60
DesignInfo::DesignPin::setDriverPin
void setDriverPin(DesignPin *_driverPinPtr)
Set the Driver Pin object.
Definition: DesignInfo.h:387
DesignInfo::PinType_Q
@ PinType_Q
Definition: DesignInfo.h:201
DesignInfo::DesignPin::aliasNetId
int aliasNetId
Definition: DesignInfo.h:517
DesignInfo::DesignPin::getAliasNetId
int getAliasNetId()
Definition: DesignInfo.h:342
DesignInfo::DesignElement::getElementIdInType
int getElementIdInType()
Definition: DesignInfo.h:255
DesignInfo::DesignNet::connectToPinName
void connectToPinName(const std::string &_pinName)
bind the net to a pin by name
Definition: DesignInfo.cc:81
DesignInfo::DesignNet::containFixedPins
bool containFixedPins
Definition: DesignInfo.h:768
DesignInfo::DesignCell::cellType
DesignCellType cellType
Definition: DesignInfo.h:1139
DesignInfo::getCells
std::vector< DesignCell * > & getCells()
Definition: DesignInfo.h:1609
DesignInfo::CellType_PCIE_3_1
@ CellType_PCIE_3_1
Definition: DesignInfo.h:133
DesignInfo::CellType_RAM64M
@ CellType_RAM64M
Definition: DesignInfo.h:99
DesignInfo::ControlSetInfo::FFType
DesignInfo::DesignCellType FFType
Definition: DesignInfo.h:1319
DesignInfo::getNumNets
int getNumNets()
Definition: DesignInfo.h:1604
DesignInfo::DesignNet::pinIdPinIdInNet2EnhanceRatio
std::map< std::pair< int, int >, float > pinIdPinIdInNet2EnhanceRatio
Definition: DesignInfo.h:769
DesignInfo::CellType_RXTX_BITSLICE
@ CellType_RXTX_BITSLICE
Definition: DesignInfo.h:137
DesignInfo::DesignCell::getInputNets
std::vector< DesignNet * > & getInputNets()
Definition: DesignInfo.h:910
DesignInfo::DesignNet::overallClusterEnhanceRatio
float overallClusterEnhanceRatio
Definition: DesignInfo.h:770
DesignInfo::DesignElement::id
int id
Definition: DesignInfo.h:264
DesignInfo::name2Cell
std::map< std::string, DesignCell * > name2Cell
Definition: DesignInfo.h:1746
DesignInfo::LUTFFDeterminedOccupation
std::vector< int > LUTFFDeterminedOccupation
LUTFFDeterminedOccupation is used to record the final resource demand of a LUT/FF after final packing...
Definition: DesignInfo.h:1765
DeviceInfo
Information class related to FPGA device, including the details of BEL/Site/Tile/ClockRegion.
Definition: DeviceInfo.h:43
DesignInfo::DesignCell::getPins
std::vector< DesignPin * > & getPins()
Definition: DesignInfo.h:893
DesignInfo::DesignCell::addClockNet
void addClockNet(DesignNet *aClockNet)
add a clock net which is connected to this cell for later legalization
Definition: DesignInfo.h:1099
DesignInfo::CellType_CARRY8
@ CellType_CARRY8
Definition: DesignInfo.h:89
DesignInfo::CellType_LUT6
@ CellType_LUT6
Definition: DesignInfo.h:79
DesignInfo::DesignNet::BeDrivenPinPtrs
std::vector< DesignPin * > BeDrivenPinPtrs
Definition: DesignInfo.h:767
DesignInfo::CellType_SRLC32E
@ CellType_SRLC32E
Definition: DesignInfo.h:96
DesignInfo::DesignPin::isOutputPort
bool isOutputPort()
Definition: DesignInfo.h:362
DesignInfo::DesignCell::setHasDSPReg
void setHasDSPReg(bool _hasDSPReg)
Definition: DesignInfo.h:1114
DesignInfo::DesignCell::checkHasDSPReg
bool checkHasDSPReg()
Definition: DesignInfo.h:975
DesignInfo::DesignPin::offsetXInCell
float offsetXInCell
Definition: DesignInfo.h:515
DesignInfo::CellType_FDCE
@ CellType_FDCE
Definition: DesignInfo.h:82
DesignInfo::ControlSetInfo::~ControlSetInfo
~ControlSetInfo()
Definition: DesignInfo.h:1166
DesignInfo::DesignCell::isIO
bool isIO()
Definition: DesignInfo.h:979
DesignInfo::DesignNet::resetEnhanceRatio
void resetEnhanceRatio()
Definition: DesignInfo.h:713
DesignInfo::DesignNet::isPowerNet
bool isPowerNet
Definition: DesignInfo.h:774
DesignInfo::CellType_LUT3
@ CellType_LUT3
Definition: DesignInfo.h:76
DesignInfo::DesignPin::isFixed
bool isFixed()
Definition: DesignInfo.h:489
DesignInfo::ControlSetInfo::getId
const int getId() const
Get the Id of the control set (each control set will have a unique Id)
Definition: DesignInfo.h:1278
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
DesignInfo::DesignPin::getNetName
std::string & getNetName()
Get the name of the net which the pin connects to.
Definition: DesignInfo.h:327
DesignInfo::DesignNet::enhanceOverallClusterNetEnhancement
void enhanceOverallClusterNetEnhancement(float r)
increase the Overall Net Enhancement (the entire net can be enhanced to a pre-defined extent....
Definition: DesignInfo.h:698
DesignInfo::ControlSetInfo::id
int id
Definition: DesignInfo.h:1321
DesignInfo::CellType_FDPE
@ CellType_FDPE
Definition: DesignInfo.h:83
DesignInfo::DesignNet::setOverallTimingNetEnhancement
void setOverallTimingNetEnhancement(float r)
Set the Overall Net Enhancement (the entire net can be enhanced to a pre-defined extent....
Definition: DesignInfo.h:688
DesignInfo::DesignNet::isGlobalClock
bool isGlobalClock
Definition: DesignInfo.h:773
DesignInfo::isClockBuffer
bool isClockBuffer(DesignCellType cellType)
Definition: DesignInfo.h:1384
DesignInfo::addCell
DesignCell * addCell(DesignCell *curCell)
add a cell into the design information
Definition: DesignInfo.cc:617
DesignInfo::PinType_D
@ PinType_D
Definition: DesignInfo.h:202
DesignInfo::fromStringToCellType
DesignCellType fromStringToCellType(std::string &cellName, std::string &typeName)
translate a string into a DesignCellType for a cell
Definition: DesignInfo.cc:606
DesignInfo::isLUT
static bool isLUT(DesignCellType cellType)
Definition: DesignInfo.h:1324
DesignInfo::CellType_RAM256X1D
@ CellType_RAM256X1D
Definition: DesignInfo.h:106
DesignInfo::CellType_BSCANE2
@ CellType_BSCANE2
Definition: DesignInfo.h:135
DesignInfo::PinType_E
@ PinType_E
Definition: DesignInfo.h:203
DesignInfo::DesignPin::updateParentCellNetInfo
void updateParentCellNetInfo()
let the parent cell know that one of its pin connects to a specific net
Definition: DesignInfo.cc:33
DesignInfo::CellType_PLLE3_ADV
@ CellType_PLLE3_ADV
Definition: DesignInfo.h:143
DesignInfo::DesignCell::getInputPins
std::vector< DesignPin * > & getInputPins()
Definition: DesignInfo.h:918
DesignInfo::designArchievedTextFileName
std::string designArchievedTextFileName
Definition: DesignInfo.h:1790
DesignInfo::DesignCell::getClockNets
std::set< DesignNet * > & getClockNets()
Get the clock nets connected to this cell for later legalization.
Definition: DesignInfo.h:1109
DesignInfo::DesignPin::getCell
DesignCell * getCell()
Get the Cell object of the pin.
Definition: DesignInfo.h:418
DesignInfo::CellType_BUFG_GT
@ CellType_BUFG_GT
Definition: DesignInfo.h:114
DesignInfo::DesignNet::getOverallClusterEnhanceRatio
float getOverallClusterEnhanceRatio()
Get the Overall Enhance Ratio (the entire net can be enhanced to a pre-defined extent....
Definition: DesignInfo.h:648
DesignInfo::DesignCell::getOutputNets
std::vector< DesignNet * > & getOutputNets()
Definition: DesignInfo.h:906
DesignInfo::DesignElement::DesignElement
DesignElement(bool isVirtual, DesignElementType type, int id)
Definition: DesignInfo.h:226
DesignInfo::clocks
std::vector< DesignNet * > clocks
Definition: DesignInfo.h:1780
DesignInfo::DesignCell::outputNetPtrs
std::vector< DesignNet * > outputNetPtrs
Definition: DesignInfo.h:1136
DesignInfo::loadClocks
void loadClocks(std::string clockFileName)
load the global clock signals from a design information file
Definition: DesignInfo.cc:372
DesignInfo::DesignNet::overallTimingEnhanceRatio
float overallTimingEnhanceRatio
Definition: DesignInfo.h:771
DesignInfo::CellType_IBUFDS
@ CellType_IBUFDS
Definition: DesignInfo.h:123
DesignInfo::predefinedClusters
std::vector< std::vector< DesignCell * > > predefinedClusters
the predefined clusters which are defined in design configuration files
Definition: DesignInfo.h:1752
DesignInfo
Information related to FPGA designs, including design cells and their interconnections.
Definition: DesignInfo.h:51
DesignInfo::DesignNet::setGlobalClock
void setGlobalClock()
Set the attribute isGlobalClock to be true.
Definition: DesignInfo.h:726
DesignInfo::DesignPinType
DesignPinType
Definition: DesignInfo.h:197
DesignInfo::CellType_LUT2
@ CellType_LUT2
Definition: DesignInfo.h:75
DesignInfo::type2Cells
std::map< DesignCellType, std::vector< DesignCell * > > type2Cells
Definition: DesignInfo.h:1753
DesignInfo::DesignNet::checkIsPowerNet
bool checkIsPowerNet()
check whether the net is VCC or GND
Definition: DesignInfo.h:748
DesignInfo::DesignPin::setOffsetInCell
void setOffsetInCell(float x, float y)
Set the Offset of the pin relative to the cell.
Definition: DesignInfo.h:463
DesignInfo::isMux
static bool isMux(DesignCellType cellType)
Definition: DesignInfo.h:1347
DesignInfo::DesignPin::DesignPin
DesignPin(std::string &name, std::string &refpinname, DesignPinType pinType, bool inputOrNot, DesignElement *parentPtr, int id)
Construct a new Design Pin object.
Definition: DesignInfo.h:290
DesignInfo::CellType_RAM32M16
@ CellType_RAM32M16
Definition: DesignInfo.h:98
DesignInfo::getPins
std::vector< DesignPin * > & getPins()
Definition: DesignInfo.h:1617
DesignInfo::DesignCell::addPin
void addPin(DesignPin *_pinPtr)
bind a pin to the cell
Definition: DesignInfo.cc:116
DesignInfo::CellType_BITSLICE_CONTROL
@ CellType_BITSLICE_CONTROL
Definition: DesignInfo.h:138
DesignInfo::DesignPin::checkPinType
static DesignPinType checkPinType(DesignCell *cell, std::string &refpinname, bool isInput)
get the pin type based on its reference name
Definition: DesignInfo.cc:39
DesignInfo::DesignElement::DesignElement
DesignElement(const std::string &name, DesignElementType type, int id)
Definition: DesignInfo.h:222
DesignInfo::DesignCell::isShifter
bool isShifter()
Definition: DesignInfo.h:1004
DesignInfo::PinType_SR
@ PinType_SR
Definition: DesignInfo.h:204
DesignInfo::DesignCell::oriCellType
DesignCellType oriCellType
Definition: DesignInfo.h:1140
DesignInfo::DesignPin::setAliasNetId
void setAliasNetId(int _aliasNetId)
Definition: DesignInfo.h:347
DesignInfo::getFFSRType
static bool getFFSRType(DesignCellType typeA)
Definition: DesignInfo.h:179
DesignInfo::CellType_MUXF7
@ CellType_MUXF7
Definition: DesignInfo.h:92
DesignInfo::DesignCell::isDSP
bool isDSP()
Definition: DesignInfo.h:971