torc-master
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
XdlExtractMain.cpp
Go to the documentation of this file.
1
// Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2
// $HeadURL$
3
// $Id$
4
5
// This program is free software: you can redistribute it and/or modify it under the terms of the
6
// GNU General Public License as published by the Free Software Foundation, either version 3 of the
7
// License, or (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11
// the GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License along with this program. If
14
// not, see <http://www.gnu.org/licenses/>.
15
16
/// \file
17
/// \brief Source for a Xdl extracter command line utility.
18
19
#include <fstream>
20
#include "
MarkExtracter.hpp
"
21
#include "
torc/common/DirectoryTree.hpp
"
22
#include "
torc/physical/XdlImporter.hpp
"
23
#include "
torc/physical/XdlExporter.hpp
"
24
25
/// \brief Main entry point for the xdlextract tool.
26
int
main
(
int
argc,
char
*argv[]) {
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
48
torc::physical::XdlImporter
importer;
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
}
66
torc::physical::XdlImporter::getDesignPtr
DesignSharedPtr getDesignPtr(void)
Returns a shared pointer for the design.
Definition:
physical/XdlImporter.hpp:143
DirectoryTree.hpp
Header for the DirectoryTree class.
torc::MarkExtracter
Diff utility class for comparing physical netlists.
Definition:
MarkExtracter.hpp:43
MarkExtracter.hpp
PhysicalDiff class for comparing physical netlists.
torc::MarkExtracter::extract
DesignSharedPtr extract()
Top level call to diff two designs.
Definition:
MarkExtracter.hpp:113
torc::bitstream::string
std::string string
Definition:
LibGenFactory.hpp:35
XdlImporter.hpp
Header for the XdlImporter class.
XdlExporter.hpp
Header for the XdlExport class.
torc::common::DirectoryTree
Encapsulation of filesystem paths that are used by the library.
Definition:
DirectoryTree.hpp:28
main
int main(int argc, char *argv[])
Main entry point for the xdlextract tool.
Definition:
XdlExtractMain.cpp:26
torc::bitstream::path
boost::filesystem::path path
Definition:
LibGenFactory.hpp:36
torc::physical::DesignSharedPtr
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
Definition:
physical/Design.hpp:134
torc::physical::XdlImporter
Importer from XDL format into a physical design.
Definition:
physical/XdlImporter.hpp:48
torc::common::DirectoryTree::getExecutablePath
static const boost::filesystem::path & getExecutablePath(void)
Returns the absolute path to the executable directory.
Definition:
DirectoryTree.hpp:58
torc::physical::XdlExporter
Physical design exporter for XDL.
Definition:
XdlExporter.hpp:31
src
torc
utils
XdlExtractMain.cpp
Generated on Thu Dec 18 2014 16:30:42 for torc-master by
1.8.6