diff --git a/src/db/db/dbLayout.cc b/src/db/db/dbLayout.cc index 22c8411a7..31eb1ea41 100644 --- a/src/db/db/dbLayout.cc +++ b/src/db/db/dbLayout.cc @@ -1560,6 +1560,14 @@ Layout::allocate_new_cell () return new_index; } +void +Layout::refresh () +{ + for (iterator c = begin (); c != end (); ++c) { + c->update (); + } +} + void Layout::cleanup (const std::set &keep) { diff --git a/src/db/db/dbLayout.h b/src/db/db/dbLayout.h index e6318ca5c..69e243b2a 100644 --- a/src/db/db/dbLayout.h +++ b/src/db/db/dbLayout.h @@ -1632,6 +1632,14 @@ public: */ void cleanup (const std::set &keep = std::set ()); + /** + * @brief Calls "update" on all cells of the layout + * + * This will update PCells stored inside this layout, but will *not* update + * PCells which are imported from a library. + */ + void refresh (); + /** * @brief Implementation of the undo operations */ diff --git a/src/db/db/dbLibrary.cc b/src/db/db/dbLibrary.cc index 5c012dc52..4fa34f794 100644 --- a/src/db/db/dbLibrary.cc +++ b/src/db/db/dbLibrary.cc @@ -148,6 +148,7 @@ Library::is_retired (const db::cell_index_type library_cell_index) const void Library::refresh () { + layout ().refresh (); remap_to (this); } diff --git a/src/db/db/gsiDeclDbCell.cc b/src/db/db/gsiDeclDbCell.cc index bdb4011e6..b0eaf1704 100644 --- a/src/db/db/gsiDeclDbCell.cc +++ b/src/db/db/gsiDeclDbCell.cc @@ -2932,10 +2932,14 @@ Class decl_Cell ("db", "Cell", "This method has been introduced in version 0.22.\n" ) + gsi::method_ext ("refresh", &refresh, - "@brief Refreshes the cell\n" + "@brief Refreshes a proxy cell\n" "\n" - "If the cell is a PCell or a proxy to a PCell in a library, this method recomputes the PCell.\n" + "If the cell is a PCell variant, this method recomputes the PCell.\n" "If the cell is a library proxy, this method reloads the information from the library, but not the library itself.\n" + "Note that if the cell is an PCell variant for a PCell coming from a library, this method will not recompute the PCell. " + "Instead, you can use \\Library#refresh to recompute all PCells from that library.\n" + "\n" + "You can use \\Layout#refresh to refresh all cells from a layout.\n" "\n" "This method has been introduced in version 0.22.\n" ) + diff --git a/src/db/db/gsiDeclDbLayout.cc b/src/db/db/gsiDeclDbLayout.cc index 4935a928a..68e1f7802 100644 --- a/src/db/db/gsiDeclDbLayout.cc +++ b/src/db/db/gsiDeclDbLayout.cc @@ -1089,6 +1089,14 @@ Class decl_Layout ("db", "Layout", "@brief Gets the library this layout lives in or nil if the layout is not part of a library\n" "This attribute has been introduced in version 0.27.5." ) + + gsi::method ("refresh", &db::Layout::refresh, + "@brief Calls \\Cell#refresh on all cells inside this layout\n" + "This method is useful to recompute all PCells from a layout. Note that this does not " + "update PCells which are linked from a library. To recompute PCells from a library, you need " + "to use \\Library#refresh on the library object from which the PCells are imported.\n" + "\n" + "This method has been introduced in version 0.27.9." + ) + gsi::method ("add_meta_info", &db::Layout::add_meta_info, gsi::arg ("info"), "@brief Adds meta information to the layout\n" "See \\LayoutMetaInfo for details about layouts and meta information." diff --git a/src/db/db/gsiDeclDbLibrary.cc b/src/db/db/gsiDeclDbLibrary.cc index 6b3c64c19..d6537599f 100644 --- a/src/db/db/gsiDeclDbLibrary.cc +++ b/src/db/db/gsiDeclDbLibrary.cc @@ -237,6 +237,7 @@ LibraryClass decl_Library ("db", "Library", gsi::method ("refresh", &db::Library::refresh, "@brief Updates all layouts using this library.\n" "This method will retire cells or update layouts in the attached clients.\n" + "It will also recompute the PCells inside the library. " "\n" "This method has been introduced in version 0.27.8." ),