21 #include <boost/filesystem.hpp>
23 using namespace torc::generic;
25 int main(
int argc,
char** argv) {
28 for(
int i = 1; i < argc; i++) {
33 targetPath = targetPath.replace_extension().string()
34 +
".flat" + boost::filesystem::extension(sourcePath);
38 std::cout <<
"Reading source: " << sourcePath.string() <<
" ... ";
40 boost::shared_ptr<ObjectFactory> factoryPtr(
new ObjectFactory());
41 boost::shared_ptr<Root> rootPtr;
42 factoryPtr->create(rootPtr);
43 boost::shared_ptr<Linker> linkerPtr(
new Linker(rootPtr));
47 parser.
parse(sourcePath.string(), rootPtr, linkerPtr, factoryPtr, options);
48 std::cout <<
"done." << std::endl;
50 std::cerr << std::endl;
54 for(std::vector<Error::StackFrameInfo>::const_iterator it = stack.begin();
55 it != stack.end(); it++) {
56 std::cerr <<
" " << (*it).getFunction() <<
"() [" << (*it).getFile() <<
":"
57 << (*it).getLine() <<
"]" << std::endl;
63 DesignSharedPtrVector designs;
64 rootPtr->getDesigns(designs);
65 DesignSharedPtrVector::iterator dp = designs.begin();
66 DesignSharedPtrVector::iterator de = designs.end();
71 std::cout <<
" Flattening design " << designName <<
" ... ";
73 flatten(designPtr, factoryPtr,
true);
74 std::cout <<
"done." << std::endl;
81 std::cout <<
" Writing target: " << targetPath.string() <<
" ... ";
83 std::fstream targetStream(targetPath.string().c_str(), std::ios_base::out);
86 std::cout <<
"done." << std::endl;
90 std::cerr <<
"ERROR: Failed to flatten " << sourcePath.string() << std::endl;
int main(int argc, char **argv)
static MessageTable * instance()
Main torc::generic namespace header.
The Top level parser for parsing EDIF files.
std::vector< DesignSharedPtr > DesignSharedPtrVector
Vector of Design shared pointers.
boost::shared_ptr< Design > DesignSharedPtr
The Error object thrown by different methods of EdifOM.
const std::vector< StackFrameInfo > & getStackTrace() const
Represents a repository of unresolved usage references.
boost::filesystem::path path
void prune(RootSharedPtr &inRootPtr)
Prune all unused cells and libraries from the given root.
const MessageId getErrorMessageId() const
void flatten(const InstanceSharedPtr &inInstance, const ObjectFactorySharedPtr &inFactory, bool inRecursive, const std::string &inSeparator, const InstanceRenamingFunction &inInstanceRenameFunc, const NetRenamingFunction &inNetRenameFunc, const InstanceNamingFunction &inInstanceNameFunc, const NetNamingFunction &inNetNameFunc)
std::string getMessage(MessageId inId) const
void parse(const std::string &inFileName, const RootSharedPtr &outRoot, const LinkerSharedPtr &outLinker, const ObjectFactorySharedPtr &inFactory, const ParserOptions &inOptions)