AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
PlacementTimingInfo.h
Go to the documentation of this file.
1 
25 #ifndef _PlacementTimingInfo
26 #define _PlacementTimingInfo
27 
28 #include "DesignInfo.h"
29 #include "DeviceInfo.h"
30 #include "dumpZip.h"
31 #include <algorithm>
32 #include <assert.h>
33 #include <fstream>
34 #include <iostream>
35 #include <map>
36 #include <mutex>
37 #include <semaphore.h>
38 #include <set>
39 #include <sstream>
40 #include <string>
41 #include <thread>
42 #include <vector>
43 
49 {
50  public:
58  PlacementTimingInfo(DesignInfo *designInfo, DeviceInfo *deviceInfo, std::map<std::string, std::string> &JSONCfg);
60  {
62  delete simpleTimingGraph;
63  }
64 
70  template <typename nodeType> class TimingGraph
71  {
72  public:
78  {
79  nodes.clear();
80  edges.clear();
81  }
83  {
84  for (auto edge : edges)
85  delete edge;
86  for (auto node : nodes)
87  delete node;
88  }
89 
90  class TimingEdge;
91 
96  class TimingNode
97  {
98  public:
105  TimingNode(nodeType *designNode, int id) : designNode(designNode), id(id)
106  {
107  inEdges.clear();
108  outEdges.clear();
109  };
111 
112  inline int getId()
113  {
114  return id;
115  }
116 
117  inline nodeType *getDesignNode()
118  {
119  return designNode;
120  }
121 
126  inline void setIsRegister()
127  {
128  isRegister = true;
129  }
130 
137  inline bool checkIsRegister()
138  {
139  return isRegister;
140  }
141 
142  inline void addInEdge(TimingEdge *tmpEdge)
143  {
144  inEdges.push_back(tmpEdge);
145  }
146 
147  inline void addOutEdge(TimingEdge *tmpEdge)
148  {
149  outEdges.push_back(tmpEdge);
150  }
151 
157  inline void setForwardLevel(int _forwardLevel)
158  {
159  forwardLevel = _forwardLevel;
160  destLevel = _forwardLevel;
161  }
162 
163  inline void setBackwardLevel(int _backwardLevel)
164  {
165  backwardLevel = _backwardLevel;
166  }
167 
172  inline void calcLongestPath()
173  {
175  }
176 
183  inline int getForwardLevel()
184  {
185  return forwardLevel;
186  }
187 
194  inline int getBackwardLevel()
195  {
196  return backwardLevel;
197  }
198 
204  inline int getLongestPathLength()
205  {
206 
207  if (forwardLevel >= 0 && backwardLevel >= 0)
208  return longestPathLength;
209  else
210  return -1;
211  }
212 
213  inline void setDestLevel(int _destLevel)
214  {
215  destLevel = _destLevel;
216  }
217 
218  inline int getDestLevel()
219  {
220  return destLevel;
221  }
222 
228  inline std::vector<TimingEdge *> &getOutEdges()
229  {
230  return outEdges;
231  }
232 
238  {
239  std::sort(outEdges.begin(), outEdges.end(), [](TimingEdge *a, TimingEdge *b) -> bool {
240  return a->getSink()->getBackwardLevel() < b->getSink()->getBackwardLevel();
241  });
242  }
243 
249  inline std::vector<TimingEdge *> &getInEdges()
250  {
251  return inEdges;
252  }
253 
259  {
260  std::sort(inEdges.begin(), inEdges.end(), [](TimingEdge *a, TimingEdge *b) -> bool {
261  return a->getSource()->getForwardLevel() < b->getSource()->getForwardLevel();
262  });
263  }
264 
270  inline float getLatestInputArrival()
271  {
272  return latestInputArrival;
273  }
274 
280  inline void setLatestInputArrival(float _latestInputArrival)
281  {
282  latestInputArrival = _latestInputArrival;
283  }
284 
285  inline void setLatestOutputArrival(float _latestOutputArrival)
286  {
287  latestOutputArrival = _latestOutputArrival;
288  }
289 
290  inline float getLatestOutputArrival()
291  {
292  return latestOutputArrival;
293  }
294 
301  {
302  return slowestPredecessorId;
303  }
304 
310  inline void setSlowestPredecessorId(int _slowestPredecessorId)
311  {
312  slowestPredecessorId = _slowestPredecessorId;
313  }
314 
320  inline void setInnerDelay(float _innerDelay)
321  {
322  innerDelay = _innerDelay;
323  }
324 
330  inline float getInnerDelay()
331  {
332  return innerDelay;
333  }
334 
340  inline float getRequiredArrivalTime()
341  {
342  return requiredArrival;
343  }
344 
350  inline void setRequiredArrivalTime(float _requiredArrival)
351  {
352  requiredArrival = _requiredArrival;
353  }
354 
360  inline void setInitialRequiredArrivalTime(float _requiredArrival)
361  {
362  if (clockPeriod > 0)
364  else
365  requiredArrival = _requiredArrival;
366  }
367 
374  {
375  return slowestPredecessorId;
376  }
377 
383  inline void setEarlestSuccessorId(int _earliestSuccessorId)
384  {
385  earliestSuccessorId = _earliestSuccessorId;
386  }
387 
388  inline void setClockPeriod(float _clockPeriod)
389  {
390  clockPeriod = _clockPeriod;
391  }
392 
393  inline float getClockPeriod()
394  {
395  return clockPeriod;
396  }
397 
398  inline void setClusterId(int _clusterId)
399  {
400  clusterId = _clusterId;
401  }
402 
403  inline float getClusterId()
404  {
405  return clusterId;
406  }
407 
408  private:
413  nodeType *designNode = nullptr;
414  int id;
415  float latestInputArrival = 0.0; // ns
416  float latestOutputArrival = 0.0;
417  float requiredArrival = 10.0; // ns
418  float clockPeriod = -10;
421  int clusterId = -1;
422 
427  float innerDelay = 0.1;
428  bool isRegister = false;
429  std::vector<TimingEdge *> inEdges;
430  std::vector<TimingEdge *> outEdges;
431 
437  int forwardLevel = -1;
438 
444  int backwardLevel = -1;
445  int destLevel = -1;
446 
451  int longestPathLength = 100000000;
452  };
453 
460  {
461  public:
473  DesignInfo::DesignPin *sinkPin, DesignInfo::DesignNet *net = nullptr, int id = -1)
475  {
476  assert(srcPin);
477  assert(sinkPin);
478  assert(id >= 0);
479  }
481 
482  inline int getId()
483  {
484  return id;
485  }
486 
487  inline void setDelay(float _delay)
488  {
489  delay = _delay;
490  }
491 
492  inline float getDelay()
493  {
494  return delay;
495  }
496 
497  inline TimingNode *getSink()
498  {
499  return sinkNode;
500  }
501 
503  {
504  return srcNode;
505  }
506 
508  {
509  return sinkPin;
510  }
511 
513  {
514  return srcPin;
515  }
516 
517  private:
518  TimingNode *srcNode = nullptr;
519  TimingNode *sinkNode = nullptr;
523  int id;
524  float delay = 0; // ns
525  };
526 
532  inline void insertTimingNode(TimingNode *timingNode)
533  {
534  nodes.push_back(timingNode);
535  }
536 
537  inline std::vector<TimingNode *> &getNodes()
538  {
539  return nodes;
540  }
541 
542  inline std::vector<TimingEdge *> &getEdges()
543  {
544  return edges;
545  }
546 
557  inline void addEdgeBetween(int idA, int idB, DesignInfo::DesignPin *srcPin, DesignInfo::DesignPin *sinkPin,
558  DesignInfo::DesignNet *net = nullptr, float delay = 0.0)
559  {
560  auto newEdge = new TimingEdge(nodes[idA], nodes[idB], srcPin, sinkPin, net, edges.size());
561  newEdge->setDelay(delay);
562  edges.push_back(newEdge);
563 
564  nodes[idB]->addInEdge(newEdge);
565  nodes[idA]->addOutEdge(newEdge);
566  }
567 
576  void findALoopFromNode(std::vector<int> &nodeInPath, int startNode, int curNode, int level)
577  {
578  if (level > 0 && curNode == startNode)
579  {
580  for (auto nodeId : nodeInPath)
581  {
582  std::cout << nodes[nodeId]->getDesignNode()->getName() << " =>" << nodes[nodeId]->checkIsRegister()
583  << "\n";
584  std::cout << nodes[nodeId]->getDesignNode() << "\n";
585  }
586  exit(0);
587  }
588  for (auto outEdge : nodes[curNode]->getOutEdges())
589  {
590  int nextId = outEdge->getSink()->getId();
591 
592  if (!nodes[nextId]->checkIsRegister())
593  {
594 
595  nodeInPath.push_back(nextId);
596  findALoopFromNode(nodeInPath, startNode, nextId, level + 1);
597  nodeInPath.pop_back();
598  }
599  }
600  }
601 
607  void forwardLevelization();
608 
614  void backwardLevelization();
615 
620  void propogateArrivalTime();
621 
627 
629  {
630  maxDelay = 0;
631  maxDelayId = -1;
632  for (unsigned int i = 0; i < getNodes().size(); i++)
633  {
634  if (getNodes()[i]->getLatestInputArrival() > maxDelay)
635  {
636  maxDelay = getNodes()[i]->getLatestInputArrival();
637  maxDelayId = i;
638  }
639  }
640  }
641 
642  inline int getCriticalEndPoint()
643  {
644  return maxDelayId;
645  }
646 
647  inline float getCriticalPathDelay()
648  {
649  return maxDelay;
650  }
651 
658  std::vector<int> backTraceDelayLongestPathFromNode(int curNodeId);
659 
660  bool backTraceDelayLongestPathFromNode(int curNodeId, std::vector<int> &isCovered, std::vector<int> &resPath,
661  int converThr = 30);
662 
669  {
670  for (auto tmpNode : nodes)
671  {
672  tmpNode->calcLongestPath();
673  tmpNode->getDesignNode()->setTimingLength(tmpNode->getLongestPathLength());
674  }
675 
677  std::sort(pathLenSortedNodes.begin(), pathLenSortedNodes.end(), [](TimingNode *a, TimingNode *b) -> bool {
678  return (a->getLongestPathLength() == b->getLongestPathLength())
679  ? (a->getForwardLevel() < b->getForwardLevel())
680  : (a->getLongestPathLength() > b->getLongestPathLength());
681  });
682  }
683 
685  {
687  for (auto id : forwardlevel2NodeIds[0])
688  {
689  if (nodes[id]->getInEdges().size() == 0)
690  continue;
691  delaySortedTimingEndpointNodes.push_back(nodes[id]);
692  }
694  [](TimingNode *a, TimingNode *b) -> bool {
695  return (a->getLatestInputArrival() > b->getLatestInputArrival());
696  });
697  }
698 
699  inline std::vector<TimingNode *> &getSortedTimingEndpoints()
700  {
702  }
703 
710  std::vector<int> traceBackFromNode(int targetId);
711 
718  std::vector<int> traceForwardFromNode(int targetId);
719 
727  std::vector<int> BFSFromNode(int startNodeId, int pathLenThr, unsigned sizeThr, std::set<int> &exceptionCells);
728 
737  std::vector<int> DFSFromNode(int startNodeId, int pathLenThr, unsigned sizeThr, std::set<int> &exceptionCells,
738  int fanoutThr = 10000000);
739 
740  inline std::vector<TimingNode *> &getPathLenSortedNodes()
741  {
742  return pathLenSortedNodes;
743  }
744 
751  {
752  return longPathThresholdLevel;
753  }
754 
761  {
763  }
764 
765  inline void setLongPathThrRatio(float _r)
766  {
767  longPathThrRatio = _r;
768  }
769 
777  inline float getClockPeriod()
778  {
779  return clockPeriod;
780  }
781 
789  inline void setClockPeriod(float _clockPeriod)
790  {
791  clockPeriod = _clockPeriod;
792  }
793 
794  private:
796  std::vector<TimingNode *> nodes;
797  std::vector<TimingNode *> pathLenSortedNodes;
798  std::vector<TimingNode *> delaySortedTimingEndpointNodes;
799  std::vector<TimingEdge *> edges;
800 
805  std::vector<std::vector<int>> forwardlevel2NodeIds;
806 
811  std::vector<std::vector<int>> backwardlevel2NodeIds;
812 
813  float longPathThrRatio = 0.95;
814  float mediumPathThrRatio = 0.8;
817 
818  float clockPeriod = 10.0; // ns
819 
820  float maxDelay = 0;
821  int maxDelayId = -1;
822  };
823 
828  void buildSimpleTimingGraph();
829 
835  inline std::vector<TimingGraph<DesignInfo::DesignCell>::TimingNode *> &getSimplePlacementTimingInfo()
836  {
837  return simpleTimingGraph->getNodes();
838  }
839 
840  inline std::vector<TimingGraph<DesignInfo::DesignCell>::TimingNode *> &getSimplePlacementTimingInfo_PathLenSorted()
841  {
843  }
844 
851  {
852  return simpleTimingGraph;
853  }
854 
856  {
858  }
859 
861  {
863  }
864 
866  {
867  return deviceInfo;
868  }
869 
870  void setDSPInnerDelay();
871 
872  private:
875 
876  // settings
877  std::map<std::string, std::string> &JSONCfg;
878 
880  bool verbose = false;
881 
882  float clockPeriod = 10.0; // ns
883  bool DSPCritical = false;
884 
885  std::map<DesignInfo::DesignNet *, float> clockNet2Period;
886  std::map<int, float> cellId2Period;
887 };
888 
889 #endif
PlacementTimingInfo::clockPeriod
float clockPeriod
Definition: PlacementTimingInfo.h:882
PlacementTimingInfo::TimingGraph::TimingNode::setForwardLevel
void setForwardLevel(int _forwardLevel)
Set the data path forward level of the node for later propagation.
Definition: PlacementTimingInfo.h:157
PlacementTimingInfo::TimingGraph::TimingNode::getLatestInputArrival
float getLatestInputArrival()
Get the latest arrival time to the output of this timing node.
Definition: PlacementTimingInfo.h:270
delayVisualization.delay
delay
Definition: delayVisualization.py:55
PlacementTimingInfo::designInfo
DesignInfo * designInfo
Definition: PlacementTimingInfo.h:873
PlacementTimingInfo::TimingGraph::TimingEdge::getSourcePin
DesignInfo::DesignPin * getSourcePin()
Definition: PlacementTimingInfo.h:512
PlacementTimingInfo::TimingGraph::TimingNode::getClusterId
float getClusterId()
Definition: PlacementTimingInfo.h:403
PlacementTimingInfo::TimingGraph::longPathThrRatio
float longPathThrRatio
Definition: PlacementTimingInfo.h:813
PlacementTimingInfo::TimingGraph::TimingEdge::~TimingEdge
~TimingEdge()
Definition: PlacementTimingInfo.h:480
PlacementTimingInfo::TimingGraph::TimingNode::getInEdges
std::vector< TimingEdge * > & getInEdges()
Get the inward edges to this TimingNode.
Definition: PlacementTimingInfo.h:249
PlacementTimingInfo::TimingGraph::TimingNode::TimingNode
TimingNode(nodeType *designNode, int id)
Construct a new Timing Node object.
Definition: PlacementTimingInfo.h:105
PlacementTimingInfo::TimingGraph::traceBackFromNode
std::vector< int > traceBackFromNode(int targetId)
find the longest path from a register to the target node (id)
Definition: PlacementTimingInfo.cc:399
PlacementTimingInfo::TimingGraph::TimingNode::forwardLevel
int forwardLevel
the distance toward the farthest predecessor register based on the path length (instead of delay)
Definition: PlacementTimingInfo.h:437
PlacementTimingInfo::getSimplePlacementTimingInfo_PathLenSorted
std::vector< TimingGraph< DesignInfo::DesignCell >::TimingNode * > & getSimplePlacementTimingInfo_PathLenSorted()
Definition: PlacementTimingInfo.h:840
PlacementTimingInfo::TimingGraph::updateCriticalPath
void updateCriticalPath()
Definition: PlacementTimingInfo.h:628
PlacementTimingInfo::TimingGraph::getNodes
std::vector< TimingNode * > & getNodes()
Definition: PlacementTimingInfo.h:537
PlacementTimingInfo::TimingGraph::TimingNode::setSlowestPredecessorId
void setSlowestPredecessorId(int _slowestPredecessorId)
Set the slowest predecessor node Id.
Definition: PlacementTimingInfo.h:310
PlacementTimingInfo::TimingGraph::setClockPeriod
void setClockPeriod(float _clockPeriod)
Set the clock period.
Definition: PlacementTimingInfo.h:789
PlacementTimingInfo::TimingGraph::TimingEdge::id
int id
Definition: PlacementTimingInfo.h:523
PlacementTimingInfo::clockNet2Period
std::map< DesignInfo::DesignNet *, float > clockNet2Period
Definition: PlacementTimingInfo.h:885
PlacementTimingInfo
PlacementTimingInfo is the container which record the timing information related to placement.
Definition: PlacementTimingInfo.h:49
PlacementTimingInfo::TimingGraph::setLongestPathLength
void setLongestPathLength()
Set the Longest Path Length for each TimingNode in the TimingGraph and get a sorted vector of TimingN...
Definition: PlacementTimingInfo.h:668
PlacementTimingInfo::TimingGraph::TimingNode::inEdges
std::vector< TimingEdge * > inEdges
Definition: PlacementTimingInfo.h:429
DesignInfo::DesignNet
a design net (hyperedge) defined in the design, connecting to pins of cells
Definition: DesignInfo.h:525
PlacementTimingInfo::TimingGraph::TimingNode::slowestPredecessorId
int slowestPredecessorId
Definition: PlacementTimingInfo.h:419
PlacementTimingInfo::TimingGraph::TimingNode::latestOutputArrival
float latestOutputArrival
Definition: PlacementTimingInfo.h:416
PlacementTimingInfo::TimingGraph::TimingNode::setRequiredArrivalTime
void setRequiredArrivalTime(float _requiredArrival)
Set the required arrival time.
Definition: PlacementTimingInfo.h:350
PlacementTimingInfo::TimingGraph::TimingNode::setIsRegister
void setIsRegister()
indicate that this node is a register node
Definition: PlacementTimingInfo.h:126
PlacementTimingInfo::TimingGraph::TimingNode::clusterId
int clusterId
Definition: PlacementTimingInfo.h:421
PlacementTimingInfo::TimingGraph::TimingEdge::srcNode
TimingNode * srcNode
Definition: PlacementTimingInfo.h:518
PlacementTimingInfo::TimingGraph::mediumPathThresholdLevel
int mediumPathThresholdLevel
Definition: PlacementTimingInfo.h:816
PlacementTimingInfo::TimingGraph::DFSFromNode
std::vector< int > DFSFromNode(int startNodeId, int pathLenThr, unsigned sizeThr, std::set< int > &exceptionCells, int fanoutThr=10000000)
DFS the sucessors(predecessors) of a node in the long paths.
Definition: PlacementTimingInfo.cc:460
PlacementTimingInfo::TimingGraph::TimingGraph
TimingGraph(PlacementTimingInfo *timingInfo)
Construct a new empty Timing Graph object.
Definition: PlacementTimingInfo.h:77
PlacementTimingInfo::deviceInfo
DeviceInfo * deviceInfo
Definition: PlacementTimingInfo.h:874
PlacementTimingInfo::TimingGraph::TimingNode::clockPeriod
float clockPeriod
Definition: PlacementTimingInfo.h:418
PlacementTimingInfo::TimingGraph::getClockPeriod
float getClockPeriod()
Get the clock period.
Definition: PlacementTimingInfo.h:777
DesignInfo::DesignPin
A design pin on a design cell connected to a net.
Definition: DesignInfo.h:277
PlacementTimingInfo::TimingGraph::TimingNode::longestPathLength
int longestPathLength
the length of the longest path containing this TimingNode
Definition: PlacementTimingInfo.h:451
PlacementTimingInfo::TimingGraph::TimingEdge::getSinkPin
DesignInfo::DesignPin * getSinkPin()
Definition: PlacementTimingInfo.h:507
PlacementTimingInfo::TimingGraph::TimingNode::setInitialRequiredArrivalTime
void setInitialRequiredArrivalTime(float _requiredArrival)
Set the required arrival time.
Definition: PlacementTimingInfo.h:360
PlacementTimingInfo::TimingGraph::TimingNode::setDestLevel
void setDestLevel(int _destLevel)
Definition: PlacementTimingInfo.h:213
PlacementTimingInfo::TimingGraph::backwardLevelization
void backwardLevelization()
propogate the backward level of each TimingNode backward level of a TimingNode is the distance toward...
Definition: PlacementTimingInfo.cc:309
PlacementTimingInfo::TimingGraph::TimingEdge::TimingEdge
TimingEdge(TimingNode *srcNode, TimingNode *sinkNode, DesignInfo::DesignPin *srcPin, DesignInfo::DesignPin *sinkPin, DesignInfo::DesignNet *net=nullptr, int id=-1)
Construct a new Timing Edge object.
Definition: PlacementTimingInfo.h:472
PlacementTimingInfo::TimingGraph::backwardlevel2NodeIds
std::vector< std::vector< int > > backwardlevel2NodeIds
levelized nodes in difference backward level
Definition: PlacementTimingInfo.h:811
PlacementTimingInfo::TimingGraph::TimingNode::setInnerDelay
void setInnerDelay(float _innerDelay)
Set the inner delay.
Definition: PlacementTimingInfo.h:320
PlacementTimingInfo::TimingGraph::TimingNode::calcLongestPath
void calcLongestPath()
calculate the length of the longest path containing this TimingNode
Definition: PlacementTimingInfo.h:172
PlacementTimingInfo::~PlacementTimingInfo
~PlacementTimingInfo()
Definition: PlacementTimingInfo.h:59
DesignInfo.h
This header file contains the classes of data for a standalone design netlist.
PlacementTimingInfo::TimingGraph::TimingNode::outEdges
std::vector< TimingEdge * > outEdges
Definition: PlacementTimingInfo.h:430
PlacementTimingInfo::TimingGraph::TimingNode::setBackwardLevel
void setBackwardLevel(int _backwardLevel)
Definition: PlacementTimingInfo.h:163
PlacementTimingInfo::TimingGraph::TimingNode::getOutEdges
std::vector< TimingEdge * > & getOutEdges()
Get the outward edges from this TimingNode.
Definition: PlacementTimingInfo.h:228
PlacementTimingInfo::TimingGraph::getEdges
std::vector< TimingEdge * > & getEdges()
Definition: PlacementTimingInfo.h:542
PlacementTimingInfo::TimingGraph::longPathThresholdLevel
int longPathThresholdLevel
Definition: PlacementTimingInfo.h:815
PlacementTimingInfo::TimingGraph::getCriticalPathDelay
float getCriticalPathDelay()
Definition: PlacementTimingInfo.h:647
PlacementTimingInfo::TimingGraph::TimingNode::getClockPeriod
float getClockPeriod()
Definition: PlacementTimingInfo.h:393
dumpZip.h
PlacementTimingInfo::TimingGraph::maxDelay
float maxDelay
Definition: PlacementTimingInfo.h:820
PlacementTimingInfo::TimingGraph::TimingNode
TimingNode is the node in TimingGraph, which could be pin or cell in the design netlist.
Definition: PlacementTimingInfo.h:97
DeviceInfo.h
This header file contains the classes of data for a standalone device.
PlacementTimingInfo::TimingGraph::setLongPathThrRatio
void setLongPathThrRatio(float _r)
Definition: PlacementTimingInfo.h:765
PlacementTimingInfo::TimingGraph::TimingEdge::delay
float delay
Definition: PlacementTimingInfo.h:524
PlacementTimingInfo::TimingGraph::TimingNode::earliestSuccessorId
int earliestSuccessorId
Definition: PlacementTimingInfo.h:420
PlacementTimingInfo::TimingGraph::TimingNode::setLatestInputArrival
void setLatestInputArrival(float _latestInputArrival)
Set the latest arrival time to the output of this timing node.
Definition: PlacementTimingInfo.h:280
PlacementTimingInfo::TimingGraph::timingInfo
PlacementTimingInfo * timingInfo
Definition: PlacementTimingInfo.h:795
PlacementTimingInfo::TimingGraph::TimingNode::getRequiredArrivalTime
float getRequiredArrivalTime()
Get the required arrival time.
Definition: PlacementTimingInfo.h:340
PlacementTimingInfo::TimingGraph::getSortedTimingEndpoints
std::vector< TimingNode * > & getSortedTimingEndpoints()
Definition: PlacementTimingInfo.h:699
PlacementTimingInfo::TimingGraph::forwardlevel2NodeIds
std::vector< std::vector< int > > forwardlevel2NodeIds
levelized nodes in difference forward level
Definition: PlacementTimingInfo.h:805
PlacementTimingInfo::TimingGraph::TimingEdge::srcPin
DesignInfo::DesignPin * srcPin
Definition: PlacementTimingInfo.h:520
PlacementTimingInfo::TimingGraph::backTraceDelayLongestPathFromNode
std::vector< int > backTraceDelayLongestPathFromNode(int curNodeId)
backtrace the longest delay path from the node
Definition: PlacementTimingInfo.cc:685
PlacementTimingInfo::TimingGraph::findALoopFromNode
void findALoopFromNode(std::vector< int > &nodeInPath, int startNode, int curNode, int level)
find loop from a node in timing graph (for debug)
Definition: PlacementTimingInfo.h:576
PlacementTimingInfo::TimingGraph::TimingNode::getSlowestPredecessorId
int getSlowestPredecessorId()
Get the slowest predecessor node Id.
Definition: PlacementTimingInfo.h:300
PlacementTimingInfo::TimingGraph::TimingNode::isRegister
bool isRegister
Definition: PlacementTimingInfo.h:428
PlacementTimingInfo::TimingGraph::TimingNode::sortInEdgesByForwardLevel
void sortInEdgesByForwardLevel()
sort the inward edges by their source node forward level
Definition: PlacementTimingInfo.h:258
PlacementTimingInfo::TimingGraph::TimingNode::designNode
nodeType * designNode
the pointer linked to the design element (pin or cell)
Definition: PlacementTimingInfo.h:413
PlacementTimingInfo::TimingGraph::TimingNode::requiredArrival
float requiredArrival
Definition: PlacementTimingInfo.h:417
PlacementTimingInfo::TimingGraph::TimingEdge::net
DesignInfo::DesignNet * net
Definition: PlacementTimingInfo.h:522
PlacementTimingInfo::TimingGraph::forwardLevelization
void forwardLevelization()
propogate the forward level of each TimingNode forward level of a TimingNode is the distance toward t...
Definition: PlacementTimingInfo.cc:186
PlacementTimingInfo::TimingGraph::propogateArrivalTime
void propogateArrivalTime()
propogate the timing delay along the TimingEdge
Definition: PlacementTimingInfo.cc:578
PlacementTimingInfo::TimingGraph::TimingNode::setEarlestSuccessorId
void setEarlestSuccessorId(int _earliestSuccessorId)
Set the earliest successor node Id.
Definition: PlacementTimingInfo.h:383
PlacementTimingInfo::TimingGraph::TimingEdge::getDelay
float getDelay()
Definition: PlacementTimingInfo.h:492
PlacementTimingInfo::TimingGraph::delaySortedTimingEndpointNodes
std::vector< TimingNode * > delaySortedTimingEndpointNodes
Definition: PlacementTimingInfo.h:798
PlacementTimingInfo::TimingGraph::TimingNode::getForwardLevel
int getForwardLevel()
Get the distance toward the farthest predecessor register based on the path length (instead of delay)
Definition: PlacementTimingInfo.h:183
PlacementTimingInfo::TimingGraph::TimingEdge::sinkNode
TimingNode * sinkNode
Definition: PlacementTimingInfo.h:519
PlacementTimingInfo::getMediumPathThresholdLevel
int getMediumPathThresholdLevel()
Definition: PlacementTimingInfo.h:860
PlacementTimingInfo::TimingGraph::TimingNode::getId
int getId()
Definition: PlacementTimingInfo.h:112
PlacementTimingInfo::TimingGraph::addEdgeBetween
void addEdgeBetween(int idA, int idB, DesignInfo::DesignPin *srcPin, DesignInfo::DesignPin *sinkPin, DesignInfo::DesignNet *net=nullptr, float delay=0.0)
add a TimingEdge into TimingGraph based on some related information
Definition: PlacementTimingInfo.h:557
PlacementTimingInfo::getDeviceInfo
DeviceInfo * getDeviceInfo()
Definition: PlacementTimingInfo.h:865
PlacementTimingInfo::TimingGraph::TimingNode::backwardLevel
int backwardLevel
the distance toward the farthest successor register based on the path length (instead of delay)
Definition: PlacementTimingInfo.h:444
PlacementTimingInfo::TimingGraph::TimingNode::destLevel
int destLevel
Definition: PlacementTimingInfo.h:445
PlacementTimingInfo::TimingGraph::getMediumPathThresholdLevel
int getMediumPathThresholdLevel()
Get the medium path threshold level.
Definition: PlacementTimingInfo.h:760
PlacementTimingInfo::cellId2Period
std::map< int, float > cellId2Period
Definition: PlacementTimingInfo.h:886
PlacementTimingInfo::TimingGraph
a directed graph for timing analysis
Definition: PlacementTimingInfo.h:71
PlacementTimingInfo::TimingGraph::TimingNode::setClockPeriod
void setClockPeriod(float _clockPeriod)
Definition: PlacementTimingInfo.h:388
PlacementTimingInfo::TimingGraph::TimingEdge::getId
int getId()
Definition: PlacementTimingInfo.h:482
PlacementTimingInfo::TimingGraph::TimingNode::getInnerDelay
float getInnerDelay()
Get the inner delay.
Definition: PlacementTimingInfo.h:330
PlacementTimingInfo::verbose
bool verbose
Definition: PlacementTimingInfo.h:880
PlacementTimingInfo::TimingGraph::nodes
std::vector< TimingNode * > nodes
Definition: PlacementTimingInfo.h:796
PlacementTimingInfo::TimingGraph::TimingNode::~TimingNode
~TimingNode()
Definition: PlacementTimingInfo.h:110
PlacementTimingInfo::TimingGraph::TimingNode::getLatestOutputArrival
float getLatestOutputArrival()
Definition: PlacementTimingInfo.h:290
PlacementTimingInfo::TimingGraph::TimingNode::sortOutEdgesByBackwardLevel
void sortOutEdgesByBackwardLevel()
sort the outward edges by their sink node backward level
Definition: PlacementTimingInfo.h:237
PlacementTimingInfo::TimingGraph::getPathLenSortedNodes
std::vector< TimingNode * > & getPathLenSortedNodes()
Definition: PlacementTimingInfo.h:740
PlacementTimingInfo::getSimplePlacementTimingInfo
std::vector< TimingGraph< DesignInfo::DesignCell >::TimingNode * > & getSimplePlacementTimingInfo()
Get the Simple Timing Info object which regard design cells as timing nodes.
Definition: PlacementTimingInfo.h:835
PlacementTimingInfo::TimingGraph::TimingNode::id
int id
Definition: PlacementTimingInfo.h:414
PlacementTimingInfo::DSPCritical
bool DSPCritical
Definition: PlacementTimingInfo.h:883
PlacementTimingInfo::TimingGraph::getCriticalEndPoint
int getCriticalEndPoint()
Definition: PlacementTimingInfo.h:642
DeviceInfo
Information class related to FPGA device, including the details of BEL/Site/Tile/ClockRegion.
Definition: DeviceInfo.h:43
PlacementTimingInfo::TimingGraph::getLongPathThresholdLevel
int getLongPathThresholdLevel()
Get the long path threshold level.
Definition: PlacementTimingInfo.h:750
PlacementTimingInfo::TimingGraph::pathLenSortedNodes
std::vector< TimingNode * > pathLenSortedNodes
Definition: PlacementTimingInfo.h:797
PlacementTimingInfo::TimingGraph::TimingNode::innerDelay
float innerDelay
the node can have internal delay (e.g., cell delay)
Definition: PlacementTimingInfo.h:427
PlacementTimingInfo::TimingGraph::TimingNode::getLongestPathLength
int getLongestPathLength()
Get the length of the longest path containing this TimingNode.
Definition: PlacementTimingInfo.h:204
PlacementTimingInfo::TimingGraph::edges
std::vector< TimingEdge * > edges
Definition: PlacementTimingInfo.h:799
checkHalfColumn.i
int i
Definition: checkHalfColumn.py:5
PlacementTimingInfo::TimingGraph::TimingEdge::getSink
TimingNode * getSink()
Definition: PlacementTimingInfo.h:497
PlacementTimingInfo::TimingGraph::TimingNode::getDestLevel
int getDestLevel()
Definition: PlacementTimingInfo.h:218
PlacementTimingInfo::TimingGraph::maxDelayId
int maxDelayId
Definition: PlacementTimingInfo.h:821
PlacementTimingInfo::PlacementTimingInfo
PlacementTimingInfo(DesignInfo *designInfo, DeviceInfo *deviceInfo, std::map< std::string, std::string > &JSONCfg)
Construct a new Placement Timing Info object based on the information of design and device.
Definition: PlacementTimingInfo.cc:35
PlacementTimingInfo::TimingGraph::clockPeriod
float clockPeriod
Definition: PlacementTimingInfo.h:818
PlacementTimingInfo::setDSPInnerDelay
void setDSPInnerDelay()
Definition: PlacementTimingInfo.cc:74
PlacementTimingInfo::TimingGraph::traceForwardFromNode
std::vector< int > traceForwardFromNode(int targetId)
find the longest path from the target node (id) to a register
Definition: PlacementTimingInfo.cc:429
PlacementTimingInfo::TimingGraph::insertTimingNode
void insertTimingNode(TimingNode *timingNode)
insert a TimingNode into this TimingGraph
Definition: PlacementTimingInfo.h:532
PlacementTimingInfo::TimingGraph::TimingNode::getEarlestSuccessorId
int getEarlestSuccessorId()
Get the earliest successor node Id.
Definition: PlacementTimingInfo.h:373
PlacementTimingInfo::JSONCfg
std::map< std::string, std::string > & JSONCfg
Definition: PlacementTimingInfo.h:877
PlacementTimingInfo::TimingGraph::TimingEdge::sinkPin
DesignInfo::DesignPin * sinkPin
Definition: PlacementTimingInfo.h:521
PlacementTimingInfo::TimingGraph::TimingNode::addOutEdge
void addOutEdge(TimingEdge *tmpEdge)
Definition: PlacementTimingInfo.h:147
PlacementTimingInfo::TimingGraph::TimingNode::setClusterId
void setClusterId(int _clusterId)
Definition: PlacementTimingInfo.h:398
PlacementTimingInfo::TimingGraph::mediumPathThrRatio
float mediumPathThrRatio
Definition: PlacementTimingInfo.h:814
PlacementTimingInfo::TimingGraph::TimingNode::checkIsRegister
bool checkIsRegister()
check if the node is a register node
Definition: PlacementTimingInfo.h:137
DesignInfo
Information related to FPGA designs, including design cells and their interconnections.
Definition: DesignInfo.h:51
PlacementTimingInfo::TimingGraph::~TimingGraph
~TimingGraph()
Definition: PlacementTimingInfo.h:82
PlacementTimingInfo::TimingGraph::TimingEdge::setDelay
void setDelay(float _delay)
Definition: PlacementTimingInfo.h:487
PlacementTimingInfo::TimingGraph::TimingEdge::getSource
TimingNode * getSource()
Definition: PlacementTimingInfo.h:502
PlacementTimingInfo::buildSimpleTimingGraph
void buildSimpleTimingGraph()
build a simple timing graph, where the inner delay between pin paris for an element will be identical
Definition: PlacementTimingInfo.cc:92
PlacementTimingInfo::TimingGraph::backPropogateRequiredArrivalTime
void backPropogateRequiredArrivalTime()
back propogate the required arrival time
Definition: PlacementTimingInfo.cc:650
PlacementTimingInfo::TimingGraph::TimingEdge
TimingEdge records a directed interconnection relationship between two TimingNode....
Definition: PlacementTimingInfo.h:460
PlacementTimingInfo::TimingGraph::TimingNode::latestInputArrival
float latestInputArrival
Definition: PlacementTimingInfo.h:415
PlacementTimingInfo::getLongPathThresholdLevel
int getLongPathThresholdLevel()
Definition: PlacementTimingInfo.h:855
PlacementTimingInfo::TimingGraph::sortedEndpointByDelay
void sortedEndpointByDelay()
Definition: PlacementTimingInfo.h:684
PlacementTimingInfo::TimingGraph::TimingNode::getBackwardLevel
int getBackwardLevel()
Get the distance toward the farthest successor register based on the path length (instead of delay)
Definition: PlacementTimingInfo.h:194
PlacementTimingInfo::TimingGraph::TimingNode::setLatestOutputArrival
void setLatestOutputArrival(float _latestOutputArrival)
Definition: PlacementTimingInfo.h:285
PlacementTimingInfo::TimingGraph::TimingNode::getDesignNode
nodeType * getDesignNode()
Definition: PlacementTimingInfo.h:117
PlacementTimingInfo::getSimplePlacementTimingGraph
TimingGraph< DesignInfo::DesignCell > * getSimplePlacementTimingGraph()
Get the Simple Placement Timing Graph object.
Definition: PlacementTimingInfo.h:850
PlacementTimingInfo::TimingGraph::TimingNode::addInEdge
void addInEdge(TimingEdge *tmpEdge)
Definition: PlacementTimingInfo.h:142
PlacementTimingInfo::simpleTimingGraph
TimingGraph< DesignInfo::DesignCell > * simpleTimingGraph
Definition: PlacementTimingInfo.h:879
PlacementTimingInfo::TimingGraph::BFSFromNode
std::vector< int > BFSFromNode(int startNodeId, int pathLenThr, unsigned sizeThr, std::set< int > &exceptionCells)
BFS the sucessors(predecessors) of a node in the long paths.
Definition: PlacementTimingInfo.cc:519