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

Example program to read in an XDL file, do something with it, and write it back out. More...

#include "torc/Physical.hpp"
#include <fstream>
+ Include dependency graph for PhysicalExample.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Standard main() function. More...
 

Detailed Description

Example program to read in an XDL file, do something with it, and write it back out.

Definition in file PhysicalExample.cpp.

Function Documentation

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

Standard main() function.

Definition at line 23 of file PhysicalExample.cpp.

23  {
24 
25  // import the XDL design
26  if(argc < 2) return 0;
27  std::string inFileName(argv[1]);
28  std::fstream fileStream(inFileName.c_str());
29  if(!fileStream.good()) return -1;
31  importer(fileStream, inFileName);
32 
33  // look up the design (and do something with it ...)
34  torc::physical::DesignSharedPtr designPtr = importer.getDesignPtr();
35 
36  // export the XDL design
37  std::string outFileName = boost::filesystem::path(inFileName).replace_extension().string()
38  + ".mod.xdl";
39  std::fstream xdlExport(outFileName.c_str(), std::ios_base::out);
40  torc::physical::XdlExporter fileExporter(xdlExport);
41  fileExporter(designPtr);
42 
43  return 0;
44 }
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
std::string string
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: