Minor bug fixed, introduced by rails.

in Dijkstra:
   - NULL object verification added
in GCell:
   - NULL object verification added
This commit is contained in:
EricLaoGitHub 2017-10-31 17:45:35 +01:00
parent de02cf5685
commit 7214f5343e
2 changed files with 17 additions and 16 deletions

View File

@ -506,11 +506,12 @@ namespace Anabatic {
cdebug_log(112,0) << "Case horizontal: " << isiSet() << endl;
GCell* gprev = getGPrev(Vertex::From2Mode);
intervfrom = getIntervFrom(From2Mode);
Vertex* prev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
Vertex* prev = NULL;
if (gprev) prev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
cdebug_log(112,0) << "PREV: " << prev << " ";
intervfrom.print();
if (isiSet()){
if (isiSet()||(prev == NULL)){
cdebug_log(112,0) << "isiSet: ";
printInterv();
y = getIAxis();
@ -580,11 +581,12 @@ namespace Anabatic {
//GCell* gprev = NULL;
GCell* gprev = getGPrev(Vertex::From2Mode);
intervfrom = getIntervFrom(From2Mode);
Vertex* prev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
Vertex* prev = NULL;
if (gprev) prev = gprev->getObserver<Vertex>(GCell::Observable::Vertex);
cdebug_log(112,0) << "PREV: " << prev << " ";
intervfrom.print();
if (isiSet()){
if (isiSet()||(prev == NULL)){
cdebug_log(112,0) << "isiSet: ";
printInterv();
x = getIAxis();
@ -2387,7 +2389,7 @@ 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) {
@ -2428,7 +2430,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;
}

View File

@ -1708,17 +1708,16 @@ namespace Anabatic {
return false;
}
void GCell::setEdgesOccupancy ( unsigned int width, unsigned int height )
{
getEastEdge()->setCapacity(width);
getWestEdge()->setCapacity(width);
getNorthEdge()->setCapacity(height);
getSouthEdge()->setCapacity(height);
getEastEdge()->setRealOccupancy(0);
getWestEdge()->setRealOccupancy(0);
getNorthEdge()->setRealOccupancy(0);
getSouthEdge()->setRealOccupancy(0);
if (getEastEdge() ) getEastEdge()->setCapacity(width);
if (getWestEdge() ) getWestEdge()->setCapacity(width);
if (getNorthEdge()) getNorthEdge()->setCapacity(height);
if (getSouthEdge()) getSouthEdge()->setCapacity(height);
if (getEastEdge() ) getEastEdge()->setRealOccupancy(0);
if (getWestEdge() ) getWestEdge()->setRealOccupancy(0);
if (getNorthEdge()) getNorthEdge()->setRealOccupancy(0);
if (getSouthEdge()) getSouthEdge()->setRealOccupancy(0);
}