Fix divide by zero in GCells of null size.
* Bug: In Anabatic::GCell, when width and/or heigh is null, do not try to compute densities as it will trigger a divide by zero (and do not make much sense anyway). * Change: In CRL Core, in cmos/alliance.conf, honor the ALLIANCE_TOP variable if it is found in the user's environement.
This commit is contained in:
parent
3835d6f7ad
commit
e19893ac32
|
@ -1417,21 +1417,36 @@ namespace Anabatic {
|
||||||
for ( size_t i=0 ; i<_depth ; i++ ) {
|
for ( size_t i=0 ; i<_depth ; i++ ) {
|
||||||
switch ( Session::getDirection(i) ) {
|
switch ( Session::getDirection(i) ) {
|
||||||
case Flags::Horizontal:
|
case Flags::Horizontal:
|
||||||
_densities [i] = ((float)uLengths2[i]) / ( hcapacity * (float)width );
|
if (width) {
|
||||||
_feedthroughs [i] += (float)(_blockages[i] / width);
|
_densities [i] = ((float)uLengths2[i]) / ( hcapacity * (float)width );
|
||||||
_fragmentations[i] = (float)ufragments[i].getMaxFree().getSize() / (float)width;
|
_feedthroughs [i] += (float)(_blockages[i] / width);
|
||||||
|
_fragmentations[i] = (float)ufragments[i].getMaxFree().getSize() / (float)width;
|
||||||
|
} else {
|
||||||
|
_densities [i] = 0;
|
||||||
|
_feedthroughs [i] = 0;
|
||||||
|
_fragmentations[i] = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Flags::Vertical:
|
case Flags::Vertical:
|
||||||
_densities [i] = ((float)uLengths2[i]) / ( vcapacity * (float)height );
|
if (height) {
|
||||||
_feedthroughs [i] += (float)(_blockages[i] / height);
|
_densities [i] = ((float)uLengths2[i]) / ( vcapacity * (float)height );
|
||||||
_fragmentations[i] = (float)ufragments[i].getMaxFree().getSize() / (float)height;
|
_feedthroughs [i] += (float)(_blockages[i] / height);
|
||||||
|
_fragmentations[i] = (float)ufragments[i].getMaxFree().getSize() / (float)height;
|
||||||
|
} else {
|
||||||
|
_densities [i] = 0;
|
||||||
|
_feedthroughs [i] = 0;
|
||||||
|
_fragmentations[i] = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_densities[i] >= 1.0) _flags |= Flags::Saturated;
|
if (_densities[i] >= 1.0) _flags |= Flags::Saturated;
|
||||||
}
|
}
|
||||||
|
|
||||||
_cDensity = ( (float)_contacts.size() ) / ccapacity;
|
if (ccapacity)
|
||||||
|
_cDensity = ( (float)_contacts.size() ) / ccapacity;
|
||||||
|
else
|
||||||
|
_cDensity = 0;
|
||||||
_flags.reset( Flags::Invalidated );
|
_flags.reset( Flags::Invalidated );
|
||||||
|
|
||||||
checkDensity();
|
checkDensity();
|
||||||
|
|
|
@ -32,13 +32,8 @@
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
||||||
const char* reopenSession =
|
const char* reopenSession = "Session::open(): Session already open for %s (internal error).";
|
||||||
"Session::open() :\n\n"
|
const char* openSessionError = "%s: Session has not been opened (internal error).";
|
||||||
" Session already open for %s (internal error).";
|
|
||||||
|
|
||||||
const char* openSessionError =
|
|
||||||
"%s :\n\n"
|
|
||||||
" Session has not been opened (internal error).";
|
|
||||||
|
|
||||||
|
|
||||||
} // End of local namespace.
|
} // End of local namespace.
|
||||||
|
|
|
@ -6,7 +6,7 @@ from helpers.Alliance import Gauge
|
||||||
|
|
||||||
|
|
||||||
allianceTop = None
|
allianceTop = None
|
||||||
if os.environ.has_key['ALLIANCE_TOP']:
|
if os.environ.has_key('ALLIANCE_TOP'):
|
||||||
allianceTop = os.environ['ALLIANCE_TOP']
|
allianceTop = os.environ['ALLIANCE_TOP']
|
||||||
if not os.path.isdir(allianceTop):
|
if not os.path.isdir(allianceTop):
|
||||||
allianceTop = None
|
allianceTop = None
|
||||||
|
|
Loading…
Reference in New Issue