@@ -3179,7 +3179,7 @@ void GlobalRouter::checkPinPlacement()
31793179
31803180double GlobalRouter::dbuToMicrons (int dbu)
31813181{
3182- return (double ) dbu / db_->getTech ()-> getDbUnitsPerMicron ();
3182+ return (double ) dbu / db_->getDbuPerMicron ();
31833183}
31843184
31853185float GlobalRouter::getLayerResistance (int layer,
@@ -3234,11 +3234,19 @@ float GlobalRouter::getViaResistance(int from_layer, int to_layer)
32343234 return total_via_resistance;
32353235}
32363236
3237- float GlobalRouter::estimatePathResistance (odb::dbITerm * pin1,
3238- odb::dbITerm * pin2,
3237+ float GlobalRouter::estimatePathResistance (odb::dbObject * pin1,
3238+ odb::dbObject * pin2,
32393239 bool verbose)
32403240{
3241- odb::dbNet* db_net = pin1->getNet ();
3241+ odb::dbNet* db_net = nullptr ;
3242+ if (pin1->getObjectType () == odb::dbITermObj) {
3243+ db_net = ((odb::dbITerm*) pin1)->getNet ();
3244+ } else if (pin1->getObjectType () == odb::dbBTermObj) {
3245+ db_net = ((odb::dbBTerm*) pin1)->getNet ();
3246+ } else {
3247+ return 0.0 ;
3248+ }
3249+
32423250 if (routes_.find (db_net) == routes_.end ()) {
32433251 return 0.0 ;
32443252 }
@@ -3249,9 +3257,9 @@ float GlobalRouter::estimatePathResistance(odb::dbITerm* pin1,
32493257 odb::dbTech* tech = db_->getTech ();
32503258
32513259 for (auto & loc : pin_locs) {
3252- if (loc.iterm == pin1) {
3260+ if (loc.iterm == pin1 || loc. bterm == pin1 ) {
32533261 start_loc = &loc;
3254- } else if (loc.iterm == pin2) {
3262+ } else if (loc.iterm == pin2 || loc. bterm == pin2 ) {
32553263 end_loc = &loc;
32563264 }
32573265 }
@@ -3261,11 +3269,17 @@ float GlobalRouter::estimatePathResistance(odb::dbITerm* pin1,
32613269 }
32623270
32633271 if (verbose) {
3272+ std::string pin1_name = (pin1->getObjectType () == odb::dbITermObj)
3273+ ? ((odb::dbITerm*) pin1)->getName ()
3274+ : ((odb::dbBTerm*) pin1)->getName ();
3275+ std::string pin2_name = (pin2->getObjectType () == odb::dbITermObj)
3276+ ? ((odb::dbITerm*) pin2)->getName ()
3277+ : ((odb::dbBTerm*) pin2)->getName ();
32643278 logger_->report (
32653279 " Estimating Path Resistance between pin ({}) and pin ({}) through net "
32663280 " ({})" ,
3267- start_loc-> iterm -> getName () ,
3268- end_loc-> iterm -> getName () ,
3281+ pin1_name ,
3282+ pin2_name ,
32693283 db_net->getConstName ());
32703284 }
32713285
@@ -3364,22 +3378,30 @@ float GlobalRouter::estimatePathResistance(odb::dbITerm* pin1,
33643378
33653379// Estimate Path Resistance between two pins considering the vertical and
33663380// horizontal metal layers defined by the user
3367- float GlobalRouter::estimatePathResistance (odb::dbITerm * pin1,
3368- odb::dbITerm * pin2,
3381+ float GlobalRouter::estimatePathResistance (odb::dbObject * pin1,
3382+ odb::dbObject * pin2,
33693383 odb::dbTechLayer* layer1,
33703384 odb::dbTechLayer* layer2,
33713385 bool verbose)
33723386{
3373- odb::dbNet* db_net = pin1->getNet ();
3387+ odb::dbNet* db_net = nullptr ;
3388+ if (pin1->getObjectType () == odb::dbITermObj) {
3389+ db_net = ((odb::dbITerm*) pin1)->getNet ();
3390+ } else if (pin1->getObjectType () == odb::dbBTermObj) {
3391+ db_net = ((odb::dbBTerm*) pin1)->getNet ();
3392+ } else {
3393+ return 0.0 ;
3394+ }
3395+
33743396 std::vector<PinGridLocation> pin_locs = getPinGridPositions (db_net);
33753397 PinGridLocation* start_loc = nullptr ;
33763398 PinGridLocation* end_loc = nullptr ;
33773399 odb::dbTech* tech = db_->getTech ();
33783400
33793401 for (auto & loc : pin_locs) {
3380- if (loc.iterm == pin1) {
3402+ if (loc.iterm == pin1 || loc. bterm == pin1 ) {
33813403 start_loc = &loc;
3382- } else if (loc.iterm == pin2) {
3404+ } else if (loc.iterm == pin2 || loc. bterm == pin2 ) {
33833405 end_loc = &loc;
33843406 }
33853407 }
@@ -3389,11 +3411,17 @@ float GlobalRouter::estimatePathResistance(odb::dbITerm* pin1,
33893411 }
33903412
33913413 if (verbose) {
3414+ std::string pin1_name = (pin1->getObjectType () == odb::dbITermObj)
3415+ ? ((odb::dbITerm*) pin1)->getName ()
3416+ : ((odb::dbBTerm*) pin1)->getName ();
3417+ std::string pin2_name = (pin2->getObjectType () == odb::dbITermObj)
3418+ ? ((odb::dbITerm*) pin2)->getName ()
3419+ : ((odb::dbBTerm*) pin2)->getName ();
33923420 logger_->report (
33933421 " Estimating Path Resistance between pin ({}) and pin ({}) using layers "
33943422 " {} and {}" ,
3395- start_loc-> iterm -> getName () ,
3396- end_loc-> iterm -> getName () ,
3423+ pin1_name ,
3424+ pin2_name ,
33973425 layer1->getName (),
33983426 layer2->getName ());
33993427 }
0 commit comments