AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
ParallelCLBPacker_PackingCLBCluster.cc
Go to the documentation of this file.
1 
26 #include "ParallelCLBPacker.h"
27 
29 {
30  std::vector<DesignInfo::DesignCell *> LUTs;
31  LUTs.clear();
32  for (auto tmpLUT : singleLUTs)
33  LUTs.push_back(tmpLUT);
34  for (auto tmpLUTPair : pairedLUTs)
35  {
36  LUTs.push_back(tmpLUTPair.first);
37  LUTs.push_back(tmpLUTPair.second);
38  assert(singleLUTs.find(tmpLUTPair.first) == singleLUTs.end());
39  assert(singleLUTs.find(tmpLUTPair.second) == singleLUTs.end());
40  singleLUTs.insert(tmpLUTPair.first);
41  singleLUTs.insert(tmpLUTPair.second);
42  }
43  std::sort(LUTs.begin(), LUTs.end(), [](DesignInfo::DesignCell *a, DesignInfo::DesignCell *b) -> bool {
44  return a->getCellId() > b->getCellId();
45  });
46 
47  pairedLUTs.clear();
48 
49  // std::vector<std::pair<int, int>> LUTPairCandidates;
50  std::vector<float> LUTPairCost;
51  // LUTPairCandidates.clear();
52 
53  MaximalCardinalityMatching::Graph G(LUTs.size());
54 
55  for (unsigned int i = 0; i < LUTs.size(); i++)
56  {
57  if (LUTs[i]->getInputPins().size() <= 5 &&
58  !LUTs[i]->isLUT6()) // it might be a virtual cell or it has to occupy one LUT slot
59  {
60  for (unsigned int j = i + 1; j < LUTs.size(); j++)
61  {
62  if (LUTs[j]->getInputPins().size() <= 5 && !LUTs[j]->isLUT6())
63  {
64  int pairPinNum = getPairPinNum(LUTs[i], LUTs[j]);
65  if (pairPinNum <= 5)
66  {
67  if (!(parentPackingCLB->conflictLUTsContain(LUTs[i]) &&
69  {
70  G.AddEdge(i, j);
71  }
72 
73  // LUTPairCandidates.emplace_back(i, j);
74  // LUTPairCost.push_back(10 - LUTs[i]->getInputPins().size() - LUTs[j]->getInputPins().size());
75  }
76  }
77  }
78  }
79  }
80 
81  MaximalCardinalityMatching M(G);
82 
83  std::list<int> matching;
84  matching = M.SolveMaximumMatching();
85 
86  std::set<int> addedNodes;
87  addedNodes.clear();
88  for (std::list<int>::iterator it = matching.begin(); it != matching.end(); it++)
89  {
90  std::pair<int, int> e = G.GetEdge(*it);
91  assert(addedNodes.find(e.first) == addedNodes.end());
92  assert(addedNodes.find(e.second) == addedNodes.end());
93  assert(e.first != e.second);
94  auto LUTA = LUTs[e.first];
95  auto LUTB = LUTs[e.second];
96 
97  assert(singleLUTs.find(LUTA) != singleLUTs.end() && singleLUTs.find(LUTB) != singleLUTs.end());
98  singleLUTs.erase(LUTA);
99  singleLUTs.erase(LUTB);
100  addedNodes.insert(e.first);
101  addedNodes.insert(e.second);
102  if (LUTA->getCellId() < LUTB->getCellId())
103  {
104  pairedLUTs.emplace(LUTA, LUTB);
105  }
106  else
107  {
108  pairedLUTs.emplace(LUTB, LUTA);
109  }
110  }
111 }
112 
114 {
115 
116  assert(singleLUTs.find(curLUT) == singleLUTs.end());
117 
118  if (singleLUTs.size() + 1 + pairedLUTs.size() + parentPackingCLB->getFixedPairedLUTs().size() <= MaxNum_LUTSite)
119  {
120  singleLUTs.insert(curLUT);
121 
122  return true;
123  }
124  if (curLUT->getInputPins().size() <= 5 &&
125  curLUT->isLUT6()) // it might be a virtual cell or it has to occupy one LUT slot
126  {
127  DesignInfo::DesignCell *LUTToPair = nullptr;
128  for (auto singleLUT : singleLUTs)
129  {
130  if (getPairPinNum(curLUT, singleLUT) <= 5)
131  {
132  if (!(parentPackingCLB->conflictLUTsContain(curLUT) &&
133  parentPackingCLB->conflictLUTsContain(singleLUT)))
134  {
135  if (!LUTToPair)
136  {
137  LUTToPair = singleLUT;
138  }
139  else if (LUTToPair->getCellId() > singleLUT->getCellId())
140  {
141  LUTToPair = singleLUT;
142  }
143  }
144  }
145  }
146  if (LUTToPair)
147  {
148  singleLUTs.erase(LUTToPair);
149  if (LUTToPair->getCellId() < curLUT->getCellId())
150  {
151  pairedLUTs.emplace(LUTToPair, curLUT);
152  }
153  else
154  {
155  pairedLUTs.emplace(curLUT, LUTToPair);
156  }
157  return true;
158  }
159  }
160 
161  singleLUTs.insert(curLUT);
162 
163  if (singleLUTs.size() + pairedLUTs.size() + parentPackingCLB->getFixedPairedLUTs().size() <= MaxNum_LUTSite)
164  {
165  return true;
166  }
167 
168  maxCardinalityMatching();
169 
170  return singleLUTs.size() + pairedLUTs.size() + parentPackingCLB->getFixedPairedLUTs().size() <= MaxNum_LUTSite;
171 }
172 
174 {
175  int i = halfCLB;
176  if (FFControlSets[i].getSize() < MaxNum_FFinControlSet)
177  {
178  if (curFF->isVirtualCell())
179  {
180  FFControlSets[i].addFF(curFF);
181  return true;
182  }
183  else if (FFControlSets[i].getCSId() < 0)
184  {
185  assert(curFF->getControlSetInfo());
186  int anotherSetId = i - 1 + ((i % 2 == 0) ? 2 : 0);
187  if (FFControlSets[anotherSetId].getCSId() < 0)
188  {
189  FFControlSets[i].addFF(curFF);
190  return true;
191  }
192  else if (FFControlSets[anotherSetId].getCLK() == curFF->getControlSetInfo()->getCLK() &&
193  FFControlSets[anotherSetId].getSR() == curFF->getControlSetInfo()->getSR() &&
194  DesignInfo::FFSRCompatible(FFControlSets[anotherSetId].getFFType(), curFF->getOriCellType()))
195  {
196  FFControlSets[i].addFF(curFF);
197  return true;
198  }
199  }
200  else if (FFControlSets[i].getCSId() == curFF->getControlSetInfo()->getId())
201  {
202  FFControlSets[i].addFF(curFF);
203  return true;
204  }
205  }
206  return false;
207 }
208 
210  int anotherHalfCLB)
211 {
212  if (!CSPtr)
213  {
214  return true;
215  }
216 
217  assert(CSPtr);
218  if (FFControlSets[anotherHalfCLB].getCSId() < 0)
219  {
220  return true;
221  }
222  else if (FFControlSets[anotherHalfCLB].getCLK() == CSPtr->getCLK() &&
223  FFControlSets[anotherHalfCLB].getSR() == CSPtr->getSR() &&
224  DesignInfo::FFSRCompatible(FFControlSets[anotherHalfCLB].getFFType(), CSPtr->getFFType()))
225  {
226  return true;
227  }
228 
229  return false;
230 }
231 
233 {
234  if (FFControlSets[halfCLB].getCSId() < 0 || FFControlSets[anotherHalfCLB].getCSId() < 0)
235  {
236  return true;
237  }
238  else if (FFControlSets[anotherHalfCLB].getCLK() == FFControlSets[halfCLB].getCLK() &&
239  FFControlSets[anotherHalfCLB].getSR() == FFControlSets[halfCLB].getSR() &&
240  DesignInfo::FFSRCompatible(FFControlSets[anotherHalfCLB].getFFType(), FFControlSets[halfCLB].getFFType()))
241  {
242  return true;
243  }
244 
245  return false;
246 }
247 
248 bool ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addToFFSet(std::vector<DesignInfo::DesignCell *> curFFs,
249  int halfCLB)
250 {
251  bool succ = true;
252  for (auto tmpFF : curFFs)
253  succ &= addToFFSet(tmpFF, halfCLB);
254 
255  assert(succ && "adding FF group should be checked in advance and should be successful.");
256 
257  return succ;
258 }
259 
261  bool enforceMainFFSlot)
262 {
263  if (enforceHalfCLB < 0)
264  {
265  if (enforceMainFFSlot)
266  {
267  for (unsigned int i = 0; i < FFControlSets.size(); i += 2)
268  {
269  if (addToFFSet(curFF, i))
270  return true;
271  }
272  }
273  else
274  {
275  const int orderIds[4] = {1, 3, 0, 2};
276  for (unsigned int i = 0; i < FFControlSets.size(); i++)
277  {
278  if (addToFFSet(curFF, orderIds[i]))
279  return true;
280  }
281  }
282  }
283  else
284  {
285  if (addToFFSet(curFF, enforceHalfCLB))
286  return true;
287  }
288  return false;
289 }
290 
292 {
293  int res = 0;
294  for (auto tmpFF : FFControlSets[i].getFFs())
295  {
296  if (!tmpFF->isVirtualCell())
297  continue;
298  if (auto tmpMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(
299  parentPackingCLB->getPlacementInfo()->getPlacementUnitByCell(tmpFF)))
300  {
301  if (tmpMacro->getMacroType() == PlacementInfo::PlacementMacro::PlacementMacroType_MUX7 ||
302  tmpMacro->getMacroType() == PlacementInfo::PlacementMacro::PlacementMacroType_MUX8)
303  {
304  res++;
305  }
306  }
307  }
308  if (res == 0)
309  return true;
310  if (res <= 1 && addNum <= 2) // muxF8 will add 3
311  return true;
312  return false;
313 }
314 
315 bool ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addFFGroup(std::vector<DesignInfo::DesignCell *> curFFs,
316  int enforceHalfCLB, bool enforceMainFFSlot,
317  bool isMuxMacro)
318 {
319  int CSId = -1;
320  int addNum = curFFs.size();
321  DesignInfo::ControlSetInfo *CSPtr = nullptr;
322  for (auto FF : curFFs)
323  {
324  if (FF->getControlSetInfo())
325  {
326  if (CSId == -1)
327  {
328  CSId = FF->getControlSetInfo()->getId();
329  CSPtr = FF->getControlSetInfo();
330  }
331  else
332  {
333  assert(CSId == FF->getControlSetInfo()->getId());
334  }
335  }
336  }
337  if (enforceHalfCLB < 0)
338  {
339  if (enforceMainFFSlot)
340  {
341  for (int i = 0; i < (int)FFControlSets.size(); i += 2)
342  {
343  int anotherSetId = i - 1 + ((i % 2 == 0) ? 2 : 0);
344  if (FFControlSets[i].getFFs().size() + curFFs.size() <= 4 && FFControlSets[i].compatibleWith(CSId))
345  {
346  if (compatibleInOneHalfCLB(CSPtr, anotherSetId))
347  {
348  if (!isMuxMacro || (isMuxMacro && checkNumMuxCompatibleInFFSet(i, addNum)))
349  {
350  assert(addToFFSet(curFFs, i));
351  FFControlSets[i].setMustMainSlots();
352  return true;
353  }
354  }
355  }
356  }
357  }
358  else
359  {
360  for (int i = 0; i < (int)FFControlSets.size(); i++)
361  {
362  int anotherSetId = i - 1 + ((i % 2 == 0) ? 2 : 0);
363  if (FFControlSets[i].getFFs().size() + curFFs.size() <= 4 && FFControlSets[i].compatibleWith(CSId))
364  {
365  if (compatibleInOneHalfCLB(CSPtr, anotherSetId))
366  {
367  if (!isMuxMacro || (isMuxMacro && checkNumMuxCompatibleInFFSet(i, addNum)))
368  {
369  assert(addToFFSet(curFFs, i));
370  return true;
371  }
372  }
373  }
374  }
375  }
376  }
377  else
378  {
379  int anotherSetId = enforceHalfCLB - enforceHalfCLB + ((enforceHalfCLB % 2 == 0) ? 2 : 0);
380  if (FFControlSets[enforceHalfCLB].getFFs().size() + curFFs.size() <= 4 &&
381  FFControlSets[enforceHalfCLB].compatibleWith(CSId))
382  {
383  if (compatibleInOneHalfCLB(CSPtr, anotherSetId))
384  {
385  if (!isMuxMacro || (isMuxMacro && checkNumMuxCompatibleInFFSet(enforceHalfCLB, addNum)))
386  {
387  assert(addToFFSet(curFFs, enforceHalfCLB));
388  return true;
389  }
390  }
391  }
392  }
393  return false;
394 }
395 
397 {
398  std::vector<DesignInfo::DesignCell *> cellsToAdd(0);
399  if (auto unpackCell = dynamic_cast<PlacementInfo::PlacementUnpackedCell *>(tmpPU))
400  {
401  cellsToAdd.push_back(unpackCell->getCell());
402  }
403  else if (auto curMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(tmpPU))
404  {
405  for (auto tmpCell : curMacro->getCells())
406  cellsToAdd.push_back(tmpCell);
407  }
408 
409  for (auto curCell : cellsToAdd)
410  {
411  std::cout << "checking:\n" << curCell << "\n";
412  bool succ = false;
413  if (curCell->isLUT())
414  {
415  succ = addLUT(curCell);
416  if (!succ)
417  {
418  std::cout << "failed to add LUT cell:\n" << curCell << "\nWWWWWWWWWWWWWWWWWWWWWWWWWWW\n";
419  std::cout << this << "\n";
420  break;
421  }
422  else
423  {
424  std::cout << "succedd to add LUT cell:\n" << curCell << "\n";
425  }
426  }
427  else if (curCell->isFF())
428  {
429  succ = addFF(curCell);
430  if (!succ)
431  {
432  std::cout << "failed to add FF cell:\n" << curCell << "\nWWWWWWWWWWWWWWWWWWWWWWWWWWW\n";
433  for (auto inputPin : curCell->getInputPins())
434  {
435  if (inputPin->getPinType() == DesignInfo::PinType_CLK)
436  {
437  if (!inputPin->isUnconnected())
438  {
439  std::cout << "CLK: " << inputPin->getNet()->getName() << "\n";
440  }
441  }
442  else if (inputPin->getPinType() == DesignInfo::PinType_E)
443  {
444  if (!inputPin->isUnconnected())
445  {
446  std::cout << "CE: " << inputPin->getNet()->getName() << "\n";
447  }
448  }
449  else if (inputPin->getPinType() == DesignInfo::PinType_SR)
450  {
451  if (!inputPin->isUnconnected())
452  {
453  std::cout << "SR: " << inputPin->getNet()->getName() << "\n";
454  }
455  }
456  else if (inputPin->getPinType() == DesignInfo::PinType_D)
457  {
458  // bypass
459  }
460  else
461  {
462  assert(false && "undefined FF input pin type.");
463  }
464  }
465  std::cout << this << "\n";
466  break;
467  }
468  else
469  {
470  std::cout << "succedd to add FF cell:\n" << curCell << "\n";
471  }
472  }
473  else
474  {
475  succ = true;
476  assert(curCell->isMux());
477  }
478  }
479 
480  if (!parentPackingCLB->getPlacementInfo()->checkClockColumnLegalization(tmpPU, parentPackingCLB->getCLBSite()))
481  {
482  std::cout << parentPackingCLB->getCLBSite()->getName() << "\n";
483  std::cout << "Clock Utilization Overflow: #clockNum: "
484  << parentPackingCLB->getPlacementInfo()
485  ->getClockCol2ClockNets()[parentPackingCLB->getCLBSite()->getClockHalfColumn()]
486  .size()
487  << "\n";
488  }
489 }
490 
492 {
493  int res = 0;
494  if (curNet->getUnits().size() > 512) // ignore large net
495  {
496  return 1;
497  }
498  // if (curNet->getDesignNet())
499  // if (curNet->getDesignNet()->getDriverPins().size() == 1)
500  // if (curNet->getDesignNet()->getDriverPins()[0]->getCell()->isFF())
501  // return 1;
502  for (auto tmpPU : curNet->getUnitsBeDriven())
503  {
504  if (PUs.find(tmpPU) != PUs.end())
505  {
506  res++;
507  }
508  }
509 
510  if (!res)
511  res = 1;
512  return res;
513 }
514 
516 {
517  std::set<PlacementInfo::PlacementNet *, Packing_Netcompare> nets;
518  nets.clear();
519  // net2ConnectivityScore.clear();
520 
521  HPWLChange = 0;
522  totalNetNum = 0;
523  totalLen = 0;
524 
525  totalCellNum = 0;
526 
527  for (auto tmpPU : PUs)
528  {
529  HPWLChange += getHPWLChangeForPU(tmpPU);
530  for (auto tmpNet : *tmpPU->getNetsSetPtr())
531  {
532  if (tmpNet->getUnits().size() > 64) // ignore large net
533  continue;
534 
535  if (nets.find(tmpNet) == nets.end())
536  {
537  nets.insert(tmpNet);
538  }
539  }
540  totalNetNum += tmpPU->getNetsSetPtr()->size() * 0.5; //(tmpPU->getWeight() > 1 ? (tmpPU->getWeight() / 2) : 1);
541  totalLen += getPlacementUnitMaxPathLen(tmpPU);
542  if (tmpPU->getType() == PlacementInfo::PlacementUnitType_Macro)
543  totalCellNum += tmpPU->getWeight();
544  else
545  totalCellNum += 1;
546  }
547 
548  totalConnectivityScore = 0;
549  for (auto tmpNet : nets)
550  {
551  if (tmpNet->getUnits().size() > 1)
552  {
553  float tmpConnectivityVal = (float)(getInternalPinsNum(tmpNet) - 1) / (float)(tmpNet->getUnits().size() - 1);
554  // net2ConnectivityScore[tmpNet] = tmpConnectivityVal;
555  totalConnectivityScore += tmpConnectivityVal;
556  }
557  else
558  {
559  // net2ConnectivityScore[tmpNet] = 1;
560  totalConnectivityScore += 1;
561  }
562  }
563 
564  scoreInSite = totalNetNum * 0.45 + 0.05 * totalLen + 0.5 * totalConnectivityScore - HPWLWeight * HPWLChange -
565  0.2 * (singleLUTs.size() + pairedLUTs.size());
566 }
567 
570 {
571  std::set<PlacementInfo::PlacementNet *, Packing_Netcompare> nets;
572  nets.clear();
573  // net2ConnectivityScore.clear();
574 
575  HPWLChange = 0;
576  totalNetNum = 0;
577  totalLen = 0;
578  totalCellNum = 0;
579  for (auto tmpPU : PUs)
580  {
581  HPWLChange += getHPWLChangeForPU(tmpPU);
582  for (auto tmpNet : *tmpPU->getNetsSetPtr())
583  {
584  if (tmpNet->getUnits().size() > 64) // ignore large net
585  continue;
586 
587  if (nets.find(tmpNet) == nets.end())
588  {
589  nets.insert(tmpNet);
590  }
591  }
592  totalNetNum += tmpPU->getNetsSetPtr()->size() * 0.5; //(tmpPU->getWeight() > 1 ? (tmpPU->getWeight() / 2) : 1);
593  totalLen += getPlacementUnitMaxPathLen(tmpPU);
594  if (tmpPU->getType() == PlacementInfo::PlacementUnitType_Macro)
595  totalCellNum += tmpPU->getWeight();
596  else
597  totalCellNum += 1;
598  }
599 
600  totalConnectivityScore = 0;
601  for (auto tmpNet : nets)
602  {
603  if (tmpNet->getUnits().size() > 1)
604  {
605  float tmpConnectivityVal = (float)(getInternalPinsNum(tmpNet) - 1) / (float)(tmpNet->getUnits().size() - 1);
606 
607  // net2ConnectivityScore[tmpNet] = tmpConnectivityVal;
608  totalConnectivityScore += tmpConnectivityVal;
609  }
610  else
611  {
612  // net2ConnectivityScore[tmpNet] = 1;
613  totalConnectivityScore += 1;
614  }
615  }
616 
617  scoreInSite = totalNetNum * 0.45 + 0.05 * totalLen + 0.5 * totalConnectivityScore - HPWLWeight * HPWLChange -
618  0.2 * (singleLUTs.size() + pairedLUTs.size());
619 }
620 
622 {
623  if (parentPackingCLB->checkIsLUTRAMSite())
624  return false;
625 
626  if (!allowOverlap)
627  {
628  if (PUs.find(tmpPU) != PUs.end())
629  return false;
630  }
631  else
632  {
633  if (PUs.find(tmpPU) != PUs.end())
634  return true;
635  }
636 
637  bool enforceMainFF = false;
638  bool isMUXMacro = false;
639  auto tmpMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(tmpPU);
640  if (tmpMacro)
641  {
642  if (tmpMacro->getMacroType() == PlacementInfo::PlacementMacro::PlacementMacroType_MUX7 ||
643  tmpMacro->getMacroType() == PlacementInfo::PlacementMacro::PlacementMacroType_MUX8)
644  {
645  enforceMainFF = true;
646  isMUXMacro = true;
647  if (parentPackingCLB->checkIsPrePackedSite())
648  {
649  return false;
650  }
651  }
652  else if (tmpMacro->getMacroType() == PlacementInfo::PlacementMacro::PlacementMacroType_LCLB)
653  {
654  if (parentPackingCLB->getCLBSite()->getSiteType() == "SLICEM")
655  return false;
656  }
657  else if (tmpMacro->getMacroType() == PlacementInfo::PlacementMacro::PlacementMacroType_LUTFFPair)
658  {
659  if (tmpMacro->getCells()[0]->isLUT6())
660  {
661  if (tmpMacro->getCells()[0]->getTimingLength() > 10)
662  enforceMainFF = true;
663  }
664  }
665  }
666 
667  std::vector<DesignInfo::DesignCell *> cellsToAdd(0);
668  std::vector<DesignInfo::DesignCell *> FFsToAdd(0);
669  if (auto unpackCell = dynamic_cast<PlacementInfo::PlacementUnpackedCell *>(tmpPU))
670  {
671  cellsToAdd.push_back(unpackCell->getCell());
672  if (isMUXMacro && unpackCell->getCell()->isFF())
673  FFsToAdd.push_back(unpackCell->getCell());
674  }
675  else if (auto curMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(tmpPU))
676  {
677  for (auto tmpCell : curMacro->getCells())
678  {
679  cellsToAdd.push_back(tmpCell);
680  if (isMUXMacro && tmpCell->isFF())
681  {
682  FFsToAdd.push_back(tmpCell);
683  }
684  }
685  }
686 
687  if (isMUXMacro && FFsToAdd.size())
688  {
689  if (!addFFGroup(FFsToAdd, -1, true, true))
690  {
691  return false;
692  }
693  }
694  // assert(checkCellCorrectness(tmpPU, true));
695 
696  for (auto curCell : cellsToAdd)
697  {
698  bool succ = false;
699  if (curCell->isLUT())
700  {
701  succ = addLUT(curCell);
702  }
703  else if (curCell->isFF())
704  {
705  if (isMUXMacro)
706  continue;
707  // assert(!containFF(curCell));
708  succ = addFF(curCell, -1, enforceMainFF);
709  }
710  else
711  {
712  if (parentPackingCLB->checkIsCarrySite())
713  succ = false;
714  else
715  succ = true;
716  assert(curCell->isMux());
717  if (succ)
718  {
719  // don't need to check mux, because the muxes have virtual LUT6s. As long as the virtual LUT6s can be
720  // placed, the MUXes can be placed.
721  }
722  }
723  if (!succ)
724  {
725  if (!(PUs.size() > 0 || parentPackingCLB->checkIsPrePackedSite()))
726  {
727  printMyself();
728  std::cout << " curPU=\n" << tmpPU << "\n";
729  std::cout << " curCell=\n" << curCell << "\n";
730  if (curCell->isFF())
731  {
732  if (!curCell->getControlSetInfo())
733  {
734  std::cout << " CLK: virtual\n";
735  std::cout << " SR: virtual\n";
736  std::cout << " CE: virtual\n";
737  continue;
738  }
739  else
740  {
741  if (curCell->getControlSetInfo()->getCLK())
742  std::cout << " CLK: " << curCell->getControlSetInfo()->getCLK()->getName() << "\n";
743  if (curCell->getControlSetInfo()->getSR())
744  std::cout << " SR: " << curCell->getControlSetInfo()->getSR()->getName() << "\n";
745  if (curCell->getControlSetInfo()->getCE())
746  std::cout << " CE: " << curCell->getControlSetInfo()->getCE()->getName() << "\n";
747  }
748  }
749  std::cout.flush();
750  }
751  assert(PUs.size() > 0 || parentPackingCLB->checkIsPrePackedSite());
752 
753  return false;
754  }
755  }
756  PUs.insert(tmpPU);
757  // assert(checkCellCorrectness(tmpPU, true));
758  hashed = false;
759  if (isMUXMacro)
760  {
761  numMuxes++;
762  }
763 
764  if (!parentPackingCLB->getPlacementInfo()->checkClockColumnLegalization(tmpPU, parentPackingCLB->getCLBSite()))
765  return false;
766 
767  return true;
768 }
769 
771  bool isAddPU)
772 {
773  for (auto tmpLUTPair0 : pairedLUTs)
774  {
775  auto tmpPUA = parentPackingCLB->getPlacementInfo()->getPlacementUnitByCell(tmpLUTPair0.second);
776  auto tmpPUB = parentPackingCLB->getPlacementInfo()->getPlacementUnitByCell(tmpLUTPair0.first);
777  if (PUs.find(tmpPUA) == PUs.end() || PUs.find(tmpPUB) == PUs.end())
778  {
779  bool Aok = false;
780  bool Bok = false;
781  if (PUs.find(tmpPUA) == PUs.end())
782  {
783  if (auto tmpMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(tmpPUA))
784  {
785  if (tmpMacro->checkHasCARRY())
786  {
787  Aok = true;
788  }
789  }
790  if (tmpPUA == parentPackingCLB->getCarryMacro())
791  {
792  Aok = true;
793  }
794  }
795  else
796  {
797  Aok = true;
798  }
799  if (PUs.find(tmpPUB) == PUs.end())
800  {
801  if (auto tmpMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(tmpPUB))
802  {
803  if (tmpMacro->checkHasCARRY())
804  {
805  Bok = true;
806  }
807  }
808  if (tmpPUB == parentPackingCLB->getCarryMacro())
809  {
810  Bok = true;
811  }
812  }
813  else
814  {
815  Bok = true;
816  }
817  if (Aok && Bok)
818  {
819  continue;
820  }
821  if (tmpPU)
822  {
823  if (isAddPU)
824  std::cout << "adding PU=\n" << tmpPU << "\n";
825  else
826  std::cout << "removing PU\n" << tmpPU << "\n";
827  }
828  printMyself();
829  std::cout << "problem is this pair:\n" << tmpPUA << "\n" << tmpPUB << "\n";
830  return (false);
831  }
832  }
833 
834  for (auto tmpLUT : singleLUTs)
835  {
836  auto tmpPUA = parentPackingCLB->getPlacementInfo()->getPlacementUnitByCell(tmpLUT);
837  if (PUs.find(tmpPUA) == PUs.end())
838  {
839  bool Aok = false;
840  if (PUs.find(tmpPUA) == PUs.end())
841  {
842  if (auto tmpMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(tmpPUA))
843  {
844  if (tmpMacro->checkHasCARRY())
845  {
846  Aok = true;
847  }
848  }
849  if (tmpPUA == parentPackingCLB->getCarryMacro())
850  {
851  Aok = true;
852  }
853  }
854  else
855  {
856  Aok = true;
857  }
858 
859  if (Aok)
860  {
861  continue;
862  }
863  if (tmpPU)
864  {
865  if (isAddPU)
866  std::cout << "adding PU=\n" << tmpPU << "\n";
867  else
868  std::cout << "removing PU\n" << tmpPU << "\n";
869  }
870  printMyself();
871  std::cout << "problem is this PU LUT:\n" << tmpPUA << "\n";
872  return (false);
873  }
874  }
875 
876  for (auto &CS : FFControlSets)
877  {
878  for (auto tmpFF : CS.getFFs())
879  {
880  auto tmpPUA = parentPackingCLB->getPlacementInfo()->getPlacementUnitByCell(tmpFF);
881  if (PUs.find(tmpPUA) == PUs.end())
882  {
883  bool Aok = false;
884  if (PUs.find(tmpPUA) == PUs.end())
885  {
886  if (auto tmpMacro = dynamic_cast<PlacementInfo::PlacementMacro *>(tmpPUA))
887  {
888  if (tmpMacro->checkHasCARRY())
889  {
890  Aok = true;
891  }
892  }
893  if (tmpPUA == parentPackingCLB->getCarryMacro())
894  {
895  Aok = true;
896  }
897  }
898  else
899  {
900  Aok = true;
901  }
902 
903  if (Aok)
904  {
905  continue;
906  }
907  if (tmpPU)
908  {
909  if (isAddPU)
910  std::cout << "adding PU=\n" << tmpPU << "\n";
911  else
912  std::cout << "removing PU\n" << tmpPU << "\n";
913  }
914  printMyself();
915  std::cout << "problem is this PU FF:\n" << tmpPUA << "\n";
916  return (false);
917  }
918  }
919  }
920  return true;
921 }
922 
923 std::ostream &operator<<(std::ostream &os, const ParallelCLBPacker::PackingCLBSite::PackingCLBCluster *tmpCluster)
924 {
925  os << "===============================================\n";
926  int tmpSize = 0;
927  for (auto tmpPU : tmpCluster->getPUs())
928  {
929  if (tmpPU->getType() == PlacementInfo::PlacementUnitType_Macro)
930  tmpSize += tmpPU->getWeight();
931  else
932  tmpSize += 1;
933  }
934  os << "PackingCLBCluster: id=" << tmpCluster->getId() << " #cell=" << tmpSize
935  << " hash=" << tmpCluster->getHashConst() << " score=" << tmpCluster->getScoreInSite() << " \n";
936  os << " targetSite: " << tmpCluster->getParentPackingCLB()->getCLBSite()->getName()
937  << " X:" << tmpCluster->getParentPackingCLB()->getCLBSite()->X()
938  << " Y:" << tmpCluster->getParentPackingCLB()->getCLBSite()->Y() << "\n";
939 
940  if (tmpCluster->getParentPackingCLB()->getCarryMacro())
941  {
942  os << "CARRY part (offset=" << tmpCluster->getParentPackingCLB()->getCarrySiteOffset()
943  << "):" << tmpCluster->getParentPackingCLB()->getCarryMacro() << "\n";
944  }
945 
946  for (auto tmpPU : tmpCluster->getPUs())
947  {
948  os << tmpPU;
949  float HPWLChange = 0;
950  for (auto tmpNet : *tmpPU->getNetsSetPtr())
951  {
952  if (tmpNet->getUnits().size() > 64) // ignore large net
953  continue;
954  HPWLChange += tmpNet->getNewHPWLByTrying(tmpPU, tmpCluster->getParentPackingCLB()->getCLBSite()->X(),
955  tmpCluster->getParentPackingCLB()->getCLBSite()->Y(),
956  tmpCluster->getParentPackingCLB()->getY2xRatio());
957  HPWLChange -= tmpNet->getHPWL(tmpCluster->getParentPackingCLB()->getY2xRatio());
958  }
959  os << " HPWLChange=" << HPWLChange << "\n";
960  }
961  int cnt = 0;
962 
963  for (auto singleLUT : tmpCluster->getSingleLUTs())
964  {
965  os << "SingleLUT#" << cnt << ": " << singleLUT << "\n";
966  cnt++;
967  }
968  cnt = 0;
969  for (auto tmpPair : tmpCluster->getPairedLUTs())
970  {
971  os << "LUTPair#" << cnt << "\n";
972  cnt++;
973  os << " LUT-A: " << tmpPair.first << "\n";
974  os << " LUT-B: " << tmpPair.second << "\n";
975  }
976  for (auto tmpPair : tmpCluster->getParentPackingCLB()->getFixedPairedLUTs())
977  {
978  os << "FixedLUTPair#" << cnt << "\n";
979  cnt++;
980  os << " LUT-A: " << tmpPair.first << "\n";
981  os << " LUT-B: " << tmpPair.second << "\n";
982  }
983  cnt = 0;
984  for (auto &FG : tmpCluster->getFFControlSets())
985  {
986  os << "FG#" << cnt << "\n";
987  if (FG.getFFs().size() == 0)
988  continue;
989  if (FG.getFFs().size() == 0)
990  continue;
991  if (FG.getCSId() >= 0)
992  {
993  if (FG.getCLK())
994  os << " CLK:" << FG.getCLK()->getName() << "\n";
995  if (FG.getSR())
996  os << " SR:" << FG.getSR()->getName() << "\n";
997  if (FG.getCE())
998  os << " CE:" << FG.getCE()->getName() << "\n";
999  }
1000  else
1001 
1002  {
1003  os << " CLK: virtual.\n";
1004  os << " SR: virtual.\n";
1005  os << " CE: virtual.\n";
1006  }
1007 
1008  cnt++;
1009  for (auto curFF : FG.getFFs())
1010  {
1011  os << " FF: " << curFF << "\n";
1012  }
1013  }
1014  os << "===============================================\n";
1015  return os;
1016 }
1017 
1019 {
1020  std::cout << "===============================================\n";
1021  int tmpSize = 0;
1022  for (auto tmpPU : getPUs())
1023  {
1024  if (tmpPU->getType() == PlacementInfo::PlacementUnitType_Macro)
1025  tmpSize += tmpPU->getWeight();
1026  else
1027  tmpSize += 1;
1028  }
1029  std::cout << "PackingCLBCluster: id=" << getId() << " #cell=" << tmpSize << " hash=" << getHashConst()
1030  << " score=" << getScoreInSite() << " \n";
1031  std::cout << " targetSite: " << getParentPackingCLB()->getCLBSite()->getName()
1032  << " X:" << getParentPackingCLB()->getCLBSite()->X() << " Y:" << getParentPackingCLB()->getCLBSite()->Y()
1033  << "\n";
1034 
1035  if (getParentPackingCLB()->getCarryMacro())
1036  {
1037  std::cout << "CARRY part (offset=" << getParentPackingCLB()->getCarrySiteOffset()
1038  << "):" << getParentPackingCLB()->getCarryMacro() << "\n";
1039  }
1040 
1041  for (auto tmpPU : getPUs())
1042  {
1043  std::cout << tmpPU;
1044  float HPWLChange = 0;
1045  for (auto tmpNet : *tmpPU->getNetsSetPtr())
1046  {
1047  if (tmpNet->getUnits().size() > 64) // ignore large net
1048  continue;
1049  HPWLChange += tmpNet->getNewHPWLByTrying(tmpPU, getParentPackingCLB()->getCLBSite()->X(),
1050  getParentPackingCLB()->getCLBSite()->Y(),
1051  getParentPackingCLB()->getY2xRatio());
1052  HPWLChange -= tmpNet->getHPWL(getParentPackingCLB()->getY2xRatio());
1053  }
1054  std::cout << " HPWLChange=" << HPWLChange << "\n";
1055  }
1056  int cnt = 0;
1057 
1058  for (auto singleLUT : getSingleLUTs())
1059  {
1060  std::cout << "SingleLUT#" << cnt << ": " << singleLUT << "\n";
1061  cnt++;
1062  }
1063  cnt = 0;
1064  for (auto tmpPair : getPairedLUTs())
1065  {
1066  std::cout << "LUTPair#" << cnt << "\n";
1067  cnt++;
1068  std::cout << " LUT-A: " << tmpPair.first << "\n";
1069  std::cout << " LUT-B: " << tmpPair.second << "\n";
1070  }
1071  for (auto tmpPair : parentPackingCLB->getFixedPairedLUTs())
1072  {
1073  std::cout << "FixedLUTPair#" << cnt << "\n";
1074  cnt++;
1075  std::cout << " LUT-A: " << tmpPair.first << "\n";
1076  std::cout << " LUT-B: " << tmpPair.second << "\n";
1077  }
1078  cnt = 0;
1079  for (auto &FG : getFFControlSets())
1080  {
1081  std::cout << "FG#" << cnt << "\n";
1082  if (FG.getFFs().size() == 0)
1083  continue;
1084  if (FG.getCSId() >= 0)
1085  {
1086  if (FG.getCLK())
1087  std::cout << " CLK:" << FG.getCLK()->getName() << "\n";
1088  if (FG.getSR())
1089  std::cout << " SR:" << FG.getSR()->getName() << "\n";
1090  if (FG.getCE())
1091  std::cout << " CE:" << FG.getCE()->getName() << "\n";
1092  }
1093  else
1094 
1095  {
1096  std::cout << " CLK: virtual.\n";
1097  std::cout << " SR: virtual.\n";
1098  std::cout << " CE: virtual.\n";
1099  }
1100  cnt++;
1101  for (auto curFF : FG.getFFs())
1102  {
1103  std::cout << " FF: " << curFF << "\n";
1104  }
1105  }
1106  std::cout << "===============================================\n";
1107 }
DesignInfo::DesignCell::isVirtualCell
bool isVirtualCell()
Definition: DesignInfo.h:1042
ParallelCLBPacker::PackingCLBSite::getY2xRatio
float getY2xRatio() const
Definition: ParallelCLBPacker.h:1923
PlacementInfo::PlacementNet
Placement net, compared to design net, includes information related to placement.
Definition: PlacementInfo.h:1877
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addFFGroup
bool addFFGroup(std::vector< DesignInfo::DesignCell * > curFFs, int enforceHalfCLB, bool enforceMainFFSlot, bool isMuxMacro)
try to add a given list of FFs into this cluster
Definition: ParallelCLBPacker_PackingCLBCluster.cc:315
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::checkNumMuxCompatibleInFFSet
bool checkNumMuxCompatibleInFFSet(int i, int addNum)
check whether a specific number of Muxes can be compatible with a specific FFset for packing
Definition: ParallelCLBPacker_PackingCLBCluster.cc:291
paintPlacement.cnt
int cnt
Definition: paintPlacement.py:155
PlacementInfo::PlacementNet::getUnitsBeDriven
std::vector< PlacementUnit * > & getUnitsBeDriven()
Get the reference of the vector of the PlacementUnits driven by the net.
Definition: PlacementInfo.h:1963
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addFF
bool addFF(DesignInfo::DesignCell *curFF, int enforceHalfCLB=-1, bool enforceMainFFSlot=false)
try to add a given FF into this cluster
Definition: ParallelCLBPacker_PackingCLBCluster.cc:260
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::printMyself
void printMyself()
a API to print the information of cluster
Definition: ParallelCLBPacker_PackingCLBCluster.cc:1018
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addPUFailReason
void addPUFailReason(PlacementInfo::PlacementUnit *tmpPU)
find/print the reason why the PlacementUnit fails to be added into this cluster
Definition: ParallelCLBPacker_PackingCLBCluster.cc:396
ParallelCLBPacker::PackingCLBSite::compatibleInOneHalfCLB
bool compatibleInOneHalfCLB(int halfCLB, int anotherHalfCLB)
check whether two half CLB can be packed togather
Definition: ParallelCLBPacker.h:2406
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::compatibleInOneHalfCLB
bool compatibleInOneHalfCLB(DesignInfo::ControlSetInfo *CSPtr, int anotherHalfCLB)
check whether a control set can be placed in a given half CLB
Definition: ParallelCLBPacker_PackingCLBCluster.cc:209
DeviceInfo::DeviceElement::getName
std::string & getName()
Definition: DeviceInfo.h:79
PlacementInfo::PlacementMacro
a fixed group of multiple standard cells with constraints of their relative locations
Definition: PlacementInfo.h:1525
DesignInfo::DesignCell::isLUT6
bool isLUT6()
Definition: DesignInfo.h:923
DesignInfo::DesignCell
a DesignCell in design netlist, DesignPin objects of which might connect to DesignNet objects
Definition: DesignInfo.h:782
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getSingleLUTs
const std::set< DesignInfo::DesignCell * > & getSingleLUTs() const
Get the set of single LUTs in this cluster (some other LUTs have been paired for packing)
Definition: ParallelCLBPacker.h:1145
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getInternalPinsNum
int getInternalPinsNum(PlacementInfo::PlacementNet *curNet)
Get the number of pins within this site for a given net (more pins are located in ont site will reduc...
Definition: ParallelCLBPacker_PackingCLBCluster.cc:491
PlacementInfo::PlacementMacro::PlacementMacroType_LCLB
@ PlacementMacroType_LCLB
Definition: PlacementInfo.h:1533
ParallelCLBPacker.h
This header file contains the definitions of ParallelCLBPacker class and its internal modules and API...
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getScoreInSite
float getScoreInSite() const
Get the score if this cluster is mapped the site.
Definition: ParallelCLBPacker.h:1318
ParallelCLBPacker::PackingCLBSite::getHPWLChangeForPU
float getHPWLChangeForPU(PlacementInfo::PlacementUnit *tmpPU)
Definition: ParallelCLBPacker.h:1943
PlacementInfo::PlacementMacro::PlacementMacroType_MUX8
@ PlacementMacroType_MUX8
Definition: PlacementInfo.h:1541
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::pairedLUTs
std::set< std::pair< DesignInfo::DesignCell *, DesignInfo::DesignCell * > > pairedLUTs
the paired LUTs in the cluster
Definition: ParallelCLBPacker.h:1799
DesignInfo::FFSRCompatible
static bool FFSRCompatible(DesignCellType typeA, DesignCellType typeB)
Definition: DesignInfo.h:148
DesignInfo::PinType_CLK
@ PinType_CLK
Definition: DesignInfo.h:200
DesignInfo::ControlSetInfo::getFFType
DesignInfo::DesignCellType getFFType() const
Definition: DesignInfo.h:1269
DesignInfo::ControlSetInfo::getCLK
DesignInfo::DesignNet * getCLK() const
Definition: DesignInfo.h:1256
PlacementInfo::PlacementMacro::PlacementMacroType_MUX7
@ PlacementMacroType_MUX7
Definition: PlacementInfo.h:1540
ParallelCLBPacker::PackingCLBSite::conflictLUTsContain
bool conflictLUTsContain(DesignInfo::DesignCell *tmpCell)
check whether a given cell is unpackable
Definition: ParallelCLBPacker.h:2565
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getHashConst
int getHashConst() const
Get the hash code of this cluster without changing the class variables of this cluster.
Definition: ParallelCLBPacker.h:1438
PlacementInfo::PlacementUnit::getName
std::string & getName()
Definition: PlacementInfo.h:1186
delayVisualization.X
X
Definition: delayVisualization.py:80
DesignInfo::DesignCell::getOriCellType
DesignCellType getOriCellType()
Get the Original Cell Type object defined in the design netlist.
Definition: DesignInfo.h:1089
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::updateScoreInSite
void updateScoreInSite()
update the score of this cluster by considering HPWL, interconnection density, timing and etc
Definition: ParallelCLBPacker_PackingCLBCluster.cc:515
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::checkCellCorrectness
bool checkCellCorrectness(PlacementInfo::PlacementUnit *tmpPU, bool isAddPU)
a verification function to check whether the cells in this cluster are REALLY LEGAL.
Definition: ParallelCLBPacker_PackingCLBCluster.cc:770
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getFFControlSets
const std::vector< PackedControlSet > & getFFControlSets() const
Definition: ParallelCLBPacker.h:1135
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
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getId
int getId() const
Get the Id of the PackingCLBCluster (just for debug information don't use it in algorithm)
Definition: ParallelCLBPacker.h:501
DesignInfo::ControlSetInfo::getSR
DesignInfo::DesignNet * getSR() const
Definition: DesignInfo.h:1260
isLUT6
bool isLUT6(DesignInfo::DesignCell *cell)
Definition: ParallelCLBPacker_PackingCLBSite.cc:536
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getPairPinNum
unsigned int getPairPinNum(DesignInfo::DesignCell *LUTA, DesignInfo::DesignCell *LUTB)
check how many input pins will be needed if the two LUTs are packed.
Definition: ParallelCLBPacker.h:522
operator<<
std::ostream & operator<<(std::ostream &os, const ParallelCLBPacker::PackingCLBSite::PackingCLBCluster *tmpCluster)
Definition: ParallelCLBPacker_PackingCLBCluster.cc:923
PlacementInfo::PlacementMacro::PlacementMacroType_LUTFFPair
@ PlacementMacroType_LUTFFPair
Definition: PlacementInfo.h:1529
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addLUT
bool addLUT(DesignInfo::DesignCell *curLUT)
try to add a given LUT into this cluster
Definition: ParallelCLBPacker_PackingCLBCluster.cc:113
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::singleLUTs
std::set< DesignInfo::DesignCell * > singleLUTs
the set of LUTs have not been paired with other LUTs in the clutser
Definition: ParallelCLBPacker.h:1793
ParallelCLBPacker::PackingCLBSite::HPWLWeight
float HPWLWeight
the factor of HPWL overhead in packing evaluation for a cell
Definition: ParallelCLBPacker.h:2733
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster
PackingCLBCluster is a container of cells/PlacementUnits which can be packed in the corresponding CLB...
Definition: ParallelCLBPacker.h:453
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addPU
bool addPU(PlacementInfo::PlacementUnit *tmpPU, bool allowOverlap=false)
try to add a given PlacementUnit into this cluster
Definition: ParallelCLBPacker_PackingCLBCluster.cc:621
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getPUs
const std::set< PlacementInfo::PlacementUnit *, Packing_PUcompare > & getPUs() const
Definition: ParallelCLBPacker.h:1032
PlacementInfo::PlacementUnit
a movement unit in placement with information of location and resource demand
Definition: PlacementInfo.h:1010
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getParentPackingCLB
PackingCLBSite * getParentPackingCLB() const
Get the Parent Packing CLB site of this cluster (this can be used to get more device information)
Definition: ParallelCLBPacker.h:1342
DesignInfo::DesignCell::getCellId
int getCellId()
Get the Cell Id in the cell list.
Definition: DesignInfo.h:1037
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::parentPackingCLB
PackingCLBSite * parentPackingCLB
the paraent CLB site for this cluster
Definition: ParallelCLBPacker.h:1703
DesignInfo::DesignCell::getControlSetInfo
ControlSetInfo * getControlSetInfo()
Get the Control Set Info object of this cell.
Definition: DesignInfo.h:1054
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::addToFFSet
bool addToFFSet(DesignInfo::DesignCell *curFF, int halfCLB)
try to add a given FF into a specific half CLB in this cluster
Definition: ParallelCLBPacker_PackingCLBCluster.cc:173
ParallelCLBPacker::PackingCLBSite::getFixedPairedLUTs
std::set< std::pair< DesignInfo::DesignCell *, DesignInfo::DesignCell * > > & getFixedPairedLUTs()
Get the fixed pairs of LUTs which should NOT be broken.
Definition: ParallelCLBPacker.h:2541
ParallelCLBPacker::PackingCLBSite::getCLBSite
DeviceInfo::DeviceSite * getCLBSite()
Definition: ParallelCLBPacker.h:1918
ParallelCLBPacker::PackingCLBSite::getCarrySiteOffset
int getCarrySiteOffset()
Definition: ParallelCLBPacker.h:2118
DeviceInfo::DeviceSite::X
float X()
Definition: DeviceInfo.h:288
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::incrementalUpdateScoreInSite
void incrementalUpdateScoreInSite(PlacementInfo::PlacementUnit *tmpPU)
incrementally update the score of this cluster by considering that only a given PlacementUnit will be...
Definition: ParallelCLBPacker_PackingCLBCluster.cc:568
delayVisualization.Y
Y
Definition: delayVisualization.py:80
PlacementInfo::PlacementUnitType_Macro
@ PlacementUnitType_Macro
Definition: PlacementInfo.h:70
PlacementInfo::PlacementUnpackedCell
the smallest, indivisible, representable component. It will include only one standard cell
Definition: PlacementInfo.h:1447
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
ParallelCLBPacker::PackingCLBSite::isMuxMacro
bool isMuxMacro(DesignInfo::DesignCell *cell)
Definition: ParallelCLBPacker.h:2477
checkHalfColumn.i
int i
Definition: checkHalfColumn.py:5
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
ParallelCLBPacker::PackingCLBSite::getPairPinNum
unsigned int getPairPinNum(DesignInfo::DesignCell *LUTA, DesignInfo::DesignCell *LUTB)
check how many input pins will be needed if the two LUTs are packed.
Definition: ParallelCLBPacker.h:2130
DesignInfo::PinType_D
@ PinType_D
Definition: DesignInfo.h:202
DesignInfo::PinType_E
@ PinType_E
Definition: DesignInfo.h:203
DesignInfo::DesignCell::getInputPins
std::vector< DesignPin * > & getInputPins()
Definition: DesignInfo.h:918
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::maxCardinalityMatching
void maxCardinalityMatching(bool verbose=false)
conduct maximun cardinality matching algorithm to pair LUTs
Definition: ParallelCLBPacker_PackingCLBCluster.cc:28
ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getPairedLUTs
const std::set< std::pair< DesignInfo::DesignCell *, DesignInfo::DesignCell * > > & getPairedLUTs() const
Get the set of the paired LUTs.
Definition: ParallelCLBPacker.h:1258
ParallelCLBPacker::PackingCLBSite::getCarryMacro
PlacementInfo::PlacementMacro * getCarryMacro()
Definition: ParallelCLBPacker.h:2098
DeviceInfo::DeviceSite::Y
float Y()
Definition: DeviceInfo.h:292
DesignInfo::PinType_SR
@ PinType_SR
Definition: DesignInfo.h:204