From 6c9af4a5fa6fef796f360ec33b6fdfc9a7e10e83 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Sat, 18 Apr 2026 11:39:03 -0700 Subject: [PATCH] LibertyPort::less Signed-off-by: James Cherry --- include/sta/TimingArc.hh | 2 +- liberty/Liberty.cc | 3 ++- liberty/TimingArc.cc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/sta/TimingArc.hh b/include/sta/TimingArc.hh index 4f9d5445..b2f56230 100644 --- a/include/sta/TimingArc.hh +++ b/include/sta/TimingArc.hh @@ -146,7 +146,7 @@ class TimingArcSet public: ~TimingArcSet(); - std::string to_string(); + std::string to_string() const; LibertyCell *libertyCell() const; LibertyPort *from() const { return from_; } LibertyPort *to() const { return to_; } diff --git a/liberty/Liberty.cc b/liberty/Liberty.cc index 8d7a59e0..97682e1e 100644 --- a/liberty/Liberty.cc +++ b/liberty/Liberty.cc @@ -2380,12 +2380,13 @@ LibertyPort::equiv(const LibertyPort *port1, && port1->pwr_gnd_type_ == port2->pwr_gnd_type_); } +// Note port1 and port2 may be from different cells (timingArcSetLess). bool LibertyPort::less(const LibertyPort *port1, const LibertyPort *port2) { if (port1 && port2) - return port1->pinIndex() < port2->pinIndex(); + return port1->name() < port2->name(); else return port1 == nullptr && port2 != nullptr; } diff --git a/liberty/TimingArc.cc b/liberty/TimingArc.cc index ae99b043..dd1694bd 100644 --- a/liberty/TimingArc.cc +++ b/liberty/TimingArc.cc @@ -212,7 +212,7 @@ TimingArcSet::TimingArcSet(const TimingRole *role, } std::string -TimingArcSet::to_string() +TimingArcSet::to_string() const { std::string str = from_->name(); str += " -> ";