Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Matt Liberty 2025-11-03 18:30:51 +00:00
commit 19202ac933
5 changed files with 52 additions and 15 deletions

View File

@ -416,7 +416,7 @@ public:
virtual void connectPinAfter(PinSet *, virtual void connectPinAfter(PinSet *,
Network *) {} Network *) {}
virtual void disconnectPinBefore(const Pin *, virtual void disconnectPinBefore(const Pin *,
Network *) {} Network *);
void deleteInstance(const Instance *inst, void deleteInstance(const Instance *inst,
const Network *network); const Network *network);

View File

@ -1054,6 +1054,7 @@ protected:
ExceptionPath *findMergeMatch(ExceptionPath *exception); ExceptionPath *findMergeMatch(ExceptionPath *exception);
void addException1(ExceptionPath *exception); void addException1(ExceptionPath *exception);
void addException2(ExceptionPath *exception); void addException2(ExceptionPath *exception);
void recordExceptionPins(ExceptionPath *exception);
void recordPathDelayInternalFrom(ExceptionPath *exception); void recordPathDelayInternalFrom(ExceptionPath *exception);
void unrecordPathDelayInternalFrom(ExceptionPath *exception); void unrecordPathDelayInternalFrom(ExceptionPath *exception);
bool pathDelayFrom(const Pin *pin); bool pathDelayFrom(const Pin *pin);
@ -1369,6 +1370,7 @@ protected:
PinExceptionsMap first_to_pin_exceptions_; PinExceptionsMap first_to_pin_exceptions_;
ClockExceptionsMap first_to_clk_exceptions_; ClockExceptionsMap first_to_clk_exceptions_;
InstanceExceptionsMap first_to_inst_exceptions_; InstanceExceptionsMap first_to_inst_exceptions_;
PinExceptionsMap pin_exceptions_;
// Edges that traverse hierarchical exception pins. // Edges that traverse hierarchical exception pins.
EdgeExceptionsMap first_thru_edge_exceptions_; EdgeExceptionsMap first_thru_edge_exceptions_;
// Exception hash with one missing from/thru/to point, used for merging. // Exception hash with one missing from/thru/to point, used for merging.

View File

@ -1155,6 +1155,13 @@ ExceptionFromTo::deleteInstance(const Instance *inst,
} }
} }
void
ExceptionFromTo::disconnectPinBefore(const Pin *pin,
Network *network)
{
deletePin(pin, network);
}
const char * const char *
ExceptionFromTo::asString(const Network *network) const ExceptionFromTo::asString(const Network *network) const
{ {
@ -2057,6 +2064,7 @@ void
ExceptionThru::disconnectPinBefore(const Pin *pin, ExceptionThru::disconnectPinBefore(const Pin *pin,
Network *network) Network *network)
{ {
deletePin(pin, network);
// Remove edges from/to leaf pin and through hier pin. // Remove edges from/to leaf pin and through hier pin.
deletePinEdges(pin, network); deletePinEdges(pin, network);
} }

View File

@ -4601,6 +4601,7 @@ Sdc::recordException(ExceptionPath *exception)
exception->setId(++exception_id_); exception->setId(++exception_id_);
recordMergeHashes(exception); recordMergeHashes(exception);
recordExceptionFirstPts(exception); recordExceptionFirstPts(exception);
recordExceptionPins(exception);
checkForThruHpins(exception); checkForThruHpins(exception);
} }
@ -4671,6 +4672,22 @@ Sdc::recordExceptionFirstFrom(ExceptionPath *exception)
recordExceptionClks(exception, from->clks(), first_from_clk_exceptions_); recordExceptionClks(exception, from->clks(), first_from_clk_exceptions_);
} }
void
Sdc::recordExceptionPins(ExceptionPath *exception)
{
ExceptionFrom *from = exception->from();
if (from)
recordExceptionPins(exception, from->pins(), pin_exceptions_);
ExceptionThruSeq *thrus = exception->thrus();
if (thrus) {
for (ExceptionThru *thru : *thrus)
recordExceptionPins(exception, thru->pins(), pin_exceptions_);
}
ExceptionTo *to = exception->to();
if (to)
recordExceptionPins(exception, to->pins(), pin_exceptions_);
}
void void
Sdc::recordExceptionFirstThru(ExceptionPath *exception) Sdc::recordExceptionFirstThru(ExceptionPath *exception)
{ {
@ -5089,7 +5106,8 @@ public:
ExpandException(ExceptionPath *exception, ExpandException(ExceptionPath *exception,
ExceptionPathSet &expansions, ExceptionPathSet &expansions,
Network *network); Network *network);
virtual void visit(ExceptionFrom *from, ExceptionThruSeq *thrus, virtual void visit(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to); ExceptionTo *to);
private: private:
@ -5606,13 +5624,19 @@ Sdc::connectPinAfter(const Pin *pin)
void void
Sdc::disconnectPinBefore(const Pin *pin) Sdc::disconnectPinBefore(const Pin *pin)
{ {
if (have_thru_hpin_exceptions_) { auto itr = pin_exceptions_.find(pin);
for (ExceptionPath *exception : exceptions_) { if (itr != pin_exceptions_.end()) {
for (ExceptionPath *exception : *itr->second) {
ExceptionFrom *from = exception->from();
if (from)
from->disconnectPinBefore(pin, network_);
ExceptionTo *to = exception->to();
if (to)
to->disconnectPinBefore(pin, network_);
ExceptionPt *first_pt = exception->firstPt(); ExceptionPt *first_pt = exception->firstPt();
ExceptionThruSeq *thrus = exception->thrus(); ExceptionThruSeq *thrus = exception->thrus();
if (thrus) { if (thrus) {
for (ExceptionThru *thru : *exception->thrus()) { for (ExceptionThru *thru : *exception->thrus()) {
if (thru->edges()) {
thru->disconnectPinBefore(pin, network_); thru->disconnectPinBefore(pin, network_);
if (thru == first_pt) if (thru == first_pt)
recordExceptionEdges(exception, thru->edges(), recordExceptionEdges(exception, thru->edges(),
@ -5620,8 +5644,12 @@ Sdc::disconnectPinBefore(const Pin *pin)
} }
} }
} }
first_from_pin_exceptions_.erase(pin);
first_thru_pin_exceptions_.erase(pin);
first_to_pin_exceptions_.erase(pin);
pin_exceptions_.erase(pin);
} }
}
for (int corner_index = 0; corner_index < corners_->count(); corner_index++) for (int corner_index = 0; corner_index < corners_->count(); corner_index++)
drvr_pin_wire_cap_maps_[corner_index].erase(pin); drvr_pin_wire_cap_maps_[corner_index].erase(pin);
} }

View File

@ -642,15 +642,14 @@ MakePathEnds1::visitPathEnd(PathEnd *path_end,
if (group->saveable(path_end)) { if (group->saveable(path_end)) {
// Only keep the path end with the smallest slack/latest arrival. // Only keep the path end with the smallest slack/latest arrival.
PathEnd *worst_end = ends_.findKey(group); PathEnd *worst_end = ends_.findKey(group);
PathEnd *copy = path_end->copy();
if (worst_end) { if (worst_end) {
if (cmp_(path_end, worst_end)) { if (cmp_(path_end, worst_end)) {
ends_[group] = copy; ends_[group] = path_end->copy();
delete worst_end; delete worst_end;
} }
} }
else else
ends_[group] = copy; ends_[group] = path_end->copy();
} }
} }