Skip to content
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

rsz: Buffering and sizing improvements #6564

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

openroad-ci
Copy link
Collaborator

This PR combines a number of related resizer changes impacting QoR:

  • Improvements to gain buffering (repair_design -buffer_gain)
  • Pre-selection of buffers used for repair to filter out slow and delay buffers (except for hold repair)
  • Replacing resize to target slew with a fanout-of-4 rule
  • Restructuring of repair_design to do minimal resizing in response to a violation

It supersedes #6332

povik added 14 commits January 21, 2025 17:43
Signed-off-by: Martin Povišer <[email protected]>
Signed-off-by: Martin Povišer <[email protected]>
Signed-off-by: Martin Povišer <[email protected]>
Signed-off-by: Martin Povišer <[email protected]>
@povik
Copy link
Contributor

povik commented Jan 21, 2025

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

}
size_cin /= nports;
if (size_cin > cin)
cin = size_cin;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: statement should be inside braces [google-readability-braces-around-statements]

Suggested change
cin = size_cin;
if (size_cin > cin) {
cin = size_cin;
}

float delay_penalty = max_drive_resist * extra_input_cap;

float wlimit = maxLoad(network_->cell(worse)),
blimit = maxLoad(network_->cell(better));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Value stored to 'blimit' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

        blimit = maxLoad(network_->cell(better));
        ^
Additional context

src/rsz/src/Resizer.cc:539: Value stored to 'blimit' during its initialization is never read

        blimit = maxLoad(network_->cell(better));
        ^

float delay_penalty = max_drive_resist * extra_input_cap;

float wlimit = maxLoad(network_->cell(worse)),
blimit = maxLoad(network_->cell(better));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unused variable 'blimit' [clang-diagnostic-unused-variable]

        blimit = maxLoad(network_->cell(better));
        ^

// TODO: factor out
for (TimingArcSet* arc_set : worse->timingArcSets()) {
TimingRole* role = arc_set->role();
if (role->combinational() && arc_set->from() == win
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: static member accessed through instance [readability-static-accessed-through-instance]

Suggested change
if (role->combinational() && arc_set->from() == win
if (sta::TimingRole::combinational() && arc_set->from() == win


for (TimingArcSet* arc_set : better->timingArcSets()) {
TimingRole* role = arc_set->role();
if (role->combinational() && arc_set->from() == bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: static member accessed through instance [readability-static-accessed-through-instance]

Suggested change
if (role->combinational() && arc_set->from() == bin
if (sta::TimingRole::combinational() && arc_set->from() == bin

LibertyCellSeq sizes_by_inp_cap;
sizes_by_inp_cap = buffer_cells_;
sort(sizes_by_inp_cap,
[this](const LibertyCell* buffer1, const LibertyCell* buffer2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: lambda capture 'this' is not used [clang-diagnostic-unused-lambda-capture]

Suggested change
[this](const LibertyCell* buffer1, const LibertyCell* buffer2) {
[](const LibertyCell* buffer1, const LibertyCell* buffer2) {

while (port_iter.hasNext()) {
const LibertyPort* port = port_iter.next();
if (port->direction() == sta::PortDirection::input()) {
cin += port->capacitance();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]

      cin += port->capacitance();
          ^
Additional context

src/rsz/src/Resizer.cc:1483: Assuming 'inst' is non-null

  LibertyCell* cell = inst ? network_->libertyCell(inst) : nullptr;
                      ^

src/rsz/src/Resizer.cc:1483: '?' condition is true

  LibertyCell* cell = inst ? network_->libertyCell(inst) : nullptr;
                      ^

src/rsz/src/Resizer.cc:1484: Assuming the condition is true

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
      ^

src/rsz/src/Resizer.cc:1484: Left side of '&&' is true

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
      ^

src/rsz/src/Resizer.cc:1484: 'inst' is non-null

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
                                             ^

src/rsz/src/Resizer.cc:1484: Left side of '&&' is true

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
      ^

src/rsz/src/Resizer.cc:1484: Left side of '&&' is true

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
      ^

src/rsz/src/Resizer.cc:1484: Assuming 'cell' is non-null

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
                                                                         ^

src/rsz/src/Resizer.cc:1484: Left side of '&&' is true

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
      ^

src/rsz/src/Resizer.cc:1484: Taking true branch

  if (!network_->isTopLevelPort(drvr_pin) && inst && !dontTouch(inst) && cell
  ^

src/rsz/src/Resizer.cc:1486: 'cin' declared without an initial value

    float cin, load_cap;
          ^

src/rsz/src/Resizer.cc:1491: Assuming the condition is true

    if (load_cap > 0.0 && getCin(cell, cin)) {
        ^

src/rsz/src/Resizer.cc:1491: Left side of '&&' is true

    if (load_cap > 0.0 && getCin(cell, cin)) {
        ^

src/rsz/src/Resizer.cc:1491: Passing value via 2nd parameter 'cin'

    if (load_cap > 0.0 && getCin(cell, cin)) {
                                       ^

src/rsz/src/Resizer.cc:1491: Calling 'Resizer::getCin'

    if (load_cap > 0.0 && getCin(cell, cin)) {
                          ^

src/rsz/src/Resizer.cc:1465: Loop condition is true. Entering loop body

  while (port_iter.hasNext()) {
  ^

src/rsz/src/Resizer.cc:1467: Assuming the condition is true

    if (port->direction() == sta::PortDirection::input()) {
        ^

src/rsz/src/Resizer.cc:1467: Taking true branch

    if (port->direction() == sta::PortDirection::input()) {
    ^

src/rsz/src/Resizer.cc:1468: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage

      cin += port->capacitance();
          ^

// Includes net parasitic capacitance.
load_cap = graph_delay_calc_->loadCap(drvr_pin, tgt_slew_dcalc_ap_);
if (load_cap > 0.0 && getCin(cell, cin)) {
bool is_buf_inv = cell->isBuffer() || cell->isInverter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: Value stored to 'is_buf_inv' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

      bool is_buf_inv = cell->isBuffer() || cell->isInverter();
           ^
Additional context

src/rsz/src/Resizer.cc:1492: Value stored to 'is_buf_inv' during its initialization is never read

      bool is_buf_inv = cell->isBuffer() || cell->isInverter();
           ^

// Includes net parasitic capacitance.
load_cap = graph_delay_calc_->loadCap(drvr_pin, tgt_slew_dcalc_ap_);
if (load_cap > 0.0 && getCin(cell, cin)) {
bool is_buf_inv = cell->isBuffer() || cell->isInverter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unused variable 'is_buf_inv' [clang-diagnostic-unused-variable]

      bool is_buf_inv = cell->isBuffer() || cell->isInverter();
           ^

Comment on lines 15 to 17
Differences found at line 95.
- i1-179 BUF_X16 + PLACED ( 0 3580000 ) N ;
- i1-179 BUF_X8 + PLACED ( 0 3580000 ) N ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no diffs in the ok file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, missed that, will fix here and in other places if there are any

Comment on lines 541 to 545
#if 0
if (/* blimit exists */ blimit > 0 && wlimit > blimit) {
return false;
}
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm unused code

@maliberty
Copy link
Member

09:38:53  The following tests FAILED:
09:38:53  	366 - gpl.convergence01.tcl (Failed)
09:38:53  	367 - gpl.convergence01.py (Failed)
09:38:53  	389 - gpl.simple01-td.tcl (Failed)
09:38:53  	390 - gpl.simple01-td.py (Failed)
09:38:53  	391 - gpl.simple01-td-tune.tcl (Failed)
09:38:53  	392 - gpl.simple01-td-tune.py (Failed)

needs attention

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@precisionmoon
Copy link
Contributor

@maliberty
Copy link
Member

Please resolve the merge conflicts so we can get this in.

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.

4 participants