diff --git a/anabatic/src/Constants.cpp b/anabatic/src/Constants.cpp index 7531ce4b..a6495a79 100644 --- a/anabatic/src/Constants.cpp +++ b/anabatic/src/Constants.cpp @@ -41,6 +41,8 @@ namespace Anabatic { const BaseFlags Flags::Saturated = (1L << 11); const BaseFlags Flags::StdCellRow = (1L << 12); const BaseFlags Flags::ChannelRow = (1L << 13); + const BaseFlags Flags::HRailGCell = (1L << 14); + const BaseFlags Flags::VRailGCell = (1L << 15); const BaseFlags Flags::IllimitedCapacity = (1L << 5); // Flags for Anabatic objects states only. const BaseFlags Flags::DemoMode = (1L << 5); @@ -66,12 +68,16 @@ namespace Anabatic { | MatrixGCell | IoPadGCell | StdCellRow - | ChannelRow; + | ChannelRow + | HRailGCell + | VRailGCell; const BaseFlags Flags::RowGCellMask = StdCellRow|ChannelRow; const BaseFlags Flags::AnalogGCellMask = DeviceGCell | HChannelGCell | VChannelGCell - | StrutGCell; + | StrutGCell + | HRailGCell + | VRailGCell; // Flags for functions arguments only. const BaseFlags Flags::Create = (1L << 5); const BaseFlags Flags::WithPerpands = (1L << 6); @@ -168,6 +174,8 @@ namespace Anabatic { s += (_flags & (uint64_t)DeviceGCell ) ? 'd' : '-'; s += (_flags & (uint64_t)HChannelGCell) ? 'c' : '-'; s += (_flags & (uint64_t)VChannelGCell) ? 'c' : '-'; + s += (_flags & (uint64_t)HRailGCell ) ? 'r' : '-'; + s += (_flags & (uint64_t)VRailGCell ) ? 'r' : '-'; s += (_flags & (uint64_t)StrutGCell ) ? 's' : '-'; s += (_flags & (uint64_t)MatrixGCell ) ? 'm' : '-'; s += (_flags & (uint64_t)StdCellRow ) ? 'S' : '-'; diff --git a/anabatic/src/Dijkstra.cpp b/anabatic/src/Dijkstra.cpp index 32be8a2c..00aaf8b5 100644 --- a/anabatic/src/Dijkstra.cpp +++ b/anabatic/src/Dijkstra.cpp @@ -49,6 +49,31 @@ namespace Anabatic { using Hurricane::NetRoutingExtension; + + + DbU::Unit calcDistance( Point p1, Point p2 ) + { + return abs(p1.getX()-p2.getX()) + abs(p1.getY()-p2.getY()); + } + + + DbU::Unit calcMidIntersection( DbU::Unit imin1, DbU::Unit imax1, DbU::Unit imin2, DbU::Unit imax2 ) + { + if ( (imin1 > imax1) + || (imin2 > imax2) + ){ + cerr << "DbU::Unit calcMidIntersection(...): Wrong parameters." << endl; + return 0; + } + if ( (imin1 > imax2) + || (imax1 < imin2) + ) { + cerr << "DbU::Unit calcMidIntersection(...): No intersection." << endl; + return 0; + } + return ( max(imin1, imin2) + min(imax1, imax2) )/2; + } + // ------------------------------------------------------------------- // Class : "Anabatic::IntervalC". @@ -80,6 +105,15 @@ namespace Anabatic { } + IntervalC::IntervalC( DbU::Unit min, DbU::Unit max, DbU::Unit axis ) + { + _min = min; + _max = max; + _axis = axis; + setiSet(); + } + + IntervalC::~IntervalC() {} @@ -174,6 +208,30 @@ namespace Anabatic { bool Vertex::hasValidStamp () const { return _stamp == getAnabatic()->getStamp(); } + Edge* Vertex::getFrom() const + { + if (hasValidStamp()) return _from; + else return NULL; + } + + + void Vertex::setRestricted () + { + setNRestricted(); + setSRestricted(); + setERestricted(); + setWRestricted(); + } + + + void Vertex::clearRestriction () + { + unsetFlags(NRestricted); + unsetFlags(SRestricted); + unsetFlags(ERestricted); + unsetFlags(WRestricted); + } + bool Vertex::hasRP( Net* net ) const { @@ -295,10 +353,14 @@ namespace Anabatic { return Point(0,0); } + //<<<<<<< HEAD + /*if (vnext->getGCell()->isMatrix()) { +======= if (not vnext->getGCell()->isAnalog()) { +>>>>>>> 987289653831df12933bd4490d9559415e61f220 cdebug_tabw(112,-1); return Point(vnext->getGCell()->getXCenter(), vnext->getGCell()->getYCenter()); - } + }*/ GCell* gnext = vnext->getGCell(); GCell* gcurr = getGCell(); @@ -307,9 +369,9 @@ namespace Anabatic { if (vnext->isV()){ - cdebug_log(112,0) << "Case next: Vertical: " << vnext->isiSet() << endl; //", d:" << vnext->getDistance() << endl; + //cdebug_log(112,0) << "Case next: Vertical: " << vnext->isiSet() << endl; //", d:" << vnext->getDistance() << endl; if ((vnext->isiSet())&&(vnext->hasValidStamp())){ - cdebug_log(112,0) << "Case set" << endl; + //cdebug_log(112,0) << "Case set" << endl; x = vnext->getIAxis(); if (isNorth(vnext)) y = vnext->getIMin(); else if (isSouth(vnext)) y = vnext->getIMax(); @@ -319,7 +381,7 @@ namespace Anabatic { else y = pcurr.getY(); } else cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.1" << endl; } else { - cdebug_log(112,0) << "Case not set" << endl; + //cdebug_log(112,0) << "Case not set" << endl; if (isNorth(vnext)){ y = gcurr->getYMax(); if (pcurr.getX() < gnext->getXMin()) x = gnext->getXMin(); @@ -345,10 +407,10 @@ namespace Anabatic { } } else if (vnext->isH()) { - cdebug_log(112,0) << "Case next: Horizontal: " << vnext->isiSet() << endl; //", d:" << vnext->getDistance() << endl; + //cdebug_log(112,0) << "Case next: Horizontal: " << vnext->isiSet() << endl; //", d:" << vnext->getDistance() << endl; if ((vnext->isiSet())&&(vnext->hasValidStamp())){ - cdebug_log(112,0) << "Case set" << endl; + //cdebug_log(112,0) << "Case set" << endl; y = vnext->getIAxis(); if (isEast (vnext)) x = vnext->getIMin(); else if (isWest (vnext)) x = vnext->getIMax(); @@ -359,7 +421,7 @@ namespace Anabatic { } else cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.3" << endl; } else { - cdebug_log(112,0) << "Case not set" << endl; + //cdebug_log(112,0) << "Case not set" << endl; if (isNorth(vnext)){ y = gcurr->getYMax(); if (pcurr.getX() < gnext->getXMin()) x = gnext->getXMin(); @@ -384,7 +446,8 @@ namespace Anabatic { } else cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.4" << endl; } } else { - cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.5" << endl; + cdebug_log(112,0) << "[ERROR](Point Vertex::getNextPathPoint2(...) const: Something is wrong.5: " << vnext << endl; + } cdebug_tabw(112,-1); return Point(x,y); @@ -402,13 +465,25 @@ namespace Anabatic { IntervalC intervfrom = IntervalC(); if (_adata == NULL){ - cdebug_log(112,0) << "Point Vertex::getStartPathPoint( const Vertex* next ) const: GRAData unset." << endl; + //cdebug_log(112,0) << "Point Vertex::getStartPathPoint( const Vertex* next ) const: Digital vertex." << endl; cdebug_tabw(112,-1); return Point(0,0); } - - if (gcurr->isDevice ()){ + if (gcurr->isMatrix()){ + GCell* gprev = getGPrev(); + cdebug_log(112,-1) << endl; + if (gprev) { + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + if (isNorth(vprev)) return Point (gcurr->getXCenter(), gcurr->getYMax() ); + else if (isSouth(vprev)) return Point (gcurr->getXCenter(), gcurr->getYMin() ); + else if (isWest (vprev)) return Point (gcurr->getXMin() , gcurr->getYCenter() ); + else if (isEast (vprev)) return Point (gcurr->getXMax() , gcurr->getYCenter() ); + else return Point (gcurr->getXCenter(), gcurr->getYCenter() ); + } else return Point (gcurr->getXCenter(), gcurr->getYCenter() ); + } else if (gcurr->isDevice ()){ cdebug_log(112,0) << "Case device" << endl; + cdebug_log(112,0) << "seed isH(): " << isH() << endl; + cdebug_log(112,0) << "seed isV(): " << isV() << endl; if (isH()){ cdebug_log(112,0) << "hinterval: " << DbU::getValueString(getIAxis()) << endl; y = getIAxis(); @@ -455,15 +530,12 @@ namespace Anabatic { cdebug_log(112,0) << "prev is V" << endl; if (isNorth(prev)){ - //cdebug_log(112,0) << "1" << endl; x = intervfrom.getAxis(); y = gcurr->getYMax(); } else if (isSouth(prev)){ - //cdebug_log(112,0) << "2" << endl; x = intervfrom.getAxis(); y = gcurr->getYMin(); } else if (isWest (prev)){ - //cdebug_log(112,0) << "3" << endl; x = gcurr->getXMin(); if (isNorth(next)){ if (intervfrom.getMax() > gcurr->getYMax()) y = gcurr->getYMax(); @@ -478,7 +550,6 @@ namespace Anabatic { } } } else if (isEast (prev)){ - //cdebug_log(112,0) << "4" << endl; x = gcurr->getXMax(); if (isNorth(next)){ if (intervfrom.getMax() > gcurr->getYMax()) y = gcurr->getYMax(); @@ -598,8 +669,8 @@ namespace Anabatic { { GCell* gcell = getGCell(); if (gcell->isDevice()) return isiHorizontal(); - else if (gcell->isHChannel()) return true; - else if (gcell->isStrut()) return ((gcell->getWidth() > gcell->getHeight())||(gcell->getWidth() == gcell->getHeight())); + else if ((gcell->isHChannel())||(gcell->isHRail())) return true; + else if (gcell->isStrut()| gcell->isMatrix() ) return ((gcell->getWidth() > gcell->getHeight())||(gcell->getWidth() == gcell->getHeight())); else return false; } @@ -608,8 +679,8 @@ namespace Anabatic { { GCell* gcell = getGCell(); if (gcell->isDevice()) return isiVertical(); - else if (gcell->isVChannel()) return true; - else if (gcell->isStrut()) return gcell->getWidth() < gcell->getHeight(); + else if ((gcell->isVChannel())||(gcell->isVRail())) return true; + else if (gcell->isStrut()|| gcell->isMatrix()) return gcell->getWidth() < gcell->getHeight(); else return false; } @@ -793,28 +864,41 @@ namespace Anabatic { void Vertex::createAData() { - if (_adata == NULL) _adata = GRAData::create(); + if (!getGCell()->isMatrix()){ + if (_adata == NULL) _adata = GRAData::create(); + } } bool Vertex::isiSet() const { - if (_adata){ - return _adata->isiSet(); - } else { - cdebug_log(112,0) << "bool Vertex::isiSet() const: Inappropriate usage of GRAData. " << endl; - return false; - } + if (_adata) return _adata->isiSet(); + else return false; } DbU::Unit Vertex::getIAxis() const { - if (_adata){ - return _adata->getIAxis(); - } else { - cdebug_log(112,0) << "DbU::Unit Vertex::getIAxis() const: Inappropriate usage of GRAData. " << endl; - return 0; + if (_adata) return _adata->getIAxis(); + else { + if (_from){ + //cdebug_log(112,0) << "DbU::Unit Vertex::getIAxis() const: Digital vertex. " << endl; + + GCell* gcurr = getGCell(); + GCell* gprev = _from->getOpposite(gcurr); + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + if (isNorth(vprev)||isSouth(vprev)) + return calcMidIntersection(gcurr->getXMin(), gcurr->getXMax(), gprev->getXMin(), gprev->getXMax()); + else if (isWest (vprev)||isEast (vprev)) + return calcMidIntersection(gcurr->getYMin(), gcurr->getYMax(), gprev->getYMin(), gprev->getYMax()); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getIAxis() const: Not a neighbour GCell. " << endl; + return 0; + } + } else { + if (isH()) return getGCell()->getXCenter(); + else return getGCell()->getYCenter(); + } } } @@ -824,19 +908,64 @@ namespace Anabatic { if (_adata){ return _adata->getIMax(); } else { - cdebug_log(112,0) << "DbU::Unit Vertex::getIMax() const: Inappropriate usage of GRAData. " << endl; - return 0; + if (_from){ + //cdebug_log(112,0) << "DbU::Unit Vertex::getIMax() const: Digital vertex. " << endl; + GCell* gcurr = getGCell(); + GCell* gprev = _from->getOpposite(gcurr); + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + if (isH()){ + if (isNorth(vprev)||isSouth(vprev)||isWest (vprev)) return getGCell()->getXCenter(); + else if (isEast (vprev)) return getGCell()->getXMax(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getIMax() const: Not a neighbour GCell. " << endl; + return 0; + } + } else { + if (isWest(vprev)||isEast(vprev)||isSouth (vprev)) return getGCell()->getYCenter(); + else if (isNorth (vprev)) return getGCell()->getYMax(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getIMax() const: Not a neighbour GCell. " << endl; + return 0; + } + } + } else { + if (isH()) return getGCell()->getXCenter(); + else return getGCell()->getYCenter(); + } } } + DbU::Unit Vertex::getIMin() const { if (_adata){ return _adata->getIMin(); } else { - cdebug_log(112,0) << "DbU::Unit Vertex::getIMin() const: Inappropriate usage of GRAData. " << endl; - return 0; + //cdebug_log(112,0) << "DbU::Unit Vertex::getIMin() const: Digital vertex. " << endl; + if (_from){ + GCell* gcurr = getGCell(); + GCell* gprev = _from->getOpposite(gcurr); + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + if (isH()){ + if (isNorth(vprev)||isSouth(vprev)||isEast (vprev)) return getGCell()->getXCenter(); + else if (isWest (vprev)) return getGCell()->getXMin(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getIMin() const: Not a neighbour GCell. " << endl; + return 0; + } + } else { + if (isWest(vprev)||isEast(vprev)||isNorth (vprev)) return getGCell()->getYCenter(); + else if (isSouth (vprev)) return getGCell()->getYMin(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getIMin() const: Not a neighbour GCell. " << endl; + return 0; + } + } + } else { + if (isH()) return getGCell()->getXCenter(); + else return getGCell()->getYCenter(); + } } } @@ -846,19 +975,67 @@ namespace Anabatic { if (_adata){ return _adata->getPIAxis(); } else { - cdebug_log(112,0) << "DbU::Unit Vertex::getPIAxis() const: Inappropriate usage of GRAData. " << endl; - return 0; + //cdebug_log(112,0) << "DbU::Unit Vertex::getPIAxis() const: Digital vertex. " << endl; + if (_from){ + GCell* gcurr = getGCell(); + GCell* gprev = _from->getOpposite(gcurr); + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + + if (vprev->isH()){ + if (vprev->isWest(this)||vprev->isEast (this)) return gprev->getYCenter(); + else if (vprev->isSouth (this)) return gprev->getYMin(); + else if (vprev->isNorth (this)) return gprev->getYMax(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIAxis() const: Not a neighbour GCell. " << endl; + return 0; + } + } else { + if (vprev->isNorth(this)||vprev->isSouth (this)) return gprev->getXCenter(); + else if (vprev->isWest (this)) return gprev->getXMin(); + else if (vprev->isEast (this)) return gprev->getXMax(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIAxis() const: Not a neighbour GCell. " << endl; + return 0; + } + } + } else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIAxis() const: Inappropriate usage of GRAData. " << endl; + return 0; + } } } - + DbU::Unit Vertex::getPIMax() const { if (_adata){ return _adata->getPIMax(); } else { - cdebug_log(112,0) << "DbU::Unit Vertex::getPIMax() const: Inappropriate usage of GRAData. " << endl; - return 0; + //cdebug_log(112,0) << "DbU::Unit Vertex::getPIMax() const: Digital vertex. " << endl; + if (_from){ + GCell* gcurr = getGCell(); + GCell* gprev = _from->getOpposite(gcurr); + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + + if (vprev->isH()){ + if (vprev->isSouth(this)||vprev->isWest(this)||vprev->isNorth(this)) return gprev->getXCenter(); + else if (vprev->isEast (this)) return gprev->getXMax(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIMax() const: Not a neighbour GCell. " << endl; + return 0; + } + } else { + if (vprev->isSouth(this)||vprev->isWest(this)||vprev->isEast(this)) return gprev->getYCenter(); + else if (vprev->isNorth (this)) return gprev->getYMax(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIMax() const: Not a neighbour GCell. " << endl; + return 0; + } + } + } else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIMax() const: Inappropriate usage of GRAData. " << endl; + return 0; + } } } @@ -868,8 +1045,31 @@ namespace Anabatic { if (_adata){ return _adata->getPIMin(); } else { - cdebug_log(112,0) << "DbU::Unit Vertex::getPIMin() const: Inappropriate usage of GRAData. " << endl; - return 0; + //cdebug_log(112,0) << "DbU::Unit Vertex::getPIMin() const: Digital vertex. " << endl; + if (_from){ + GCell* gcurr = getGCell(); + GCell* gprev = _from->getOpposite(gcurr); + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + + if (vprev->isH()){ + if (vprev->isSouth(this)||vprev->isWest(this)||vprev->isNorth(this)) return gprev->getXCenter(); + else if (vprev->isWest (this)) return gprev->getXMin(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIMin() const: Not a neighbour GCell. " << endl; + return 0; + } + } else { + if (vprev->isNorth(this)||vprev->isWest(this)||vprev->isEast(this)) return gprev->getYCenter(); + else if (vprev->isSouth (this)) return gprev->getYMin(); + else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIMin() const: Not a neighbour GCell. " << endl; + return 0; + } + } + } else { + cdebug_log(112,0) << "DbU::Unit Vertex::getPIMin() const: Inappropriate usage of GRAData. " << endl; + return 0; + } } } @@ -908,9 +1108,10 @@ namespace Anabatic { { if (_adata){ _adata->resetIntervals(); - } else { + } /*else { cdebug_log(112,0) << "void Vertex::resetIntervals(): Inappropriate usage of GRAData. " << endl; - } + }*/ + unsetFlags(iSet); } @@ -918,18 +1119,17 @@ namespace Anabatic { { if (_adata){ _adata->clearFrom2(); - } else { - cdebug_log(112,0) << "void Vertex::clearfrom2(): Inappropriate usage of GRAData. " << endl; - } + } } Edge* Vertex::getFrom2() const { if (_adata){ - return _adata->getFrom2(); + if (hasValidStamp()) return _adata->getFrom2(); + else return NULL; } else { - cdebug_log(112,0) << "Edge* Vertex::getFrom2() const: Inappropriate usage of GRAData. " << endl; + //cdebug_log(112,0) << "Edge* Vertex::getFrom2() const: Inappropriate usage of GRAData. " << endl; return NULL; } } @@ -940,17 +1140,7 @@ namespace Anabatic { if (_adata){ _adata->setFrom2(from); } else { - cdebug_log(112,0) << "void Vertex::setFrom2( Edge* from ): Inappropriate usage of GRAData. " << endl; - } - } - - - void Vertex::createIntervFrom2() - { - if (_adata){ - //_adata->createIntervFrom2(); - } else { - cdebug_log(112,0) << "void Vertex::createIntervFrom2(): Inappropriate usage of GRAData. " << endl; + if (from) cdebug_log(112,0) << "void Vertex::setFrom2( Edge* from ): Inappropriate usage of GRAData. " << endl; } } @@ -1027,8 +1217,8 @@ namespace Anabatic { return _adata->getIntervFrom(); } } else { - cdebug_log(112,0) << "DbU::Unit Vertex::getIntervFrom(Flags criteria) const: Inappropriate usage of GRAData. " << endl; - return IntervalC(); + //cdebug_log(112,0) << "DbU::Unit Vertex::getIntervFrom(Flags criteria) const: Inappropriate usage of GRAData. " << endl; + return IntervalC(getPIMin(), getPIMax(), getPIAxis()); } } @@ -1087,7 +1277,7 @@ namespace Anabatic { if (_adata){ _adata->printInterv(); } else { - cdebug_log(112,0) << "void Vertex::printInterv() const: Inappropriate usage of GRAData. " << endl; + cdebug_log(112,0) << "Interv => this is a digital vertex." << endl; } } @@ -1097,7 +1287,7 @@ namespace Anabatic { if (_adata){ _adata->printIntervfrom(); } else { - cdebug_log(112,0) << "void Vertex::printIntervfrom() const: Inappropriate usage of GRAData. " << endl; + cdebug_log(112,0) << "IntervFrom => this is a digital vertex." << endl; } } @@ -1173,12 +1363,30 @@ namespace Anabatic { } - DbU::Unit calcDistance( Point p1, Point p2 ) +/*U::Unit calcDistance( Point p1, Point p2 ) { return abs(p1.getX()-p2.getX()) + abs(p1.getY()-p2.getY()); } + DbU::Unit calcMidIntersection( DbU::Unit imin1, DbU::Unit imax1, DbU::Unit imin2, DbU::Unit imax2 ) + { + if ( (imin1 > imax1) + || (imin2 > imax2) + ){ + cerr << "DbU::Unit calcMidIntersection(...): Wrong parameters." << endl; + return 0; + } + if ( (imin1 > imax2) + || (imax1 < imin2) + ) { + cerr << "DbU::Unit calcMidIntersection(...): No intersection." << endl; + return 0; + } + return ( max(imin1, imin2) + min(imax1, imax2) )/2; + }*/ + + Dijkstra::Dijkstra ( AnabaticEngine* anabatic ) : _anabatic (anabatic) , _vertexes () @@ -1245,28 +1453,29 @@ namespace Anabatic { if (state){ if (state->isSelfSym()){ - cdebug_log(112,0) << "Dijkstra::SELF SYMMETRY CASE " << _net << endl; + cdebug_log(112,0) << "Dijkstra::SELF SYMMETRY CASE " << DbU::getValueString(state->getSymAxis()) << endl; } - } + } /*else { + cerr << "Error: No RoutingExtension for net: " << _net << endl; + }*/ for ( Component* component : _net->getComponents() ) { RoutingPad* rp = dynamic_cast( component ); if (rp) { if (_attachSymContactsHook(rp)) continue; // ANALOG - cdebug_log(112,0) << "| " << rp << endl; + cdebug_log(112,0) << "| frp:" << rp << endl; rps.push_back( rp ); continue; } } for ( auto rp : rps ) { + cdebug_log(112,0) << "| rp: " << rp << ", getCenter(): " << rp->getBoundingBox().getCenter() << endl; Point center = rp->getBoundingBox().getCenter(); GCell* gcell = _anabatic->getGCellUnder( center ); _limitSymSearchArea(rp); // ANALOG - - cdebug_log(112,0) << "| " << rp << endl; if (not gcell) { cerr << Error( "Dijkstra::load(): %s\n" @@ -1279,21 +1488,29 @@ namespace Anabatic { continue; } + + + cdebug_log(112,0) << "Merge search area: " << _searchArea << ", gcell: " << gcell << endl; - _searchArea.merge( gcell->getBoundingBox() ); + _searchArea.merge( gcell->getBoundingBox() ); // TO CHANGE + //if (_net->getCell()->getName() == "gmchamla") _searchArea.merge( _net->getCell()->getAbutmentBox() ); // TO CHANGE cdebug_log(112,0) << "Search area: " << _searchArea << endl; Vertex* seed = gcell->getObserver(GCell::Observable::Vertex); GCell* gseed = seed->getGCell(); if (gseed->isAnalog()) _setSourcesGRAData( seed, rp ); // ANALOG + cdebug_log(112,0) << "seed isH(): " << seed->isH() << endl; + cdebug_log(112,0) << "seed isV(): " << seed->isV() << endl; if (seed->getConnexId() < 0) { + cdebug_log(112,0) << "(seed->getConnexId() < 0)"<< endl; VertexSet connecteds; _getConnecteds( seed, connecteds ); ++_connectedsId; for ( Vertex* vertex : connecteds ) { + cdebug_log(112,0) << "| Current: " << vertex << endl; vertex->setDistance ( Vertex::unreached ); vertex->setStamp ( _stamp ); vertex->setConnexId ( _connectedsId ); @@ -1301,13 +1518,19 @@ namespace Anabatic { vertex->setDegree ( 1 ); vertex->setRpCount ( 0 ); vertex->setFrom ( NULL ); + + vertex->setFrom2 ( NULL); + vertex->unsetFlags ( Vertex::UseFromFrom2 ); + vertex->clearRestriction(); _targets.insert( vertex ); cdebug_log(112,0) << "| Add: " << vertex << endl; } } + cdebug_log(112,0) << "seed->incRpCount();" << endl; seed->incRpCount(); + cdebug_log(112,0) << "Contact* vcontact = seed->getGContact( _net );" << endl; Contact* vcontact = seed->getGContact( _net ); rp->getBodyHook()->detach(); rp->getBodyHook()->attach( vcontact->getBodyHook() ); @@ -1368,7 +1591,7 @@ namespace Anabatic { for ( Edge* edge : current->getGCell()->getNorthEdges() ) { GCell* gnext = edge->getOpposite(current->getGCell()); Vertex* vnext = gnext->getObserver(GCell::Observable::Vertex); - if ( (gnext->getXCenter() == state->getSymAxis()) + if ( (gnext->getXCenter() == state->getSymAxis()) && (gnext->getXMin() <= cell->getAbutmentBox().getXMax()) ) _queue.push( vnext ); } @@ -1405,15 +1628,17 @@ namespace Anabatic { cdebug_log(112,0) << "Find axis targets: " << endl; } while ( not _queue.empty() ) { - Vertex* current = _queue.top(); + Vertex* current = _queue.top(); + GCell* gcurr = current->getGCell(); _queue.pop(); - if ( (state->isSymVertical() && (!current->isNRestricted()) && (!current->isSRestricted())) - ||(state->isSymHorizontal() && (!current->isERestricted()) && (!current->isWRestricted())) + if ( (state->isSymVertical() && (!current->isNRestricted()) && (!current->isSRestricted()) && (gcurr->getXCenter() == state->getSymAxis()) ) + ||(state->isSymHorizontal() && (!current->isERestricted()) && (!current->isWRestricted()) && (gcurr->getYCenter() == state->getSymAxis()) ) ){ current->setDistance ( Vertex::unreached ); current->setStamp ( _stamp ); current->setConnexId( -1 ); current->setFlags(Vertex::AxisTarget); + cdebug_log(112,0) << "isAxisTarget: " << current << endl; } if (state->isSymVertical()){ @@ -1421,23 +1646,28 @@ namespace Anabatic { for ( Edge* edge : current->getGCell()->getNorthEdges() ) { GCell* gnext = edge->getOpposite(current->getGCell()); Vertex* vnext = gnext->getObserver(GCell::Observable::Vertex); - if ( (gnext->getXCenter() == state->getSymAxis()) + if ( ( (state->getSymAxis() >= gnext->getXMin()) && (state->getSymAxis() <= gnext->getXMax()) ) && (gnext->getYMin() <= cell->getAbutmentBox().getYMax()) - ) _queue.push( vnext ); + ){ + _queue.push( vnext ); + } else { cdebug_log(112,0) << "isNOT: " << gnext << endl; + } + } } else if (state->isSymHorizontal()){ // check East - for ( Edge* edge : current->getGCell()->getNorthEdges() ) { + for ( Edge* edge : current->getGCell()->getEastEdges() ) { GCell* gnext = edge->getOpposite(current->getGCell()); Vertex* vnext = gnext->getObserver(GCell::Observable::Vertex); - if ( (gnext->getXCenter() == state->getSymAxis()) + if ( ( (state->getSymAxis() >= gnext->getYMin()) && (state->getSymAxis() <= gnext->getYMax()) ) && (gnext->getXMin() <= cell->getAbutmentBox().getXMax()) - ) _queue.push( vnext ); + ) { + _queue.push( vnext ); + } else { cdebug_log(112,0) << "isNOT: " << gnext << endl; + } } - } - + } } - } } } @@ -1534,12 +1764,14 @@ namespace Anabatic { Vertex* current = _queue.top(); GCell* gcurrent = current->getGCell(); - //cdebug_log(111,1) << "Current:" << current << endl; + cdebug_log(111,0) << "Current:" << current << endl; + cdebug_log(111,0) << "isAxisTarget():" << current->isAxisTarget() << endl; + _queue.pop(); if ( current->isAxisTarget() and needAxisTarget()) unsetFlags(Mode::AxisTarget); else if ((current->getConnexId() == _connectedsId) or (current->getConnexId() < 0)) { - cdebug_log(111,1) << "Looking for neighbors:" << endl; + cdebug_log(111,0) << "Looking for neighbors:" << endl; for ( Edge* edge : current->getGCell()->getEdges() ) { cdebug_log(111,0) << "[Current]: " << current << endl; @@ -1571,7 +1803,6 @@ namespace Anabatic { } ////////////////////////////////////// DEBUG ////////////////////////////////////// - cdebug_tabw(111,1); if (current->getFrom()) { cdebug_log(111,0) << "| From: " << current->getFrom()->getOpposite(gcurrent) << endl; //current->getIntervFrom().print(); @@ -1591,29 +1822,75 @@ namespace Anabatic { bool isDistance2shorter = false; if (gcurrent->isAnalog() and gneighbor->isAnalog()) - _isDistance2Shorter ( distance, current, vneighbor, edge ); + isDistance2shorter = _isDistance2Shorter ( distance, current, vneighbor, edge ); + + /* ------------------------------------------------------------------- */ + bool push = false; + if (distance != Vertex::unreachable){ + if (not vneighbor->hasValidStamp()) { + cdebug_log(111,0) << "Vertex reached for the first time" << endl; + vneighbor->setConnexId( -1 ); + vneighbor->setStamp ( _stamp ); + vneighbor->setDegree ( 1 ); + vneighbor->setRpCount ( 0 ); + vneighbor->unsetFlags(Vertex::AxisTarget); + vneighbor->resetIntervals(); + push = true; + } else { + if ( (distance == vneighbor->getDistance()) + and (gneighbor->isAnalog()) + and (vneighbor->getFrom2() == NULL) + ) { + _pushEqualDistance( distance, isDistance2shorter, current, vneighbor, edge ); // ANALOG + + } else if (distance < vneighbor->getDistance()) { + if (vneighbor->getDistance() != Vertex::unreached) _queue.erase( vneighbor ); + cdebug_log(111,0) << "Vertex reached through a shorter path" << endl; + push = true; + } else { + cdebug_log(111,0) << "Reject: Vertex reached through a *longer* path or unreachable:" + << boolalpha << (distance == Vertex::unreachable) + << endl; + } + } + } else { + cdebug_log(111,0) << "Reject: Vertex unreachable" << endl; + } + + if (push){ + if (gneighbor->isAnalog()) // Gneighbor only not current gcell + _updateGRAData( vneighbor, isDistance2shorter, current ); + vneighbor->setBranchId( current->getBranchId() ); + vneighbor->setDistance( distance ); + cdebug_log(111,0) << "setFrom1: " << vneighbor << endl; + vneighbor->setFrom ( edge ); + _queue.push( vneighbor ); + cdebug_log(111,0) << "Push: (size:" << _queue.size() << ") " << vneighbor << ", isFromFrom2: " << vneighbor->isFromFrom2() << endl; + } + + } + /* ------------------------------------------------------------------- */ - if ( (distance == vneighbor->getDistance()) + + + /*if ( (distance == vneighbor->getDistance()) and gcurrent->isAnalog() and gneighbor->isAnalog() and (vneighbor->getFrom2() == NULL) ) { _pushEqualDistance( distance, isDistance2shorter, current, vneighbor, edge ); // ANALOG - } else - if ( (distance < vneighbor->getDistance()) and (distance != Vertex::unreachable) ) { - if (vneighbor->getDistance() != Vertex::unreached) _queue.erase( vneighbor ); - else { - if (not vneighbor->hasValidStamp()) { - cdebug_log(111,0) << "Vertex reached for the first time" << endl; - vneighbor->setConnexId( -1 ); - vneighbor->setStamp ( _stamp ); - vneighbor->setDegree ( 1 ); - vneighbor->setRpCount ( 0 ); - vneighbor->unsetFlags(Vertex::AxisTarget); - } - } - cdebug_log(111,0) << "Vertex reached through a shorter path" << endl; - if (gcurrent->isAnalog() and gneighbor->isAnalog()) + } else { + if ((distance != Vertex::unreachable) and (not vneighbor->hasValidStamp())) { + cdebug_log(111,0) << "Vertex reached for the first time" << endl; + vneighbor->setConnexId( -1 ); + vneighbor->setStamp ( _stamp ); + vneighbor->setDegree ( 1 ); + vneighbor->setRpCount ( 0 ); + vneighbor->unsetFlags(Vertex::AxisTarget); + vneighbor->resetIntervals(); + + //cdebug_log(111,0) << "Vertex reached through a shorter path" << endl; + if (gneighbor->isAnalog()) // Gneighbor only not current gcell _updateGRAData( vneighbor, isDistance2shorter, current ); vneighbor->setBranchId( current->getBranchId() ); @@ -1625,20 +1902,43 @@ namespace Anabatic { _queue.push( vneighbor ); cdebug_log(111,0) << "Push: (size:" << _queue.size() << ") " << vneighbor << endl; } else { - cdebug_log(111,0) << "Reject: Vertex reached through a *longer* path or unreachable:" - << boolalpha << (distance == Vertex::unreachable) - << endl; + if ( (distance < vneighbor->getDistance()) and (distance != Vertex::unreachable) ) { + if (vneighbor->getDistance() != Vertex::unreached) _queue.erase( vneighbor );*/ + /*else { + if (not vneighbor->hasValidStamp()) { + cdebug_log(111,0) << "Vertex reached for the first time" << endl; + vneighbor->setConnexId( -1 ); + vneighbor->setStamp ( _stamp ); + vneighbor->setDegree ( 1 ); + vneighbor->setRpCount ( 0 ); + vneighbor->unsetFlags(Vertex::AxisTarget); + vneighbor->resetIntervals(); + }*/ + // } + //} + /*cdebug_log(111,0) << "Vertex reached through a shorter path" << endl; + if (gneighbor->isAnalog()) // Gneighbor only not current gcell + _updateGRAData( vneighbor, isDistance2shorter, current ); + + vneighbor->setBranchId( current->getBranchId() ); + vneighbor->setDistance( distance ); + cdebug_log(111,0) << "setFrom1: " << vneighbor << endl; + vneighbor->setFrom ( edge ); + if (gneighbor->isAnalog()) vneighbor->setFrom2( NULL ); + + _queue.push( vneighbor ); + cdebug_log(111,0) << "Push: (size:" << _queue.size() << ") " << vneighbor << endl; + } else { + cdebug_log(111,0) << "Reject: Vertex reached through a *longer* path or unreachable:" + << boolalpha << (distance == Vertex::unreachable) + << endl; + } } - - cdebug_tabw(111,-1); - } - - cdebug_tabw(111,-2); + } + }*/ continue; } - cdebug_tabw(111,-1); - // We did reach another target (different ). // Tag back the path, with a higher . _traceback( current ); @@ -1669,6 +1969,30 @@ namespace Anabatic { bool isfirst = true; bool useFrom2 = false; + //<<<<<<< HEAD + //if (!current->getGCell()->isMatrix()){ + /*_initiateUpdateIntervals ( current ); // ANALOG + + cdebug_log(112,0) << "[Start WHILE]" << endl; + + Edge* from = NULL; + while ( current ) { + cdebug_log(112,0) << endl; + cdebug_log(112,0) << "| " << current << " | " << endl; + if (current->getFrom()) cdebug_log(112,0) << " | From :" << current->getFrom()->getOpposite(current->getGCell()) << " | " << endl; + if (current->getFrom2()) cdebug_log(112,0) << " | From2:" << current->getFrom2()->getOpposite(current->getGCell()) << " | " << endl; + + //if (!current->getGCell()->isMatrix()){ + //////////////////////////////////////////////////////////////////////////////////////////// ANALOG + if (_updateIntervals ( isfirst, current, useFrom2, branchId, from )) break; + Vertex* next = NULL; + next = current->getPredecessor(); + + if( current->isFromFrom2()) { + cdebug_log(112,0) << "ISFROMFROM2: " << current << endl; + useFrom2 = true; + current->unsetFlags(Vertex::UseFromFrom2);*/ + /*=======*/ if (current->getGCell()->isAnalog()) { _initiateUpdateIntervals( current ); } else { @@ -1676,28 +2000,43 @@ namespace Anabatic { isfirst = false; } + //cdebug_log(112,0) << "[Start WHILE]" << endl; + Edge* from = NULL; while ( current ) { cdebug_log(112,0) << "+ " << current << endl; - if (current->getFrom()) cdebug_log(112,0) << "| From:" << current->getFrom()->getOpposite(current->getGCell()) << endl; + //if (current->getFrom()) cdebug_log(112,0) << "| From:" << current->getFrom()->getOpposite(current->getGCell()) << endl; if (current->getGCell()->isAnalog()) { - if (current->getFrom2()) cdebug_log(112,0) << "| From2:" << current->getFrom2()->getOpposite(current->getGCell()) << endl; + //if (current->getFrom2()) cdebug_log(112,0) << "| From2:" << current->getFrom2()->getOpposite(current->getGCell()) << endl; if (_updateIntervals( isfirst, current, useFrom2, branchId, from )) break; Vertex* next = NULL; next = current->getPredecessor(); + if (current == next){ + cdebug_log(112,0) << "[ERROR]: Current's predecessor is current." << endl; + break; + } + if (current->isFromFrom2()) { - cdebug_log(112,0) << "| isFromFrom2:true (" << current << ")" << endl; + //cdebug_log(112,0) << "| isFromFrom2:true (" << current << ")" << endl; useFrom2 = true; current->unsetFlags( Vertex::UseFromFrom2 ); } else { - cdebug_log(112,0) << "| isFromFrom2:false" << endl; + //cdebug_log(112,0) << "| isFromFrom2:false" << endl; useFrom2 = false; } - cdebug_log(112,0) << "| Next: " << next << endl; + //cdebug_log(112,0) << "| Next: " << next << endl; current = next; + //>>>>>>> 987289653831df12933bd4490d9559415e61f220 + /*} else { + cdebug_log(112,0) << "ISNOT FROMFROM2" << endl; + useFrom2 = false; + } + cdebug_log(112,0) << "next: " << next << endl; + current = next;*/ + //////////////////////////////////////////////////////////////////////////////////////////// } else { current->incDegree(); if (current->getConnexId() == _connectedsId) break; @@ -1724,7 +2063,8 @@ namespace Anabatic { if (_sources.size() < 2) { cdebug_tabw(112,-1); return; } NetRoutingState* state = NetRoutingExtension::get( _net ); - + //cerr << "state: " << state << endl; + for ( Vertex* startVertex : _sources ) { if (not startVertex->getFrom()) continue; @@ -1801,6 +2141,7 @@ namespace Anabatic { //DbU::Unit width = Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL2")); //DbU::fromLambda(2.0); DbU::Unit width = Session::getGHorizontalPitch(); //DbU::fromLambda(2.0); + if (state) width *= state->getWPitch(); segment = Horizontal::create( sourceContact @@ -1819,8 +2160,8 @@ namespace Anabatic { //DbU::Unit width = Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL3")); //DbU::fromLambda(2.0); DbU::Unit width = Session::getGVerticalPitch(); //DbU::fromLambda(2.0); - if (state) width *= state->getWPitch(); + if (state) width *= state->getWPitch(); segment = Vertical::create( sourceContact , targetContact , _anabatic->getConfiguration()->getGVerticalLayer() @@ -1893,7 +2234,7 @@ namespace Anabatic { void Dijkstra::_toSources ( Vertex* source, int connexId ) { cdebug_log(112,1) << "Dijkstra::_toSources() " << endl; - //cdebug_log(112,0) << "* from: " << source << endl; + cdebug_log(112,0) << "* from: " << source << endl; source->setConnexId( connexId ); source->setDistance( 0.0 ); @@ -1904,20 +2245,23 @@ namespace Anabatic { VertexSet stack; stack.insert( source ); + + cdebug_log(112,0) << "in WHILE" << endl; while ( not stack.empty() ) { source = *stack.begin(); stack.erase( source ); - //cdebug_log(112,0) << "| source:" << source << " stack.size():" << stack.size() << endl; + cdebug_log(112,0) << "| source:" << source << " stack.size():" << stack.size() << endl; for ( Edge* edge : source->getGCell()->getEdges() ) { if (not edge->hasNet(_net)) { - //cdebug_log(112,0) << " Not connected:" << edge - // << " to:" << edge->getOpposite(source->getGCell()) << endl; + cdebug_log(112,0) << " Not connected:" << edge + << " to:" << edge->getOpposite(source->getGCell()) << endl; continue; } GCell* gneighbor = edge->getOpposite(source->getGCell()); + cdebug_log(112,0) << "GCell: " << gneighbor<< endl; Vertex* vneighbor = gneighbor->getObserver(GCell::Observable::Vertex); if (not vneighbor->hasValidStamp()) continue; @@ -1933,6 +2277,7 @@ namespace Anabatic { } } + cdebug_log(112,0) << "Dijkstra::_toSources() END" << endl; cdebug_tabw(112,-1); } @@ -1988,7 +2333,9 @@ namespace Anabatic { void Dijkstra::_createSelfSymSeg ( Segment* segment ) { + cdebug_log(112,0) << "void Dijkstra::_createSelfSymSeg ( Segment* segment ): " << _net << ", seg: " << segment << endl; NetRoutingState* state = NetRoutingExtension::get( _net ); + //cdebug_log(112,0) << "state: " << state << endl; if ((state != NULL)&&(segment!=NULL)){ Horizontal* h = dynamic_cast(segment); Vertical* v = dynamic_cast(segment); @@ -1998,10 +2345,12 @@ namespace Anabatic { Component* targetContact = segment->getTarget(); if (h){ if (state->isSymHorizontal()){ + cdebug_log(112,0) << "H case Horizontal" << endl; sp = Point(sourceContact->getX(), state->getSymValue(sourceContact->getY()) ); tp = Point(targetContact->getX(), state->getSymValue(targetContact->getY()) ); axis = state->getSymValue(segment->getY()); } else if (state->isSymVertical()){ + cdebug_log(112,0) << "H case Vertical" << endl; sp = Point( state->getSymValue(targetContact->getX()), targetContact->getY() ); tp = Point( state->getSymValue(sourceContact->getX()), sourceContact->getY() ); axis = segment->getY(); @@ -2009,8 +2358,12 @@ namespace Anabatic { cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong here. " << endl; return; } + //cerr << "sp: " << sp << endl; + //cerr << "tp: " << tp << endl; GCell* sgcell = _anabatic->getGCellUnder( sp ); GCell* tgcell = _anabatic->getGCellUnder( tp ); + //cerr << "Gcell: " << sgcell << endl; + //cerr << "Gcell: " << tgcell << endl; Vertex* svertex = sgcell->getObserver(GCell::Observable::Vertex); Vertex* tvertex = tgcell->getObserver(GCell::Observable::Vertex); Contact* sourceSym = NULL; @@ -2034,15 +2387,17 @@ namespace Anabatic { , targetSym , _anabatic->getConfiguration()->getGHorizontalLayer() , axis - , state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL2")) + , state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("metal2")) ); cdebug_log(112,0) << "|| " << segment2 << endl; } else if (v) { if (state->isSymVertical()){ + //cerr << "V case Vertical" << endl; sp = Point(state->getSymValue(sourceContact->getX()), sourceContact->getY() ); tp = Point(state->getSymValue(targetContact->getX()), targetContact->getY() ); axis = state->getSymValue(segment->getX()); } else if (state->isSymHorizontal()){ + //cerr << "V case Horizontal" << endl; sp = Point( targetContact->getX(), state->getSymValue(targetContact->getY()) ); tp = Point( sourceContact->getX(), state->getSymValue(sourceContact->getY()) ); axis = segment->getX(); @@ -2073,7 +2428,7 @@ namespace Anabatic { , targetSym , _anabatic->getConfiguration()->getGVerticalLayer() , axis - , state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL3")) + , state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("metal3")) ); cdebug_log(112,0) << "|| " << segment2 << endl; } @@ -2085,7 +2440,7 @@ namespace Anabatic { { if (current->getFrom2()){ if (edge == current->getFrom2()) { - //cdebug_log(111,0) << "edge == current->getFrom2()" << endl; + cdebug_log(111,0) << "edge == current->getFrom2()" << endl; return true; } else { //cdebug_log(111,0) << "edge != current->getFrom2(): " << current->getFrom2() << endl; @@ -2132,7 +2487,6 @@ namespace Anabatic { if (calcDistance(pcurr,pnext) > calcDistance(pcurr2,pnext)) { cdebug_log(111,0) << "* Distance 2 is shorter" << endl; - isDistance2shorter = true; distance = distance2; } else { @@ -2165,7 +2519,6 @@ namespace Anabatic { cdebug_log(111,0) << "setFrom2: " << vneighbor << endl; vneighbor->setFrom2 ( edge ); vneighbor->setFlags(Vertex::From2Mode); - //vneighbor->createIntervFrom2(); vneighbor->setIntervals( current ); vneighbor->unsetFlags(Vertex::From2Mode); if (isDistance2shorter) { @@ -2188,67 +2541,86 @@ namespace Anabatic { vneighbor->clearFrom2(); if (isDistance2shorter) { vneighbor->setFlags(Vertex::UseFromFrom2); - //cdebug_log(111,0) << "setFromFrom2: " << vneighbor << endl; - }// else cdebug_log(111,0) << "setFrom1: " << vneighbor << endl; + cdebug_log(111,0) << "setFlags(Vertex::UseFromFrom2): " << vneighbor << endl; + } else { + vneighbor->unsetFlags(Vertex::UseFromFrom2); + cdebug_log(111,0) << "unsetFlags(Vertex::UseFromFrom2): " << vneighbor << endl; + } + // else cdebug_log(111,0) << "setFrom1: " << vneighbor << endl; vneighbor->setIntervals( current ); vneighbor->getIntervFrom().print(); } + void Dijkstra::_initiateUpdateIntervals ( Vertex* current ) { - GCell* gcurr = current->getGCell(); - GCell* gprev = current->getFrom()->getOpposite(gcurr); - Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); - Point pcurrent = vprev->getStartPathPoint(current); - Point pentry = vprev->getNextPathPoint( pcurrent, current ); - cdebug_log(112,0) << "current : " << gcurr << endl; - cdebug_log(112,0) << "previous: " << gprev << endl; - cdebug_log(112,0) << "pcurr : x: " << DbU::getValueString(pcurrent.getX()) << ", y: " << DbU::getValueString(pcurrent.getY()) << endl; - cdebug_log(112,0) << "pentry: x: " << DbU::getValueString(pentry.getX()) << ", y: " << DbU::getValueString(pentry.getY()) << endl; + if (!current->getGCell()->isMatrix()){ + GCell* gcurr = current->getGCell(); + GCell* gprev = current->getFrom()->getOpposite(gcurr); + Vertex* vprev = gprev->getObserver(GCell::Observable::Vertex); + Point pcurrent = vprev->getStartPathPoint(current); + Point pentry = vprev->getNextPathPoint( pcurrent, current ); + //cdebug_log(112,0) << "current : " << gcurr << endl; + //cdebug_log(112,0) << "previous: " << gprev << endl; + //cdebug_log(112,0) << "pcurr : x: " << DbU::getValueString(pcurrent.getX()) << ", y: " << DbU::getValueString(pcurrent.getY()) << endl; + //cdebug_log(112,0) << "pentry: x: " << DbU::getValueString(pentry.getX()) << ", y: " << DbU::getValueString(pentry.getY()) << endl; - cdebug_log(112,0) << "| " << current << " | " << endl; - if (current->isH()){ - if (pentry.getX() < current->getIMin()){ - current->setInterv(pentry.getX(), current->getIMax(), current->getIAxis()); - cdebug_log(112,0) << "[Interval update1]: min : " << DbU::getValueString(pentry.getX()); - cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getIMax()); - cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; - } else if (pentry.getX() > current->getIMax()){ - current->setInterv(current->getIMin(), pentry.getX(), current->getIAxis()); - cdebug_log(112,0) << "[Interval update2]: min : " << DbU::getValueString(current->getIMin()); - cdebug_log(112,0) << ", max : " << DbU::getValueString(pentry.getX()); - cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; - } - } else if (current->isV()){ - if (pentry.getY() < current->getIMin()){ - current->setInterv(pentry.getY(), current->getIMax(), current->getIAxis()); - cdebug_log(112,0) << "[Interval update3]: min : " << DbU::getValueString(pentry.getY()); - cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getIMax()); - cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; - } else if (pentry.getY() > current->getIMax()){ - current->setInterv(current->getIMin(), pentry.getY(), current->getIAxis()); - cdebug_log(112,0) << "[Interval update4]: min : " << DbU::getValueString(current->getIMin()); - cdebug_log(112,0) << ", max : " << DbU::getValueString(pentry.getY()); - cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; - } - } - cdebug_log(112,0) << "isiSet: " << current->isiSet() << endl; + //cdebug_log(112,0) << "| " << current << " | " << endl; + if (current->isH()){ + if (pentry.getX() < current->getIMin()){ + current->setInterv(pentry.getX(), current->getIMax(), current->getIAxis()); + cdebug_log(112,0) << "[Interval update1]: min : " << DbU::getValueString(pentry.getX()); + cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getIMax()); + cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; + } else if (pentry.getX() > current->getIMax()){ + current->setInterv(current->getIMin(), pentry.getX(), current->getIAxis()); + cdebug_log(112,0) << "[Interval update2]: min : " << DbU::getValueString(current->getIMin()); + cdebug_log(112,0) << ", max : " << DbU::getValueString(pentry.getX()); + cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; + } + } else if (current->isV()){ + if (pentry.getY() < current->getIMin()){ + current->setInterv(pentry.getY(), current->getIMax(), current->getIAxis()); + cdebug_log(112,0) << "[Interval update3]: min : " << DbU::getValueString(pentry.getY()); + cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getIMax()); + cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; + } else if (pentry.getY() > current->getIMax()){ + current->setInterv(current->getIMin(), pentry.getY(), current->getIAxis()); + cdebug_log(112,0) << "[Interval update4]: min : " << DbU::getValueString(current->getIMin()); + cdebug_log(112,0) << ", max : " << DbU::getValueString(pentry.getY()); + cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getIAxis()) << endl; + } + } + //cdebug_log(112,0) << "isiSet: " << current->isiSet() << endl; + } } bool Dijkstra::_updateIntervals( bool& isfirst, Vertex* current, bool& useFrom2, int& branchId, Edge* from ) { if (!isfirst){ - cdebug_log(112,0) << "Is not first" << endl; + //cdebug_log(112,0) << "Is not first" << endl; current->incDegree(); - if (current->getConnexId() == _connectedsId) return true; + if (current->getConnexId() == _connectedsId){ + cdebug_log(112,0) << "| (current->getConnexId() == _connectedsId)" << endl; + return true; + } from = NULL; if (useFrom2) { - cdebug_log(112,0) << "USE FROM2: " << current->getFrom2()->getOpposite(current->getGCell()) << endl; - current->setFrom(current->getFrom2()); - current->setIntervfrom(current->getPIMin2(), current->getPIMax2(), current->getPIAxis2()); - current->clearFrom2(); + if (current->getFrom2()) { + //cdebug_log(112,0) << "| USE FROM2: " << endl; + //cdebug_log(112,0) << "| current->getFrom2(): " << current->getFrom2() << endl; + //cdebug_log(112,0) << "| current->getGCell(): " << current->getGCell() << endl; + //cdebug_log(112,0) << "| getOpposite(): " << current->getFrom2()->getOpposite(current->getGCell()) << endl; + + current->setFrom(current->getFrom2()); + current->setIntervfrom(current->getPIMin2(), current->getPIMax2(), current->getPIAxis2()); + current->clearFrom2(); + } else { + cdebug_log(112,0) << "[Warning]: Current has no getfrom2 anymore. " << endl; + + } } from = current->getFrom(); if (not from) return true; @@ -2258,15 +2630,18 @@ namespace Anabatic { current->setBranchId( branchId ); _sources.insert( current ); _queue.push( current ); - } else isfirst = false; + } else { + //cdebug_log(112,0) << "Is first" << endl; + isfirst = false; + } - if (current->getPredecessor() != NULL){ - cdebug_log(112,0) << "Predecessor() : " << current->getPredecessor() << endl; - cdebug_log(112,0) << "[Interval update]: min : " << DbU::getValueString(current->getPIMin()); - cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getPIMax()); - cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getPIAxis()) << endl; + if ((current->getPredecessor() != NULL)&&(!current->getGCell()->isMatrix())){ + //cdebug_log(112,0) << "Predecessor() : " << current->getPredecessor() << endl; + //cdebug_log(112,0) << "| [Interval update]: min : " << DbU::getValueString(current->getPIMin()); + //cdebug_log(112,0) << ", max : " << DbU::getValueString(current->getPIMax()); + //cdebug_log(112,0) << ", axis: " << DbU::getValueString(current->getPIAxis()) << endl; current->getPredecessor()->setInterv(current->getPIMin(), current->getPIMax(), current->getPIAxis()); - current->getIntervFrom().print(); + //current->getIntervFrom().print(); //if (current->getPredecessor()->getGCell()->isStrut()) _updateRealOccupancy( current ); } return false; @@ -2326,16 +2701,34 @@ namespace Anabatic { void Dijkstra::_setSourcesGRAData( Vertex* seed, RoutingPad* rp ) { + cdebug_log(112,0) << "void Dijkstra::_setSourcesGRAData() : " << seed << endl; + GCell* gseed = seed->getGCell(); Horizontal* h = dynamic_cast(rp->_getEntityAsSegment()); Vertical* v = dynamic_cast (rp->_getEntityAsSegment()); - seed->createAData(); if (h) { + cdebug_log(112,0) << "case H " << endl; + seed->unsetFlags(Vertex::iHorizontal); + seed->unsetFlags(Vertex::iVertical); seed->setFlags(Vertex::iHorizontal); - seed->setInterv(rp->getBoundingBox().getXMin(), rp->getBoundingBox().getXMax(), rp->getBoundingBox().getYCenter()); - } - if (v) { + if (!gseed->isMatrix()){ + seed->createAData(); + seed->setInterv( max(rp->getBoundingBox().getXMin(), gseed->getXMin()) + , min(rp->getBoundingBox().getXMax(), gseed->getXMax()) + , rp->getBoundingBox().getYCenter() + ); + } + } else if (v) { + cdebug_log(112,0) << "case V " << endl; + seed->unsetFlags(Vertex::iHorizontal); + seed->unsetFlags(Vertex::iVertical); seed->setFlags(Vertex::iVertical); - seed->setInterv(rp->getBoundingBox().getYMin(), rp->getBoundingBox().getYMax(), rp->getBoundingBox().getXCenter()); + if (!gseed->isMatrix()) { + seed->createAData(); + seed->setInterv( max(rp->getBoundingBox().getYMin(), gseed->getYMin()) + , min(rp->getBoundingBox().getYMax(), gseed->getYMax()) + , rp->getBoundingBox().getXCenter() + ); + } } } diff --git a/anabatic/src/Edges.cpp b/anabatic/src/Edges.cpp index d49c39e8..52735d71 100644 --- a/anabatic/src/Edges.cpp +++ b/anabatic/src/Edges.cpp @@ -74,7 +74,7 @@ namespace Anabatic { if (_stateFlags.contains(Flags::EastSide)) { if ( (_iedge < _gcell->getEastEdges().size()) and _filterFlags.contains(Flags::EastSide)) break; - // cdebug_log(110,0) << "Switching to North side." << endl; + //cdebug_log(110,0) << "Switching to North side." << endl; _stateFlags = Flags::NorthSide; _iedge = 0; // cdebug_log(110,0) << this << endl; @@ -83,7 +83,7 @@ namespace Anabatic { if (_stateFlags.contains(Flags::NorthSide)) { if ( (_iedge < _gcell->getNorthEdges().size()) and _filterFlags.contains(Flags::NorthSide)) break; - // cdebug_log(110,0) << "Switching to West side." << endl; + //cdebug_log(110,0) << "Switching to West side." << endl; _stateFlags = Flags::WestSide; _iedge = 0; // cdebug_log(110,0) << this << endl; @@ -92,7 +92,7 @@ namespace Anabatic { if (_stateFlags.contains(Flags::WestSide)) { if ( (_iedge < _gcell->getWestEdges().size()) and _filterFlags.contains(Flags::WestSide)) break; - // cdebug_log(110,0) << "Switching to South side." << endl; + //cdebug_log(110,0) << "Switching to South side." << endl; _stateFlags = Flags::SouthSide; _iedge = 0; continue; @@ -100,7 +100,7 @@ namespace Anabatic { if (_stateFlags.contains(Flags::SouthSide)) { if ( (_iedge < _gcell->getSouthEdges().size()) and _filterFlags.contains(Flags::SouthSide)) break; - // cdebug_log(110,0) << "All edges done." << endl; + //cdebug_log(110,0) << "All edges done." << endl; _stateFlags = 0; _iedge = 0; break;; diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index 06b10326..e166afb9 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -505,6 +505,34 @@ namespace Anabatic { } + GCell* GCell::getEastNMatrix() const + { + if (!this->getEast()->isMatrix()) return this->getEast(); + else { + GCell* gcell = this->getEast(); + while(gcell->getEast()){ + if (!gcell->getEast()->isMatrix()) break; + else gcell = gcell->getEast(); + } + return gcell->getEast(); + } + } + + + GCell* GCell::getNorthNMatrix() const + { + if (!this->getNorth()->isMatrix()) return this->getNorth(); + else { + GCell* gcell = this->getNorth(); + while(gcell->getNorth()){ + if (!gcell->getNorth()->isMatrix()) break; + else gcell = gcell->getNorth(); + } + return gcell->getNorth(); + } + } + + GCell* GCell::getWest ( DbU::Unit y ) const { for ( Edge* edge : _westEdges ) { @@ -718,7 +746,8 @@ namespace Anabatic { bool GCell::doGrid () { - getAnabatic()->openSession(); + bool openSession = Session::isOpen(); + if (not openSession) getAnabatic()->openSession(); DbU::Unit side = Session::getSliceHeight(); Interval hspan = getSide( Flags::Horizontal ); @@ -776,7 +805,7 @@ namespace Anabatic { // } //} - Session::close(); + if (not openSession) Session::close(); return true; } @@ -921,7 +950,7 @@ namespace Anabatic { vertical->setX( position.getX() ); } } - + if (not contact->getAnchor()) contact->setPosition( position ); } @@ -1702,6 +1731,12 @@ namespace Anabatic { string s = Super::_getString(); s.insert( s.size()-1, " "+getString(getBoundingBox()) ); s.insert( s.size()-1, " "+getString(_flags) ); + /* string s = "isDevice ()) targetContact = _doDevice (); else if (_gcell->isHChannel()) targetContact = _doHChannel(); else if (_gcell->isVChannel()) targetContact = _doVChannel(); + else if (_gcell->isHRail ()) targetContact = _doHRail(); + else if (_gcell->isVRail ()) targetContact = _doVRail(); else if (_gcell->isStrut ()) targetContact = _doStrut (); else if (_gcell->isIoPad ()) _doIoPad(); else @@ -2971,6 +2975,100 @@ namespace { return targetContact; } + + AutoContact* GCellTopology::_doHRail () + { + cdebug_log(145,1) << "void GCellTopology::_doHRail ()" << _gcell << endl; + cdebug_log(145,0) << "FromHook: " << _fromHook << endl; + cdebug_log(145,0) << "North : " << north() << endl; + cdebug_log(145,0) << "East : " << east() << endl; + cdebug_log(145,0) << "South : " << south() << endl; + cdebug_log(145,0) << "West : " << west() << endl; + cdebug_log(145,0) << "_routingPads.size(): " << _routingPads.size() << endl; + + RoutingPad* rpNE = NULL; + RoutingPad* rpSW = NULL; + _southWestContact = NULL; + if (_routingPads.size() == 1){ + rpNE = rpSW = _routingPads[0]; + } else { + cdebug_log(145,0) << "Case _routingPads.size() != 1 "<< endl; + throw Error( "GCellTopology::_doHRail() Unexpected case.\n" + " On: %s." + , getString(_gcell).c_str() ); + } + cdebug_log(145,0) << "rp: " << _routingPads[0] << endl; + AutoContact* ac = doRp_AccessAnalog( _gcell, rpNE, NoFlags ); + if (east()) { + cdebug_log(145,0) << "East" << endl; + push( east(), ac, SouthWest ); + } + if (west()) { + cdebug_log(145,0) << "West" << endl; + push( west(), ac, SouthWest ); + } + if (south()) { + cdebug_log(145,0) << "South" << endl; + push( south(), ac, SouthWest ); + } + if (north()){ + cdebug_log(145,0) << "North" << endl; + push( north(), ac, SouthWest ); + } + + cdebug_log(145,0) << "doHRail done" << endl; + cdebug_tabw(145,-1); + + return _southWestContact; + } + + + AutoContact* GCellTopology::_doVRail () + { + cdebug_log(145,1) << "void GCellTopology::_doVRail ()" << _gcell << endl; + cdebug_log(145,0) << "FromHook: " << _fromHook << endl; + cdebug_log(145,0) << "North : " << north() << endl; + cdebug_log(145,0) << "East : " << east() << endl; + cdebug_log(145,0) << "South : " << south() << endl; + cdebug_log(145,0) << "West : " << west() << endl; + cdebug_log(145,0) << "_routingPads.size(): " << _routingPads.size() << endl; + + RoutingPad* rpNE = NULL; + RoutingPad* rpSW = NULL; + _southWestContact = NULL; + if (_routingPads.size() == 1){ + rpNE = rpSW = _routingPads[0]; + } else { + cdebug_log(145,0) << "Case _routingPads.size() != 1 "<< endl; + throw Error( "GCellTopology::_doVRail() Unexpected case.\n" + " On: %s." + , getString(_gcell).c_str() ); + } + cdebug_log(145,0) << "rp: " << _routingPads[0] << endl; + AutoContact* ac = doRp_AccessAnalog( _gcell, rpNE, NoFlags ); + if (east()) { + cdebug_log(145,0) << "East" << endl; + push( east(), ac, SouthWest ); + } + if (west()) { + cdebug_log(145,0) << "West" << endl; + push( west(), ac, SouthWest ); + } + if (south()) { + cdebug_log(145,0) << "South" << endl; + push( south(), ac, SouthWest ); + } + if (north()){ + cdebug_log(145,0) << "North" << endl; + push( north(), ac, SouthWest ); + } + + cdebug_log(145,0) << "doVRail done" << endl; + cdebug_tabw(145,-1); + + return _southWestContact; + } + unsigned int GCellTopology::getNumberGlobals () { @@ -3438,7 +3536,7 @@ namespace Anabatic { _loadNetGlobalRouting( net ); Session::revalidate(); DebugSession::close(); - } + } } AutoSegment::setAnalogMode( false ); @@ -3500,7 +3598,8 @@ namespace Anabatic { forEach ( RoutingPad*, startRp, routingPads ) { bool segmentFound = false; - cdebug_log(145,0) << "startRp: " << startRp << endl; + cdebug_log(145,0) << "startRp : " << startRp << endl; + cdebug_log(145,0) << "startHook: " << startHook << endl; forEach ( Hook*, ihook, startRp->getBodyHook()->getHooks() ) { cdebug_log(145,0) << "Component " << ihook->getComponent() << endl; Segment* segment = dynamic_cast( ihook->getComponent() ); diff --git a/anabatic/src/anabatic/Constants.h b/anabatic/src/anabatic/Constants.h index 9f41b030..bc7e245b 100644 --- a/anabatic/src/anabatic/Constants.h +++ b/anabatic/src/anabatic/Constants.h @@ -41,6 +41,8 @@ namespace Anabatic { static const BaseFlags Saturated ; // = (1 << 11); static const BaseFlags StdCellRow ; // = (1 << 12); static const BaseFlags ChannelRow ; // = (1 << 13); + static const BaseFlags HRailGCell ; // = (1 << 14); + static const BaseFlags VRailGCell ; // = (1 << 15); // Flags for Edge objects states only. static const BaseFlags IllimitedCapacity ; // = (1 << 5); // Flags for Anabatic objects states only. @@ -60,9 +62,9 @@ namespace Anabatic { static const BaseFlags EndsMask ; // = Source|Target; static const BaseFlags DirectionMask ; // = Horizontal|Vertical; static const BaseFlags DestroyMask ; // = DestroyGCell|DestroyBaseContact|DestroyBaseSegment; - static const BaseFlags GCellTypeMask ; // = DeviceGCell|HChannelGCell|VChannelGCell|StrutGCell|MatrixGCell|IoPadGCell; + static const BaseFlags GCellTypeMask ; // = DeviceGCell|HChannelGCell|VChannelGCell|StrutGCell|MatrixGCell|IoPadGCell|HRailGCell|VRailGCell; static const BaseFlags RowGCellMask ; // = StdCellRow|ChannelRow; - static const BaseFlags AnalogGCellMask ; // = DeviceGCell|HChannelGCell|VChannelGCell|StrutGCell; + static const BaseFlags AnalogGCellMask ; // = DeviceGCell|HChannelGCell|VChannelGCell|StrutGCell|HRailGCell|VRailGCell; // Flags for functions arguments only. static const BaseFlags Create ; // = (1 << 5); static const BaseFlags WithPerpands ; diff --git a/anabatic/src/anabatic/Dijkstra.h b/anabatic/src/anabatic/Dijkstra.h index b7b83a7a..4cc3fd6e 100644 --- a/anabatic/src/anabatic/Dijkstra.h +++ b/anabatic/src/anabatic/Dijkstra.h @@ -44,16 +44,17 @@ namespace Anabatic { class IntervalC { public: - enum iFlag { None = 0 - , iHorizontal = (1<<0) - , iVertical = (1<<1) - , iSet = (1<<2) + enum iFlag { None = 0 + , iFHorizontal = (1<<0) + , iFVertical = (1<<1) + , iSet = (1<<2) }; public: IntervalC(); IntervalC(const IntervalC&); IntervalC(IntervalC&); + IntervalC( DbU::Unit, DbU::Unit, DbU::Unit ); ~IntervalC(); void set ( DbU::Unit, DbU::Unit, DbU::Unit ); void setRange ( DbU::Unit, DbU::Unit ); @@ -83,8 +84,8 @@ namespace Anabatic { DbU::Unit _axis; }; - inline void IntervalC::setAsH () { _flags = ((_flags & ~(0x3)) | iHorizontal); } - inline void IntervalC::setAsV () { _flags = ((_flags & ~(0x3)) | iVertical ); } + inline void IntervalC::setAsH () { _flags = ((_flags & ~(0x3)) | iFHorizontal); } + inline void IntervalC::setAsV () { _flags = ((_flags & ~(0x3)) | iFVertical ); } inline void IntervalC::setAxis ( DbU::Unit axis ) { _axis = axis; } inline DbU::Unit IntervalC::getAxis () const { return _axis; } inline DbU::Unit IntervalC::getCenter() const { return getMin()+getMax(); } @@ -92,8 +93,8 @@ namespace Anabatic { inline DbU::Unit IntervalC::getMax () const { return _max; } inline void IntervalC::setiSet () { _flags |= iSet; } inline bool IntervalC::isiSet () const { return _flags & iSet; } - inline bool IntervalC::isH () const { return _flags & iHorizontal; } - inline bool IntervalC::isV () const { return _flags & iVertical ; } + inline bool IntervalC::isH () const { return _flags & iFHorizontal; } + inline bool IntervalC::isV () const { return _flags & iFVertical ; } inline void IntervalC::setFlags ( Flags flags ) { _flags = flags; } inline Flags IntervalC::getFlags () const { return _flags; } @@ -213,7 +214,7 @@ namespace Anabatic { inline int getConnexId () const; inline int getDegree () const; inline int getRpCount () const; - inline Edge* getFrom () const; + Edge* getFrom () const; inline Vertex* getPredecessor () const; inline void setDistance ( DbU::Unit ); inline void setStamp ( int ); @@ -239,8 +240,8 @@ namespace Anabatic { inline bool isWRestricted () const; inline bool hasRestrictions() const; - inline void setRestricted (); - inline void clearRestriction (); + void setRestricted (); + void clearRestriction (); inline void setNRestricted (); inline void setSRestricted (); inline void setERestricted (); @@ -266,7 +267,7 @@ namespace Anabatic { Point getNextPathPoint ( Point, const Vertex* ) const; //////////////////////////////////////// GRDATA void setIntervals ( Vertex* ); - + inline bool hasAData () const; bool isiSet () const; DbU::Unit getIAxis () const; DbU::Unit getIMax () const; @@ -281,7 +282,6 @@ namespace Anabatic { void clearFrom2 (); Edge* getFrom2 () const; void setFrom2 ( Edge* ); - void createIntervFrom2 (); DbU::Unit getPIMax2 () const; DbU::Unit getPIMin2 () const; DbU::Unit getPIAxis2 () const; @@ -346,7 +346,7 @@ namespace Anabatic { inline int Vertex::getBranchId () const { return hasValidStamp() ? _branchId : 0; } inline int Vertex::getDegree () const { return hasValidStamp() ? _degree : 0; } inline int Vertex::getRpCount () const { return hasValidStamp() ? _rpCount : 0; } - inline Edge* Vertex::getFrom () const { return _from; } +//inline Edge* Vertex::getFrom () const { return _from; } inline void Vertex::setDistance ( DbU::Unit distance ) { _distance=distance; } inline void Vertex::setFrom ( Edge* from ) { _from=from; } inline void Vertex::setStamp ( int stamp ) { _stamp=stamp; } @@ -377,8 +377,9 @@ namespace Anabatic { inline bool Vertex::isWRestricted () const { return (_flags & WRestricted); } inline bool Vertex::hasRestrictions () const { return ( isNRestricted()||isSRestricted()||isERestricted()||isWRestricted()) ; } - inline void Vertex::setRestricted () { _flags |= 0xF; } - inline void Vertex::clearRestriction () { _flags &= ~(0xF); } + inline bool Vertex::hasAData () const { return (_adata !=NULL)? true : false; } +//inline void Vertex::setRestricted () { _flags |= 0xF; } +//inline void Vertex::clearRestriction () { _flags &= ~(0xF); } inline void Vertex::setNRestricted () { _flags |= NRestricted; } inline void Vertex::setSRestricted () { _flags |= SRestricted; } inline void Vertex::setERestricted () { _flags |= ERestricted; } @@ -522,7 +523,7 @@ namespace Anabatic { void setAxisTargets (); void unsetAxisTargets (); - bool _attachSymContactsHook ( RoutingPad* ); + bool _attachSymContactsHook ( RoutingPad* ); void _limitSymSearchArea ( RoutingPad* rp ); void _setSourcesGRAData ( Vertex*, RoutingPad*); bool _checkFrom2 ( Edge*, Vertex* ); diff --git a/anabatic/src/anabatic/GCell.h b/anabatic/src/anabatic/GCell.h index 9b4b6dcf..56000b4d 100644 --- a/anabatic/src/anabatic/GCell.h +++ b/anabatic/src/anabatic/GCell.h @@ -143,6 +143,8 @@ namespace Anabatic { inline bool isMatrix () const; inline bool isRow () const; inline bool isIoPad () const; + inline bool isHRail () const; + inline bool isVRail () const; inline bool isStdCellRow () const; inline bool isChannelRow () const; bool isWest ( GCell* ) const; @@ -176,6 +178,9 @@ namespace Anabatic { inline GCell* getSouth () const; inline GCell* getNorth () const; + GCell* getEastNMatrix () const; + GCell* getNorthNMatrix () const; + inline Edge* getWestEdge () const; inline Edge* getEastEdge () const; inline Edge* getSouthEdge () const; @@ -323,6 +328,8 @@ namespace Anabatic { inline bool GCell::isMatrix () const { return _flags & Flags::MatrixGCell; } inline bool GCell::isRow () const { return _flags & Flags::RowGCellMask; } inline bool GCell::isIoPad () const { return _flags & Flags::IoPadGCell; } + inline bool GCell::isHRail () const { return _flags & Flags::HRailGCell; } + inline bool GCell::isVRail () const { return _flags & Flags::VRailGCell; } inline bool GCell::isStdCellRow () const { return _flags & Flags::StdCellRow; } inline bool GCell::isChannelRow () const { return _flags & Flags::ChannelRow; } inline bool GCell::isSaturated () const { return _flags & Flags::Saturated; } diff --git a/crlcore/etc/common/display.conf b/crlcore/etc/common/display.conf index 2f319819..990eec9b 100644 --- a/crlcore/etc/common/display.conf +++ b/crlcore/etc/common/display.conf @@ -85,7 +85,7 @@ stylesTable = \ , (Drawing, 'gmetalv' , { 'color':'200,200,255', 'pattern':'light_antihash1.8', 'border':1 }) , (Drawing, 'gcut' , { 'color':'255,255,190', 'border':1 }) , (Drawing, 'Anabatic::Edge' , { 'color':'255,255,190', 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':4 }) - , (Drawing, 'Anabatic::GCell', { 'color':'255,0,0' , 'pattern':'0000000000000000', 'threshold':0.10*scale, 'border':4 }) + , (Drawing, 'Anabatic::GCell', { 'color':'255,0,0' , 'pattern':'0000000000000000', 'threshold':0.02*scale, 'border':4 }) ) # ---------------------------------------------------------------------- diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index 3745b708..38f17f33 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -833,7 +833,7 @@ void Cell::flattenNets ( const Instance* instance, uint64_t flags ) vector hyperNets; vector topHyperNets; - for ( Occurrence occurrence : getHyperNetRootNetOccurrences().getSubSet(NotFilter(Occurrence_Contains(instance))) ) { + for ( Occurrence occurrence : getHyperNetRootNetOccurrences().getSubSet(Occurrence_Contains(instance)) ) { Net* net = static_cast(occurrence.getEntity()); if (net->isClock() and (flags & Flags::NoClockFlatten)) continue; diff --git a/hurricane/src/isobar/PyLayer.cpp b/hurricane/src/isobar/PyLayer.cpp index 12eaf84d..b4fec151 100644 --- a/hurricane/src/isobar/PyLayer.cpp +++ b/hurricane/src/isobar/PyLayer.cpp @@ -394,6 +394,20 @@ extern "C" { } + extern Layer* PYDERIVEDLAYER_O ( PyObject* pyObject ) + { + Layer* layer = NULL; + if (IsPyLayer(pyObject)) layer = PYLAYER_O(pyObject); + if (not layer and IsPyBasicLayer(pyObject) ) layer = PYBASICLAYER_O(pyObject); + if (not layer and IsPyContactLayer(pyObject) ) layer = PYCONTACTLAYER_O(pyObject); + if (not layer and IsPyViaLayer(pyObject) ) layer = PYVIALAYER_O(pyObject); + if (not layer and IsPyDiffusionLayer(pyObject) ) layer = PYDIFFUSIONLAYER_O(pyObject); + if (not layer and IsPyRegularLayer(pyObject) ) layer = PYREGULARLAYER_O(pyObject); + if (not layer and IsPyTransistorLayer(pyObject)) layer = PYTRANSISTORLAYER_O(pyObject); + return layer; + } + + #endif // End of Shared Library Code Part. } // extern "C". diff --git a/hurricane/src/isobar/hurricane/isobar/PyLayer.h b/hurricane/src/isobar/hurricane/isobar/PyLayer.h index 5698c870..e8982482 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyLayer.h +++ b/hurricane/src/isobar/hurricane/isobar/PyLayer.h @@ -46,6 +46,7 @@ extern "C" { extern PyObject* PyLayer_LinkDerived ( Hurricane::Layer* object ); extern void PyLayer_LinkPyType (); extern void PyLayer_postModuleInit (); + extern Layer* PYDERIVEDLAYER_O ( PyObject* ); # define IsPyLayer(v) ( (v)->ob_type == &PyTypeLayer ) # define PYLAYER(v) ( (PyLayer*)(v) ) diff --git a/katana/src/SymmetricRoute.cpp b/katana/src/SymmetricRoute.cpp index b02ba171..cc740ac7 100644 --- a/katana/src/SymmetricRoute.cpp +++ b/katana/src/SymmetricRoute.cpp @@ -140,7 +140,8 @@ namespace { DebugSession::open( _data->getNet(), 144, 146 ); // Temporary. - _data->setSymAxis( _katana->getCell()->getAbutmentBox().getCenter().getX() ); + //_data->setSymAxis( _katana->getCell()->getAbutmentBox().getCenter().getX() ); + _data->setSymAxis( NetRoutingExtension::getSymAxis(_data->getNet()) ); cmess2 << " - Net: \"" << _data->getNet()->getName() << "\" "; cmess2 << "@" << DbU::getValueString(_data->getSymAxis()) << " ";