OpenASIP  2.0
Public Member Functions | List of all members
RLPriorityCriticalPath Class Reference

#include <ReadyMoveNodeGroupList.hh>

Inheritance diagram for RLPriorityCriticalPath:
Inheritance graph
Collaboration diagram for RLPriorityCriticalPath:
Collaboration graph

Public Member Functions

bool operator() (MoveNodeGroup &a, MoveNodeGroup &b)
 

Detailed Description

A function object for prioritizing the ready list according to the move's distance from farthest sink node.

Definition at line 48 of file ReadyMoveNodeGroupList.hh.

Member Function Documentation

◆ operator()()

bool RLPriorityCriticalPath::operator() ( MoveNodeGroup a,
MoveNodeGroup b 
)
inline

Compares two nodes according to their priority in the ready list.

Parameters
aNode a.
bNode b.
Returns
True if b should be scheduled before a (b greater than a).

Definition at line 58 of file ReadyMoveNodeGroupList.hh.

58  {
59 
60  if (b.isScheduled()) {
61  // keep scheduled MoveNodeSets on a top of a queue
62  // so they will be poped out
63  return true;
64  }
65  if (a.isScheduled()) {
66  // keep scheduled MoveNodeSets on a top of a queue
67  // so they will be poped out
68  return false;
69  }
70  // Compute distances only once, it is expensive operation on graph
71  int aSinkDistance = a.maxSinkDistance();
72  int bSinkDistance = b.maxSinkDistance();
73 
74  if (bSinkDistance == aSinkDistance) {
75  return b.node(0).nodeID() < a.node(0).nodeID();
76  }
77  // the higher the sink distance, the higher the priority
78  return bSinkDistance > aSinkDistance;
79  }

References MoveNodeGroup::isScheduled(), MoveNodeGroup::maxSinkDistance(), MoveNodeGroup::node(), and GraphNode::nodeID().

Here is the call graph for this function:

The documentation for this class was generated from the following file:
MoveNodeGroup::node
MoveNode & node(int index) const
Definition: MoveNodeGroup.cc:152
GraphNode::nodeID
int nodeID() const
MoveNodeGroup::maxSinkDistance
int maxSinkDistance() const
Definition: MoveNodeGroup.cc:209
MoveNodeGroup::isScheduled
bool isScheduled() const
Definition: MoveNodeGroup.cc:164