torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::router::TraceNode Class Reference

An object that holds more complete path information for routing and tracing. More...

#include <TraceNode.hpp>

+ Collaboration diagram for torc::router::TraceNode:

Public Types

typedef std::vector< TraceNode * > TraceNodePtrVector
 Vector of TraceNode pointers. More...
 
typedef std::list< TraceNode * > TraceNodePtrList
 List of TraceNode pointers. More...
 
typedef std::pair< Tilewire,
TraceNode * > 
TilewireTraceNodePtrPair
 Pair consisting of a Tilewire and TraceNode pointer. More...
 
typedef
TraceNodePtrVector::iterator 
TraceNodePtrVectorIterator
 Iterator for vector of TraceNode pointers. More...
 
typedef std::pair< Arc,
TraceNode * > 
ArcTraceNodePtrPair
 Pair consiting of an Arc and a TraceNode pointer. More...
 
typedef std::vector
< TilewireTraceNodePtrPair
TilewireTraceNodePtrPairVector
 Vector of pairs of source Tilewires and TraceNode pointers. More...
 
typedef std::vector
< ArcTraceNodePtrPair
ArcTraceNodePtrPairVector
 Vector of paires of Arcs and TraceNode pointers. More...
 

Public Member Functions

 TraceNode ()
 Null Constructor. More...
 
 TraceNode (Tilewire inTilewire)
 Public Constructor. More...
 
 ~TraceNode ()
 Destructor. More...
 
Tilewire getTilewire ()
 Get the Tilewire associated with this node. More...
 
boost::int32_t getDepth () const
 Get the depth of this node from the furthest node with no parent. More...
 
void setDepth (boost::int32_t inDepth)
 Set the depth of this node. More...
 
void addChildren (const TraceNodePtrVector &newChildren)
 Add children to the node. More...
 
void addChild (TraceNode *newChild)
 brief Add child to the node. More...
 
void addParent (TraceNode *newParent)
 Add parent to the node. More...
 
boost::uint32_t getNumChildren ()
 Get the number of children. More...
 
boost::uint32_t getNumParents ()
 Get the number of parents. More...
 
TraceNodegetChild (boost::uint32_t index)
 Get a child by index, returns 0 for invalid index. More...
 
TraceNodegetParent (boost::uint32_t index)
 Get a parent by index, returns 0 for invalid index. More...
 
TraceNoderemoveChild (boost::uint32_t index)
 Remove a child by index, returns 0 for invalid index. More...
 
TraceNoderemoveParent (boost::uint32_t index)
 Remove a parent by index, returns 0 for invalid index. More...
 

Static Public Attributes

static boost::int32_t sLiveNodes = 0
 Static allocation and deallocation count. More...
 

Protected Attributes

Tilewire mTilewire
 
TraceNodePtrVector mChildren
 TilewireVector representing this node. More...
 
TraceNodePtrVector mParents
 Vector of parent pointers. More...
 
boost::int32_t mDepth
 Depth from furthest parent with no parent. More...
 

Private Types

typedef architecture::Tilewire Tilewire
 Imported type name. More...
 
typedef architecture::Arc Arc
 Imported type name. More...
 
typedef
architecture::TilewireVector 
TilewireVector
 Imported type name. More...
 

Friends

class Trace
 The TraceNode allows access to protected functions from Trace objects. More...
 

Detailed Description

An object that holds more complete path information for routing and tracing.

Todo:
Have to justify the packing decision, and its impact on memory footprint versus performance.

A TraceNode contains children pointers to allow tracing of arcs through a device to recover complete nets from the device usage information.

Definition at line 44 of file TraceNode.hpp.

Member Typedef Documentation

Imported type name.

Definition at line 52 of file TraceNode.hpp.

Pair consiting of an Arc and a TraceNode pointer.

Definition at line 65 of file TraceNode.hpp.

Vector of paires of Arcs and TraceNode pointers.

Definition at line 69 of file TraceNode.hpp.

Imported type name.

Definition at line 50 of file TraceNode.hpp.

Pair consisting of a Tilewire and TraceNode pointer.

Definition at line 61 of file TraceNode.hpp.

Vector of pairs of source Tilewires and TraceNode pointers.

Definition at line 67 of file TraceNode.hpp.

Imported type name.

Definition at line 54 of file TraceNode.hpp.

List of TraceNode pointers.

Definition at line 59 of file TraceNode.hpp.

Vector of TraceNode pointers.

Definition at line 57 of file TraceNode.hpp.

typedef TraceNodePtrVector::iterator torc::router::TraceNode::TraceNodePtrVectorIterator

Iterator for vector of TraceNode pointers.

Definition at line 63 of file TraceNode.hpp.

Constructor & Destructor Documentation

torc::router::TraceNode::TraceNode ( )
inline

Null Constructor.

Definition at line 90 of file TraceNode.hpp.

90  : mDepth(-1) {
91  sLiveNodes++;
92  }
boost::int32_t mDepth
Depth from furthest parent with no parent.
Definition: TraceNode.hpp:82
static boost::int32_t sLiveNodes
Static allocation and deallocation count.
Definition: TraceNode.hpp:85
torc::router::TraceNode::TraceNode ( Tilewire  inTilewire)
inline

Public Constructor.

Definition at line 94 of file TraceNode.hpp.

94  : mTilewire(inTilewire), mDepth(-1) {
95  sLiveNodes++;
96  }
boost::int32_t mDepth
Depth from furthest parent with no parent.
Definition: TraceNode.hpp:82
static boost::int32_t sLiveNodes
Static allocation and deallocation count.
Definition: TraceNode.hpp:85
torc::router::TraceNode::~TraceNode ( )
inline

Destructor.

Recursively deletes all connected nodes.

Definition at line 99 of file TraceNode.hpp.

99  {
100  //std::cout << "DESTRUCT! " << mTilewire.getWireIndex() << "@"
101  // << mTilewire.getTileIndex() << std::endl;
102  /*for (unsigned int i = 0; i < mChildren.size(); i++) {
103  for (unsigned int j = 0; j < mChildren[i]->getNumParents(); j++) {
104  if (mChildren[i]->getParent(j) == this) {
105  mChildren[i]->removeParent(j);
106  break;
107  }
108  }
109  delete mChildren[i];
110  mChildren[i] = 0;
111  }
112  mChildren.clear();
113  for (unsigned int i = 0; i < mParents.size(); i++) {
114  if (mParents[i]->getNumChildren() > 0) {
115  for (unsigned int j = 0; j < mParents[i]->getNumChildren(); j++) {
116  if (mParents[i]->getChild(j) == this) {
117  mParents[i]->removeChild(j);
118  break;
119  }
120  }
121  }
122  delete mParents[i];
123  mParents[i] = 0;
124  }
125  mParents.clear();*/
126  sLiveNodes--;
127  }
static boost::int32_t sLiveNodes
Static allocation and deallocation count.
Definition: TraceNode.hpp:85

Member Function Documentation

void torc::router::TraceNode::addChild ( TraceNode newChild)
inline

brief Add child to the node.

Definition at line 145 of file TraceNode.hpp.

145  {
146  if (newChild == 0) return;
147  mChildren.push_back(newChild);
148  }
TraceNodePtrVector mChildren
TilewireVector representing this node.
Definition: TraceNode.hpp:77

+ Here is the caller graph for this function:

void torc::router::TraceNode::addChildren ( const TraceNodePtrVector newChildren)
inline

Add children to the node.

Definition at line 137 of file TraceNode.hpp.

137  {
138  boost::uint32_t size = newChildren.size();
139  if (size == 0) return;
140  mChildren.reserve(mChildren.size() + size);
141  // insert children into the node
142  mChildren.insert(mChildren.end(), newChildren.begin(), newChildren.end());
143  }
TraceNodePtrVector mChildren
TilewireVector representing this node.
Definition: TraceNode.hpp:77

+ Here is the caller graph for this function:

void torc::router::TraceNode::addParent ( TraceNode newParent)
inline

Add parent to the node.

Definition at line 150 of file TraceNode.hpp.

150  {
151  mParents.push_back(newParent);
152  }
TraceNodePtrVector mParents
Vector of parent pointers.
Definition: TraceNode.hpp:80

+ Here is the caller graph for this function:

TraceNode* torc::router::TraceNode::getChild ( boost::uint32_t  index)
inline

Get a child by index, returns 0 for invalid index.

Definition at line 162 of file TraceNode.hpp.

162  {
163  if (index >= mChildren.size()) return 0;
164  return mChildren[index];
165  }
TraceNodePtrVector mChildren
TilewireVector representing this node.
Definition: TraceNode.hpp:77

+ Here is the caller graph for this function:

boost::int32_t torc::router::TraceNode::getDepth ( ) const
inline

Get the depth of this node from the furthest node with no parent.

Definition at line 133 of file TraceNode.hpp.

133 { return mDepth; }
boost::int32_t mDepth
Depth from furthest parent with no parent.
Definition: TraceNode.hpp:82

+ Here is the caller graph for this function:

boost::uint32_t torc::router::TraceNode::getNumChildren ( )
inline

Get the number of children.

Definition at line 154 of file TraceNode.hpp.

154  {
155  return mChildren.size();
156  }
TraceNodePtrVector mChildren
TilewireVector representing this node.
Definition: TraceNode.hpp:77

+ Here is the caller graph for this function:

boost::uint32_t torc::router::TraceNode::getNumParents ( )
inline

Get the number of parents.

Definition at line 158 of file TraceNode.hpp.

158  {
159  return mParents.size();
160  }
TraceNodePtrVector mParents
Vector of parent pointers.
Definition: TraceNode.hpp:80

+ Here is the caller graph for this function:

TraceNode* torc::router::TraceNode::getParent ( boost::uint32_t  index)
inline

Get a parent by index, returns 0 for invalid index.

Definition at line 167 of file TraceNode.hpp.

167  {
168  if (index >= mParents.size()) return 0;
169  return mParents[index];
170  }
TraceNodePtrVector mParents
Vector of parent pointers.
Definition: TraceNode.hpp:80

+ Here is the caller graph for this function:

Tilewire torc::router::TraceNode::getTilewire ( void  )
inline

Get the Tilewire associated with this node.

Definition at line 130 of file TraceNode.hpp.

130 { return mTilewire; }

+ Here is the caller graph for this function:

TraceNode* torc::router::TraceNode::removeChild ( boost::uint32_t  index)
inline

Remove a child by index, returns 0 for invalid index.

Definition at line 172 of file TraceNode.hpp.

172  {
173  if (index >= mChildren.size()) return 0;
174  TraceNode* node = mChildren[index];
175  mChildren.erase(mChildren.begin() + index);
176  return node;
177  }
TraceNodePtrVector mChildren
TilewireVector representing this node.
Definition: TraceNode.hpp:77
TraceNode()
Null Constructor.
Definition: TraceNode.hpp:90

+ Here is the caller graph for this function:

TraceNode* torc::router::TraceNode::removeParent ( boost::uint32_t  index)
inline

Remove a parent by index, returns 0 for invalid index.

Definition at line 179 of file TraceNode.hpp.

179  {
180  if (index >= mParents.size()) return 0;
181  TraceNode* node = mParents[index];
182  mParents.erase(mParents.begin() + index);
183  return node;
184  }
TraceNode()
Null Constructor.
Definition: TraceNode.hpp:90
TraceNodePtrVector mParents
Vector of parent pointers.
Definition: TraceNode.hpp:80

+ Here is the caller graph for this function:

void torc::router::TraceNode::setDepth ( boost::int32_t  inDepth)
inline

Set the depth of this node.

Definition at line 135 of file TraceNode.hpp.

135 { mDepth = inDepth; }
boost::int32_t mDepth
Depth from furthest parent with no parent.
Definition: TraceNode.hpp:82

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class Trace
friend

The TraceNode allows access to protected functions from Trace objects.

Definition at line 47 of file TraceNode.hpp.

Field Documentation

TraceNodePtrVector torc::router::TraceNode::mChildren
protected

TilewireVector representing this node.

Vector of child pointers.

Definition at line 77 of file TraceNode.hpp.

boost::int32_t torc::router::TraceNode::mDepth
protected

Depth from furthest parent with no parent.

Definition at line 82 of file TraceNode.hpp.

TraceNodePtrVector torc::router::TraceNode::mParents
protected

Vector of parent pointers.

Definition at line 80 of file TraceNode.hpp.

Tilewire torc::router::TraceNode::mTilewire
protected

Definition at line 73 of file TraceNode.hpp.

boost::int32_t torc::router::TraceNode::sLiveNodes = 0
static

Static allocation and deallocation count.

Definition at line 85 of file TraceNode.hpp.


The documentation for this class was generated from the following files: