From b664eee731487baee875e06a97598e8ec2928b22 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 21 Feb 2018 17:33:01 +0100 Subject: [PATCH] Problem of merging for GCell::updateGContacts(), again. --- anabatic/src/GCell.cpp | 34 ++++++++++++++++++++++++++-------- anabatic/src/anabatic/GCell.h | 1 + 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index 1ea69d60..231863ea 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -941,24 +941,24 @@ namespace Anabatic { void GCell::setSouthWestCorner ( DbU::Unit x, DbU::Unit y ) { - DbU::Unit dx = x - _xmin; - DbU::Unit dy = y - _ymin; + //DbU::Unit dx = x - _xmin; + //DbU::Unit dy = y - _ymin; - for ( Contact* contact : _gcontacts ) { - Point position = contact->getPosition().translate( dx, dy ); + /*for ( Contact* contact : _gcontacts ) { + Point position = contact->getPosition().translate( dx, dy ); for ( Component* component : contact->getSlaveComponents() ) { Horizontal* horizontal = dynamic_cast( component ); if (horizontal) { - horizontal->setY( position.getY() ); + horizontal->setY( position.getY() ); } else { Vertical* vertical = dynamic_cast( component ); - vertical->setX( position.getX() ); + vertical->setX( position.getX() ); } } - if (not contact->getAnchor()) contact->setPosition( position ); - } + if (not contact->getAnchor()) contact->setPosition( Point(x,y) ); + }*/ _xmin = x; _ymin = y; @@ -967,6 +967,24 @@ namespace Anabatic { } + void GCell::updateGContacts () + { + for ( Contact* contact : _gcontacts ) { + + for ( Component* component : contact->getSlaveComponents() ) { + Horizontal* horizontal = dynamic_cast( component ); + if (horizontal) { + horizontal->setY( _ymin+getHeight()/2 ); + } else { + Vertical* vertical = dynamic_cast( component ); + vertical->setX( _xmin+getWidth()/2 ); + } + } + if (not contact->getAnchor()) contact->setPosition( Point( _xmin+getWidth()/2, _ymin+getHeight()/2 ) ); + } + } + + Contact* GCell::getGContact ( Net* net ) { for ( Contact* contact : _gcontacts ) { diff --git a/anabatic/src/anabatic/GCell.h b/anabatic/src/anabatic/GCell.h index 97d301df..379dfb59 100644 --- a/anabatic/src/anabatic/GCell.h +++ b/anabatic/src/anabatic/GCell.h @@ -246,6 +246,7 @@ namespace Anabatic { void removeVSegment ( AutoSegment* ); void removeHSegment ( AutoSegment* ); void removeContact ( AutoContact* ); + void updateGContacts (); void updateContacts (); size_t updateDensity (); inline void updateKey ( size_t depth );