From eb9363eca1bafa6583ae1b16d8d2804687dcf2a1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 18 Jul 2017 23:31:09 +0200 Subject: [PATCH] Bugfixes for XOR tool 1.) Wrong scaling of output when using output to layout A or B and different DBU's were present 2.) A threading issue when delivering outputs to layout A or B resulting in random crashes and weired behavior. This happened when threading was enabled. --- src/ext/extXORToolDialog.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/ext/extXORToolDialog.cc b/src/ext/extXORToolDialog.cc index 0e05b7a8b..32a2b7017 100644 --- a/src/ext/extXORToolDialog.cc +++ b/src/ext/extXORToolDialog.cc @@ -27,6 +27,7 @@ #include "dbShapeProcessor.h" #include "dbRecursiveShapeIterator.h" #include "dbClip.h" +#include "dbLayoutUtils.h" #include "tlTimer.h" #include "tlProgress.h" #include "tlThreadedWorkers.h" @@ -436,7 +437,7 @@ public: return m_tolerances; } - const std::vector > sub_output_layers () const + const std::vector > &sub_output_layers () const { return m_sub_output_layers; } @@ -490,7 +491,16 @@ public: subcell = m_sub_cells[tol_index]; layout_layer = m_sub_output_layers[tol_index][layer_index]; - subcell->shapes (layout_layer).insert (polygon); + + double factor = 1.0; + if (subcell->layout ()) { + factor = dbu () / subcell->layout ()->dbu (); + } + if (tl::equal (factor, 1.0)) { + subcell->shapes (layout_layer).insert (polygon); + } else { + subcell->shapes (layout_layer).insert (db::Polygon (polygon * factor)); + } } } @@ -1290,6 +1300,11 @@ XORToolDialog::run_xor () // into a global one .. tl::RelativeProgress progress (tl::to_string (QObject::tr ("Performing ")) + op_name, todo_count, 1); + // We need to lock the layouts during the processing - in OMNewLayerA and OMNewLayerB mode + // we actually modify the layout we iterate over + db::LayoutLocker locker_a (& cva->layout ()); + db::LayoutLocker locker_b (& cvb->layout ()); + try { job.start ();