From fda5d86b4bd2ab0f584aa1e35fcf890687c67279 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 2 Aug 2019 01:39:07 +0200 Subject: [PATCH 1/3] Performance enhancement of netlist compare (avoid O(2) loop) --- src/db/db/dbNetlistCompare.cc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/db/db/dbNetlistCompare.cc b/src/db/db/dbNetlistCompare.cc index c1ee28855..e6d776188 100644 --- a/src/db/db/dbNetlistCompare.cc +++ b/src/db/db/dbNetlistCompare.cc @@ -692,6 +692,12 @@ public: typedef std::pair, std::pair > edge_type; + static void swap_edges (edge_type &e1, edge_type &e2) + { + e1.first.swap (e2.first); + std::swap (e1.second, e2.second); + } + struct EdgeToEdgeOnlyCompare { bool operator() (const edge_type &a, const std::vector &b) const @@ -1149,17 +1155,22 @@ NetGraphNode::expand_subcircuit_nodes (NetGraph *graph) std::list sc_edges; - for (size_t i = 0; i < m_edges.size (); ) { - if (m_edges [i].second.second == 0) { + size_t ii = 0; + for (size_t i = 0; i < m_edges.size (); ++i) { + if (ii != i) { + swap_edges (m_edges [ii], m_edges [i]); + } + if (m_edges [ii].second.second == 0) { // subcircuit pin - sc_edges.push_back (m_edges [i]); - m_edges.erase (m_edges.begin () + i); + sc_edges.push_back (m_edges [ii]); } else { - n2entry.insert (std::make_pair (m_edges [i].second.second, i)); - ++i; + n2entry.insert (std::make_pair (m_edges [ii].second.second, ii)); + ++ii; } } + m_edges.erase (m_edges.begin () + ii, m_edges.end ()); + for (std::list::const_iterator e = sc_edges.begin (); e != sc_edges.end (); ++e) { const db::SubCircuit *sc = 0; From e148898d4cb58db7d31a47fdbfc40d19c58f0864 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 18 Aug 2019 23:56:00 +0200 Subject: [PATCH 2/3] Fixed an issue with drawing canvas and undo When a "create instance" operation with a library cell was undone the following issue could be seen: as the library cell might create new layers in the target layout, these needed to be undone when the operation was reverted. But then the canvas bit planes got messed up because the "LayoutView::set_view_ops" call was missing. Now this happens inside the manipulation functions for deleting and inserting layers. This should also reduce the necessity to call LayoutView::update_content explicitly. --- src/lay/lay/TechBaseEditorPage.ui | 297 ++++++++++++---------- src/lay/lay/layMainWindow.cc | 2 - src/lay/lay/layTechSetupDialog.cc | 35 +++ src/laybasic/laybasic/layLayoutView.cc | 6 + src/laybasic/laybasic/layLibrariesView.cc | 4 + 5 files changed, 205 insertions(+), 139 deletions(-) diff --git a/src/lay/lay/TechBaseEditorPage.ui b/src/lay/lay/TechBaseEditorPage.ui index 99267f779..059659437 100644 --- a/src/lay/lay/TechBaseEditorPage.ui +++ b/src/lay/lay/TechBaseEditorPage.ui @@ -6,14 +6,48 @@ 0 0 - 568 - 353 + 604 + 498 Form + + + + ... + + + + + + + + + + Name + + + + + + + false + + + + + + + The base path is used to locate auxiliary files if those are specified with a relative path. If none is specified, the default path is used. The default path is the one from which a technology was imported. + + + true + + + @@ -21,9 +55,6 @@ - - - @@ -40,135 +71,6 @@ - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - - - - µm - - - - - - - - - - Qt::Vertical - - - - 0 - 27 - - - - - - - - Qt::Horizontal - - - - - - - The base path is used to locate auxiliary files if those are specified with a relative path. If none is specified, the default path is used. The default path is the one from which a technology was imported. - - - true - - - - - - - Base path - - - - - - - Qt::Horizontal - - - - - - - ... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Name - - - - - - - false - - - - - - - (Use the rename button to change this) - - - - - - @@ -223,10 +125,10 @@ - - + + - The default database unit is used as database unit for freshly created layouts + Base path @@ -252,6 +154,127 @@ unit + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + + + + (Use the rename button to change this) + + + + + + + The default database unit is used as database unit for freshly created layouts + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + + µm + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Technology +specific +libraries + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QAbstractItemView::NoSelection + + + diff --git a/src/lay/lay/layMainWindow.cc b/src/lay/lay/layMainWindow.cc index 67475dff5..3ae39ec3d 100644 --- a/src/lay/lay/layMainWindow.cc +++ b/src/lay/lay/layMainWindow.cc @@ -2414,7 +2414,6 @@ MainWindow::cm_undo () (*vp)->cancel (); } m_manager.undo (); - current_view ()->update_content (); } END_PROTECTED @@ -2431,7 +2430,6 @@ MainWindow::cm_redo () (*vp)->cancel (); } m_manager.redo (); - current_view ()->update_content (); } END_PROTECTED diff --git a/src/lay/lay/layTechSetupDialog.cc b/src/lay/lay/layTechSetupDialog.cc index 89454c5d1..0e881fd0b 100644 --- a/src/lay/lay/layTechSetupDialog.cc +++ b/src/lay/lay/layTechSetupDialog.cc @@ -37,6 +37,8 @@ #include "tlStream.h" #include "tlClassRegistry.h" #include "dbStream.h" +#include "dbLibraryManager.h" +#include "dbLibrary.h" #include "ui_TechSetupDialog.h" #include "ui_TechMacrosPage.h" @@ -51,6 +53,7 @@ #include #include #include +#include #include #include @@ -114,6 +117,38 @@ TechBaseEditorPage::setup () mp_ui->lyp_grp->setChecked (! lyp.empty ()); mp_ui->lyp_le->setText (tl::to_qstring (lyp)); mp_ui->add_other_layers_cbx->setChecked (tech ()->add_other_layers ()); + + mp_ui->libs_lw->clear (); + + if (! tech ()->name ().empty ()) { + + mp_ui->libs_lbl->setEnabled (true); + mp_ui->libs_lw->setEnabled (true); + + std::vector libs; + + for (db::LibraryManager::iterator l = db::LibraryManager::instance ().begin (); l != db::LibraryManager::instance ().end (); ++l) { + const db::Library *lib = db::LibraryManager::instance ().lib (l->second); + if (lib->get_technology () == tech ()->name ()) { + std::string text = lib->get_name (); + if (! lib->get_description ().empty ()) { + text += " - " + lib->get_description (); + } + libs.push_back (text); + } + } + + std::sort (libs.begin (), libs.end ()); + + for (std::vector::const_iterator l = libs.begin (); l != libs.end (); ++l) { + mp_ui->libs_lw->addItem (new QListWidgetItem (tl::to_qstring (*l))); + } + + } else { + mp_ui->libs_lbl->setEnabled (false); + mp_ui->libs_lw->setEnabled (false); + mp_ui->libs_lw->addItem (tr ("The default technology can't have libraries")); + } } void diff --git a/src/laybasic/laybasic/layLayoutView.cc b/src/laybasic/laybasic/layLayoutView.cc index 3930c678c..3249333e9 100644 --- a/src/laybasic/laybasic/layLayoutView.cc +++ b/src/laybasic/laybasic/layLayoutView.cc @@ -1706,9 +1706,12 @@ LayoutView::insert_layer_list (unsigned index, const LayerPropertiesList &props) m_current_layer_list = index; current_layer_list_changed_event (index); + layer_list_inserted_event (index); redraw (); + + dm_prop_changed (); } void @@ -1750,6 +1753,7 @@ LayoutView::delete_layer_list (unsigned index) } layer_list_deleted_event (index); + dm_prop_changed (); } void @@ -1986,6 +1990,7 @@ LayoutView::insert_layer (unsigned int index, const LayerPropertiesConstIterator if (index == current_layer_list ()) { layer_list_changed_event (2); redraw (); + dm_prop_changed (); } return ret; @@ -2013,6 +2018,7 @@ LayoutView::delete_layer (unsigned int index, LayerPropertiesConstIterator &iter if (index == current_layer_list ()) { layer_list_changed_event (2); redraw (); + dm_prop_changed (); } // invalidate the iterator so it can be used to refer to the next element diff --git a/src/laybasic/laybasic/layLibrariesView.cc b/src/laybasic/laybasic/layLibrariesView.cc index d0bc69894..7acf3d6cd 100644 --- a/src/laybasic/laybasic/layLibrariesView.cc +++ b/src/laybasic/laybasic/layLibrariesView.cc @@ -795,6 +795,10 @@ LibrariesView::display_string (int n) const if (! lib->get_description ().empty ()) { text += " - " + lib->get_description (); } + if (! lib->get_technology ().empty ()) { + text += " "; + text += tl::to_string (QObject::tr ("[Technology %1]").arg (tl::to_qstring (lib->get_technology ()))); + } return text; } From 6f2d29d05b3dbbc9c79384cf1dab36df28ee09b1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 20 Aug 2019 23:38:48 +0200 Subject: [PATCH 3/3] Fixed a segfault when running a PCell definition macro (segfault happened in update of library view because the library was gone). Fixed a dialog title. --- src/edt/edt/PCellParametersDialog.ui | 2 +- src/laybasic/laybasic/layLibrariesView.cc | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/edt/edt/PCellParametersDialog.ui b/src/edt/edt/PCellParametersDialog.ui index ddfe5ab55..be3b83cde 100644 --- a/src/edt/edt/PCellParametersDialog.ui +++ b/src/edt/edt/PCellParametersDialog.ui @@ -11,7 +11,7 @@ - Instantiation Path + PCell Parameters diff --git a/src/laybasic/laybasic/layLibrariesView.cc b/src/laybasic/laybasic/layLibrariesView.cc index 7acf3d6cd..2e9d44483 100644 --- a/src/laybasic/laybasic/layLibrariesView.cc +++ b/src/laybasic/laybasic/layLibrariesView.cc @@ -588,10 +588,6 @@ LibrariesView::do_update_content (int lib_index) m_force_close [i] = true; } - if (m_needs_update [i]) { - mp_cell_lists [i]->doItemsLayout (); // triggers a redraw - } - m_libraries [i].reset (libraries [i]); } @@ -715,6 +711,8 @@ LibrariesView::do_update_content (int lib_index) m_needs_update [i] = false; + mp_cell_lists [i]->doItemsLayout (); // triggers a redraw -> the model might need this + } mp_cell_list_headers [i]->setVisible (split_mode && m_libraries.size () > 1);