Skip to content

Commit 6abc87c

Browse files
committed
Merge branch 'master' of github.com:jfgava/OpenROAD into cts-ndr-strategies
Signed-off-by: Jonas Gava <[email protected]>
2 parents 5937486 + 6ff4ea2 commit 6abc87c

File tree

240 files changed

+17376
-4773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+17376
-4773
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ CheckOptions:
6565

6666
# All modules but sta
6767
# Exclude build as there is too much noise from swig generated code
68-
HeaderFilterRegex: "(?!build/.*)/(ant|cts|dbSta|dft|dpl|drt|dst|exa|fin|gpl|grt|gui|ifp|mpl|odb|ord|pad|par|pdn|ppl|psm|rcx|rmp|rsz|stt|tap|upf|utl)/.*"
68+
HeaderFilterRegex: "(?!build/.*)/(ant|cts|dbSta|dft|dpl|drt|dst|est|exa|fin|gpl|grt|gui|ifp|mpl|odb|ord|pad|par|pdn|ppl|psm|rcx|rmp|rsz|stt|tap|upf|utl)/.*"
6969

7070
# Not currently handling identifier naming
7171
# WarningsAsErrors: "*"

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ OPENROAD_LIBRARY_DEPS = [
6262
"//src/drt:ui",
6363
"//src/dst",
6464
"//src/dst:ui",
65+
"//src/est",
66+
"//src/est:ui",
6567
"//src/exa",
6668
"//src/exa:ui",
6769
"//src/fin",

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ workspace(name = "openroad")
88

99
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1010

11-
rules_hdl_git_hash = "80266603b55778dd30531c9b286152a7b664fbb7"
11+
rules_hdl_git_hash = "56da46a87e8e5a4dbe84c0bbe5d00e92b936494f"
1212

13-
rules_hdl_git_sha256 = "38f04d38cfbf46c52643325b496673d607ce5ea6fda99dc1dfa3997a520bb0c2"
13+
rules_hdl_git_sha256 = "dc184ad0fe92f315eb5600fb3293c94ce1fce3fc1d0fd79400107038ed917d70"
1414

1515
http_archive(
1616
name = "rules_hdl",

docs/contrib/DeveloperGuide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ Tool namespaces are usually three-lettered lowercase letters.
240240
- Macro Placer ([mpl](../main/src/mpl/README.md))
241241
- RePlAce Global Placer ([gpl](../main/src/gpl/README.md))
242242
- Gate resizing and buffering ([rsz](../main/src/rsz/README.md))
243+
- Parasitics estimation ([est](../main/src/est/README.md))
243244
- Detailed placement ([dpl](../main/src/dpl/README.md))
244245
- Clock tree synthesis ([cts](../main/src/cts/README.md))
245246
- FastRoute Global routing ([grt](../main/src/grt/README.md))

include/ord/OpenRoad.hh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ namespace dft {
115115
class Dft;
116116
}
117117

118+
namespace est {
119+
class EstimateParasitics;
120+
}
121+
118122
namespace ord {
119123

120124
using std::string;
@@ -164,6 +168,10 @@ class OpenRoad
164168
dst::Distributed* getDistributed() { return distributer_; }
165169
stt::SteinerTreeBuilder* getSteinerTreeBuilder() { return stt_builder_; }
166170
dft::Dft* getDft() { return dft_; }
171+
est::EstimateParasitics* getEstimateParasitics()
172+
{
173+
return estimate_parasitics_;
174+
}
167175

168176
// Return the bounding box of the db rows.
169177
odb::Rect getCore();
@@ -258,6 +266,7 @@ class OpenRoad
258266
dst::Distributed* distributer_ = nullptr;
259267
stt::SteinerTreeBuilder* stt_builder_ = nullptr;
260268
dft::Dft* dft_ = nullptr;
269+
est::EstimateParasitics* estimate_parasitics_ = nullptr;
261270
utl::CallBackHandler* callback_handler_ = nullptr;
262271

263272
int threads_ = 1;

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ add_subdirectory(pdn)
279279
add_subdirectory(dft)
280280
add_subdirectory(mpl)
281281
add_subdirectory(par)
282+
add_subdirectory(est)
282283

283284
################################################################
284285

@@ -341,6 +342,7 @@ target_link_libraries(openroad
341342
dft
342343
mpl
343344
par
345+
est
344346
${ABC_LIBRARY}
345347
${TCL_LIBRARY}
346348
${CMAKE_THREAD_LIBS_INIT}

src/Metrics.tcl

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ proc report_tns_metric { args } {
3636

3737
define_cmd_args "report_worst_slack_metric" {[-setup]|[-hold]}
3838
proc report_worst_slack_metric { args } {
39-
global sta_report_default_digits
4039
parse_key_args "report_worst_slack_metric" args keys {} flags {-setup -hold}
4140

4241
set min_max "-max"
@@ -53,7 +52,6 @@ proc report_worst_slack_metric { args } {
5352

5453
define_cmd_args "report_worst_negative_slack_metric" {[-setup]|[-hold]}
5554
proc report_worst_negative_slack_metric { args } {
56-
global sta_report_default_digits
5755
parse_key_args "report_worst_negative_slack_metric" args keys {} flags {-setup -hold}
5856

5957
set min_max "-max"
@@ -68,6 +66,58 @@ proc report_worst_negative_slack_metric { args } {
6866
utl::metric_float $metric_name [worst_negative_slack $min_max]
6967
}
7068

69+
define_cmd_args "report_fmax_metric" {}
70+
proc report_fmax_metric { args } {
71+
parse_key_args "report_fmax_metric" args keys {} flags {}
72+
73+
# Taken from: https://github.com/siliconcompiler/siliconcompiler/blob/e46c702df218c93483b951533fe00bcf01cf772d/siliconcompiler/tools/openroad/scripts/common/reports.tcl#L98
74+
# Modeled on: https://github.com/The-OpenROAD-Project/OpenSTA/blob/f913c3ddbb3e7b4364ed4437c65ac78c4da9174b/tcl/Search.tcl#L1078
75+
set fmax_metric 0
76+
foreach clk [sta::sort_by_name [all_clocks]] {
77+
set clk_name [get_name $clk]
78+
set min_period [sta::find_clk_min_period $clk 1]
79+
if { $min_period == 0.0 } {
80+
continue
81+
}
82+
set fmax [expr { 1.0 / $min_period }]
83+
utl::metric_float "timing__fmax__clock:${clk_name}" $fmax
84+
set fmax_metric [expr { max($fmax_metric, $fmax) }]
85+
}
86+
if { $fmax_metric == 0 } {
87+
# attempt to compute based on combinatorial path
88+
set fmax_valid true
89+
set max_paths [find_timing_paths -unconstrained -path_delay max]
90+
if { $max_paths == "" } {
91+
set fmax_valid false
92+
} else {
93+
set max_path_delay -1
94+
foreach path $max_paths {
95+
set path_delay [$path data_arrival_time]
96+
set max_path_delay [expr { max($max_path_delay, $path_delay) }]
97+
}
98+
}
99+
set min_paths [find_timing_paths -unconstrained -path_delay min]
100+
if { $min_paths == "" } {
101+
set fmax_valid false
102+
} else {
103+
set min_path_delay 1e12
104+
foreach path $min_paths {
105+
set path_delay [$path data_arrival_time]
106+
set min_path_delay [expr { min($min_path_delay, $path_delay) }]
107+
}
108+
}
109+
if { $fmax_valid } {
110+
set path_delay [expr { $max_path_delay - min(0, $min_path_delay) }]
111+
if { $path_delay > 0 } {
112+
set fmax_metric [expr { 1.0 / $path_delay }]
113+
}
114+
}
115+
}
116+
if { $fmax_metric > 0 } {
117+
utl::metric_float "timing__fmax" $fmax_metric
118+
}
119+
}
120+
71121
# From https://wiki.tcl-lang.org/page/Inf
72122
proc ::tcl::mathfunc::finite { x } {
73123
expr { [string is double -strict $x] && $x == $x && $x + 1 != $x }

src/OpenRoad.cc

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "dft/MakeDft.hh"
2525
#include "dpl/MakeOpendp.h"
2626
#include "dst/MakeDistributed.h"
27+
#include "est/EstimateParasitics.h"
28+
#include "est/MakeEstimateParasitics.h"
2729
#include "exa/MakeExample.h"
2830
#include "fin/MakeFinale.h"
2931
#include "gpl/MakeReplace.h"
@@ -115,6 +117,7 @@ OpenRoad::~OpenRoad()
115117
deleteDistributed(distributer_);
116118
deleteSteinerTreeBuilder(stt_builder_);
117119
dft::deleteDft(dft_);
120+
est::deleteEstimateParasitics(estimate_parasitics_);
118121
delete logger_;
119122
delete verilog_reader_;
120123
delete callback_handler_;
@@ -187,6 +190,7 @@ void OpenRoad::init(Tcl_Interp* tcl_interp,
187190
distributer_ = dst::makeDistributed();
188191
stt_builder_ = stt::makeSteinerTreeBuilder();
189192
dft_ = dft::makeDft();
193+
estimate_parasitics_ = est::makeEstimateParasitics();
190194

191195
// Init components.
192196
Ord_Init(tcl_interp);
@@ -207,7 +211,8 @@ void OpenRoad::init(Tcl_Interp* tcl_interp,
207211
sta_,
208212
stt_builder_,
209213
global_router_,
210-
opendp_);
214+
opendp_,
215+
estimate_parasitics_);
211216
initDbVerilogNetwork(verilog_network_, sta_);
212217
initIoplacer(ioPlacer_, db_, logger_, tcl_interp);
213218
initReplace(
@@ -217,7 +222,6 @@ void OpenRoad::init(Tcl_Interp* tcl_interp,
217222
initGlobalRouter(global_router_,
218223
db_,
219224
sta_,
220-
resizer_,
221225
antenna_checker_,
222226
opendp_,
223227
stt_builder_,
@@ -230,6 +234,7 @@ void OpenRoad::init(Tcl_Interp* tcl_interp,
230234
sta_,
231235
stt_builder_,
232236
resizer_,
237+
estimate_parasitics_,
233238
logger_,
234239
tcl_interp);
235240
initTapcell(tapcell_, db_, logger_, tcl_interp);
@@ -243,22 +248,37 @@ void OpenRoad::init(Tcl_Interp* tcl_interp,
243248
initExample(example_, db_, logger_, tcl_interp);
244249
initOpenRCX(extractor_, db_, logger_, getVersion(), tcl_interp);
245250
initICeWall(icewall_, db_, logger_, tcl_interp);
246-
initRestructure(restructure_, logger_, sta_, db_, resizer_, tcl_interp);
251+
initRestructure(restructure_,
252+
logger_,
253+
sta_,
254+
db_,
255+
resizer_,
256+
estimate_parasitics_,
257+
tcl_interp);
247258
initTritonRoute(detailed_router_,
248259
db_,
249260
logger_,
250261
callback_handler_,
251262
distributer_,
252263
stt_builder_,
253264
tcl_interp);
254-
initPDNSim(pdnsim_, logger_, db_, sta_, resizer_, opendp_, tcl_interp);
265+
initPDNSim(
266+
pdnsim_, logger_, db_, sta_, estimate_parasitics_, opendp_, tcl_interp);
255267
initAntennaChecker(antenna_checker_, db_, logger_, tcl_interp);
256268
initPartitionMgr(
257269
partitionMgr_, db_, getDbNetwork(), sta_, logger_, tcl_interp);
258270
initPdnGen(pdngen_, db_, logger_, tcl_interp);
259271
initDistributed(distributer_, logger_, tcl_interp);
260272
initSteinerTreeBuilder(stt_builder_, db_, logger_, tcl_interp);
261273
dft::initDft(dft_, db_, sta_, logger_, tcl_interp);
274+
initEstimateParasitics(estimate_parasitics_,
275+
tcl_interp,
276+
logger_,
277+
callback_handler_,
278+
db_,
279+
sta_,
280+
stt_builder_,
281+
global_router_);
262282

263283
// Import exported commands to global namespace.
264284
Tcl_Eval(tcl_interp, "sta::define_sta_cmds");

src/OpenRoad.i

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ getResizer()
8787
return openroad->getResizer();
8888
}
8989

90+
est::EstimateParasitics *
91+
getEstimateParasitics()
92+
{
93+
OpenRoad *openroad = getOpenRoad();
94+
return openroad->getEstimateParasitics();
95+
}
96+
9097
rmp::Restructure *
9198
getRestructure()
9299
{

src/ant/BUILD

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,6 @@ package(
99
features = ["layering_check"],
1010
)
1111

12-
cc_library(
13-
name = "types",
14-
hdrs = [
15-
"include/ant/AntennaChecker.hh",
16-
],
17-
includes = [
18-
"include",
19-
],
20-
deps = [
21-
"//src/odb",
22-
],
23-
)
24-
2512
cc_library(
2613
name = "ant",
2714
srcs = [
@@ -32,14 +19,16 @@ cc_library(
3219
"src/WireBuilder.cc",
3320
"src/WireBuilder.hh",
3421
],
22+
hdrs = [
23+
"include/ant/AntennaChecker.hh",
24+
],
3525
copts = [
3626
"-fopenmp",
3727
],
3828
includes = [
3929
"include",
4030
],
4131
deps = [
42-
":types",
4332
"//src/odb",
4433
"//src/utl",
4534
"@boost.container_hash",

0 commit comments

Comments
 (0)