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

Source for a Xdl extracter command line utility. More...

+ Include dependency graph for XdlExtractMain.cpp:

Go to the source code of this file.

Functions

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

Detailed Description

Source for a Xdl extracter command line utility.

Definition in file XdlExtractMain.cpp.

Function Documentation

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

Main entry point for the xdlextract tool.

Definition at line 26 of file XdlExtractMain.cpp.

26  {
27  typedef std::string string;
28  torc::common::DirectoryTree directoryTree(argv[0]);
29 
30  std::cout << "XDL Extracter: " << __DATE__ << " " << __TIME__ << std::endl;
31 
32  if(argc != 4) {
33  std::cout << "Usage: " << argv[0] << " <pattern> <xdlfile> <outxdlfile>" << std::endl;
34  return 1;
35  }
36 
37  string argpattern = argv[1];
38  string argxdl = argv[2];
39  string argoutxdl = argv[3];
40 
41  // create the appropriate file paths
42  boost::filesystem::path xdlPath = directoryTree.getExecutablePath() / argxdl;
43  boost::filesystem::path xdlOutPath = directoryTree.getExecutablePath() / argoutxdl;
44 
45  std::fstream xdlFile(xdlPath.string().c_str());
46 
47  // import the designs
49 
50  importer(xdlFile, xdlPath.string());
51  torc::physical::DesignSharedPtr designPtr = importer.getDesignPtr();
52 
53  // create the physical diff object and perform the diff.
54  torc::MarkExtracter extract(std::cout, designPtr, argpattern);
55  torc::physical::DesignSharedPtr newDesignPtr = extract.extract();
56 
57  std::fstream xdlOutFile(xdlOutPath.string().c_str(), std::ios_base::out);
58  torc::physical::XdlExporter exporter(xdlOutFile);
59  //exporter(designOut);
60  exporter(newDesignPtr);
61 
62  std::cout << "Output: " << xdlOutPath.string() << std::endl;
63 
64  return 0;
65 }
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
Diff utility class for comparing physical netlists.
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.
Physical design exporter for XDL.
Definition: XdlExporter.hpp:31

+ Here is the call graph for this function: