RiseFall use shortName instead of to_string

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2026-03-06 12:02:05 -07:00
parent f1e5587fef
commit d8c0e9285b
18 changed files with 63 additions and 47 deletions

View File

@ -118,7 +118,7 @@ CcsCeffDelayCalc::gateDelay(const Pin *drvr_pin,
ref_time_ = output_waveforms_->referenceTime(in_slew_);
debugPrint(debug_, "ccs_dcalc", 1, "%s %s",
drvr_cell->name(),
drvr_rf_->to_string().c_str());
drvr_rf_->shortName());
ArcDelay gate_delay;
Slew drvr_slew;
gateDelaySlew(drvr_library, drvr_rf_, gate_delay, drvr_slew);

View File

@ -604,7 +604,7 @@ GraphDelayCalc::findInputDriverDelay(const LibertyCell *drvr_cell,
{
debugPrint(debug_, "delay_calc", 2, " driver cell %s %s",
drvr_cell->name(),
rf->to_string().c_str());
rf->shortName());
for (TimingArcSet *arc_set : drvr_cell->timingArcSets(from_port, to_port)) {
for (TimingArc *arc : arc_set->arcs()) {
if (arc->toEdge()->asRiseFall() == rf) {

View File

@ -231,7 +231,7 @@ PrimaDelayCalc::gateDelays(ArcDcalcArgSeq &dcalc_args,
output_waveforms_[drvr_idx] = output_waveforms;
debugPrint(debug_, "ccs_dcalc", 1, "%s %s",
dcalc_arg.drvrCell()->name(),
drvr_rf_->to_string().c_str());
drvr_rf_->shortName());
LibertyCell *drvr_cell = dcalc_arg.drvrCell();
const LibertyLibrary *drvr_library = drvr_cell->libertyLibrary();
bool vdd_exists;
@ -744,7 +744,7 @@ PrimaDelayCalc::dcalcResults()
debugPrint(debug_, "ccs_dcalc", 2,
"load %s %s delay %s slew %s",
network_->pathName(load_pin),
drvr_rf_->to_string().c_str(),
drvr_rf_->shortName(),
delayAsString(wire_delay, this),
delayAsString(load_slew, this));

View File

@ -299,7 +299,7 @@ latch_d_to_q_en()
if (enable_port)
return stringPrintTmp("%s %s",
enable_port->name(),
enable_rf->to_string().c_str());
enable_rf->shortName());
}
return "";
}

View File

@ -48,8 +48,7 @@ public:
static const RiseFall *fall() { return &fall_; }
static int riseIndex() { return rise_.sdf_triple_index_; }
static int fallIndex() { return fall_.sdf_triple_index_; }
const std::string &to_string_long() const { return name_; }
const std::string &to_string() const { return short_name_; }
const std::string &to_string(bool use_short = false) const;
const char *name() const { return name_.c_str(); }
const char *shortName() const { return short_name_.c_str(); }
int index() const { return sdf_triple_index_; }
@ -94,7 +93,7 @@ public:
static const RiseFallBoth *rise() { return &rise_; }
static const RiseFallBoth *fall() { return &fall_; }
static const RiseFallBoth *riseFall() { return &rise_fall_; }
const std::string &to_string() const { return short_name_; }
const std::string &to_string(bool use_short = false) const;
const char *name() const { return name_.c_str(); }
const char *shortName() const { return short_name_.c_str(); }
int index() const { return sdf_triple_index_; }

View File

@ -524,7 +524,7 @@ void
LibertyReader::readThresholds(const LibertyGroup *library_group)
{
for (const RiseFall *rf : RiseFall::range()) {
std::string suffix = rf->to_string_long();
std::string suffix = rf->to_string();
readLibAttrFloat(library_group, ("input_threshold_pct_" + suffix).c_str(),
&LibertyLibrary::setInputThreshold, rf, 0.01F);
if (library_->inputThreshold(rf) == 0.0)
@ -907,7 +907,7 @@ void
LibertyReader::readSlewDegradations(const LibertyGroup *library_group)
{
for (const RiseFall *rf : RiseFall::range()) {
const std::string group_name = rf->to_string_long() + "_transition_degradation";
const std::string group_name = rf->to_string() + "_transition_degradation";
const LibertyGroup *degradation_group =
library_group->findSubgroup(group_name.c_str());
if (degradation_group) {
@ -1480,7 +1480,7 @@ LibertyReader::readCapacitance(const LibertyPortSeq &ports,
for (LibertyPort *port : ports) {
// rise/fall_capacitance
for (const RiseFall *rf : RiseFall::range()) {
std::string attr_name = rf->to_string_long() + "_capacitance";
std::string attr_name = rf->to_string() + "_capacitance";
float cap;
bool exists;
port_group->findAttrFloat(attr_name, cap, exists);
@ -1490,7 +1490,7 @@ LibertyReader::readCapacitance(const LibertyPortSeq &ports,
}
// rise/fall_capacitance_range(min_cap, max_cap);
attr_name = rf->to_string_long() + "_capacitance_range";
attr_name = rf->to_string() + "_capacitance_range";
const LibertyComplexAttrSeq &range_attrs = port_group->findComplexAttrs(attr_name);
if (!range_attrs.empty()) {
const LibertyComplexAttr *attr = range_attrs[0];
@ -2081,7 +2081,7 @@ LibertyReader::makeLinearModels(LibertyCell *cell,
{
LibertyLibrary *library = cell->libertyLibrary();
for (const RiseFall *rf : RiseFall::range()) {
std::string intr_attr_name = "intrinsic_" + rf->to_string_long();
std::string intr_attr_name = "intrinsic_" + rf->to_string();
float intr = 0.0;
bool intr_exists;
timing_group->findAttrFloat(intr_attr_name, intr, intr_exists);
@ -2094,7 +2094,7 @@ LibertyReader::makeLinearModels(LibertyCell *cell,
if (timingTypeIsCheck(timing_attrs->timingType()))
model = new CheckLinearModel(cell, intr);
else {
std::string res_attr_name = rf->to_string_long() + "_resistance";
std::string res_attr_name = rf->to_string() + "_resistance";
float res = 0.0;
bool res_exists;
timing_group->findAttrFloat(res_attr_name, res, res_exists);
@ -2117,18 +2117,18 @@ LibertyReader::makeTableModels(LibertyCell *cell,
{
bool found_model = false;
for (const RiseFall *rf : RiseFall::range()) {
std::string delay_attr_name = "cell_" + rf->to_string_long();
std::string delay_attr_name = "cell_" + rf->to_string();
TableModel *delay = readGateTableModel(timing_group, delay_attr_name.c_str(), rf,
TableTemplateType::delay, time_scale_,
ScaleFactorType::cell);
std::string transition_attr_name = rf->to_string_long() + "_transition";
std::string transition_attr_name = rf->to_string() + "_transition";
TableModel *transition = readGateTableModel(timing_group,
transition_attr_name.c_str(),
rf, TableTemplateType::delay,
time_scale_,
ScaleFactorType::transition);
if (delay || transition) {
std::string delay_sigma_attr_name = "ocv_sigma_cell_" + rf->to_string_long();
std::string delay_sigma_attr_name = "ocv_sigma_cell_" + rf->to_string();
TableModelsEarlyLate delay_sigmas =
readEarlyLateTableModels(timing_group,
delay_sigma_attr_name.c_str(),
@ -2136,7 +2136,7 @@ LibertyReader::makeTableModels(LibertyCell *cell,
time_scale_,
ScaleFactorType::unknown);
std::string slew_sigma_attr_name = "ocv_sigma_" + rf->to_string_long()
std::string slew_sigma_attr_name = "ocv_sigma_" + rf->to_string()
+ "_transition";
TableModelsEarlyLate slew_sigmas =
readEarlyLateTableModels(timing_group,
@ -2164,7 +2164,7 @@ LibertyReader::makeTableModels(LibertyCell *cell,
found_model = true;
}
else {
std::string constraint_attr_name = rf->to_string_long() + "_constraint";
std::string constraint_attr_name = rf->to_string() + "_constraint";
ScaleFactorType scale_factor_type =
timingTypeScaleFactorType(timing_attrs->timingType());
TableModel *constraint = readCheckTableModel(timing_group,
@ -2172,7 +2172,7 @@ LibertyReader::makeTableModels(LibertyCell *cell,
rf, TableTemplateType::delay,
time_scale_, scale_factor_type);
if (constraint) {
std::string constraint_sigma_attr_name = "ocv_sigma_" + rf->to_string_long()
std::string constraint_sigma_attr_name = "ocv_sigma_" + rf->to_string()
+ "_constraint";
TableModelsEarlyLate constraint_sigmas =
readEarlyLateTableModels(timing_group,
@ -2298,7 +2298,7 @@ LibertyReader::readReceiverCapacitance(const LibertyGroup *timing_group,
ReceiverModelPtr &receiver_model)
{
std::string cap_group_name1 = cap_group_name;
cap_group_name1 += "_" + rf->to_string_long();
cap_group_name1 += "_" + rf->to_string();
const LibertyGroup *cap_group = timing_group->findSubgroup(cap_group_name1);
if (cap_group) {
const LibertySimpleAttr *segment_attr = cap_group->findSimpleAttr("segment");
@ -2328,7 +2328,7 @@ OutputWaveforms *
LibertyReader::readOutputWaveforms(const LibertyGroup *timing_group,
const RiseFall *rf)
{
const std::string current_group_name = "output_current_" + rf->to_string_long();
const std::string current_group_name = "output_current_" + rf->to_string();
const LibertyGroup *current_group = timing_group->findSubgroup(current_group_name);
if (current_group) {
OutputWaveformSeq output_currents;
@ -2680,7 +2680,7 @@ LibertyReader::readInternalPowerGroups(LibertyCell *cell,
InternalPowerModels models;
// rise/fall_power group
for (const RiseFall *rf : RiseFall::range()) {
std::string pwr_attr_name = rf->to_string_long() + "_power";
std::string pwr_attr_name = rf->to_string() + "_power";
const LibertyGroup *pwr_group = ipwr_group->findSubgroup(pwr_attr_name);
if (pwr_group) {
TableModel *model = readTableModel(pwr_group, rf, TableTemplateType::power,

View File

@ -311,7 +311,7 @@ reduceToPiElmore(const Parasitic *parasitic_network,
if (drvr_node) {
debugPrint(sta->debug(), "parasitic_reduce", 1, "Reduce driver %s %s %s",
sta->network()->pathName(drvr_pin),
rf->to_string().c_str(),
rf->shortName(),
min_max->to_string().c_str());
ReduceToPiElmore reducer(sta);
return reducer.makePiElmore(parasitic_network, drvr_pin, drvr_node,

View File

@ -531,7 +531,7 @@ ClockEdge::ClockEdge(Clock *clock,
const RiseFall *rf) :
clock_(clock),
rf_(rf),
name_(stringPrint("%s %s", clock_->name(), rf_->to_string().c_str())),
name_(stringPrint("%s %s", clock_->name(), rf_->shortName())),
time_(0.0),
index_(clock_->index() * RiseFall::index_count + rf_->index())
{

View File

@ -106,7 +106,7 @@ ClkSkews::reportClkSkew(ClkSkew &clk_skew,
report_->reportLine("%7s source latency %s %s",
time_unit->asString(src_latency, digits),
sdc_network_->pathName(src_path->pin(this)),
src_path->transition(this)->to_string().c_str());
src_path->transition(this)->shortName());
if (src_internal_clk_latency != 0.0)
report_->reportLine("%7s source internal clock delay",
time_unit->asString(src_internal_clk_latency, digits));
@ -116,7 +116,7 @@ ClkSkews::reportClkSkew(ClkSkew &clk_skew,
report_->reportLine("%7s target latency %s %s",
time_unit->asString(-tgt_latency, digits),
sdc_network_->pathName(tgt_path->pin(this)),
tgt_path->transition(this)->to_string().c_str());
tgt_path->transition(this)->shortName());
if (tgt_internal_clk_latency != 0.0)
report_->reportLine("%7s target internal clock delay",
time_unit->asString(-tgt_internal_clk_latency, digits));
@ -315,10 +315,10 @@ ClkSkews::findClkSkew(Vertex *src_vertex,
debugPrint(debug_, "clk_skew", 2,
"%s %s %s -> %s %s %s crpr = %s skew = %s",
network_->pathName(src_path->pin(this)),
src_path->transition(this)->to_string().c_str(),
src_path->transition(this)->shortName(),
time_unit->asString(probe.srcLatency(this)),
network_->pathName(tgt_path->pin(this)),
tgt_path->transition(this)->to_string().c_str(),
tgt_path->transition(this)->shortName(),
time_unit->asString(probe.tgtLatency(this)),
delayAsString(probe.crpr(this), this),
time_unit->asString(probe.skew()));

View File

@ -878,7 +878,7 @@ Genclks::recordSrcPaths(Clock *gclk)
debugPrint(debug_, "genclk", 2, " %s insertion %s %s %s",
network_->pathName(gclk_pin),
early_late->to_string().c_str(),
rf->to_string().c_str(),
rf->shortName(),
delayAsString(path->arrival(), this));
src_path = *path;
}

View File

@ -201,7 +201,7 @@ Path::to_string(const StaState *sta) const
else
return stringPrintTmp("%s %s %s/%s %d",
vertex(sta)->to_string(sta).c_str(),
transition(sta)->to_string().c_str(),
transition(sta)->shortName(),
scene(sta)->name().c_str(),
minMax(sta)->to_string().c_str(),
tagIndex(sta));

View File

@ -426,7 +426,7 @@ PathEnumFaninVisitor::visitFromToPath(const Pin *,
debugPrint(debug_, "path_enum", 3, "visit fanin %s -> %s %s %s",
from_path->to_string(this).c_str(),
to_vertex->to_string(this).c_str(),
to_rf->to_string().c_str(),
to_rf->shortName(),
delayAsString(search_->deratedDelay(from_vertex, arc, edge,
false, from_path->minMax(this),
from_path->dcalcAnalysisPtIndex(this),

View File

@ -805,7 +805,7 @@ MakePathEndsAll::vertexEnd(Vertex *)
debugPrint(debug, "path_group", 2, "insert %s %s %s %d",
path_end->vertex(sta_)->to_string(sta_).c_str(),
path_end->typeName(),
path_end->transition(sta_)->to_string().c_str(),
path_end->transition(sta_)->shortName(),
path_end->path()->tag(sta_)->index());
// Give the group a copy of the path end because
// it may delete it during pruning.
@ -820,7 +820,7 @@ MakePathEndsAll::vertexEnd(Vertex *)
debugPrint(debug, "path_group", 3, "prune %s %s %s %d",
path_end->vertex(sta_)->to_string(sta_).c_str(),
path_end->typeName(),
path_end->transition(sta_)->to_string().c_str(),
path_end->transition(sta_)->shortName(),
path_end->path()->tag(sta_)->index());
}
// Clear ends for next vertex.

View File

@ -1365,8 +1365,8 @@ ArrivalVisitor::visitFromToPath(const Pin * /* from_pin */,
debugPrint(debug_, "search", 3, " %s",
from_vertex->to_string(this).c_str());
debugPrint(debug_, "search", 3, " %s -> %s %s",
from_rf->to_string().c_str(),
to_rf->to_string().c_str(),
from_rf->shortName(),
to_rf->shortName(),
min_max->to_string().c_str());
debugPrint(debug_, "search", 3, " from tag: %s",
from_tag->to_string(this).c_str());
@ -2919,7 +2919,7 @@ Search::reportArrivals(Vertex *vertex,
prev_str += "NULL";
}
report_->reportLine(" %s %s %s / %s %s%s",
rf->to_string().c_str(),
rf->shortName(),
path->minMax(this)->to_string().c_str(),
delayAsString(path->arrival(), this),
req,
@ -3656,8 +3656,8 @@ RequiredVisitor::visitFromToPath(const Pin *,
// Don't propagate required times through latch D->Q edges.
if (edge->role() != TimingRole::latchDtoQ()) {
debugPrint(debug_, "search", 3, " %s -> %s %s",
from_rf->to_string().c_str(),
to_rf->to_string().c_str(),
from_rf->shortName(),
to_rf->shortName(),
min_max->to_string().c_str());
debugPrint(debug_, "search", 3, " from tag %2u: %s",
from_tag->index(),

View File

@ -104,8 +104,7 @@ Tag::to_string(bool report_index,
if (report_rf_min_max) {
const RiseFall *rf = transition();
const MinMax *min_max = minMax();
result += rf->to_string();
result += " ";
result += rf->shortName();
result += min_max->to_string();
result += " ";
}

View File

@ -215,10 +215,10 @@ WritePathSpice::writeHeader()
{
const Path *start_path = path_expanded_.startPath();
std::string title = stdstrPrint("Path from %s %s to %s %s",
network_->pathName(start_path->pin(this)),
start_path->transition(this)->to_string().c_str(),
network_->pathName(path_->pin(this)),
path_->transition(this)->to_string().c_str());
network_->pathName(start_path->pin(this)),
start_path->transition(this)->shortName(),
network_->pathName(path_->pin(this)),
path_->transition(this)->shortName());
float max_time = maxTime();
float time_step = 1e-13;
writeHeader(title, max_time, time_step);

View File

@ -497,7 +497,7 @@ using namespace sta;
const RiseFall *rf = $1;
const char *str = "";
if (rf)
str = rf->to_string().c_str();
str = rf->shortName();
Tcl_SetResult(interp, const_cast<char*>(str), TCL_STATIC);
}
@ -517,7 +517,7 @@ using namespace sta;
RiseFallBoth *tr = $1;
const char *str = "";
if (tr)
str = tr->asString();
str = tr->shortName();
Tcl_SetResult(interp, const_cast<char*>(str), TCL_STATIC);
}

View File

@ -44,6 +44,15 @@ RiseFall::RiseFall(const char *name,
{
}
const std::string &
RiseFall::to_string(bool use_short) const
{
if (use_short)
return short_name_;
else
return name_;
}
const RiseFall *
RiseFall::opposite() const
{
@ -134,6 +143,15 @@ RiseFallBoth::RiseFallBoth(const char *name,
{
}
const std::string &
RiseFallBoth::to_string(bool use_short) const
{
if (use_short)
return short_name_;
else
return name_;
}
const RiseFallBoth *
RiseFallBoth::find(const char *tr_str)
{