-
Notifications
You must be signed in to change notification settings - Fork 602
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: Revamp rebuffering #6637
base: master
Are you sure you want to change the base?
rsz: Revamp rebuffering #6637
Conversation
There was a problem hiding this 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
}); | ||
|
||
if (Z.empty()) | ||
return; |
There was a problem hiding this comment.
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]
return; | |
if (Z.empty()) { | |
return; | |
} |
}); | ||
|
||
if (Z.empty()) | ||
return; |
There was a problem hiding this comment.
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]
return; | |
if (Z.empty()) { | |
return; | |
} |
src/rsz/src/Rebuffer.cc
Outdated
} | ||
|
||
// Find initial timing-optimized rebuffering choice | ||
BufferedNetPtr RepairSetup::rebufferForTiming(BufferedNetPtr bnet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'bnet' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
BufferedNetPtr RepairSetup::rebufferForTiming(BufferedNetPtr bnet) | |
BufferedNetPtr RepairSetup::rebufferForTiming(const BufferedNetPtr& bnet) |
src/rsz/src/RepairSetup.hh:210:
- BufferedNetPtr rebufferForTiming(BufferedNetPtr bnet);
+ BufferedNetPtr rebufferForTiming(const BufferedNetPtr& bnet);
src/rsz/src/Rebuffer.cc
Outdated
using BnetPtr = BufferedNetPtr; | ||
|
||
const BnetSeq Z = visitTree( | ||
[this](auto& recurse, int level, BnetPtr bnet) -> BnetSeq { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'bnet' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
[this](auto& recurse, int level, BnetPtr bnet) -> BnetSeq {
^
case BnetType::wire: { | ||
BnetSeq Z = recurse(bnet->ref()); | ||
for (BnetPtr& z : Z) | ||
z = addWire(z, bnet->location(), bnet->layer(), level); |
There was a problem hiding this comment.
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]
z = addWire(z, bnet->location(), bnet->layer(), level); | |
for (BnetPtr& z : Z) { | |
z = addWire(z, bnet->location(), bnet->layer(), level); | |
} |
src/rsz/src/Rebuffer.cc
Outdated
|
||
// spread down arrival delay | ||
visitTree( | ||
[](auto& recurse, int level, BufferedNetPtr bnet, Delay arrival) -> int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'bnet' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
[](auto& recurse, int level, BufferedNetPtr bnet, Delay arrival) -> int {
^
src/rsz/src/Rebuffer.cc
Outdated
drvr_delay); | ||
|
||
BnetSeq Z = visitTree( | ||
[&](auto& recurse, int level, BufferedNetPtr bnet) -> BufferedNetSeq { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'bnet' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
[&](auto& recurse, int level, BufferedNetPtr bnet) -> BufferedNetSeq {
^
assert(bnet->ref()->type == BnetType::wire); | ||
BnetSeq Z = recurse(bnet->ref()->ref()); | ||
for (BnetPtr& z : Z) | ||
z = addWire(z, bnet->location(), bnet->ref()->layer(), level); |
There was a problem hiding this comment.
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]
z = addWire(z, bnet->location(), bnet->ref()->layer(), level); | |
for (BnetPtr& z : Z) { | |
z = addWire(z, bnet->location(), bnet->ref()->layer(), level); | |
} |
case BnetType::wire: { | ||
BnetSeq Z = recurse(bnet->ref()); | ||
for (BnetPtr& z : Z) | ||
z = addWire(z, bnet->location(), bnet->layer(), level); |
There was a problem hiding this comment.
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]
z = addWire(z, bnet->location(), bnet->layer(), level); | |
for (BnetPtr& z : Z) { | |
z = addWire(z, bnet->location(), bnet->layer(), level); | |
} |
} else { | ||
debugPrint(logger_, RSZ, "rebuffer", 2, "no available option"); | ||
return nullptr; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'else' after 'return' [readability-else-after-return]
} | |
} if (best_slack_option) { | |
debugPrint(logger_, | |
RSZ, | |
"rebuffer", | |
2, | |
"best option {} (closest to meeting timing)", | |
best_slack_index); | |
return best_slack_option; | |
} else { | |
debugPrint(logger_, RSZ, "rebuffer", 2, "no available option"); | |
return nullptr; | |
} |
Buffered net constructor already sets the appropriate capacitance value for each bnet type. 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]>
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]>
Signed-off-by: Martin Povišer <[email protected]>
175660a
to
b175f20
Compare
There was a problem hiding this 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
src/rsz/src/Resizer.cc
Outdated
while (pin_iter->hasNext()) { | ||
const Pin *pin = pin_iter->next(); | ||
const LibertyPort *port; | ||
if ((port = network_->libertyPort(pin)) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: an assignment within an 'if' condition is bug-prone [bugprone-assignment-in-if-condition]
if ((port = network_->libertyPort(pin)) &&
^
Additional context
src/rsz/src/Resizer.cc:303: if it should be an assignment, move it out of the 'if' condition
if ((port = network_->libertyPort(pin)) &&
^
src/rsz/src/Resizer.cc:303: if it is meant to be an equality check, change '=' to '=='
if ((port = network_->libertyPort(pin)) &&
^
insts.push_back(inst); | ||
const Pin *out_pin = network_->findPin(inst, out); | ||
if (out_pin) | ||
queue.push_back(network_->net(out_pin)); |
There was a problem hiding this comment.
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]
queue.push_back(network_->net(out_pin)); | |
if (out_pin) { | |
queue.push_back(network_->net(out_pin)); | |
} |
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]>
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Martin Povišer <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Martin Povišer <[email protected]>
clang-tidy review says "All clean, LGTM! 👍" |
Overall the effect of this change is a slight improvement in timing QoR: https://dashboard.precisioninno.com/compare?sourceAType=Commit&sourceBType=Commit&sourceBName=80fedddbbc3e57d381ef2685597027e220f23586&sourceBID=2&sourceAName=ae2e846418d75a113415ef9bf2d88999226a8846&sourceAID=5099 On public designs, the metric failures are:
I've started secure CI under secure-rsz-rebuffer-revamp |
worst slack -0.15 | ||
No differences found. | ||
worst slack -0.13 | ||
Differences found at line 312. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No differences
@povik you have some conflicts to resolve |
Improve the rebuffering code:
Fixes #5440, #5441