mirror of https://github.com/KLayout/klayout.git
Fixed #458 (Array instance net tracing bug)
This commit is contained in:
parent
85c033db64
commit
c4636cebdb
|
|
@ -1347,30 +1347,37 @@ private:
|
|||
return;
|
||||
}
|
||||
|
||||
db::ICplxTrans i1t = i1.complex_trans ();
|
||||
db::ICplxTrans tt1 = t1 * i1t;
|
||||
InstanceToInstanceInteraction ii_key;
|
||||
db::ICplxTrans i1t, i2t;
|
||||
|
||||
db::ICplxTrans i2t = i2.complex_trans ();
|
||||
db::ICplxTrans tt2 = t2 * i2t;
|
||||
{
|
||||
i1t = i1element.at_end () ? i1.complex_trans () : i1.complex_trans (*i1element);
|
||||
db::ICplxTrans tt1 = t1 * i1t;
|
||||
|
||||
db::ICplxTrans tt21 = tt1.inverted () * tt2;
|
||||
InstanceToInstanceInteraction ii_key (i1.cell_index (), i1.cell_inst ().delegate (), i2.cell_index (), i2.cell_inst ().delegate (), tt21);
|
||||
i2t = i2element.at_end () ? i2.complex_trans () : i2.complex_trans (*i2element);
|
||||
db::ICplxTrans tt2 = t2 * i2t;
|
||||
|
||||
instance_interaction_cache_type::iterator ii = mp_instance_interaction_cache->find (ii_key);
|
||||
if (ii != mp_instance_interaction_cache->end ()) {
|
||||
db::ICplxTrans tt21 = tt1.inverted () * tt2;
|
||||
ii_key = InstanceToInstanceInteraction (i1.cell_index (), (! i1element.at_end () || i1.size () == 1) ? 0 : i1.cell_inst ().delegate (),
|
||||
i2.cell_index (), (! i2element.at_end () || i2.size () == 1) ? 0 : i2.cell_inst ().delegate (),
|
||||
tt21);
|
||||
|
||||
instance_interaction_cache_type::iterator ii = mp_instance_interaction_cache->find (ii_key);
|
||||
if (ii != mp_instance_interaction_cache->end ()) {
|
||||
|
||||
// use cached interactions
|
||||
interacting_clusters = ii->second;
|
||||
for (std::list<std::pair<ClusterInstance, ClusterInstance> >::iterator i = interacting_clusters.begin (); i != interacting_clusters.end (); ++i) {
|
||||
// translate the property IDs
|
||||
i->first.set_inst_prop_id (i1.prop_id ());
|
||||
i->first.transform (i1t);
|
||||
i->second.set_inst_prop_id (i2.prop_id ());
|
||||
i->second.transform (i2t);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
// use cached interactions
|
||||
interacting_clusters = ii->second;
|
||||
for (std::list<std::pair<ClusterInstance, ClusterInstance> >::iterator i = interacting_clusters.begin (); i != interacting_clusters.end (); ++i) {
|
||||
// translate the property IDs
|
||||
i->first.set_inst_prop_id (i1.prop_id ());
|
||||
i->first.transform (i1t);
|
||||
i->second.set_inst_prop_id (i2.prop_id ());
|
||||
i->second.transform (i2t);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// array interactions
|
||||
|
|
|
|||
|
|
@ -765,6 +765,10 @@ struct InstanceToInstanceInteraction
|
|||
: ci1 (_ci1), ci2 (_ci2), array1 (_array1), array2 (_array2), t21 (_t21)
|
||||
{ }
|
||||
|
||||
InstanceToInstanceInteraction ()
|
||||
: ci1 (0), ci2 (0), array1 (0), array2 (0)
|
||||
{ }
|
||||
|
||||
bool operator== (const InstanceToInstanceInteraction &other) const
|
||||
{
|
||||
return ci1 == other.ci1 && ci2 == other.ci2 && t21.equal (other.t21) &&
|
||||
|
|
|
|||
|
|
@ -1275,3 +1275,9 @@ TEST(118_HierClustersMeanderArrays)
|
|||
run_hc_test (_this, "meander.gds.gz", "meander_au1.gds");
|
||||
run_hc_test_with_backannotation (_this, "meander.gds.gz", "meander_au2.gds");
|
||||
}
|
||||
|
||||
TEST(119_HierClustersCombArrays)
|
||||
{
|
||||
run_hc_test (_this, "comb.gds", "comb_au1.gds");
|
||||
run_hc_test_with_backannotation (_this, "comb.gds", "comb_au2.gds");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue