diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index 849b9cc7..f1fbea40 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -836,6 +836,39 @@ namespace Anabatic { } + void GCell::setXY ( DbU::Unit x, DbU::Unit y ) + { + UpdateSession::open(); + _xmin = x; + _ymin = y; + UpdateSession::close(); + } + + + void GCell::updateContactsPosition () + { + UpdateSession::open(); + DbU::Unit xc = (getXMax() + getXMin())/2; + DbU::Unit yc = (getYMax() + getYMin())/2; + for (vector::iterator it = _gcontacts.begin(); it != _gcontacts.end(); it++){ + for ( Component* c : (*it)->getSlaveComponents() ){ + Horizontal* h = dynamic_cast(c); + Vertical* v = dynamic_cast (c); + if (h){ + //if (h->getY() == (*it)->getY()) h->setY(yc); + h->setY(yc); + } else if (v) { + //if (v->getX() == (*it)->getX()) v->setX(xc); + v->setX(xc); + } + } + (*it)->setX(xc); + (*it)->setY(yc); + } + UpdateSession::close(); + } + + Contact* GCell::getGContact ( Net* net ) { diff --git a/anabatic/src/anabatic/GCell.h b/anabatic/src/anabatic/GCell.h index f27bfe99..67994171 100644 --- a/anabatic/src/anabatic/GCell.h +++ b/anabatic/src/anabatic/GCell.h @@ -24,10 +24,16 @@ #include "hurricane/Name.h" #include "hurricane/Box.h" #include "hurricane/Cell.h" +#include "hurricane/Component.h" +#include "hurricane/Horizontal.h" +#include "hurricane/Vertical.h" #include "hurricane/ExtensionGo.h" namespace Hurricane { class Contact; class RoutingPad; + class Component; + class Horizontal; + class Vertical; } #include "anabatic/Edge.h" #include "anabatic/AutoSegments.h" @@ -52,6 +58,9 @@ namespace Anabatic { using Hurricane::Contact; using Hurricane::RoutingPad; using Hurricane::Cell; + using Hurricane::Component; + using Hurricane::Horizontal; + using Hurricane::Vertical; class AnabaticEngine; class GCell; @@ -160,6 +169,8 @@ namespace Anabatic { Contact* getGContact ( Net* ); inline const vector& getGContacts () const; bool unrefContact ( Contact* ); + void setXY ( DbU::Unit x, DbU::Unit y ); + void updateContactsPosition (); void cleanupGlobal (); // Detailed routing functions. bool hasFreeTrack ( size_t depth, float reserve ) const;