Correct management of last E/N GCell boundaries.

* Bug: In Anabatic::GCell, new functions getConstraintUMax() to return the
    correct bounding box for the last north/east GCell. The GCells do not
    own their north/east edges, except for the last ones. Thoses functions
    must distinct from getUMax() because for them, the shrink is always
    applied. getConstraintBox() uses the "getConstraintUMax()" functions.
* Bug: In Anabatic::AutoContact, initialize the constraint box from the
    new GCell::getConstraintUMax(), to manage correctly the boundaries
    of the nothernmost & easternmost GCells. The problem was showing for
    pins on the north/east side of a circuit, the constraint
* Bug: In Anabatic::AutoContactHTee, Anabatic::AutoContactVTee and
    Anabatic::AutoContactTerminal forgot to call the _preCreate() function
    in the various create().
* Bug: In Matrix::getUnder(), if on the N/E boundary, decrease by one to
    be enclosed in it.
This commit is contained in:
Jean-Paul Chaput 2016-08-27 15:59:12 +02:00
parent 41b1b72b7c
commit 44500a2329
11 changed files with 36 additions and 9 deletions

View File

@ -67,9 +67,9 @@ namespace Anabatic {
, _gcell (gcell)
, _flags (CntInvalidatedCache|CntInCreationStage)
, _dxMin (0)
, _dxMax ((int)DbU::toLambda( _gcell->getXMax()-_gcell->getXMin() ))
, _dyMin (0)
, _dyMax ((int)DbU::toLambda( _gcell->getYMax()-_gcell->getYMin() ))
, _dxMax ((int)DbU::toLambda(gcell->getConstraintXMax()))
, _dyMin ()
, _dyMax ((int)DbU::toLambda(gcell->getConstraintYMax()))
{
_allocateds++;
_gcell->addContact ( this );
@ -257,7 +257,7 @@ namespace Anabatic {
{
if (isUserNativeConstraints()) return getConstraintBox();
if (isFixed()) return Box(_contact->getPosition());
return _gcell->getBoundingBox();
return _gcell->getConstraintBox();
}
@ -316,8 +316,8 @@ namespace Anabatic {
_contact->setPosition( _gcell->getCenter() );
_dxMin = 0;
_dyMin = 0;
_dxMax = (int)DbU::toLambda( _gcell->getXMax()-_gcell->getXMin() );
_dyMax = (int)DbU::toLambda( _gcell->getYMax()-_gcell->getYMin() );
_dxMax = (int)DbU::toLambda( gcell->getConstraintXMax() );
_dyMax = (int)DbU::toLambda( gcell->getConstraintYMax() );
if (cdebug.enabled()) {
int dxMin = _dxMin;
int dyMin = _dyMin;

View File

@ -49,6 +49,8 @@ namespace Anabatic {
AutoContactHTee* AutoContactHTee::create ( GCell* gcell, Net* net, const Layer* layer )
{
_preCreate( gcell, net, layer );
DbU::Unit viaSide = Session::getViaWidth( layer );
Contact* contact = Contact::create ( net
, layer

View File

@ -88,6 +88,8 @@ namespace Anabatic {
cdebug_log(145,0) << "AutoContactTerminal::create(... x, y, ...)" << endl;
cdebug_log(145,0) << "@ x:" << DbU::getValueString(x) << " y:" << DbU::getValueString(y) << endl;
_preCreate( gcell, anchor->getNet(), layer );
Point anchorPosition = anchor->getPosition();
Contact* contact = Contact::create( anchor

View File

@ -49,6 +49,8 @@ namespace Anabatic {
AutoContactVTee* AutoContactVTee::create ( GCell* gcell, Net* net, const Layer* layer )
{
_preCreate( gcell, net, layer );
DbU::Unit viaSide = Session::getViaWidth( layer );
Contact* contact = Contact::create( net
, layer

View File

@ -553,6 +553,8 @@ namespace Anabatic {
{
const GCell* current = this;
if (not this) cerr << Error("*this* is NULL!") << endl;
while ( current ) {
if (not current->isFlat() and current->getBoundingBox().contains(x,y)) break;
@ -796,7 +798,7 @@ namespace Anabatic {
cerr << Error( "GCell::_revalidate(): %s, Y Min is greater than Max.", getString(this).c_str() );
_anabatic->_updateLookup( this );
_anabatic->getMatrix()->show();
//_anabatic->getMatrix()->show();
cdebug_tabw(110,-1);
}

View File

@ -73,10 +73,14 @@ namespace Anabatic {
GCell* Matrix::getUnder ( DbU::Unit x, DbU::Unit y ) const
{
if (x == _area.getXMax()) --x;
if (y == _area.getYMax()) --y;
int index = xy2maxIndex(x,y);
cdebug_log(110,0) << "Matrix::getUnder() ("
<< DbU::getValueString(x) << " "
<< DbU::getValueString(y) << ") index:" << index << endl;
return (index < 0) ? NULL : _gcells[index]->getUnder(x,y);
}
@ -133,6 +137,7 @@ namespace Anabatic {
cdebug_tabw(110,-1);
}
void Matrix::show () const
{
cdebug_log(111,0) << this << endl;

View File

@ -31,6 +31,7 @@ namespace Anabatic {
class AutoContactHTee : public AutoContact {
typedef AutoContact Super;
friend class AutoContact;
public:
static AutoContactHTee* create ( GCell*, Net*, const Layer* );

View File

@ -28,6 +28,7 @@ namespace Anabatic {
class AutoContactTerminal : public AutoContact {
typedef AutoContact Super;
friend class AutoContact;
public:
static AutoContactTerminal* create ( GCell* gcell

View File

@ -28,6 +28,7 @@ namespace Anabatic {
class AutoContactVTee : public AutoContact {
typedef AutoContact Super;
friend class AutoContact;
public:
static AutoContactVTee* create ( GCell*, Net*, const Layer* );

View File

@ -149,8 +149,11 @@ namespace Anabatic {
inline DbU::Unit getYMin () const;
inline DbU::Unit getXMax ( int shrink=0 ) const;
inline DbU::Unit getYMax ( int shrink=0 ) const;
inline DbU::Unit getConstraintXMax () const;
inline DbU::Unit getConstraintYMax () const;
inline Interval getSide ( Flags direction ) const;
inline Point getCenter () const;
inline Box getConstraintBox () const;
inline const vector<Edge*>& getWestEdges () const;
inline const vector<Edge*>& getEastEdges () const;
inline const vector<Edge*>& getNorthEdges () const;
@ -333,9 +336,18 @@ namespace Anabatic {
{ return _northEdges.empty() ? getCell()->getAbutmentBox().getYMax() - shrink
: _northEdges[0]->getOpposite(this)->getYMin() - shrink; }
inline DbU::Unit GCell::getConstraintXMax () const
{ return getXMax( _eastEdges .empty() ? -1 : 0 ); }
inline DbU::Unit GCell::getConstraintYMax () const
{ return getYMax( _northEdges .empty() ? -1 : 0 ); }
inline Point GCell::getCenter () const
{ return Point( (getXMin()+getXMax())/2, (getYMin()+getYMax())/2); }
inline Box GCell::getConstraintBox () const
{ return Box( getXMin(), getYMin(), getConstraintXMax(), getConstraintYMax() ); }
inline Interval GCell::getSide ( Flags direction ) const
{
if (direction.isset(Flags::Vertical)) return Interval( getYMin(), getYMax() );

View File

@ -112,7 +112,6 @@ namespace Anabatic {
};
// Matrix inline functions.
inline Box Matrix::getArea () const { return _area; }
inline DbU::Unit Matrix::getSide () const { return _side; }