@@ -1301,8 +1301,8 @@ bool PlacerPadPlacer::padSpreading(
13011301 const int check_move
13021302 = std::max (prev_pos, std::min (next_pos, curr_pos + move_by));
13031303 if (move_by != 0 ) {
1304- const int tunnel_move
1305- = getTunnelingPosition ( curr, check_move, move_by > 0 , itr);
1304+ const int tunnel_move = getTunnelingPosition (
1305+ curr, check_move, move_by > 0 , prev_pos, curr_pos, next_pos , itr);
13061306 move_by = tunnel_move - curr_pos;
13071307 }
13081308
@@ -1456,6 +1456,9 @@ int PlacerPadPlacer::getRowEnd(odb::dbInst* inst) const
14561456int PlacerPadPlacer::getTunnelingPosition (odb::dbInst* inst,
14571457 int target,
14581458 bool move_up,
1459+ int low_bound,
1460+ int curr_pos,
1461+ int high_bound,
14591462 int itr) const
14601463{
14611464 const double dbus = getBlock ()->getDbUnitsPerMicron ();
@@ -1464,32 +1467,121 @@ int PlacerPadPlacer::getTunnelingPosition(odb::dbInst* inst,
14641467 // pad is moving up in the row
14651468 int next = getNearestLegalPosition (inst, target, false , true );
14661469 if (next != target) {
1467- debugPrint (
1468- getLogger (),
1469- utl::PAD,
1470- " Place" ,
1471- 2 ,
1472- " {} / {}: Tunneling past obstruction (up) {:.4f} um -> {:.4f} um" ,
1473- itr,
1474- inst->getName (),
1475- target / dbus,
1476- next / dbus);
1470+ if (next > high_bound) {
1471+ // check if high_bound is safe to pin to
1472+ placeInstanceSimple (inst, high_bound, true );
1473+ if (checkInstancePlacement (inst)) {
1474+ next = getNearestLegalPosition (inst, target, true , false );
1475+ if (next <= high_bound) {
1476+ debugPrint (getLogger (),
1477+ utl::PAD,
1478+ " Place" ,
1479+ 2 ,
1480+ " {} / {}: Tunneling past obstruction (up) {:.4f} um -> "
1481+ " {:.4f} um, blocked by lower bound {:.4f}um, pinning to "
1482+ " blockage ({:.4f}um , {:.4f}um , {:.4f}um)" ,
1483+ itr,
1484+ inst->getName (),
1485+ target / dbus,
1486+ next / dbus,
1487+ high_bound / dbus,
1488+ low_bound / dbus,
1489+ curr_pos / dbus,
1490+ high_bound / dbus);
1491+ return next;
1492+ }
1493+ debugPrint (getLogger (),
1494+ utl::PAD,
1495+ " Place" ,
1496+ 2 ,
1497+ " {} / {}: Tunneling past obstruction (up) {:.4f} um -> "
1498+ " {:.4f} um, blocked by lower bound {:.4f}um ({:.4f}um , "
1499+ " {:.4f}um , {:.4f}um)" ,
1500+ itr,
1501+ inst->getName (),
1502+ target / dbus,
1503+ next / dbus,
1504+ high_bound / dbus,
1505+ low_bound / dbus,
1506+ curr_pos / dbus,
1507+ high_bound / dbus);
1508+ return curr_pos;
1509+ }
1510+ }
1511+ debugPrint (getLogger (),
1512+ utl::PAD,
1513+ " Place" ,
1514+ 2 ,
1515+ " {} / {}: Tunneling past obstruction (up) {:.4f} um -> {:.4f} "
1516+ " um ({:.4f}um , {:.4f}um , {:.4f}um)" ,
1517+ itr,
1518+ inst->getName (),
1519+ target / dbus,
1520+ next / dbus,
1521+ low_bound / dbus,
1522+ curr_pos / dbus,
1523+ high_bound / dbus);
14771524 return next;
14781525 }
14791526 }
14801527 // pad is moving down in the row
14811528 int next = getNearestLegalPosition (inst, target, true , false );
14821529 if (next != target) {
1483- debugPrint (
1484- getLogger (),
1485- utl::PAD,
1486- " Place" ,
1487- 2 ,
1488- " {} / {}: Tunneling past obstruction (down) {:.4f} um -> {:.4f} um" ,
1489- itr,
1490- inst->getName (),
1491- target / dbus,
1492- next / dbus);
1530+ if (next < low_bound) {
1531+ // check if low_bound is safe to pin to
1532+ placeInstanceSimple (inst, low_bound, true );
1533+ if (checkInstancePlacement (inst)) {
1534+ next = getNearestLegalPosition (inst, target, true , false );
1535+ if (next >= low_bound) {
1536+ debugPrint (getLogger (),
1537+ utl::PAD,
1538+ " Place" ,
1539+ 2 ,
1540+ " {} / {}: Tunneling past obstruction (down) {:.4f} um -> "
1541+ " {:.4f} um, blocked by lower bound, pinning to blockage "
1542+ " {:.4f}um ({:.4f}um , {:.4f}um , {:.4f}um)" ,
1543+ itr,
1544+ inst->getName (),
1545+ target / dbus,
1546+ next / dbus,
1547+ high_bound / dbus,
1548+ low_bound / dbus,
1549+ curr_pos / dbus,
1550+ high_bound / dbus);
1551+ return next;
1552+ }
1553+ next = curr_pos;
1554+ debugPrint (getLogger (),
1555+ utl::PAD,
1556+ " Place" ,
1557+ 2 ,
1558+ " {} / {}: Tunneling past obstruction (down) {:.4f} um -> "
1559+ " {:.4f} um, blocked by lower bound {:.4f}um ({:.4f}um , "
1560+ " {:.4f}um , {:.4f}um)" ,
1561+ itr,
1562+ inst->getName (),
1563+ target / dbus,
1564+ next / dbus,
1565+ low_bound / dbus,
1566+ low_bound / dbus,
1567+ curr_pos / dbus,
1568+ high_bound / dbus);
1569+ return next;
1570+ }
1571+ }
1572+ debugPrint (getLogger (),
1573+ utl::PAD,
1574+ " Place" ,
1575+ 2 ,
1576+ " {} / {}: Tunneling past obstruction (down) {:.4f} um -> {:.4f} "
1577+ " um ({:.4f}um , {:.4f}um , {:.4f}um)" ,
1578+ itr,
1579+ inst->getName (),
1580+ target / dbus,
1581+ next / dbus,
1582+ low_bound / dbus,
1583+ curr_pos / dbus,
1584+ high_bound / dbus);
14931585 return next;
14941586 }
14951587
0 commit comments