Skip to content

Commit

Permalink
mutateTag cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Aug 9, 2022
1 parent 254115c commit c7debe5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 42 deletions.
9 changes: 4 additions & 5 deletions include/sta/Sdc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -946,11 +946,10 @@ public:
ExceptionStateSet *&states) const;
// Return hierarchical -thru exceptions that start between
// from_pin and to_pin.
void exceptionThruStates(const Pin *from_pin,
const Pin *to_pin,
const RiseFall *to_rf,
const MinMax *min_max,
ExceptionStateSet *&states) const;
ExceptionStateSet *exceptionThruStates(const Pin *from_pin,
const Pin *to_pin,
const RiseFall *to_rf,
const MinMax *min_max) const;
// Find the highest priority exception with first exception pt at
// pin/clk end.
void exceptionTo(ExceptionPathType type,
Expand Down
7 changes: 4 additions & 3 deletions sdc/Sdc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5467,13 +5467,13 @@ Sdc::filterRegQStates(const Pin *to_pin,
}
}

void
ExceptionStateSet *
Sdc::exceptionThruStates(const Pin *from_pin,
const Pin *to_pin,
const RiseFall *to_rf,
const MinMax *min_max,
ExceptionStateSet *&states) const
const MinMax *min_max) const
{
ExceptionStateSet *states = nullptr;
if (first_thru_pin_exceptions_)
exceptionThruStates(first_thru_pin_exceptions_->findKey(to_pin),
to_rf, min_max, states);
Expand All @@ -5489,6 +5489,7 @@ Sdc::exceptionThruStates(const Pin *from_pin,
exceptionThruStates(first_thru_inst_exceptions_->findKey(to_inst),
to_rf, min_max, states);
}
return states;
}

void
Expand Down
70 changes: 36 additions & 34 deletions search/Search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2552,62 +2552,64 @@ Search::mutateTag(Tag *from_tag,
bool state_change = false;
for (auto state : *from_states) {
ExceptionPath *exception = state->exception();
if (state->isComplete()
&& exception->isFalse()
&& !from_is_clk)
// Don't propagate a completed false path -thru unless it is a
// clock (which ignores exceptions).
return nullptr;

if (state->matchesNextThru(from_pin,to_pin,to_rf,min_max,network_)) {
// Found a -thru that we've been waiting for.
if (state->nextState()->isComplete()
&& exception->isLoop())
// to_pin/edge completes a loop path.
return nullptr;
// One edge may traverse multiple hierarchical thru pins.
while (state->matchesNextThru(from_pin,to_pin,to_rf,min_max,network_)) {
// Found a -thru that we've been waiting for.
state = state->nextState();
state_change = true;
break;
break;
}
if (state_change)
break;

// Don't propagate a completed false path -thru unless it is a
// clock. Clocks carry the completed false path to disable
// downstream paths that use the clock as data.
if ((state->isComplete()
&& exception->isFalse()
&& !from_is_clk)
// to_pin/edge completes a loop path.
|| (exception->isLoop()
&& state->isComplete()))
return nullptr;

// Kill path delay tags past the -to pin.
if ((exception->isPathDelay()
&& sdc_->isCompleteTo(state, from_pin, from_rf, min_max))
// Kill loop tags at register clock pins.
|| (to_is_reg_clk
&& exception->isLoop())) {
|| (exception->isLoop()
&& to_is_reg_clk)) {
state_change = true;
break;
break;
}
}

// Get the set of -thru exceptions starting at to_pin/edge.
sdc_->exceptionThruStates(from_pin, to_pin, to_rf, min_max, new_states);
new_states = sdc_->exceptionThruStates(from_pin, to_pin, to_rf, min_max);
if (new_states || state_change) {
// Second pass to apply state changes and add updated existing
// states to new states.
if (new_states == nullptr)
new_states = new ExceptionStateSet;
for (auto state : *from_states) {
ExceptionPath *exception = state->exception();
if (state->isComplete()
&& exception->isFalse()
&& !from_is_clk) {
// Don't propagate a completed false path -thru unless it is a
// clock. Clocks carry the completed false path to disable
// downstream paths that use the clock as data.
delete new_states;
return nullptr;
}
// One edge may traverse multiple hierarchical thru pins.
while (state->matchesNextThru(from_pin,to_pin,to_rf,min_max,network_))
// Found a -thru that we've been waiting for.
state = state->nextState();

if (state->isComplete()
&& exception->isLoop()) {
// to_pin/edge completes a loop path.
delete new_states;
return nullptr;
}
// Don't propagate a completed false path -thru unless it is a
// clock. Clocks carry the completed false path to disable
// downstream paths that use the clock as data.
if ((state->isComplete()
&& exception->isFalse()
&& !from_is_clk)
// to_pin/edge completes a loop path.
|| (exception->isLoop()
&& state->isComplete())) {
delete new_states;
return nullptr;
}

// Kill path delay tags past the -to pin.
if (!((exception->isPathDelay()
Expand All @@ -2621,7 +2623,7 @@ Search::mutateTag(Tag *from_tag,
}
else
// Get the set of -thru exceptions starting at to_pin/edge.
sdc_->exceptionThruStates(from_pin, to_pin, to_rf, min_max, new_states);
new_states = sdc_->exceptionThruStates(from_pin, to_pin, to_rf, min_max);

if (new_states)
return findTag(to_rf, path_ap, to_clk_info, to_is_clk,
Expand Down

0 comments on commit c7debe5

Please sign in to comment.