upstream changes 5/14 plus fix report generic field

Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
This commit is contained in:
dsengupta0628
2026-05-14 21:01:39 +00:00
parent 85f3840898
commit 1475ab0fae
7 changed files with 46 additions and 47 deletions

View File

@@ -2469,11 +2469,6 @@ ReportPath::reportPathLine(const Path *path,
std::string src_attr;
if (inst)
src_attr = network_->getAttribute(inst, "src");
std::string orig_name;
if (inst && field_orig_name_->enabled()) {
std::string port_name = network_->portName(pin);
orig_name = network_->getAttribute(inst, "orig_name_" + port_name);
}
// Don't show capacitance field for input pins.
if (is_driver && field_capacitance_->enabled())
cap = graph_delay_calc_->loadCap(pin, rf, scene, min_max);
@@ -2756,11 +2751,6 @@ ReportPath::reportPath6(const Path *path,
std::string src_attr;
if (inst)
src_attr = network_->getAttribute(inst, "src");
std::string orig_name;
if (inst && field_orig_name_->enabled()) {
std::string port_name = network_->portName(pin);
orig_name = network_->getAttribute(inst, "orig_name_" + port_name);
}
// Always show the search start point (register clk pin).
// Skip reporting the clk tree unless it is requested.
if (is_clk_start
@@ -2853,13 +2843,13 @@ ReportPath::reportPath6(const Path *path,
const std::string what = descriptionField(vertex);
reportLine(what, path1, cap, slew, fanout,
incr, field_blank_, time, false, min_max, rf, src_attr,
orig_name, line_case);
line_case);
if (report_net_) {
const std::string what2 = descriptionNet(pin);
reportLine(what2, path1, field_blank_, field_blank_, field_blank_,
field_blank_, field_blank_, field_blank_, false, min_max,
nullptr, src_attr, "", "");
nullptr, src_attr, "");
}
prev_time = time;
}
@@ -2872,7 +2862,7 @@ ReportPath::reportPath6(const Path *path,
const std::string what = descriptionField(vertex);
reportLine(what, path1, field_blank_, slew, field_blank_,
incr, field_blank_, time, false, min_max, rf, src_attr,
orig_name, line_case);
line_case);
prev_time = time;
}
}
@@ -2897,27 +2887,27 @@ ReportPath::reportVariation(const Path *path) const
float std_dev = arc_delay.stdDev();
reportLine("sigma", path, field_blank_, field_blank_, field_blank_,
field_blank_, std_dev, field_blank_, true, min_max,
nullptr, "", "", "");
nullptr, "", "");
break;
}
case PocvMode::skew_normal: {
float mean = arc_delay.mean();
reportLine("mean", path, field_blank_, field_blank_, field_blank_,
field_blank_, mean, field_blank_, true, min_max,
nullptr, "", "", "");
nullptr, "", "");
float mean_shift = arc_delay.meanShift();
reportLine("mean_shift", path, field_blank_, field_blank_, field_blank_,
field_blank_, mean_shift, field_blank_, true, min_max,
nullptr, "", "", "");
nullptr, "", "");
float std_dev = arc_delay.stdDev();
reportLine("std_dev", path, field_blank_, field_blank_, field_blank_,
field_blank_, std_dev, field_blank_, true, min_max,
nullptr, "", "", "");
nullptr, "", "");
// skewness is dimensionless, so scale it to the field's time units.
float skewness = arc_delay.skewness() * units_->timeUnit()->scale();
reportLine("skewness", path, field_blank_, field_blank_, field_blank_,
field_blank_, skewness, field_blank_, true, min_max,
nullptr, "", "", "");
nullptr, "", "");
break;
}
default:
@@ -3149,7 +3139,7 @@ ReportPath::reportLineNegative(std::string_view what,
{
reportLine(what, nullptr, field_blank_, field_blank_, field_blank_,
field_blank_, field_blank_, total, true /* tota_with_minus */,
early_late, nullptr, "", "", "");
early_late, nullptr, "", "");
}
// Report total, and transition suffix.
@@ -3211,7 +3201,6 @@ ReportPath::reportLine(std::string_view what,
const EarlyLate *early_late,
const RiseFall *rf,
std::string_view src_attr,
std::string_view orig_name,
std::string_view line_case) const
{
std::string line;
@@ -3219,7 +3208,7 @@ ReportPath::reportLine(std::string_view what,
bool first_field = true;
for (const ReportField *field : fields_) {
bool last_field = field_index == (fields_.size() - 1);
if (field->enabled()) {
if (!first_field)
line += ' ';
@@ -3262,12 +3251,6 @@ ReportPath::reportLine(std::string_view what,
else
reportFieldBlank(field, line);
}
else if (field == field_orig_name_) {
if (orig_name != "")
reportField(orig_name, field, line);
else
reportFieldBlank(field, line);
}
else if (field == field_case_)
line += line_case;
else if (field->getValue())

View File

@@ -215,7 +215,6 @@ public:
ReportField *fieldFanout() const { return field_fanout_; }
ReportField *fieldCapacitance() const { return field_capacitance_; }
ReportField *fieldSrcAttr() const { return field_src_attr_; }
ReportField *fieldOrigName() const { return field_orig_name_; }
protected:
void makeFields();
@@ -428,7 +427,6 @@ protected:
const EarlyLate *early_late,
const RiseFall *rf,
std::string_view src_attr,
std::string_view orig_name,
std::string_view line_case) const;
void reportLineTotal(std::string_view what,
const Delay &incr,
@@ -548,7 +546,6 @@ protected:
ReportField *field_fanout_;
ReportField *field_variation_;
ReportField *field_src_attr_;
ReportField *field_orig_name_;
ReportField *field_edge_;
ReportField *field_case_;

View File

@@ -333,7 +333,7 @@ define_cmd_args "report_checks" \
[-sort_by_slack]\
[-path_group group_name]\
[-format full|full_clock|full_clock_expanded|short|end|slack_only|summary|json]\
[-fields capacitance|slew|fanout|input_pin|net|src_attr|orig_name]\
[-fields capacitance|slew|fanout|input_pin|net|src_attr]\
[-digits digits]\
[-no_line_splits]\
[> filename] [>> filename]}

View File

@@ -0,0 +1,13 @@
// Shared report-path field name constants used by the OpenSTA gtest suites.
#pragma once
#include "sta/StringUtil.hh"
namespace sta {
inline const StringSeq kAllReportFields = {
"input_pin", "hierarchical_pin", "net", "capacitance",
"slew", "fanout", "variation", "src_attr"};
} // namespace sta

View File

@@ -5,6 +5,7 @@
#include <tcl.h>
#include <unistd.h>
#include "MinMax.hh"
#include "TestReportFields.hh"
#include "Transition.hh"
#include "Property.hh"
#include "ExceptionPath.hh"
@@ -1874,7 +1875,7 @@ TEST_F(StaDesignTest, SearchReportClkInfos) {
TEST_F(StaDesignTest, SetReportPathFields) {
ASSERT_NO_THROW(( [&](){
sta_->setReportPathFields(true, true, true, true, true, true, true, true, true);
sta_->setReportPathFields(kAllReportFields);
}() ));
}
@@ -3625,7 +3626,7 @@ TEST_F(StaDesignTest, ReportPathFieldOrder) {
TEST_F(StaDesignTest, ReportPathFields) {
ASSERT_NO_THROW(( [&](){
sta_->setReportPathFields(true, true, true, true, true, true, true, true, true);
sta_->setReportPathFields(kAllReportFields);
}() ));
}

View File

@@ -2,6 +2,7 @@
#include <type_traits>
#include <tcl.h>
#include "MinMax.hh"
#include "TestReportFields.hh"
#include "Transition.hh"
#include "Property.hh"
#include "ExceptionPath.hh"
@@ -433,13 +434,13 @@ TEST_F(StaInitTest, SetReportPathFields) {
ASSERT_NE(fanout_field, nullptr);
ASSERT_NE(src_attr_field, nullptr);
sta_->setReportPathFields(true, true, true, true, true, true, true, true, true);
sta_->setReportPathFields(kAllReportFields);
EXPECT_TRUE(cap_field->enabled());
EXPECT_TRUE(slew_field->enabled());
EXPECT_TRUE(fanout_field->enabled());
EXPECT_TRUE(src_attr_field->enabled());
sta_->setReportPathFields(false, false, false, false, false, false, false, false, false);
sta_->setReportPathFields(StringSeq{});
EXPECT_FALSE(cap_field->enabled());
EXPECT_FALSE(slew_field->enabled());
EXPECT_FALSE(fanout_field->enabled());
@@ -1613,8 +1614,8 @@ TEST_F(StaInitTest, ReportPathNoSplit) {
TEST_F(StaInitTest, ReportPathSetReportFields) {
ReportPath *rpt = sta_->reportPath();
rpt->setReportFields(true, true, true, true, true, true, true, true, true);
rpt->setReportFields(false, false, false, false, false, false, false, false, false);
rpt->setReportFields(kAllReportFields);
rpt->setReportFields(StringSeq{});
}
@@ -3706,7 +3707,9 @@ TEST_F(StaInitTest, LogicValueStringOne) {
// --- ReportPath.cc: ReportField constructor and setEnabled ---
TEST_F(StaInitTest, ReportFieldConstruct) {
ReportField rf("test_field", "Test Field", 10, false, nullptr, true);
ReportField rf("test_field", "test_field", "Test Field", 10, false, nullptr,
nullptr);
rf.setEnabled(true);
EXPECT_EQ(rf.name(), "test_field");
EXPECT_EQ(rf.title(), "Test Field");
EXPECT_EQ(rf.width(), 10);
@@ -3716,7 +3719,8 @@ TEST_F(StaInitTest, ReportFieldConstruct) {
}
TEST_F(StaInitTest, ReportFieldSetEnabled) {
ReportField rf("f1", "F1", 8, true, nullptr, true);
ReportField rf("f1", "f1", "F1", 8, true, nullptr, nullptr);
rf.setEnabled(true);
EXPECT_TRUE(rf.enabled());
rf.setEnabled(false);
EXPECT_FALSE(rf.enabled());
@@ -3725,14 +3729,14 @@ TEST_F(StaInitTest, ReportFieldSetEnabled) {
}
TEST_F(StaInitTest, ReportFieldSetWidth) {
ReportField rf("f2", "F2", 5, false, nullptr, true);
ReportField rf("f2", "f2", "F2", 5, false, nullptr, nullptr);
EXPECT_EQ(rf.width(), 5);
rf.setWidth(12);
EXPECT_EQ(rf.width(), 12);
}
TEST_F(StaInitTest, ReportFieldSetProperties) {
ReportField rf("f3", "F3", 5, false, nullptr, true);
ReportField rf("f3", "f3", "F3", 5, false, nullptr, nullptr);
rf.setProperties("New Title", 20, true);
EXPECT_EQ(rf.title(), "New Title");
EXPECT_EQ(rf.width(), 20);
@@ -3740,7 +3744,7 @@ TEST_F(StaInitTest, ReportFieldSetProperties) {
}
TEST_F(StaInitTest, ReportFieldBlank) {
ReportField rf("f4", "F4", 3, false, nullptr, true);
ReportField rf("f4", "f4", "F4", 3, false, nullptr, nullptr);
const std::string &blank = rf.blank();
EXPECT_FALSE(blank.empty());
}

View File

@@ -2,6 +2,7 @@
#include <type_traits>
#include <tcl.h>
#include "MinMax.hh"
#include "TestReportFields.hh"
#include "Transition.hh"
#include "Property.hh"
#include "ExceptionPath.hh"
@@ -224,7 +225,7 @@ TEST_F(StaInitTest, StaReportPathEndFooter2) {
TEST_F(StaInitTest, StaSetReportPathFields) {
ASSERT_NO_THROW(( [&](){
sta_->setReportPathFields(true, true, true, true, true, true, true, true, true);
sta_->setReportPathFields(kAllReportFields);
}() ));
}
@@ -1724,8 +1725,8 @@ TEST_F(StaInitTest, SearchClassConstants2) {
TEST_F(StaInitTest, ReportPathSetReportFields2) {
ASSERT_NO_THROW(( [&](){
ReportPath *rpt = sta_->reportPath();
rpt->setReportFields(true, true, true, true, true, true, true, true, true);
rpt->setReportFields(false, false, false, false, false, false, false, false, false);
rpt->setReportFields(kAllReportFields);
rpt->setReportFields(StringSeq{});
}() ));
}
@@ -1909,8 +1910,8 @@ TEST_F(StaInitTest, ReportPathSetReportFieldsPublic) {
ASSERT_NO_THROW(( [&](){
ReportPath *rpt = sta_->reportPath();
// Call setReportFields with various combinations
rpt->setReportFields(true, false, false, false, true, false, false, false, false);
rpt->setReportFields(true, true, true, true, true, true, true, true, true);
rpt->setReportFields(StringSeq{"input_pin", "slew"});
rpt->setReportFields(kAllReportFields);
expectStaCoreState(sta_);
}() ));
}