LibertyPort::less

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2026-04-18 11:39:03 -07:00
parent 668cfb26af
commit 6c9af4a5fa
3 changed files with 4 additions and 3 deletions

View File

@ -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_; }

View File

@ -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;
}

View File

@ -212,7 +212,7 @@ TimingArcSet::TimingArcSet(const TimingRole *role,
}
std::string
TimingArcSet::to_string()
TimingArcSet::to_string() const
{
std::string str = from_->name();
str += " -> ";