Netlist browser: command line option -mn to open netlist DB from command line.

This commit is contained in:
Matthias Koefferlein 2019-05-04 22:18:15 +02:00
parent 20eb53d626
commit 655d4bccdd
2 changed files with 22 additions and 2 deletions

View File

@ -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 <database file> Load RDB (report database) file (into previous layout view)")) + "\n";
r += tl::to_string (QObject::tr (" -mn <database file> Load L2NDB (layout to netlist database) file (into previous layout view)")) + "\n";
r += tl::to_string (QObject::tr (" -n <technology> Technology to use for next layout(s) on command line")) + "\n";
r += tl::to_string (QObject::tr (" -nn <tech file> Technology file (.lyt) to use for next layout(s) on command line")) + "\n";
r += tl::to_string (QObject::tr (" -p <plugin> 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::LayoutToNetlist> 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 ());
}
}
}

View File

@ -332,7 +332,8 @@ private:
layout_file,
layout_file_with_tech,
layout_file_with_tech_file,
rdb_file
rdb_file,
l2ndb_file
};
std::vector <std::pair<file_type, std::pair<std::string, std::string> > > m_files;