00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <fstream>
00021 #include "PhysicalDiff.hpp"
00022 #include "torc/common/DirectoryTree.hpp"
00023 #include "torc/physical/XdlImporter.hpp"
00024
00025
00026 int main(int argc, char *argv[]) {
00027 typedef std::string string;
00028 torc::common::DirectoryTree directoryTree(argv[0]);
00029
00030 if (argc != 3) {
00031 std::cout << "Usage: " << argv[0] << " <xdlfile1> <xdlfile2>" << std::endl;
00032 return 1;
00033 }
00034 string argleft = argv[1];
00035 string argright = argv[2];
00036
00037
00038 boost::filesystem::path leftPath = directoryTree.getExecutablePath() / argleft;
00039 boost::filesystem::path rightPath = directoryTree.getExecutablePath() / argright;
00040
00041 std::fstream fileLeft(leftPath.string().c_str());
00042 std::fstream fileRight(rightPath.string().c_str());
00043
00044
00045 torc::physical::XdlImporter importer;
00046
00047 importer(fileLeft, leftPath.string());
00048 torc::physical::DesignSharedPtr designPtrLeft = importer.getDesignPtr();
00049
00050 importer(fileRight, rightPath.string());
00051 torc::physical::DesignSharedPtr designPtrRight = importer.getDesignPtr();
00052
00053
00054 torc::PhysicalDiff diff(std::cout);
00055 bool result = diff.diff(designPtrLeft, designPtrRight);
00056
00057 if (result) std::cout << "No differences found." << std::endl;
00058
00059 return 0;
00060 }
00061