torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XdlDiffMain.cpp File Reference

Source for a PhysicalDiff command line utility. More...

#include <fstream>
#include "PhysicalDiff.hpp"
#include "torc/common/DirectoryTree.hpp"
#include "torc/physical/XdlImporter.hpp"
+ Include dependency graph for XdlDiffMain.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Main entry point for the xdldiff tool. More...
 

Detailed Description

Source for a PhysicalDiff command line utility.

Opens up two designs with the XDLImporter and then compares them with PhysicalDiff.

Definition in file XdlDiffMain.cpp.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Main entry point for the xdldiff tool.

Definition at line 26 of file XdlDiffMain.cpp.

26  {
27  typedef std::string string;
28  torc::common::DirectoryTree directoryTree(argv[0]);
29 
30  if(argc != 3) {
31  std::cout << "Usage: " << argv[0] << " <xdlfile1> <xdlfile2>" << std::endl;
32  return 1;
33  }
34  string argleft = argv[1];
35  string argright = argv[2];
36 
37  // create the appropriate file paths
38  boost::filesystem::path leftPath = directoryTree.getExecutablePath() / argleft;
39  boost::filesystem::path rightPath = directoryTree.getExecutablePath() / argright;
40 
41  std::fstream fileLeft(leftPath.string().c_str());
42  std::fstream fileRight(rightPath.string().c_str());
43 
44  // import the designs
46 
47  importer(fileLeft, leftPath.string());
48  torc::physical::DesignSharedPtr designPtrLeft = importer.getDesignPtr();
49 
50  importer(fileRight, rightPath.string());
51  torc::physical::DesignSharedPtr designPtrRight = importer.getDesignPtr();
52 
53  // create the physical diff object and perform the diff.
54  torc::PhysicalDiff diff(std::cout);
55  bool result = diff.diff(designPtrLeft, designPtrRight);
56 
57  if(result) std::cout << "No differences found." << std::endl;
58 
59  return 0;
60 }
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
std::string string
Encapsulation of filesystem paths that are used by the library.
boost::filesystem::path path
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
Importer from XDL format into a physical design.
Diff utility class for comparing physical netlists.

+ Here is the call graph for this function: