From 398047645591e138a6fd1ce8e9dfd069e1016ffe Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 4 Jul 2023 00:19:55 +0200 Subject: [PATCH] Trying to improve deep mode performance by avoiding multiple cell mapping operations due to partial hierarchy transfer. On the cost side, the hierarchy is always duplicated. --- src/db/db/dbHierarchyBuilder.h | 1 + src/db/db/dbRecursiveShapeIterator.cc | 6 +++++- src/db/db/dbRecursiveShapeIterator.h | 5 +++++ src/lvs/unit_tests/lvsTests.cc | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/db/db/dbHierarchyBuilder.h b/src/db/db/dbHierarchyBuilder.h index 4cd47efce..3847e57a6 100644 --- a/src/db/db/dbHierarchyBuilder.h +++ b/src/db/db/dbHierarchyBuilder.h @@ -295,6 +295,7 @@ public: */ void set_shape_receiver (HierarchyBuilderShapeReceiver *pipe); + virtual bool wants_all_cells () const { return true; } virtual void begin (const RecursiveShapeIterator *iter); virtual void end (const RecursiveShapeIterator *iter); virtual void enter_cell (const RecursiveShapeIterator *iter, const db::Cell *cell, const db::Box ®ion, const box_tree_type *complex_region); diff --git a/src/db/db/dbRecursiveShapeIterator.cc b/src/db/db/dbRecursiveShapeIterator.cc index af551b6e2..979ab6d78 100644 --- a/src/db/db/dbRecursiveShapeIterator.cc +++ b/src/db/db/dbRecursiveShapeIterator.cc @@ -693,7 +693,11 @@ RecursiveShapeIterator::next_shape (RecursiveShapeReceiver *receiver) const // determine whether the cell is empty with respect to the layers specified bool is_empty = false; - if (! m_has_layers) { + if (receiver && receiver->wants_all_cells ()) { + + // don't skip empty cells in that case + + } else if (! m_has_layers) { is_empty = mp_layout->cell (m_inst->cell_index ()).bbox (m_layer).empty (); diff --git a/src/db/db/dbRecursiveShapeIterator.h b/src/db/db/dbRecursiveShapeIterator.h index 99ffeb1fc..281a7ce82 100644 --- a/src/db/db/dbRecursiveShapeIterator.h +++ b/src/db/db/dbRecursiveShapeIterator.h @@ -913,6 +913,11 @@ public: */ virtual ~RecursiveShapeReceiver () { } + /** + * @brief Returns true, if the receivers wants the full hierarchy and not just non-empty cells + */ + virtual bool wants_all_cells () const { return false; } + /** * @brief Called once when the iterator begins pushing */ diff --git a/src/lvs/unit_tests/lvsTests.cc b/src/lvs/unit_tests/lvsTests.cc index 18c0810bf..5836b7578 100644 --- a/src/lvs/unit_tests/lvsTests.cc +++ b/src/lvs/unit_tests/lvsTests.cc @@ -142,7 +142,7 @@ TEST(16_private) TEST(17_private) { test_is_long_runner (); - run_test (_this, "test_17.lylvs", "test_17b.cir.gz", "test_17.gds.gz", true, "test_17b_4.lvsdb"); + run_test (_this, "test_17.lylvs", "test_17b.cir.gz", "test_17.gds.gz", true, "test_17b_5.lvsdb"); } TEST(18_private)