diff --git a/include/sta/Sta.hh b/include/sta/Sta.hh index 3bd008cf..f5056ee0 100644 --- a/include/sta/Sta.hh +++ b/include/sta/Sta.hh @@ -866,7 +866,9 @@ public: // User visible but non SDC commands. // Clear all state except network, scenes and liberty libraries. - virtual void clear(); + void clear(); + // Clear all state except network, scenes liberty libraries, and sdc. + void clearNonSdc(); // Namespace used by command interpreter. CmdNamespace cmdNamespace(); void setCmdNamespace(CmdNamespace namespc); @@ -1261,6 +1263,8 @@ public: // editing API. For example, reading a netlist without using the // builtin network readers. void networkChanged(); + // Network changed but all SDC references to instance/net/pin/port are preserved. + void networkChangedNonSdc(); void deleteLeafInstanceBefore(const Instance *inst); void deleteInstancePinsBefore(const Instance *inst); diff --git a/network/NetworkEdit.i b/network/NetworkEdit.i index 8584ff0a..4436c3ae 100644 --- a/network/NetworkEdit.i +++ b/network/NetworkEdit.i @@ -104,4 +104,11 @@ network_changed() Sta::sta()->networkChanged(); } +// Notify STA of network change without touching SDC network references. +void +network_changed_non_sdc() +{ + Sta::sta()->networkChangedNonSdc(); +} + %} // inline diff --git a/search/Sta.cc b/search/Sta.cc index 4df32c99..7b7a2182 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -534,6 +534,14 @@ Sta::~Sta() void Sta::clear() +{ + clearNonSdc(); + for (Mode *mode : modes_) + mode->sdc()->clear(); +} + +void +Sta::clearNonSdc() { // Sdc holds search filter, so clear search first. search_->clear(); @@ -548,10 +556,8 @@ Sta::clear() clk_skews_->clear(); // scenes are NOT cleared because they are used to index liberty files. - for (Mode *mode : modes_) { - mode->sdc()->clear(); + for (Mode *mode : modes_) mode->clkNetwork()->clkPinsInvalid(); - } delete graph_; graph_ = nullptr; @@ -616,6 +622,12 @@ Sta::networkChanged() clear(); } +void +Sta::networkChangedNonSdc() +{ + clearNonSdc(); +} + void Sta::setTclInterp(Tcl_Interp *interp) {