From 5dbc473186c614931d11989a3acaa5e5f481433e Mon Sep 17 00:00:00 2001 From: Deepashree Sengupta Date: Wed, 20 May 2026 16:55:02 -0400 Subject: [PATCH 1/6] fix makeConcreteParasitics leak+testcase (#439) * fix makeConcreteParasitics leak Signed-off-by: dsengupta0628 * simplify test, update the address review comment Signed-off-by: dsengupta0628 * reduce test verbosity Signed-off-by: dsengupta0628 --------- Signed-off-by: dsengupta0628 --- search/Sta.cc | 9 ++++++++- test/make_concrete_parasitics_leak.ok | 0 test/make_concrete_parasitics_leak.tcl | 9 +++++++++ test/regression_vars.tcl | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/make_concrete_parasitics_leak.ok create mode 100644 test/make_concrete_parasitics_leak.tcl diff --git a/search/Sta.cc b/search/Sta.cc index bdbf6e93..320e0178 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -4291,8 +4291,15 @@ Parasitics * Sta::makeConcreteParasitics(std::string_view name, std::string_view filename) { + // Free the prior entry to avoid leaking it on overwrite. + std::string key(name); + auto it = parasitics_name_map_.find(key); + if (it != parasitics_name_map_.end()) { + delete it->second; + parasitics_name_map_.erase(it); + } Parasitics *parasitics = new ConcreteParasitics(name, filename, this); - parasitics_name_map_[std::string(name)] = parasitics; + parasitics_name_map_[key] = parasitics; return parasitics; } diff --git a/test/make_concrete_parasitics_leak.ok b/test/make_concrete_parasitics_leak.ok new file mode 100644 index 00000000..e69de29b diff --git a/test/make_concrete_parasitics_leak.tcl b/test/make_concrete_parasitics_leak.tcl new file mode 100644 index 00000000..51629d45 --- /dev/null +++ b/test/make_concrete_parasitics_leak.tcl @@ -0,0 +1,9 @@ +# Sta::makeConcreteParasitics map-overwrite leak repro. +# Run under -fsanitize=address to verify no leak after the fix. +read_liberty asap7_small.lib.gz +read_verilog reg1_asap7.v +link_design top +# 1st read_spef +read_spef -min reg1_asap7.spef +# 2nd read_spef +read_spef -min reg1_asap7.spef diff --git a/test/regression_vars.tcl b/test/regression_vars.tcl index b0cab790..ce037eff 100644 --- a/test/regression_vars.tcl +++ b/test/regression_vars.tcl @@ -154,6 +154,7 @@ record_public_tests { liberty_ccsn liberty_float_as_str liberty_latch3 + make_concrete_parasitics_leak package_require path_group_names power_json From 4b4f382506dfd2911f1ad683565d0cbd5006c7b9 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 21 May 2026 19:56:10 -0700 Subject: [PATCH 2/6] tcl 8.6.18 Signed-off-by: James Cherry --- cmake/FindTCL.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/FindTCL.cmake b/cmake/FindTCL.cmake index 7df9b71d..26d6d7ce 100644 --- a/cmake/FindTCL.cmake +++ b/cmake/FindTCL.cmake @@ -34,6 +34,7 @@ if (NOT TCL_LIB_PATHS) if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(TCL_LIB_PATHS #/opt/homebrew/Cellar/tcl-tk/9.0.3/lib + /opt/homebrew/Cellar/tcl-tk@8/8.6.18/lib /opt/homebrew/Cellar/tcl-tk@8/8.6.17/lib /opt/homebrew/Cellar/tcl-tk@8/8.6.16/lib /opt/homebrew/opt/tcl-tk/lib /usr/local/lib) From de65ba62b42101787121b61118728f3cfaf10520 Mon Sep 17 00:00:00 2001 From: Masanori Ogino <167209+omasanori@users.noreply.github.com> Date: Wed, 27 May 2026 03:43:49 +0900 Subject: [PATCH 3/6] Update CUDD upstream URL in README (#440) Signed-off-by: Masanori Ogino --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e30b1051..ea9262cf 100644 --- a/README.md +++ b/README.md @@ -125,18 +125,16 @@ if { ![catch {package require tclreadline}] } { The Zlib library is an optional. If CMake finds libz, OpenSTA can read Liberty, Verilog, SDF, SPF, and SPEF files compressed with gzip. -CUDD is a binary decision diageram (BDD) package that is used to -improve conditional timing arc handling, constant propagation, power -activity propagation and spice netlist generation. +[CUDD](https://github.com/cuddorg/cudd) is a binary decision diagram (BDD) +package that is used to improve conditional timing arc handling, constant +propagation, power activity propagation and spice netlist generation. -CUDD is available -[here](https://github.com/davidkebo/cudd/blob/main/cudd_versions/cudd-3.0.0.tar.gz). - -Unpack and build CUDD. +Download and build CUDD: ``` -tar xvfz cudd-3.0.0.tar.gz -cd cudd-3.0.0 +git clone https://github.com/cuddorg/cudd.git +cd cudd +git checkout 3.0.0 ./configure make ``` From 8f5b4814954c76f944fc207dfc3cedc0e51a83e3 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Tue, 26 May 2026 19:17:29 -0700 Subject: [PATCH 4/6] ReportPath set field order/user defined field Signed-off-by: James Cherry --- search/ReportPath.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/ReportPath.cc b/search/ReportPath.cc index 4b99f4a9..1bfcdfc6 100644 --- a/search/ReportPath.cc +++ b/search/ReportPath.cc @@ -3252,9 +3252,9 @@ ReportPath::reportLine(std::string_view what, reportFieldBlank(field, line); } else if (field == field_case_) - line += line_case; + reportField(line_case, field, line); else if (field->getValue()) - line += field->value(path, this); + reportField(field->value(path, this), field, line); first_field = false; } From ffd54f38b11323d7a90473889f2786150749fb5b Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 27 May 2026 10:44:55 -0700 Subject: [PATCH 5/6] rm hashPtr Signed-off-by: James Cherry --- include/sta/Hash.hh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/sta/Hash.hh b/include/sta/Hash.hh index 5cfd423d..579b31ca 100644 --- a/include/sta/Hash.hh +++ b/include/sta/Hash.hh @@ -25,7 +25,6 @@ #pragma once #include -#include #include namespace sta { @@ -59,12 +58,4 @@ nextMersenne(size_t n) size_t hashString(std::string_view str); -// Pointer hashing is strongly discouraged because it causes results to change -// from run to run. Use Network::id functions instead. -#if __WORDSIZE == 64 - #define hashPtr(ptr) (reinterpret_cast(ptr) >> 3) -#else - #define hashPtr(ptr) (reinterpret_cast(ptr) >> 2) -#endif - } // namespace sta From 41a3d86d8cd8cb65b43f72324454d4b5d5ae32b7 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 27 May 2026 10:50:44 -0700 Subject: [PATCH 6/6] Sta::unsetAnnotatedSlew Signed-off-by: James Cherry --- include/sta/Sta.hh | 4 ++++ search/Sta.cc | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/sta/Sta.hh b/include/sta/Sta.hh index 6bc3c8eb..913608aa 100644 --- a/include/sta/Sta.hh +++ b/include/sta/Sta.hh @@ -899,6 +899,10 @@ public: const MinMaxAll *min_max, const RiseFallBoth *rf, float slew); + void unsetAnnotatedSlew(Vertex *vertex, + const Scene *scene, + const MinMaxAll *min_max, + const RiseFallBoth *rf); void writeSdf(std::string_view filename, const Scene *scene, char divider, diff --git a/search/Sta.cc b/search/Sta.cc index 320e0178..27b2119b 100644 --- a/search/Sta.cc +++ b/search/Sta.cc @@ -3875,7 +3875,6 @@ Sta::setAnnotatedSlew(Vertex *vertex, const RiseFallBoth *rf, float slew) { - ensureGraph(); for (const MinMax *mm : min_max->range()) { DcalcAPIndex ap_index = scene->dcalcAnalysisPtIndex(mm); for (const RiseFall *rf1 : rf->range()) { @@ -3887,6 +3886,24 @@ Sta::setAnnotatedSlew(Vertex *vertex, graph_delay_calc_->delayInvalid(vertex); } +void +Sta::unsetAnnotatedSlew(Vertex *vertex, + const Scene *scene, + const MinMaxAll *min_max, + const RiseFallBoth *rf) +{ + for (const MinMax *mm : min_max->range()) { + DcalcAPIndex ap_index = scene->dcalcAnalysisPtIndex(mm); + for (const RiseFall *rf1 : rf->range()) { + vertex->setSlewAnnotated(false, rf1, ap_index); + } + } + if (vertex->isDriver(network_)) + graph_delay_calc_->delayInvalid(vertex); + else + delaysInvalidFromFanin(vertex); +} + void Sta::writeSdf(std::string_view filename, const Scene *scene,