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

Diff utility class for comparing physical netlists. More...

#include <PhysicalDiff.hpp>

Public Member Functions

 PhysicalDiff (std::ostream &inOutStream)
 
bool diff (const DesignSharedPtr &left, const DesignSharedPtr &right)
 Top level call to diff two designs. More...
 

Protected Types

typedef std::string string
 Imported type name. More...
 
typedef
torc::physical::DesignSharedPtr 
DesignSharedPtr
 Imported type name. More...
 
typedef
torc::physical::ModuleSharedPtr 
ModuleSharedPtr
 Imported type name. More...
 
typedef std::vector
< ModuleSharedPtr
ModuleSharedPtrVector
 Imported type name. More...
 
typedef
torc::physical::CircuitSharedPtr 
CircuitSharedPtr
 Imported type name. More...
 
typedef
torc::physical::InstanceSharedPtr 
InstanceSharedPtr
 Imported type name. More...
 
typedef std::vector
< InstanceSharedPtr
InstanceSharedPtrVector
 Imported type name. More...
 
typedef
torc::physical::NetSharedPtr 
NetSharedPtr
 Imported type name. More...
 
typedef std::vector< NetSharedPtrNetSharedPtrVector
 Imported type name. More...
 
typedef
torc::physical::Circuit::InstanceSharedPtrConstIterator 
InstanceSharedPtrConstIterator
 Imported type name. More...
 
typedef
torc::physical::Circuit::InstanceSharedPtrIterator 
InstanceSharedPtrIterator
 Imported type name. More...
 
typedef
torc::physical::Circuit::NetSharedPtrConstIterator 
NetSharedPtrConstIterator
 Imported type name. More...
 
typedef
torc::physical::Circuit::NetSharedPtrIterator 
NetSharedPtrIterator
 Imported type name. More...
 
typedef
torc::physical::InstanceWeakPtr 
InstanceWeakPtr
 Imported type name. More...
 
typedef
torc::physical::Design::ModuleSharedPtrConstIterator 
ModuleSharedPtrConstIterator
 Imported type name. More...
 
typedef
torc::physical::Design::ModuleSharedPtrIterator 
ModuleSharedPtrIterator
 Imported type name. More...
 
typedef
torc::physical::ConfigMap::const_iterator 
ConfigMapConstIterator
 Imported type name. More...
 
typedef
torc::physical::Net::InstancePinSharedPtrConstIterator 
InstancePinSharedPtrConstIterator
 Imported type name. More...
 
typedef
torc::physical::Net::PipConstIterator 
PipConstIterator
 Imported type name. More...
 
typedef boost::shared_ptr
< torc::physical::Named
NamedSharedPtr
 Imported type name. More...
 
typedef boost::shared_ptr
< torc::physical::ConfigMap
ConfigMapSharedPtr
 Imported type name. More...
 
typedef
torc::physical::Module::PortSharedPtrConstIterator 
PortSharedPtrConstIterator
 Imported type name. More...
 

Protected Member Functions

bool diffDesign (const DesignSharedPtr &left, const DesignSharedPtr &right)
 Diff design pointers and then recursively compare modules and inherited members. More...
 
bool diffModule (const ModuleSharedPtr &left, const ModuleSharedPtr &right)
 Diff module pointers and then recursively compare inherited members from circuit. More...
 
bool diffCircuit (const CircuitSharedPtr &left, const CircuitSharedPtr &right)
 Diff circuit pointers, recursively compare nets, instances and config map. More...
 
bool diffConfigMap (const ConfigMapSharedPtr &left, const ConfigMapSharedPtr &right, const string &parentStr)
 Diff configuration information, this is called from circuits, instances and nets. More...
 
bool diffInstance (const InstanceSharedPtr &left, const InstanceSharedPtr &right)
 Diff instance pointers and then the underlying config map. More...
 
bool diffNet (const NetSharedPtr &left, const NetSharedPtr &right)
 Diff net pointers and then the underlying config map. More...
 

Protected Attributes

std::ostream & mStream
 Output stream to use for comparison results. More...
 

Friends

class utils::PhysicalDiffDesignUnitTest
 Unit test access to internal functions. More...
 
class utils::PhysicalDiffModuleUnitTest
 Unit test access to internal functions. More...
 
class utils::PhysicalDiffCircuitUnitTest
 Unit test access to internal functions. More...
 
class utils::PhysicalDiffConfigMapUnitTest
 Unit test access to internal functions. More...
 
class utils::PhysicalDiffInstanceUnitTest
 Unit test access to internal functions. More...
 
class utils::PhysicalDiffNetUnitTest
 Unit test access to internal functions. More...
 

Detailed Description

Diff utility class for comparing physical netlists.

This class takes two design pointers and compares them.

Definition at line 42 of file PhysicalDiff.hpp.

Member Typedef Documentation

Imported type name.

Definition at line 65 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 89 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 98 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 59 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 67 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 69 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 83 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 61 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 63 of file PhysicalDiff.hpp.

typedef boost::shared_ptr<torc::physical::Named> torc::PhysicalDiff::NamedSharedPtr
protected

Imported type name.

Definition at line 96 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 71 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 81 of file PhysicalDiff.hpp.

typedef std::vector<NetSharedPtr> torc::PhysicalDiff::NetSharedPtrVector
protected

Imported type name.

Definition at line 73 of file PhysicalDiff.hpp.

Imported type name.

Definition at line 94 of file PhysicalDiff.hpp.

typedef std::string torc::PhysicalDiff::string
protected

Imported type name.

Definition at line 57 of file PhysicalDiff.hpp.

Constructor & Destructor Documentation

torc::PhysicalDiff::PhysicalDiff ( std::ostream &  inOutStream)
inline
Todo:

Improve Pip comparison.

Port comparison should use port name.

Config sequence index is not used.

Instance does not check the reference pointer.

Definition at line 110 of file PhysicalDiff.hpp.

110  : mStream(inOutStream)
111  {
112  mStream << "WARNING: Pip comparison uses only tile, source, direction "
113  << "and sink!" << std::endl;
114  mStream << "WARNING: Port comparison does not use the port name!" << std::endl;
115  mStream << "WARNING: Config sequence index not used!" << std::endl;
116  mStream << "WARNING: Instance does not check reference pointer!" << std::endl;
117  }
std::ostream & mStream
Output stream to use for comparison results.

Member Function Documentation

bool torc::PhysicalDiff::diff ( const DesignSharedPtr left,
const DesignSharedPtr right 
)
inline

Top level call to diff two designs.

Definition at line 120 of file PhysicalDiff.hpp.

120  {
121  return diffDesign(left, right);
122  }
bool diffDesign(const DesignSharedPtr &left, const DesignSharedPtr &right)
Diff design pointers and then recursively compare modules and inherited members.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::PhysicalDiff::diffCircuit ( const CircuitSharedPtr left,
const CircuitSharedPtr right 
)
inlineprotected

Diff circuit pointers, recursively compare nets, instances and config map.

Definition at line 251 of file PhysicalDiff.hpp.

251  {
252  bool rval = true;
253 
254  InstanceSharedPtrVector leftInstances;
255  InstanceSharedPtrVector rightInstances;
258 
259  for (ileft = left->instancesBegin(); ileft!= left->instancesEnd(); ileft++) {
260  leftInstances.push_back(*ileft);
261  }
262  for (iright = right->instancesBegin(); iright!= right->instancesEnd(); iright++) {
263  rightInstances.push_back(*iright);
264  }
265  for (ileft = leftInstances.begin(); ileft != leftInstances.end(); ileft++) {
266  bool found = false;
267  for (iright = rightInstances.begin(); iright != rightInstances.end(); iright++) {
268  if ((*ileft)->getName() == (*iright)->getName()) {
269  found = true;
270  break;
271  }
272  }
273  if (found) {
274  //mStream << "Instance " << (*ileft)->getName() << std::endl;
275  rval = diffInstance(*ileft, *iright) && rval;
276  rightInstances.erase(iright);
277  } else {
278  mStream << "< Instance " << (*ileft)->getName() << std::endl;
279  rval = false;
280  }
281  }
282  for (iright = rightInstances.begin(); iright != rightInstances.end(); iright++) {
283  mStream << "> Instance " << (*iright)->getName() << std::endl;
284  rval = false;
285  }
286  leftInstances.clear();
287  rightInstances.clear();
288 
289  NetSharedPtrVector leftNets;
290  NetSharedPtrVector rightNets;
291  NetSharedPtrIterator nleft;
292  NetSharedPtrIterator nright;
293 
294  for (nleft = left->netsBegin(); nleft!= left->netsEnd(); nleft++) {
295  leftNets.push_back(*nleft);
296  }
297  for (nright = right->netsBegin(); nright!= right->netsEnd(); nright++) {
298  rightNets.push_back(*nright);
299  }
300  for (nleft = leftNets.begin(); nleft != leftNets.end(); nleft++) {
301  bool found = false;
302  for (nright = rightNets.begin(); nright != rightNets.end(); nright++) {
303  if ((*nleft)->getName() == (*nright)->getName()) {
304  found = true;
305  break;
306  }
307  }
308  if (found) {
309  rval = diffNet(*nleft, *nright) && rval;
310  rightNets.erase(nright);
311  } else {
312  mStream << "< Net " << (*nleft)->getName() << std::endl;
313  rval = false;
314  }
315  }
316  for (nright = rightNets.begin(); nright != rightNets.end(); nright++) {
317  mStream << "> Net " << (*nright)->getName() << std::endl;
318  rval = false;
319  }
320  leftNets.clear();
321  rightNets.clear();
322 
323  string circuitname = "Circuit ";
324  circuitname.append(left->getName());
325  // A circuit is a configmap.
326  rval = diffConfigMap(left, right, circuitname) && rval;
327  return rval;
328  }
bool diffInstance(const InstanceSharedPtr &left, const InstanceSharedPtr &right)
Diff instance pointers and then the underlying config map.
torc::physical::Circuit::NetSharedPtrIterator NetSharedPtrIterator
Imported type name.
std::vector< NetSharedPtr > NetSharedPtrVector
Imported type name.
bool diffNet(const NetSharedPtr &left, const NetSharedPtr &right)
Diff net pointers and then the underlying config map.
torc::physical::Circuit::InstanceSharedPtrIterator InstanceSharedPtrIterator
Imported type name.
std::vector< InstanceSharedPtr > InstanceSharedPtrVector
Imported type name.
std::ostream & mStream
Output stream to use for comparison results.
bool diffConfigMap(const ConfigMapSharedPtr &left, const ConfigMapSharedPtr &right, const string &parentStr)
Diff configuration information, this is called from circuits, instances and nets. ...

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::PhysicalDiff::diffConfigMap ( const ConfigMapSharedPtr left,
const ConfigMapSharedPtr right,
const string parentStr 
)
inlineprotected

Diff configuration information, this is called from circuits, instances and nets.

Definition at line 330 of file PhysicalDiff.hpp.

331  {
332  bool rval = true;
333 
334  std::vector<string> leftConfigs;
335  std::vector<string> rightConfigs;
336  std::vector<string>::iterator ileft;
337  std::vector<string>::iterator iright;
338 
339  torc::physical::ConfigMap::const_iterator p = left->configBegin();
340  torc::physical::ConfigMap::const_iterator e = left->configEnd();
341  while (p != e) {
342  const torc::physical::Config& config = p->second;
343  string t = p->first;
344  t.append(":");
345  t.append(config.getName());
346  t.append(":");
347  t.append(config.getValue());
348  leftConfigs.push_back(t);
349  p++;
350  }
351  p = right->configBegin();
352  e = right->configEnd();
353  while (p != e) {
354  const torc::physical::Config& config = p->second;
355  string t = p->first;
356  t.append(":");
357  t.append(config.getName());
358  t.append(":");
359  t.append(config.getValue());
360  rightConfigs.push_back(t);
361  p++;
362  }
363  for (ileft = leftConfigs.begin(); ileft != leftConfigs.end(); ileft++) {
364  bool found = false;
365  for (iright = rightConfigs.begin(); iright != rightConfigs.end(); iright++) {
366  if (*ileft == *iright) {
367  found = true;
368  break;
369  }
370  }
371  if (found) {
372  //mStream << "Net " << (*nleft)->getName() << std::endl;
373  rightConfigs.erase(iright);
374  } else {
375  mStream << "< " << parentStr << " Config " << *ileft << std::endl;
376  rval = false;
377  }
378  }
379  for (iright = rightConfigs.begin(); iright != rightConfigs.end(); iright++) {
380  mStream << "> " << parentStr << " Config " << *iright << std::endl;
381  rval = false;
382  }
383  leftConfigs.clear();
384  rightConfigs.clear();
385  return rval;
386  }
const_iterator const_iterator
Constant iterator to {setting,Config} pairs.
Definition: ConfigMap.hpp:52
Configuration. A {name:value} pair.
Definition: Config.hpp:39
const string & getName(void) const
Returns the object name.
Definition: Named.hpp:51
const string & getValue(void) const
Return the configuration value.
Definition: Config.hpp:86
std::ostream & mStream
Output stream to use for comparison results.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::PhysicalDiff::diffDesign ( const DesignSharedPtr left,
const DesignSharedPtr right 
)
inlineprotected

Diff design pointers and then recursively compare modules and inherited members.

Definition at line 125 of file PhysicalDiff.hpp.

125  {
126  bool rval = true;
127  string designNameLeft = left->getName();
128  string designNameRight = right->getName();
129 
130  if (!(designNameLeft == designNameRight)) {
131  mStream << "! Design Name: " << designNameLeft << " | "
132  << designNameRight << std::endl;
133  rval = false;
134  }
135  if (!(left->getDevice() == right->getDevice())) {
136  mStream << "! Device: " << left->getDevice() << " | "
137  << right->getDevice() << std::endl;
138  rval = false;
139  }
140  if (!(left->getPackage() == right->getPackage())) {
141  mStream << "! Package: " << left->getPackage() << " | "
142  << right->getPackage() << std::endl;
143  rval = false;
144  }
145  if (!(left->getSpeedGrade() == right->getSpeedGrade())) {
146  mStream << "! Speed grade: " << left->getSpeedGrade()
147  << " | " << right->getSpeedGrade() << std::endl;
148  rval = false;
149  }
150  if (!(left->getXdlVersion() == right->getXdlVersion())) {
151  mStream << "! XDL version differs: " << left->getXdlVersion()
152  << " | " << right->getXdlVersion() << std::endl;
153  rval = false;
154  }
155 
156  ModuleSharedPtrVector leftModules;
157  ModuleSharedPtrVector rightModules;
158 
159  for (ModuleSharedPtrConstIterator p = left->modulesBegin(); p!= left->modulesEnd(); p++) {
160  leftModules.push_back(*p);
161  }
162  for (ModuleSharedPtrConstIterator p = right->modulesBegin(); p!= right->modulesEnd(); p++) {
163  rightModules.push_back(*p);
164  }
165 
166  // look left to right
169  for (ileft = leftModules.begin(); ileft != leftModules.end(); ileft++) {
170  bool found = false;
171  for (iright = rightModules.begin(); iright != rightModules.end(); iright++) {
172  if ((*ileft)->getName() == (*iright)->getName()) {
173  found = true;
174  break;
175  }
176  }
177  if (found) {
178  rval = diffModule(*ileft, *iright) && rval;
179  rightModules.erase(iright);
180  } else {
181  mStream << "< Module " << (*ileft)->getName() << std::endl;
182  rval = false;
183  }
184  }
185  // anything left on the right doesn't appear on the left
186  for (iright = rightModules.begin(); iright != rightModules.end(); iright++) {
187  mStream << "> Module " << (*iright)->getName() << std::endl;
188  rval = false;
189  }
190  // A design is a circuit
191  rval = diffCircuit(left, right) && rval;
192  return rval;
193  }
bool diffCircuit(const CircuitSharedPtr &left, const CircuitSharedPtr &right)
Diff circuit pointers, recursively compare nets, instances and config map.
torc::physical::Design::ModuleSharedPtrIterator ModuleSharedPtrIterator
Imported type name.
std::vector< ModuleSharedPtr > ModuleSharedPtrVector
Imported type name.
bool diffModule(const ModuleSharedPtr &left, const ModuleSharedPtr &right)
Diff module pointers and then recursively compare inherited members from circuit. ...
std::ostream & mStream
Output stream to use for comparison results.
torc::physical::Design::ModuleSharedPtrConstIterator ModuleSharedPtrConstIterator
Imported type name.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::PhysicalDiff::diffInstance ( const InstanceSharedPtr left,
const InstanceSharedPtr right 
)
inlineprotected

Diff instance pointers and then the underlying config map.

Definition at line 388 of file PhysicalDiff.hpp.

388  {
389  bool rval = true;
390  if (!(left->getType() == right->getType())) {
391  mStream << "! Instance " << left->getName() << " type: " << left->getType()
392  << " | " << right->getType() << std::endl;
393  rval = false;
394  }
395  if (!(left->getTile() == right->getTile())) {
396  mStream << "! Instance " << left->getName() << " tile: " << left->getTile()
397  << " | " << right->getTile() << std::endl;;
398  rval = false;
399  }
400  if (!(left->getSite() == right->getSite())) {
401  mStream << "! Instance " << left->getName() << "site: " << left->getSite()
402  << " | " << right->getSite() << std::endl;
403  rval = false;
404  }
405  if (!(left->getBonding() == right->getBonding())) {
406  mStream << "! Instance " << left->getName() << " bonding: " << left->getBonding()
407  << " | " << right->getBonding() << std::endl;
408  rval = false;
409  }
410 
411  string instancename = "Instance ";
412  instancename.append(left->getName());
413  // An instance is a configmap.
414  rval = diffConfigMap(left, right, instancename) && rval;
415  return rval;
416  }
std::ostream & mStream
Output stream to use for comparison results.
bool diffConfigMap(const ConfigMapSharedPtr &left, const ConfigMapSharedPtr &right, const string &parentStr)
Diff configuration information, this is called from circuits, instances and nets. ...

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::PhysicalDiff::diffModule ( const ModuleSharedPtr left,
const ModuleSharedPtr right 
)
inlineprotected

Diff module pointers and then recursively compare inherited members from circuit.

Definition at line 195 of file PhysicalDiff.hpp.

195  {
196  bool rval = true;
197 
198  if (!(left->getAnchor() == right->getAnchor())) {
199  mStream << "! Module " << left->getName() << " anchor: " << left->getAnchor()
200  << " | " << right->getAnchor() << std::endl;
201  rval = false;
202  }
203 
204  std::vector<string> leftPorts;
205  std::vector<string> rightPorts;
206  std::vector<string>::iterator leftport;
207  std::vector<string>::iterator rightport;
208  for (PortSharedPtrConstIterator leftport = left->portsBegin();
209  leftport != left->portsEnd(); leftport++) {
210  string t = (*leftport)->getInstancePtr().lock()->getName();
211  t.append(".");
212  t.append((*leftport)->getPinName());
213  leftPorts.push_back(t);
214  }
215  for (PortSharedPtrConstIterator rightport = right->portsBegin();
216  rightport != right->portsEnd(); rightport++) {
217  string t = (*rightport)->getInstancePtr().lock()->getName();
218  t.append(".");
219  t.append((*rightport)->getPinName());
220  rightPorts.push_back(t);
221  }
222  for (leftport = leftPorts.begin(); leftport != leftPorts.end(); leftport++) {
223  bool found = false;
224  for (rightport = rightPorts.begin(); rightport != rightPorts.end(); rightport++) {
225  if (*leftport == *rightport) {
226  found = true;
227  break;
228  }
229  }
230  if (found) {
231  rightPorts.erase(rightport);
232  } else {
233  mStream << "< Module " << left->getName() << " port: "
234  << *leftport << std::endl;
235  rval = false;
236  }
237  }
238  for (rightport = rightPorts.begin(); rightport != rightPorts.end(); rightport++) {
239  mStream << "> Module " << right->getName() << " port: "
240  << *rightport << std::endl;
241  rval = false;
242  }
243  leftPorts.clear();
244  rightPorts.clear();
245 
246  // A module is a circuit
247  rval = diffCircuit(left, right) && rval;
248  return rval;
249  }
bool diffCircuit(const CircuitSharedPtr &left, const CircuitSharedPtr &right)
Diff circuit pointers, recursively compare nets, instances and config map.
torc::physical::Module::PortSharedPtrConstIterator PortSharedPtrConstIterator
Imported type name.
std::ostream & mStream
Output stream to use for comparison results.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool torc::PhysicalDiff::diffNet ( const NetSharedPtr left,
const NetSharedPtr right 
)
inlineprotected

Diff net pointers and then the underlying config map.

Definition at line 418 of file PhysicalDiff.hpp.

418  {
419  bool rval = true;
420  if (!(left->getNetType() == right->getNetType())) {
421  mStream << "! Net " << left->getName() << " type: " << left->getNetType()
422  << " | " << right->getNetType() << std::endl;
423  rval = false;
424  }
425 
426  std::vector<string> leftPins;
427  std::vector<string> rightPins;
428  std::vector<string>::iterator leftpin;
429  std::vector<string>::iterator rightpin;
430 
431  for (InstancePinSharedPtrConstIterator leftpinPtr = left->sourcesBegin();
432  leftpinPtr != left->sourcesEnd(); leftpinPtr++) {
433  string t = (*leftpinPtr)->getInstancePtr().lock()->getName();
434  t.append(".");
435  t.append((*leftpinPtr)->getPinName());
436  leftPins.push_back(t);
437  }
438  for (InstancePinSharedPtrConstIterator rightpinPtr = right->sourcesBegin();
439  rightpinPtr != right->sourcesEnd(); rightpinPtr++) {
440  string t = (*rightpinPtr)->getInstancePtr().lock()->getName();
441  t.append(".");
442  t.append((*rightpinPtr)->getPinName());
443  rightPins.push_back(t);
444  }
445  for (leftpin = leftPins.begin(); leftpin != leftPins.end(); leftpin++) {
446  bool found = false;
447  for (rightpin = rightPins.begin(); rightpin != rightPins.end(); rightpin++) {
448  if (*leftpin == *rightpin) {
449  found = true;
450  break;
451  }
452  }
453  if (found) {
454  rightPins.erase(rightpin);
455  } else {
456  mStream << "< Net " << left->getName() << " outpin: "
457  << *leftpin << std::endl;
458  rval = false;
459  }
460  }
461  for (rightpin = rightPins.begin(); rightpin != rightPins.end(); rightpin++) {
462  mStream << "> Net " << right->getName() << " outpin: "
463  << *rightpin << std::endl;
464  rval = false;
465  }
466  leftPins.clear();
467  rightPins.clear();
468 
469  for (InstancePinSharedPtrConstIterator leftpinPtr = left->sinksBegin();
470  leftpinPtr != left->sinksEnd(); leftpinPtr++) {
471  string t = (*leftpinPtr)->getInstancePtr().lock()->getName();
472  t.append(".");
473  t.append((*leftpinPtr)->getPinName());
474  leftPins.push_back(t);
475  }
476  for (InstancePinSharedPtrConstIterator rightpinPtr = right->sinksBegin();
477  rightpinPtr != right->sinksEnd(); rightpinPtr++) {
478  string t = (*rightpinPtr)->getInstancePtr().lock()->getName();
479  t.append(".");
480  t.append((*rightpinPtr)->getPinName());
481  rightPins.push_back(t);
482  }
483  for (leftpin = leftPins.begin(); leftpin != leftPins.end(); leftpin++) {
484  bool found = false;
485  for (rightpin = rightPins.begin(); rightpin != rightPins.end(); rightpin++) {
486  if (*leftpin == *rightpin) {
487  found = true;
488  break;
489  }
490  }
491  if (found) {
492  rightPins.erase(rightpin);
493  } else {
494  mStream << "< Net " << left->getName() << " inpin: "
495  << *leftpin << std::endl;
496  rval = false;
497  }
498  }
499  for (rightpin = rightPins.begin(); rightpin != rightPins.end(); rightpin++) {
500  mStream << "> Net " << right->getName() << " inpin: "
501  << *rightpin << std::endl;
502  rval = false;
503  }
504  leftPins.clear();
505  rightPins.clear();
506 
507  std::vector<string> leftPips;
508  std::vector<string> rightPips;
509  std::vector<string>::iterator leftpip;
510  std::vector<string>::iterator rightpip;
511  for (PipConstIterator leftpip = left->pipsBegin();
512  leftpip != left->pipsEnd(); leftpip++) {
513  string t = leftpip->getTileName();
514  t.append(" ");
515  t.append(leftpip->getSourceWireName());
516  t.append(" ");
517  t.append(leftpip->getDirectionString());
518  t.append(" ");
519  t.append(leftpip->getSinkWireName());
520  leftPips.push_back(t);
521  }
522  for (PipConstIterator rightpip = right->pipsBegin();
523  rightpip != right->pipsEnd(); rightpip++) {
524  string t = rightpip->getTileName();
525  t.append(" ");
526  t.append(rightpip->getSourceWireName());
527  t.append(" ");
528  t.append(rightpip->getDirectionString());
529  t.append(" ");
530  t.append(rightpip->getSinkWireName());
531  rightPips.push_back(t);
532  }
533  for (leftpip = leftPips.begin(); leftpip != leftPips.end(); leftpip++) {
534  bool found = false;
535  for (rightpip = rightPips.begin(); rightpip != rightPips.end(); rightpip++) {
536  if (*leftpip == *rightpip) {
537  found = true;
538  break;
539  }
540  }
541  if (found) {
542  rightPips.erase(rightpip);
543  } else {
544  mStream << "< Net " << left->getName() << " pip: "
545  << *leftpip << std::endl;
546  rval = false;
547  }
548  }
549  for (rightpip = rightPips.begin(); rightpip != rightPips.end(); rightpip++) {
550  mStream << "> Net " << right->getName() << " pip: "
551  << *rightpip << std::endl;
552  rval = false;
553  }
554  leftPips.clear();
555  rightPips.clear();
556 
557  string netname = "Net ";
558  netname.append(left->getName());
559  // A net is a configmap.
560  rval = diffConfigMap(left, right, netname) && rval;
561  return rval;
562  }
torc::physical::Net::PipConstIterator PipConstIterator
Imported type name.
std::ostream & mStream
Output stream to use for comparison results.
torc::physical::Net::InstancePinSharedPtrConstIterator InstancePinSharedPtrConstIterator
Imported type name.
bool diffConfigMap(const ConfigMapSharedPtr &left, const ConfigMapSharedPtr &right, const string &parentStr)
Diff configuration information, this is called from circuits, instances and nets. ...

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class utils::PhysicalDiffCircuitUnitTest
friend

Unit test access to internal functions.

Definition at line 48 of file PhysicalDiff.hpp.

friend class utils::PhysicalDiffConfigMapUnitTest
friend

Unit test access to internal functions.

Definition at line 50 of file PhysicalDiff.hpp.

friend class utils::PhysicalDiffDesignUnitTest
friend

Unit test access to internal functions.

Definition at line 44 of file PhysicalDiff.hpp.

friend class utils::PhysicalDiffInstanceUnitTest
friend

Unit test access to internal functions.

Definition at line 52 of file PhysicalDiff.hpp.

friend class utils::PhysicalDiffModuleUnitTest
friend

Unit test access to internal functions.

Definition at line 46 of file PhysicalDiff.hpp.

friend class utils::PhysicalDiffNetUnitTest
friend

Unit test access to internal functions.

Definition at line 54 of file PhysicalDiff.hpp.

Field Documentation

std::ostream& torc::PhysicalDiff::mStream
protected

Output stream to use for comparison results.

Definition at line 103 of file PhysicalDiff.hpp.


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