Skip to content

Commit 1475199

Browse files
authored
Merge pull request #367 from The-OpenROAD-Project-staging/sta_latest_0528
Sta latest 0528
2 parents 1b94d2c + 8372530 commit 1475199

8 files changed

Lines changed: 48 additions & 20 deletions

File tree

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,16 @@ if { ![catch {package require tclreadline}] } {
125125
The Zlib library is an optional. If CMake finds libz, OpenSTA can
126126
read Liberty, Verilog, SDF, SPF, and SPEF files compressed with gzip.
127127

128-
CUDD is a binary decision diageram (BDD) package that is used to
129-
improve conditional timing arc handling, constant propagation, power
130-
activity propagation and spice netlist generation.
128+
[CUDD](https://github.com/cuddorg/cudd) is a binary decision diagram (BDD)
129+
package that is used to improve conditional timing arc handling, constant
130+
propagation, power activity propagation and spice netlist generation.
131131

132-
CUDD is available
133-
[here](https://github.com/davidkebo/cudd/blob/main/cudd_versions/cudd-3.0.0.tar.gz).
134-
135-
Unpack and build CUDD.
132+
Download and build CUDD:
136133

137134
```
138-
tar xvfz cudd-3.0.0.tar.gz
139-
cd cudd-3.0.0
135+
git clone https://github.com/cuddorg/cudd.git
136+
cd cudd
137+
git checkout 3.0.0
140138
./configure
141139
make
142140
```

cmake/FindTCL.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (NOT TCL_LIB_PATHS)
3434
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
3535
set(TCL_LIB_PATHS
3636
#/opt/homebrew/Cellar/tcl-tk/9.0.3/lib
37+
/opt/homebrew/Cellar/tcl-tk@8/8.6.18/lib
3738
/opt/homebrew/Cellar/tcl-tk@8/8.6.17/lib
3839
/opt/homebrew/Cellar/tcl-tk@8/8.6.16/lib
3940
/opt/homebrew/opt/tcl-tk/lib /usr/local/lib)

include/sta/Hash.hh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#pragma once
2626

2727
#include <cstddef>
28-
#include <cstdint>
2928
#include <string_view>
3029

3130
namespace sta {
@@ -59,12 +58,4 @@ nextMersenne(size_t n)
5958
size_t
6059
hashString(std::string_view str);
6160

62-
// Pointer hashing is strongly discouraged because it causes results to change
63-
// from run to run. Use Network::id functions instead.
64-
#if __WORDSIZE == 64
65-
#define hashPtr(ptr) (reinterpret_cast<intptr_t>(ptr) >> 3)
66-
#else
67-
#define hashPtr(ptr) (reinterpret_cast<intptr_t>(ptr) >> 2)
68-
#endif
69-
7061
} // namespace sta

include/sta/Sta.hh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,10 @@ public:
899899
const MinMaxAll *min_max,
900900
const RiseFallBoth *rf,
901901
float slew);
902+
void unsetAnnotatedSlew(Vertex *vertex,
903+
const Scene *scene,
904+
const MinMaxAll *min_max,
905+
const RiseFallBoth *rf);
902906
void writeSdf(std::string_view filename,
903907
const Scene *scene,
904908
char divider,

search/Sta.cc

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,7 +3900,6 @@ Sta::setAnnotatedSlew(Vertex *vertex,
39003900
const RiseFallBoth *rf,
39013901
float slew)
39023902
{
3903-
ensureGraph();
39043903
for (const MinMax *mm : min_max->range()) {
39053904
DcalcAPIndex ap_index = scene->dcalcAnalysisPtIndex(mm);
39063905
for (const RiseFall *rf1 : rf->range()) {
@@ -3912,6 +3911,24 @@ Sta::setAnnotatedSlew(Vertex *vertex,
39123911
graph_delay_calc_->delayInvalid(vertex);
39133912
}
39143913

3914+
void
3915+
Sta::unsetAnnotatedSlew(Vertex *vertex,
3916+
const Scene *scene,
3917+
const MinMaxAll *min_max,
3918+
const RiseFallBoth *rf)
3919+
{
3920+
for (const MinMax *mm : min_max->range()) {
3921+
DcalcAPIndex ap_index = scene->dcalcAnalysisPtIndex(mm);
3922+
for (const RiseFall *rf1 : rf->range()) {
3923+
vertex->setSlewAnnotated(false, rf1, ap_index);
3924+
}
3925+
}
3926+
if (vertex->isDriver(network_))
3927+
graph_delay_calc_->delayInvalid(vertex);
3928+
else
3929+
delaysInvalidFromFanin(vertex);
3930+
}
3931+
39153932
void
39163933
Sta::writeSdf(std::string_view filename,
39173934
const Scene *scene,
@@ -4316,8 +4333,15 @@ Parasitics *
43164333
Sta::makeConcreteParasitics(std::string_view name,
43174334
std::string_view filename)
43184335
{
4336+
// Free the prior entry to avoid leaking it on overwrite.
4337+
std::string key(name);
4338+
auto it = parasitics_name_map_.find(key);
4339+
if (it != parasitics_name_map_.end()) {
4340+
delete it->second;
4341+
parasitics_name_map_.erase(it);
4342+
}
43194343
Parasitics *parasitics = new ConcreteParasitics(name, filename, this);
4320-
parasitics_name_map_[std::string(name)] = parasitics;
4344+
parasitics_name_map_[key] = parasitics;
43214345
return parasitics;
43224346
}
43234347

test/make_concrete_parasitics_leak.ok

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Sta::makeConcreteParasitics map-overwrite leak repro.
2+
# Run under -fsanitize=address to verify no leak after the fix.
3+
read_liberty asap7_small.lib.gz
4+
read_verilog reg1_asap7.v
5+
link_design top
6+
# 1st read_spef
7+
read_spef -min reg1_asap7.spef
8+
# 2nd read_spef
9+
read_spef -min reg1_asap7.spef

test/regression_vars.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ record_public_tests {
154154
liberty_ccsn
155155
liberty_float_as_str
156156
liberty_latch3
157+
make_concrete_parasitics_leak
157158
package_require
158159
path_group_names
159160
power_json

0 commit comments

Comments
 (0)