Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 15 additions & 26 deletions src/rsz/src/RepairDesign.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
2,
"Annotating slew for driver {}",
network_->pathName(drvr->pin()));
for (auto rf : {sta::RiseFall::rise(), sta::RiseFall::fall()}) {
for (auto rf : sta::RiseFall::range()) {
if (!drvr->slewAnnotated(rf, min_) && !drvr->slewAnnotated(rf, max_)) {
sta_->setAnnotatedSlew(drvr,
resizer_->tgt_slew_corner_,
Expand All @@ -197,9 +197,6 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
}
findBufferSizes();

sta_->searchPreamble();
search_->findAllArrivals();

for (int i = drvrs.size() - 1; i >= 0; i--) {
sta::Vertex* drvr = drvrs[i];
sta::Pin* drvr_pin = drvr->pin();
Expand All @@ -220,7 +217,6 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
odb::dbNet* net_db = nullptr;
odb::dbModNet* mod_net_db = nullptr;
db_network_->staToDb(net, net_db, mod_net_db);
search_->findRequireds(drvr->level() + 1);

if (resizer_->okToBufferNet(drvr_pin)
&& !sta_->isClock(drvr_pin, sta_->cmdMode())
Expand All @@ -241,7 +237,7 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
max_fanout = 1e9;
}

if (performGainBuffering(net, drvr_pin, max_fanout)) {
if (performGainBuffering(net, drvr, max_fanout)) {
debugPrint(logger_,
RSZ,
"early_sizing",
Expand All @@ -266,12 +262,12 @@ void RepairDesign::performEarlySizingRound(int& repaired_net_count)
}
}

for (auto mm : sta::MinMaxAll::all()->range()) {
for (auto rf : sta::RiseFallBoth::riseFall()->range()) {
if (!slew_user_annotated.contains(std::make_pair(drvr, rf->index()))) {
drvr->setSlewAnnotated(
false, rf, resizer_->tgt_slew_corner_->dcalcAnalysisPtIndex(mm));
}
for (auto rf : sta::RiseFall::range()) {
if (!slew_user_annotated.contains(std::make_pair(drvr, rf->index()))) {
sta_->unsetAnnotatedSlew(drvr,
resizer_->tgt_slew_corner_,
sta::MinMaxAll::all(),
rf->asRiseFallBoth());
}
}
}
Expand Down Expand Up @@ -307,7 +303,6 @@ void RepairDesign::repairDesign(
sta_->checkCapacitancesPreamble(sta_->scenes());
sta_->checkFanoutPreamble();
sta_->searchPreamble();
search_->findAllArrivals();

if (initial_sizing) {
performEarlySizingRound(repaired_net_count);
Expand Down Expand Up @@ -422,12 +417,11 @@ void RepairDesign::repairDesign(
for (auto vertex : annotations_to_clean_up) {
for (auto corner : sta_->scenes()) {
for (const sta::RiseFall* rf : sta::RiseFall::range()) {
vertex->setSlewAnnotated(
false, rf, corner->dcalcAnalysisPtIndex(max_));
sta_->unsetAnnotatedSlew(
vertex, corner, sta::MinMaxAll::max(), rf->asRiseFallBoth());
}
}
}
sta_->delaysInvalid();
}

printProgress(print_iteration,
Expand Down Expand Up @@ -681,7 +675,7 @@ void RepairDesign::findBufferSizes()
/// construction and critical path isolation.
///
bool RepairDesign::performGainBuffering(sta::Net* net,
const sta::Pin* drvr_pin,
sta::Vertex* drvr,
int max_fanout)
{
struct EnqueuedPin
Expand Down Expand Up @@ -731,9 +725,13 @@ bool RepairDesign::performGainBuffering(sta::Net* net,
}
};

sta::Pin* drvr_pin = drvr->pin();

// 1. Collect all sinks
std::vector<EnqueuedPin> sinks;

// vertexWorstSlackPath prerequisite.
sta_->findRequired(drvr);
sta::NetConnectedPinIterator* pin_iter = network_->connectedPinIterator(net);
while (pin_iter->hasNext()) {
const sta::Pin* pin = pin_iter->next();
Expand Down Expand Up @@ -854,15 +852,6 @@ bool RepairDesign::performGainBuffering(sta::Net* net,
load += size_in->capacitance();
}

// 5. Incremental timing update
sta_->ensureLevelized();
sta::Level max_level = 0;
for (auto vertex : tree_boundary) {
max_level = std::max(vertex->level(), max_level);
}
sta_->findDelays(max_level);
search_->findArrivals(max_level);

return repaired_net;
}

Expand Down
4 changes: 1 addition & 3 deletions src/rsz/src/RepairDesign.hh
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ class RepairDesign : sta::dbStaState
bool getCin(const sta::Pin* drvr_pin, float& cin);
bool getLargestSizeCin(const sta::Pin* drvr_pin, float& cin);
void findBufferSizes();
bool performGainBuffering(sta::Net* net,
const sta::Pin* drvr_pin,
int max_fanout);
bool performGainBuffering(sta::Net* net, sta::Vertex* drvr, int max_fanout);
void performEarlySizingRound(int& repaired_net_count);

void checkDriverArcSlew(const sta::Scene* corner,
Expand Down
90 changes: 46 additions & 44 deletions src/rsz/src/RepairTargetCollector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,36 +438,37 @@ sta::Slack RepairTargetCollector::getPathSlackByIndex(
// Create ExceptionTo for this endpoint
sta::PinSet* to_pins = new sta::PinSet(network_);
to_pins->insert(endpoint_pin);
sta::ExceptionTo* to = sdc_->makeExceptionTo(to_pins,
sta::ExceptionTo* to = sta_->makeExceptionTo(to_pins,
nullptr,
nullptr,
sta::RiseFallBoth::riseFall(),
sta::RiseFallBoth::riseFall());
sta::RiseFallBoth::riseFall(),
sdc_);

// Find paths to the endpoint - request only up to path_index+1 paths
sta::StringSeq group_names;
int num_paths_needed = path_index + 1;
sta::PathEndSeq path_ends
= search_->findPathEnds(nullptr, // from
nullptr, // thrus
to, // to
false, // unconstrained
sta_->scenes(), // scene
sta::MinMaxAll::all(), // min_max
num_paths_needed, // group_path_count
num_paths_needed, // endpoint_path_count
false, // unique_pins
false, // unique_edges
-sta::INF, // slack_min
sta::INF, // slack_max
true, // sort_by_slack
group_names, // group_names
true,
false,
true,
true,
true,
true); // checks
= sta_->findPathEnds(nullptr, // from
nullptr, // thrus
to, // to
false, // unconstrained
sta_->scenes(), // scene
sta::MinMaxAll::all(), // min_max
num_paths_needed, // group_path_count
num_paths_needed, // endpoint_path_count
false, // unique_pins
false, // unique_edges
-sta::INF, // slack_min
sta::INF, // slack_max
true, // sort_by_slack
group_names, // group_names
true,
false,
true,
true,
true,
true); // checks

// Return the slack of the requested path index
if (std::cmp_less(path_index, path_ends.size())) {
Expand Down Expand Up @@ -1134,35 +1135,36 @@ set<const sta::Pin*> RepairTargetCollector::collectPinsByPathEndpoint(
sta::PinSet* to_pins = new sta::PinSet(network_);
to_pins->insert(endpoint_pin);
// The ExceptionTo object will be owned and deleted by the SDC.
sta::ExceptionTo* to = sdc_->makeExceptionTo(to_pins,
sta::ExceptionTo* to = sta_->makeExceptionTo(to_pins,
nullptr,
nullptr,
sta::RiseFallBoth::riseFall(),
sta::RiseFallBoth::riseFall());
sta::RiseFallBoth::riseFall(),
sdc_);

// 2. Find paths to the endpoint.
sta::StringSeq group_names;
sta::PathEndSeq path_ends
= search_->findPathEnds(nullptr, // from
nullptr, // thrus
to, // to
false, // unconstrained
sta_->scenes(), // scene
sta::MinMaxAll::all(), // min_max
paths_per_endpoint, // group_path_count
paths_per_endpoint, // endpoint_path_count
false, // unique_pins
false, // unique_edges
-sta::INF, // slack_min
sta::INF, // slack_max
true, // sort_by_slack
group_names, // group_names
true,
false,
true,
true,
true,
true); // checks
= sta_->findPathEnds(nullptr, // from
nullptr, // thrus
to, // to
false, // unconstrained
sta_->scenes(), // scene
sta::MinMaxAll::all(), // min_max
paths_per_endpoint, // group_path_count
paths_per_endpoint, // endpoint_path_count
false, // unique_pins
false, // unique_edges
-sta::INF, // slack_min
sta::INF, // slack_max
true, // sort_by_slack
group_names, // group_names
true,
false,
true,
true,
true,
true); // checks

int path_num = 1;
for (const sta::PathEnd* path_end : path_ends) {
Expand Down
Loading