Skip to content

Commit defec0b

Browse files
authored
Merge pull request #344 from The-OpenROAD-Project-staging/sta_mbff_changes
Show original name of pins in path report for mbff cluster…
2 parents 6599d47 + ca4e757 commit defec0b

9 files changed

Lines changed: 73 additions & 38 deletions

File tree

include/sta/Sta.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,8 @@ public:
992992
bool report_slew,
993993
bool report_fanout,
994994
bool report_variation,
995-
bool report_src_attr);
995+
bool report_src_attr,
996+
bool report_orig_name);
996997
ReportField *findReportPathField(std::string_view name);
997998
void setReportPathDigits(int digits);
998999
void setReportPathNoSplit(bool no_split);

search/ReportPath.cc

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ ReportPath::ReportPath(StaState *sta) :
133133
{
134134
makeFields();
135135
setDigits(2);
136-
setReportFields(false, false, false, false, false, false, false, false);
136+
setReportFields(false, false, false, false, false, false, false, false, false);
137137
}
138138

139139
ReportPath::~ReportPath()
@@ -146,6 +146,7 @@ ReportPath::~ReportPath()
146146
delete field_fanout_;
147147
delete field_variation_;
148148
delete field_src_attr_;
149+
delete field_orig_name_;
149150
delete field_edge_;
150151
delete field_case_;
151152
}
@@ -171,6 +172,8 @@ ReportPath::makeFields()
171172
true, nullptr, true);
172173
field_src_attr_ = makeField("src_attr", "Src Attr", 40,
173174
true, nullptr, true);
175+
field_orig_name_ = makeField("orig_name", "Orig Name", 36,
176+
true, nullptr, false);
174177
}
175178

176179
ReportField *
@@ -231,7 +234,8 @@ ReportPath::setReportFields(bool report_input_pin,
231234
bool report_slew,
232235
bool report_fanout,
233236
bool report_variation,
234-
bool report_src_attr)
237+
bool report_src_attr,
238+
bool report_orig_name)
235239
{
236240
report_input_pin_ = report_input_pin;
237241
report_hier_pins_ = report_hier_pins;
@@ -242,6 +246,7 @@ ReportPath::setReportFields(bool report_input_pin,
242246
field_fanout_->setEnabled(report_fanout);
243247
field_variation_->setEnabled(report_variation);
244248
field_src_attr_->setEnabled(report_src_attr);
249+
field_orig_name_->setEnabled(report_orig_name);
245250
// for debug
246251
field_case_->setEnabled(false);
247252
}
@@ -2457,11 +2462,16 @@ ReportPath::reportPathLine(const Path *path,
24572462
std::string src_attr;
24582463
if (inst)
24592464
src_attr = network_->getAttribute(inst, "src");
2465+
std::string orig_name;
2466+
if (inst && field_orig_name_->enabled()) {
2467+
std::string port_name = network_->portName(pin);
2468+
orig_name = network_->getAttribute(inst, "orig_name_" + port_name);
2469+
}
24602470
// Don't show capacitance field for input pins.
24612471
if (is_driver && field_capacitance_->enabled())
24622472
cap = graph_delay_calc_->loadCap(pin, rf, scene, min_max);
24632473
reportLine(what, cap, slew, field_blank_, incr, field_blank_,
2464-
time, false, early_late, rf, src_attr, line_case);
2474+
time, false, early_late, rf, src_attr, orig_name, line_case);
24652475
}
24662476

24672477
void
@@ -2739,6 +2749,11 @@ ReportPath::reportPath6(const Path *path,
27392749
std::string src_attr;
27402750
if (inst)
27412751
src_attr = network_->getAttribute(inst, "src");
2752+
std::string orig_name;
2753+
if (inst && field_orig_name_->enabled()) {
2754+
std::string port_name = network_->portName(pin);
2755+
orig_name = network_->getAttribute(inst, "orig_name_" + port_name);
2756+
}
27422757
// Always show the search start point (register clk pin).
27432758
// Skip reporting the clk tree unless it is requested.
27442759
if (is_clk_start
@@ -2831,13 +2846,13 @@ ReportPath::reportPath6(const Path *path,
28312846
const std::string what = descriptionField(vertex);
28322847
reportLine(what, cap, slew, fanout,
28332848
incr, field_blank_, time, false, min_max, rf, src_attr,
2834-
line_case);
2849+
orig_name, line_case);
28352850

28362851
if (report_net_) {
28372852
const std::string what2 = descriptionNet(pin);
28382853
reportLine(what2, field_blank_, field_blank_, field_blank_,
28392854
field_blank_, field_blank_, field_blank_, false, min_max,
2840-
nullptr, src_attr, "");
2855+
nullptr, src_attr, "", "");
28412856
}
28422857
prev_time = time;
28432858
}
@@ -2850,7 +2865,7 @@ ReportPath::reportPath6(const Path *path,
28502865
const std::string what = descriptionField(vertex);
28512866
reportLine(what, field_blank_, slew, field_blank_,
28522867
incr, field_blank_, time, false, min_max, rf, src_attr,
2853-
line_case);
2868+
orig_name, line_case);
28542869
prev_time = time;
28552870
}
28562871
}
@@ -2875,27 +2890,27 @@ ReportPath::reportVariation(const Path *path) const
28752890
float std_dev = arc_delay.stdDev();
28762891
reportLine("sigma", field_blank_, field_blank_, field_blank_,
28772892
field_blank_, std_dev, field_blank_, true, min_max,
2878-
nullptr, "", "");
2893+
nullptr, "", "", "");
28792894
break;
28802895
}
28812896
case PocvMode::skew_normal: {
28822897
float mean = arc_delay.mean();
28832898
reportLine("mean", field_blank_, field_blank_, field_blank_,
28842899
field_blank_, mean, field_blank_, true, min_max,
2885-
nullptr, "", "");
2900+
nullptr, "", "", "");
28862901
float mean_shift = arc_delay.meanShift();
28872902
reportLine("mean_shift", field_blank_, field_blank_, field_blank_,
28882903
field_blank_, mean_shift, field_blank_, true, min_max,
2889-
nullptr, "", "");
2904+
nullptr, "", "", "");
28902905
float std_dev = arc_delay.stdDev();
28912906
reportLine("std_dev", field_blank_, field_blank_, field_blank_,
28922907
field_blank_, std_dev, field_blank_, true, min_max,
2893-
nullptr, "", "");
2908+
nullptr, "", "", "");
28942909
// skewness is dimensionless, so scale it to the field's time units.
28952910
float skewness = arc_delay.skewness() * units_->timeUnit()->scale();
28962911
reportLine("skewness", field_blank_, field_blank_, field_blank_,
28972912
field_blank_, skewness, field_blank_, true, min_max,
2898-
nullptr, "", "");
2913+
nullptr, "", "", "");
28992914
break;
29002915
}
29012916
default:
@@ -2923,7 +2938,7 @@ ReportPath::reportHierPinsThru(const Path *path) const
29232938
const std::string what = descriptionField(hpin);
29242939
reportLine(what, field_blank_, field_blank_, field_blank_,
29252940
field_blank_, field_blank_, field_blank_, false, path->minMax(this),
2926-
nullptr, "", "");
2941+
nullptr, "", "", "");
29272942
}
29282943
}
29292944
}
@@ -3116,7 +3131,7 @@ ReportPath::reportLine(std::string_view what,
31163131
const EarlyLate *early_late) const
31173132
{
31183133
reportLine(what, field_blank_, field_blank_, field_blank_, field_blank_,
3119-
field_blank_, total, false, early_late, nullptr, "", "");
3134+
field_blank_, total, false, early_late, nullptr, "", "", "");
31203135
}
31213136

31223137
// Report negative total.
@@ -3127,7 +3142,7 @@ ReportPath::reportLineNegative(std::string_view what,
31273142
{
31283143
reportLine(what, field_blank_, field_blank_, field_blank_,
31293144
field_blank_, field_blank_, total, true /* tota_with_minus */,
3130-
early_late, nullptr, "", "");
3145+
early_late, nullptr, "", "", "");
31313146
}
31323147

31333148
// Report total, and transition suffix.
@@ -3138,7 +3153,7 @@ ReportPath::reportLine(std::string_view what,
31383153
const RiseFall *rf) const
31393154
{
31403155
reportLine(what, field_blank_, field_blank_, field_blank_,
3141-
field_blank_, field_blank_, total, false, early_late, rf, "", "");
3156+
field_blank_, field_blank_, total, false, early_late, rf, "", "", "");
31423157
}
31433158

31443159
// Report increment, and total.
@@ -3149,7 +3164,7 @@ ReportPath::reportLine(std::string_view what,
31493164
const EarlyLate *early_late) const
31503165
{
31513166
reportLine(what, field_blank_, field_blank_, field_blank_,
3152-
incr, field_blank_, total, false, early_late, nullptr, "", "");
3167+
incr, field_blank_, total, false, early_late, nullptr, "", "", "");
31533168
}
31543169

31553170
// Report increment, total, and transition suffix.
@@ -3161,7 +3176,7 @@ ReportPath::reportLine(std::string_view what,
31613176
const RiseFall *rf) const
31623177
{
31633178
reportLine(what, field_blank_, field_blank_, field_blank_,
3164-
incr, field_blank_, total, false, early_late, rf, "", "");
3179+
incr, field_blank_, total, false, early_late, rf, "", "", "");
31653180
}
31663181

31673182
// Report slew, increment, and total.
@@ -3173,7 +3188,7 @@ ReportPath::reportLine(std::string_view what,
31733188
const EarlyLate *early_late) const
31743189
{
31753190
reportLine(what, field_blank_, slew, field_blank_,
3176-
incr, field_blank_, total, false, early_late, nullptr, "", "");
3191+
incr, field_blank_, total, false, early_late, nullptr, "", "", "");
31773192
}
31783193

31793194
void
@@ -3188,14 +3203,15 @@ ReportPath::reportLine(std::string_view what,
31883203
const EarlyLate *early_late,
31893204
const RiseFall *rf,
31903205
std::string_view src_attr,
3206+
std::string_view orig_name,
31913207
std::string_view line_case) const
31923208
{
31933209
std::string line;
31943210
size_t field_index = 0;
31953211
bool first_field = true;
31963212
for (const ReportField *field : fields_) {
31973213
bool last_field = field_index == (fields_.size() - 1);
3198-
3214+
31993215
if (field->enabled()) {
32003216
if (!first_field)
32013217
line += ' ';
@@ -3238,6 +3254,12 @@ ReportPath::reportLine(std::string_view what,
32383254
else
32393255
reportFieldBlank(field, line);
32403256
}
3257+
else if (field == field_orig_name_) {
3258+
if (orig_name != "")
3259+
reportField(orig_name, field, line);
3260+
else
3261+
reportFieldBlank(field, line);
3262+
}
32413263
else if (field == field_case_)
32423264
line += line_case;
32433265

search/ReportPath.hh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public:
5858
bool report_slew,
5959
bool report_fanout,
6060
bool report_variation,
61-
bool report_src_attr);
61+
bool report_src_attr,
62+
bool report_orig_name);
6263
int digits() const { return digits_; }
6364
void setDigits(int digits);
6465
void setNoSplit(bool no_split);
@@ -159,6 +160,7 @@ public:
159160
ReportField *fieldFanout() const { return field_fanout_; }
160161
ReportField *fieldCapacitance() const { return field_capacitance_; }
161162
ReportField *fieldSrcAttr() const { return field_src_attr_; }
163+
ReportField *fieldOrigName() const { return field_orig_name_; }
162164

163165
protected:
164166
void makeFields();
@@ -370,6 +372,7 @@ protected:
370372
const EarlyLate *early_late,
371373
const RiseFall *rf,
372374
std::string_view src_attr,
375+
std::string_view orig_name,
373376
std::string_view line_case) const;
374377
void reportLineTotal(std::string_view what,
375378
const Delay &incr,
@@ -490,6 +493,7 @@ protected:
490493
ReportField *field_fanout_;
491494
ReportField *field_variation_;
492495
ReportField *field_src_attr_;
496+
ReportField *field_orig_name_;
493497
ReportField *field_edge_;
494498
ReportField *field_case_;
495499

search/Search.i

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ set_report_path_fields(bool report_input_pin,
415415
bool report_slew,
416416
bool report_fanout,
417417
bool report_variation,
418-
bool report_src_attr)
418+
bool report_src_attr,
419+
bool report_orig_name)
419420
{
420421
Sta::sta()->setReportPathFields(report_input_pin,
421422
report_hier_pins,
@@ -424,7 +425,8 @@ set_report_path_fields(bool report_input_pin,
424425
report_slew,
425426
report_fanout,
426427
report_variation,
427-
report_src_attr);
428+
report_src_attr,
429+
report_orig_name);
428430
}
429431

430432
void

search/Search.tcl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ define_cmd_args "report_checks" \
336336
[-sort_by_slack]\
337337
[-path_group group_name]\
338338
[-format full|full_clock|full_clock_expanded|short|end|slack_only|summary|json]\
339-
[-fields capacitance|slew|fanout|input_pin|net|src_attr]\
339+
[-fields capacitance|slew|fanout|input_pin|net|src_attr|orig_name]\
340340
[-digits digits]\
341341
[-no_line_splits]\
342342
[> filename] [>> filename]}
@@ -722,6 +722,7 @@ proc parse_report_path_options { cmd args_var default_format
722722
set report_fanout 0
723723
set report_variation 0
724724
set report_src_attr 0
725+
set report_orig_name 0
725726
if { [info exists path_options(-fields)] } {
726727
foreach field $path_options(-fields) {
727728
if { [string match "input*" $field] } {
@@ -740,14 +741,17 @@ proc parse_report_path_options { cmd args_var default_format
740741
set report_variation 1
741742
} elseif { [string match "src*" $field] } {
742743
set report_src_attr 1
744+
} elseif { [string match "orig*" $field] } {
745+
set report_orig_name 1
743746
} else {
744747
sta_warn 168 "unknown field $field."
745748
}
746749
}
747750
}
748751

749752
set_report_path_fields $report_input_pin $report_hier_pins $report_net \
750-
$report_cap $report_slew $report_fanout $report_variation $report_src_attr
753+
$report_cap $report_slew $report_fanout $report_variation $report_src_attr \
754+
$report_orig_name
751755

752756
set_report_path_no_split [info exists path_options(-no_line_splits)]
753757
}

search/Sta.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,11 +2769,13 @@ Sta::setReportPathFields(bool report_input_pin,
27692769
bool report_slew,
27702770
bool report_fanout,
27712771
bool report_variation,
2772-
bool report_src_attr)
2772+
bool report_src_attr,
2773+
bool report_orig_name)
27732774
{
27742775
report_path_->setReportFields(report_input_pin, report_hier_pins, report_net,
27752776
report_cap, report_slew, report_fanout,
2776-
report_variation, report_src_attr);
2777+
report_variation, report_src_attr,
2778+
report_orig_name);
27772779
}
27782780

27792781
ReportField *

search/test/cpp/TestSearchStaDesign.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ TEST_F(StaDesignTest, SearchReportClkInfos) {
18741874

18751875
TEST_F(StaDesignTest, SetReportPathFields) {
18761876
ASSERT_NO_THROW(( [&](){
1877-
sta_->setReportPathFields(true, true, true, true, true, true, true, true);
1877+
sta_->setReportPathFields(true, true, true, true, true, true, true, true, true);
18781878

18791879
}() ));
18801880
}
@@ -3625,7 +3625,7 @@ TEST_F(StaDesignTest, ReportPathFieldOrder) {
36253625

36263626
TEST_F(StaDesignTest, ReportPathFields) {
36273627
ASSERT_NO_THROW(( [&](){
3628-
sta_->setReportPathFields(true, true, true, true, true, true, true, true);
3628+
sta_->setReportPathFields(true, true, true, true, true, true, true, true, true);
36293629

36303630
}() ));
36313631
}

search/test/cpp/TestSearchStaInit.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,13 @@ TEST_F(StaInitTest, SetReportPathFields) {
433433
ASSERT_NE(fanout_field, nullptr);
434434
ASSERT_NE(src_attr_field, nullptr);
435435

436-
sta_->setReportPathFields(true, true, true, true, true, true, true, true);
436+
sta_->setReportPathFields(true, true, true, true, true, true, true, true, true);
437437
EXPECT_TRUE(cap_field->enabled());
438438
EXPECT_TRUE(slew_field->enabled());
439439
EXPECT_TRUE(fanout_field->enabled());
440440
EXPECT_TRUE(src_attr_field->enabled());
441441

442-
sta_->setReportPathFields(false, false, false, false, false, false, false, false);
442+
sta_->setReportPathFields(false, false, false, false, false, false, false, false, false);
443443
EXPECT_FALSE(cap_field->enabled());
444444
EXPECT_FALSE(slew_field->enabled());
445445
EXPECT_FALSE(fanout_field->enabled());
@@ -1613,8 +1613,8 @@ TEST_F(StaInitTest, ReportPathNoSplit) {
16131613

16141614
TEST_F(StaInitTest, ReportPathSetReportFields) {
16151615
ReportPath *rpt = sta_->reportPath();
1616-
rpt->setReportFields(true, true, true, true, true, true, true, true);
1617-
rpt->setReportFields(false, false, false, false, false, false, false, false);
1616+
rpt->setReportFields(true, true, true, true, true, true, true, true, true);
1617+
rpt->setReportFields(false, false, false, false, false, false, false, false, false);
16181618

16191619
}
16201620

0 commit comments

Comments
 (0)