Skip to content

Commit 5b312ee

Browse files
committed
rm disconnected pin from exceptions resolves #318
Signed-off-by: James Cherry <[email protected]>
1 parent 49dd390 commit 5b312ee

File tree

4 files changed

+50
-12
lines changed

4 files changed

+50
-12
lines changed

include/sta/ExceptionPath.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public:
416416
virtual void connectPinAfter(PinSet *,
417417
Network *) {}
418418
virtual void disconnectPinBefore(const Pin *,
419-
Network *) {}
419+
Network *);
420420
void deleteInstance(const Instance *inst,
421421
const Network *network);
422422

include/sta/Sdc.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,7 @@ protected:
10541054
ExceptionPath *findMergeMatch(ExceptionPath *exception);
10551055
void addException1(ExceptionPath *exception);
10561056
void addException2(ExceptionPath *exception);
1057+
void recordExceptionPins(ExceptionPath *exception);
10571058
void recordPathDelayInternalFrom(ExceptionPath *exception);
10581059
void unrecordPathDelayInternalFrom(ExceptionPath *exception);
10591060
bool pathDelayFrom(const Pin *pin);
@@ -1369,6 +1370,7 @@ protected:
13691370
PinExceptionsMap first_to_pin_exceptions_;
13701371
ClockExceptionsMap first_to_clk_exceptions_;
13711372
InstanceExceptionsMap first_to_inst_exceptions_;
1373+
PinExceptionsMap pin_exceptions_;
13721374
// Edges that traverse hierarchical exception pins.
13731375
EdgeExceptionsMap first_thru_edge_exceptions_;
13741376
// Exception hash with one missing from/thru/to point, used for merging.

sdc/ExceptionPath.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,13 @@ ExceptionFromTo::deleteInstance(const Instance *inst,
11551155
}
11561156
}
11571157

1158+
void
1159+
ExceptionFromTo::disconnectPinBefore(const Pin *pin,
1160+
Network *network)
1161+
{
1162+
deletePin(pin, network);
1163+
}
1164+
11581165
const char *
11591166
ExceptionFromTo::asString(const Network *network) const
11601167
{
@@ -2057,6 +2064,7 @@ void
20572064
ExceptionThru::disconnectPinBefore(const Pin *pin,
20582065
Network *network)
20592066
{
2067+
deletePin(pin, network);
20602068
// Remove edges from/to leaf pin and through hier pin.
20612069
deletePinEdges(pin, network);
20622070
}

sdc/Sdc.cc

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4601,6 +4601,7 @@ Sdc::recordException(ExceptionPath *exception)
46014601
exception->setId(++exception_id_);
46024602
recordMergeHashes(exception);
46034603
recordExceptionFirstPts(exception);
4604+
recordExceptionPins(exception);
46044605
checkForThruHpins(exception);
46054606
}
46064607

@@ -4671,6 +4672,22 @@ Sdc::recordExceptionFirstFrom(ExceptionPath *exception)
46714672
recordExceptionClks(exception, from->clks(), first_from_clk_exceptions_);
46724673
}
46734674

4675+
void
4676+
Sdc::recordExceptionPins(ExceptionPath *exception)
4677+
{
4678+
ExceptionFrom *from = exception->from();
4679+
if (from)
4680+
recordExceptionPins(exception, from->pins(), pin_exceptions_);
4681+
ExceptionThruSeq *thrus = exception->thrus();
4682+
if (thrus) {
4683+
for (ExceptionThru *thru : *thrus)
4684+
recordExceptionPins(exception, thru->pins(), pin_exceptions_);
4685+
}
4686+
ExceptionTo *to = exception->to();
4687+
if (to)
4688+
recordExceptionPins(exception, to->pins(), pin_exceptions_);
4689+
}
4690+
46744691
void
46754692
Sdc::recordExceptionFirstThru(ExceptionPath *exception)
46764693
{
@@ -5089,7 +5106,8 @@ class ExpandException : public ExpandedExceptionVisitor
50895106
ExpandException(ExceptionPath *exception,
50905107
ExceptionPathSet &expansions,
50915108
Network *network);
5092-
virtual void visit(ExceptionFrom *from, ExceptionThruSeq *thrus,
5109+
virtual void visit(ExceptionFrom *from,
5110+
ExceptionThruSeq *thrus,
50935111
ExceptionTo *to);
50945112

50955113
private:
@@ -5606,22 +5624,32 @@ Sdc::connectPinAfter(const Pin *pin)
56065624
void
56075625
Sdc::disconnectPinBefore(const Pin *pin)
56085626
{
5609-
if (have_thru_hpin_exceptions_) {
5610-
for (ExceptionPath *exception : exceptions_) {
5627+
auto itr = pin_exceptions_.find(pin);
5628+
if (itr != pin_exceptions_.end()) {
5629+
for (ExceptionPath *exception : *itr->second) {
5630+
ExceptionFrom *from = exception->from();
5631+
if (from)
5632+
from->disconnectPinBefore(pin, network_);
5633+
ExceptionTo *to = exception->to();
5634+
if (to)
5635+
to->disconnectPinBefore(pin, network_);
56115636
ExceptionPt *first_pt = exception->firstPt();
56125637
ExceptionThruSeq *thrus = exception->thrus();
56135638
if (thrus) {
5614-
for (ExceptionThru *thru : *exception->thrus()) {
5615-
if (thru->edges()) {
5616-
thru->disconnectPinBefore(pin, network_);
5617-
if (thru == first_pt)
5618-
recordExceptionEdges(exception, thru->edges(),
5619-
first_thru_edge_exceptions_);
5620-
}
5621-
}
5639+
for (ExceptionThru *thru : *exception->thrus()) {
5640+
thru->disconnectPinBefore(pin, network_);
5641+
if (thru == first_pt)
5642+
recordExceptionEdges(exception, thru->edges(),
5643+
first_thru_edge_exceptions_);
5644+
}
56225645
}
56235646
}
5647+
first_from_pin_exceptions_.erase(pin);
5648+
first_thru_pin_exceptions_.erase(pin);
5649+
first_to_pin_exceptions_.erase(pin);
5650+
pin_exceptions_.erase(pin);
56245651
}
5652+
56255653
for (int corner_index = 0; corner_index < corners_->count(); corner_index++)
56265654
drvr_pin_wire_cap_maps_[corner_index].erase(pin);
56275655
}

0 commit comments

Comments
 (0)