rm disconnected pin from exceptions resolves #318

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-10-31 10:36:57 -07:00
parent 49dd390d29
commit 5b312ee084
4 changed files with 50 additions and 12 deletions

View File

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

View File

@ -1054,6 +1054,7 @@ protected:
ExceptionPath *findMergeMatch(ExceptionPath *exception);
void addException1(ExceptionPath *exception);
void addException2(ExceptionPath *exception);
void recordExceptionPins(ExceptionPath *exception);
void recordPathDelayInternalFrom(ExceptionPath *exception);
void unrecordPathDelayInternalFrom(ExceptionPath *exception);
bool pathDelayFrom(const Pin *pin);
@ -1369,6 +1370,7 @@ protected:
PinExceptionsMap first_to_pin_exceptions_;
ClockExceptionsMap first_to_clk_exceptions_;
InstanceExceptionsMap first_to_inst_exceptions_;
PinExceptionsMap pin_exceptions_;
// Edges that traverse hierarchical exception pins.
EdgeExceptionsMap first_thru_edge_exceptions_;
// 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 *
ExceptionFromTo::asString(const Network *network) const
{
@ -2057,6 +2064,7 @@ void
ExceptionThru::disconnectPinBefore(const Pin *pin,
Network *network)
{
deletePin(pin, network);
// Remove edges from/to leaf pin and through hier pin.
deletePinEdges(pin, network);
}

View File

@ -4601,6 +4601,7 @@ Sdc::recordException(ExceptionPath *exception)
exception->setId(++exception_id_);
recordMergeHashes(exception);
recordExceptionFirstPts(exception);
recordExceptionPins(exception);
checkForThruHpins(exception);
}
@ -4671,6 +4672,22 @@ Sdc::recordExceptionFirstFrom(ExceptionPath *exception)
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
Sdc::recordExceptionFirstThru(ExceptionPath *exception)
{
@ -5089,7 +5106,8 @@ public:
ExpandException(ExceptionPath *exception,
ExceptionPathSet &expansions,
Network *network);
virtual void visit(ExceptionFrom *from, ExceptionThruSeq *thrus,
virtual void visit(ExceptionFrom *from,
ExceptionThruSeq *thrus,
ExceptionTo *to);
private:
@ -5606,22 +5624,32 @@ Sdc::connectPinAfter(const Pin *pin)
void
Sdc::disconnectPinBefore(const Pin *pin)
{
if (have_thru_hpin_exceptions_) {
for (ExceptionPath *exception : exceptions_) {
auto itr = pin_exceptions_.find(pin);
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();
ExceptionThruSeq *thrus = exception->thrus();
if (thrus) {
for (ExceptionThru *thru : *exception->thrus()) {
if (thru->edges()) {
thru->disconnectPinBefore(pin, network_);
if (thru == first_pt)
recordExceptionEdges(exception, thru->edges(),
first_thru_edge_exceptions_);
}
}
for (ExceptionThru *thru : *exception->thrus()) {
thru->disconnectPinBefore(pin, network_);
if (thru == first_pt)
recordExceptionEdges(exception, thru->edges(),
first_thru_edge_exceptions_);
}
}
}
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++)
drvr_pin_wire_cap_maps_[corner_index].erase(pin);
}