Skip to content

Commit 6193a4a

Browse files
committed
grt: error messages with invalid input
Signed-off-by: Jonas Gava <[email protected]>
1 parent a944e4c commit 6193a4a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/grt/src/GlobalRouter.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,11 +3245,12 @@ float GlobalRouter::estimatePathResistance(odb::dbObject* pin1,
32453245
} else if (pin1->getObjectType() == odb::dbBTermObj) {
32463246
db_net = ((odb::dbBTerm*) pin1)->getNet();
32473247
} else {
3248-
return 0.0;
3248+
logger_->error(GRT, 81, "Invalid pin type. Expected Iterm or Bterm.");
32493249
}
32503250

32513251
if (routes_.find(db_net) == routes_.end()) {
3252-
return 0.0;
3252+
logger_->error(
3253+
GRT, 82, "Didn't find a route for net {}", db_net->getName());
32533254
}
32543255

32553256
std::vector<PinGridLocation> pin_locs = getPinGridPositions(db_net);
@@ -3266,7 +3267,7 @@ float GlobalRouter::estimatePathResistance(odb::dbObject* pin1,
32663267
}
32673268

32683269
if (!start_loc || !end_loc) {
3269-
return 0.0;
3270+
logger_->error(GRT, 83, "There is no path between the two pins.");
32703271
}
32713272

32723273
if (verbose) {
@@ -3391,7 +3392,7 @@ float GlobalRouter::estimatePathResistance(odb::dbObject* pin1,
33913392
} else if (pin1->getObjectType() == odb::dbBTermObj) {
33923393
db_net = ((odb::dbBTerm*) pin1)->getNet();
33933394
} else {
3394-
return 0.0;
3395+
logger_->error(GRT, 87, "Invalid pin type. Expected Iterm or Bterm.");
33953396
}
33963397

33973398
std::vector<PinGridLocation> pin_locs = getPinGridPositions(db_net);
@@ -3408,7 +3409,7 @@ float GlobalRouter::estimatePathResistance(odb::dbObject* pin1,
34083409
}
34093410

34103411
if (!start_loc || !end_loc) {
3411-
return 0.0;
3412+
logger_->error(GRT, 89, "There is no path between the two pins.");
34123413
}
34133414

34143415
if (verbose) {
@@ -3443,14 +3444,13 @@ float GlobalRouter::estimatePathResistance(odb::dbObject* pin1,
34433444
}
34443445

34453446
if (!h_layer || !v_layer) {
3446-
logger_->warn(
3447+
logger_->error(
34473448
GRT,
3448-
289,
3449+
91,
34493450
"Could not identify horizontal and vertical layers from {} and "
34503451
"{}. Please provide one horizontal and one vertical layer.",
34513452
layer1->getName(),
34523453
layer2->getName());
3453-
return 0.0;
34543454
}
34553455

34563456
RoutePt start_pt(start_loc->grid_pt.getX(),

0 commit comments

Comments
 (0)