|
11 | 11 | #include <optional> |
12 | 12 | #include <string> |
13 | 13 | #include <string_view> |
| 14 | +#include <utility> |
14 | 15 | #include <vector> |
15 | 16 |
|
16 | 17 | #include "DelayEstimator.hh" |
@@ -295,11 +296,16 @@ void DelayEstimatorReporter::reportAccuracyForSizing( |
295 | 296 | { |
296 | 297 | odb::dbDatabase::beginEco(reporter.block_); |
297 | 298 | } |
298 | | - ~EcoJournalScope() |
| 299 | + ~EcoJournalScope() noexcept |
299 | 300 | { |
300 | | - reporter.resizer_.initForJournalRestore(); |
301 | | - odb::dbDatabase::undoEco(reporter.block_); |
302 | | - reporter.resizer_.updateParasiticsAndTiming(); |
| 301 | + try { |
| 302 | + reporter.resizer_.initForJournalRestore(); |
| 303 | + odb::dbDatabase::undoEco(reporter.block_); |
| 304 | + reporter.resizer_.updateParasiticsAndTiming(); |
| 305 | + } catch (...) { |
| 306 | + // Destructors must not throw during diagnostic ECO cleanup. |
| 307 | + return; |
| 308 | + } |
303 | 309 | } |
304 | 310 | }; |
305 | 311 |
|
@@ -702,25 +708,31 @@ DelayEstimatorReporter::buildLegacyProfile(const Target& target, |
702 | 708 | } |
703 | 709 |
|
704 | 710 | sta::PathExpanded expanded(target.endpoint_path, resizer_.staState()); |
705 | | - StageProfileRow current_row{ |
706 | | - .path_index = target.path_index, |
707 | | - .role = Role::kTarget, |
708 | | - .pin_name = stagePinName(expanded, target.path_index), |
709 | | - .cell_name = driver_port->libertyCell()->name(), |
710 | | - .input_slew = context->target().input_slew, |
711 | | - .cell_delay = current_cell_delay, |
712 | | - .wire_delay = pathWireDelay(expanded, target.path_index), |
713 | | - .load_cap = load_cap, |
714 | | - .output_slew = context->target().current_slew, |
715 | | - .extra_delay = current_fanin_penalty}; |
716 | | - profile.current_stages.push_back(current_row); |
717 | | - |
718 | | - StageProfileRow candidate_row = current_row; |
719 | | - candidate_row.cell_name = replacement->name(); |
720 | | - candidate_row.cell_delay = candidate_cell_delay; |
721 | | - candidate_row.output_slew = kMissingValue; |
722 | | - candidate_row.extra_delay = candidate_fanin_penalty; |
723 | | - profile.candidate_stages.push_back(candidate_row); |
| 711 | + const std::string target_pin_name = stagePinName(expanded, target.path_index); |
| 712 | + const float target_wire_delay = pathWireDelay(expanded, target.path_index); |
| 713 | + StageProfileRow current_row{.path_index = target.path_index, |
| 714 | + .role = Role::kTarget, |
| 715 | + .pin_name = target_pin_name, |
| 716 | + .cell_name = driver_port->libertyCell()->name(), |
| 717 | + .input_slew = context->target().input_slew, |
| 718 | + .cell_delay = current_cell_delay, |
| 719 | + .wire_delay = target_wire_delay, |
| 720 | + .load_cap = load_cap, |
| 721 | + .output_slew = context->target().current_slew, |
| 722 | + .extra_delay = current_fanin_penalty}; |
| 723 | + profile.current_stages.push_back(std::move(current_row)); |
| 724 | + |
| 725 | + StageProfileRow candidate_row{.path_index = target.path_index, |
| 726 | + .role = Role::kTarget, |
| 727 | + .pin_name = target_pin_name, |
| 728 | + .cell_name = replacement->name(), |
| 729 | + .input_slew = context->target().input_slew, |
| 730 | + .cell_delay = candidate_cell_delay, |
| 731 | + .wire_delay = target_wire_delay, |
| 732 | + .load_cap = load_cap, |
| 733 | + .output_slew = kMissingValue, |
| 734 | + .extra_delay = candidate_fanin_penalty}; |
| 735 | + profile.candidate_stages.push_back(std::move(candidate_row)); |
724 | 736 |
|
725 | 737 | return profile; |
726 | 738 | } |
@@ -877,7 +889,7 @@ DelayEstimatorReporter::captureFixedStages(const Target& target, |
877 | 889 | fixed_stage.next_pin_name = network_->pathName(next_pin); |
878 | 890 | } |
879 | 891 |
|
880 | | - fixed_stages.push_back(fixed_stage); |
| 892 | + fixed_stages.push_back(std::move(fixed_stage)); |
881 | 893 | } |
882 | 894 | return fixed_stages; |
883 | 895 | } |
@@ -1178,28 +1190,36 @@ void DelayEstimatorReporter::printStageWindowDetail( |
1178 | 1190 | const bool has_golden_before = row_index < golden_before.size(); |
1179 | 1191 | const bool has_golden_after = row_index < golden_after.size(); |
1180 | 1192 |
|
1181 | | - const Role role = has_estimated_current ? estimated_current_row.role |
1182 | | - : has_estimated_candidate ? estimated_candidate_row.role |
1183 | | - : has_golden_before ? golden_before_row.role |
1184 | | - : golden_after_row.role; |
1185 | | - const int path_index |
1186 | | - = has_estimated_current ? estimated_current_row.path_index |
1187 | | - : has_estimated_candidate ? estimated_candidate_row.path_index |
1188 | | - : has_golden_before ? golden_before_row.path_index |
1189 | | - : golden_after_row.path_index; |
1190 | | - const std::string& pin_name |
1191 | | - = has_estimated_current ? estimated_current_row.pin_name |
1192 | | - : has_estimated_candidate ? estimated_candidate_row.pin_name |
1193 | | - : has_golden_before ? golden_before_row.pin_name |
1194 | | - : golden_after_row.pin_name; |
1195 | | - const std::string& pre_cell |
1196 | | - = has_estimated_current ? estimated_current_row.cell_name |
1197 | | - : has_golden_before ? golden_before_row.cell_name |
1198 | | - : kDashCell; |
1199 | | - const std::string& post_cell |
1200 | | - = has_estimated_candidate ? estimated_candidate_row.cell_name |
1201 | | - : has_golden_after ? golden_after_row.cell_name |
1202 | | - : kDashCell; |
| 1193 | + const StageProfileRow* reference_row = &golden_after_row; |
| 1194 | + if (has_golden_before) { |
| 1195 | + reference_row = &golden_before_row; |
| 1196 | + } |
| 1197 | + if (has_estimated_candidate) { |
| 1198 | + reference_row = &estimated_candidate_row; |
| 1199 | + } |
| 1200 | + if (has_estimated_current) { |
| 1201 | + reference_row = &estimated_current_row; |
| 1202 | + } |
| 1203 | + |
| 1204 | + const std::string* pre_cell = &kDashCell; |
| 1205 | + if (has_golden_before) { |
| 1206 | + pre_cell = &golden_before_row.cell_name; |
| 1207 | + } |
| 1208 | + if (has_estimated_current) { |
| 1209 | + pre_cell = &estimated_current_row.cell_name; |
| 1210 | + } |
| 1211 | + |
| 1212 | + const std::string* post_cell = &kDashCell; |
| 1213 | + if (has_golden_after) { |
| 1214 | + post_cell = &golden_after_row.cell_name; |
| 1215 | + } |
| 1216 | + if (has_estimated_candidate) { |
| 1217 | + post_cell = &estimated_candidate_row.cell_name; |
| 1218 | + } |
| 1219 | + |
| 1220 | + const Role role = reference_row->role; |
| 1221 | + const int path_index = reference_row->path_index; |
| 1222 | + const std::string& pin_name = reference_row->pin_name; |
1203 | 1223 |
|
1204 | 1224 | const float estimated_current_delay |
1205 | 1225 | = has_estimated_current |
@@ -1281,8 +1301,8 @@ void DelayEstimatorReporter::printStageWindowDetail( |
1281 | 1301 | const bool post_arc_relaxed |
1282 | 1302 | = has_estimated_candidate && estimated_candidate_row.arc_match_relaxed; |
1283 | 1303 | logger_->report(" cell: pre={} post={}{}", |
1284 | | - pre_cell, |
1285 | | - post_cell, |
| 1304 | + *pre_cell, |
| 1305 | + *post_cell, |
1286 | 1306 | post_arc_relaxed ? " arc_match: relaxed" : ""); |
1287 | 1307 | logger_->report(""); |
1288 | 1308 | logger_->report(" {:<31} {:>10} {:>10} {:>10}", |
|
0 commit comments