From 64bcc6bb654f0d35c24ae1c1a15c1a916a75c576 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 10 Sep 2023 22:51:22 +0200 Subject: [PATCH] Bugfixed last commit --- src/db/db/dbCell.cc | 2 +- src/db/db/dbInstances.cc | 8 ++++---- src/db/db/dbInstances.h | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/db/db/dbCell.cc b/src/db/db/dbCell.cc index e8d2a1c9f..5c9780a18 100644 --- a/src/db/db/dbCell.cc +++ b/src/db/db/dbCell.cc @@ -701,7 +701,7 @@ Cell::clear_parent_insts (size_t sz) void Cell::sort_child_insts () { - m_instances.sort_child_insts (); + m_instances.sort_child_insts (false); } std::pair diff --git a/src/db/db/dbInstances.cc b/src/db/db/dbInstances.cc index c0a0f4ca3..1ed3aa44f 100644 --- a/src/db/db/dbInstances.cc +++ b/src/db/db/dbInstances.cc @@ -1387,9 +1387,9 @@ struct cell_inst_compare_f }; void -Instances::sort_child_insts () +Instances::sort_child_insts (bool force) { - if (! instance_by_cell_index_needs_made ()) { + if (! force && ! instance_by_cell_index_needs_made ()) { return; } set_instance_by_cell_index_needs_made (false); @@ -1440,7 +1440,7 @@ Instances::sort_inst_tree (const Layout *g, bool force) } else { m_generic.unstable_tree->sort (cell_inst_array_box_converter (*g)); // since we use unstable instance trees in non-editable mode, we need to resort the child instances in this case - sort_child_insts (); + sort_child_insts (true); } } if (m_generic_wp.any) { @@ -1449,7 +1449,7 @@ Instances::sort_inst_tree (const Layout *g, bool force) } else { m_generic_wp.unstable_tree->sort (cell_inst_wp_array_box_converter (*g)); // since we use unstable instance trees in non-editable mode, we need to resort the child instances in this case - sort_child_insts (); + sort_child_insts (true); } } diff --git a/src/db/db/dbInstances.h b/src/db/db/dbInstances.h index e57b64eac..60c2a2a69 100644 --- a/src/db/db/dbInstances.h +++ b/src/db/db/dbInstances.h @@ -1547,8 +1547,9 @@ public: /** * @brief Establish the instance index list giving the instances by cell index + * If force is true, the instance tree is always sorted. */ - void sort_child_insts (); + void sort_child_insts (bool force); /** * @brief Sort the cell instance list