diff --git a/src/lay/lay/layApplication.cc b/src/lay/lay/layApplication.cc index 4d26993e9..54a6acf18 100644 --- a/src/lay/lay/layApplication.cc +++ b/src/lay/lay/layApplication.cc @@ -51,6 +51,7 @@ #include "dbLibrary.h" #include "dbLibraryManager.h" #include "dbInit.h" +#include "dbLayoutToNetlist.h" #include "tlExceptions.h" #include "tlException.h" #include "tlAssert.h" @@ -496,6 +497,10 @@ ApplicationBase::parse_cmd (int &argc, char **argv) m_files.push_back (std::make_pair (rdb_file, std::make_pair (std::string (args [++i]), std::string ()))); + } else if (a == "-mn" && (i + 1) < argc) { + + m_files.push_back (std::make_pair (l2ndb_file, std::make_pair (std::string (args [++i]), std::string ()))); + } else if (a[0] == '-') { throw tl::Exception (tl::to_string (QObject::tr ("Unknown option: ")) + a); @@ -951,6 +956,7 @@ ApplicationBase::usage () r += tl::to_string (QObject::tr (" -lx With -l: add other layers as well")) + "\n"; r += tl::to_string (QObject::tr (" -lf With -l: use the lyp file as it is (no expansion to multiple layouts)")) + "\n"; r += tl::to_string (QObject::tr (" -m Load RDB (report database) file (into previous layout view)")) + "\n"; + r += tl::to_string (QObject::tr (" -mn Load L2NDB (layout to netlist database) file (into previous layout view)")) + "\n"; r += tl::to_string (QObject::tr (" -n Technology to use for next layout(s) on command line")) + "\n"; r += tl::to_string (QObject::tr (" -nn Technology file (.lyt) to use for next layout(s) on command line")) + "\n"; r += tl::to_string (QObject::tr (" -p Load the plugin (can be used multiple times)")) + "\n"; @@ -1069,7 +1075,7 @@ ApplicationBase::run () mw->current_view ()->set_active_cellview_index (0); } - } else { + } else if (f->first == rdb_file) { if (mw->current_view () == 0) { mw->create_view (); @@ -1082,6 +1088,19 @@ ApplicationBase::run () mw->current_view ()->open_rdb_browser (rdb_index, mw->current_view ()->active_cellview_index ()); } + } else if (f->first == l2ndb_file) { + + if (mw->current_view () == 0) { + mw->create_view (); + } + + if (mw->current_view () != 0) { + std::auto_ptr db (new db::LayoutToNetlist ()); + db->load (f->second.first); + int l2ndb_index = mw->current_view ()->add_l2ndb (db.release ()); + mw->current_view ()->open_l2ndb_browser (l2ndb_index, mw->current_view ()->active_cellview_index ()); + } + } } diff --git a/src/lay/lay/layApplication.h b/src/lay/lay/layApplication.h index 40cb2d1a9..52382231f 100644 --- a/src/lay/lay/layApplication.h +++ b/src/lay/lay/layApplication.h @@ -332,7 +332,8 @@ private: layout_file, layout_file_with_tech, layout_file_with_tech_file, - rdb_file + rdb_file, + l2ndb_file }; std::vector > > m_files;