Skip to content

repair_timing upsizeCell swappable sort BugFix? #7531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spongebobaa16
Copy link

When call command "repair_timing", in upsize move, the swappable cells will be sorted.
However, the sorting order seems to be strange..?

return std::tie(drive2, intrinsic1, capacitance1) < std::tie(drive1, intrinsic2, capacitance2);

Is there any specific heuristic or reason to sort in this way?

@maliberty maliberty requested a review from precisionmoon June 6, 2025 18:14
@povik
Copy link
Contributor

povik commented Jun 9, 2025

Expanded sorting code from before #7311:

    sort(swappable_cells,
         [=](const LibertyCell* cell1, const LibertyCell* cell2) {
           LibertyPort* port1
               = cell1->findLibertyPort(drvr_port_name)->cornerPort(lib_ap);
           LibertyPort* port2
               = cell2->findLibertyPort(drvr_port_name)->cornerPort(lib_ap);
           const float drive1 = port1->driveResistance();
           const float drive2 = port2->driveResistance();
           const ArcDelay intrinsic1 = port1->intrinsicDelay(this);
           const ArcDelay intrinsic2 = port2->intrinsicDelay(this);
           return drive1 > drive2
                  || ((drive1 == drive2 && intrinsic1 < intrinsic2)
                      || (intrinsic1 == intrinsic2
                          && port1->capacitance() < port2->capacitance()));
         });

We try weak drivers first. Your change might make us upsize to the strongest driver right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants