Skip to content

Commit 93160b6

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents 5cce978 + 438dc4f commit 93160b6

File tree

106 files changed

+85496
-87255
lines changed

Some content is hidden

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

106 files changed

+85496
-87255
lines changed

.github/workflows/github-actions-clang-tidy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
build_dir: "./build"
2222
cmake_command: cmake . -B build
2323
config_file: ".clang-tidy"
24-
exclude: "*/codeGenerator/templates/*,*/third-party/*"
24+
exclude: "*/codeGenerator/templates/*,*/third-party/*,*/test/orfs/*"
2525
split_workflow: true
2626
apt_packages: libomp-15-dev,libfl-dev,libyaml-cpp-dev
2727
- uses: The-OpenROAD-Project/clang-tidy-review/upload@master

src/dbSta/include/db_sta/dbNetwork.hh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ class dbNetwork : public ConcreteNetwork
337337

338338
bool hasPort(const Net* net) const;
339339

340+
// Return the highest net above the given net.
341+
// - If the net is a flat net, return it.
342+
// - If the net is a hier net, return the modnet in the highest hierarchy.
343+
Net* highestNetAbove(Net* net) const override;
344+
340345
////////////////////////////////////////////////////////////////
341346
// Edit functions
342347
Instance* makeInstance(LibertyCell* cell,

src/dbSta/src/dbNetwork.cc

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,11 +4056,9 @@ class PinModDbNetConnection : public PinVisitor
40564056
Logger* logger,
40574057
const Net* net_to_search);
40584058
void operator()(const Pin* pin) override;
4059-
const std::set<dbModNet*>& getModNets() const { return modnets_; }
40604059
dbNet* getNet() const { return dbnet_; }
40614060

40624061
private:
4063-
std::set<dbModNet*> modnets_;
40644062
dbNet* dbnet_;
40654063
Logger* logger_ = nullptr;
40664064
bool db_net_search_ = false;
@@ -4092,14 +4090,6 @@ void PinModDbNetConnection::operator()(const Pin* pin)
40924090

40934091
db_network_->staToDb(pin, iterm, bterm, moditerm);
40944092

4095-
if (iterm && iterm->getModNet()) {
4096-
modnets_.insert(iterm->getModNet());
4097-
} else if (bterm && bterm->getModNet()) {
4098-
modnets_.insert(bterm->getModNet());
4099-
} else if (moditerm && moditerm->getModNet()) {
4100-
modnets_.insert(moditerm->getModNet());
4101-
}
4102-
41034093
dbNet* candidate_flat_net = db_network_->flatNet(pin);
41044094
if (candidate_flat_net) {
41054095
//
@@ -5024,4 +5014,36 @@ bool dbNetwork::isPGSupply(dbNet* net) const
50245014
return net->isSpecial() && net->getSigType().isSupply();
50255015
}
50265016

5017+
Net* dbNetwork::highestNetAbove(Net* net) const
5018+
{
5019+
if (net == nullptr) {
5020+
return nullptr;
5021+
}
5022+
5023+
dbNet* dbnet;
5024+
dbModNet* modnet;
5025+
staToDb(net, dbnet, modnet);
5026+
5027+
if (dbnet) {
5028+
// If a flat net, return it.
5029+
// - We should not return the highest modnet related to the flat net.
5030+
// - Otherwise, it breaks estimate_parasitics function.
5031+
// . est module uses flat nets for parasitic estimation
5032+
// . It has (highestNetAbove(flat_net) != flat_net) comparison.
5033+
// . If highestNetAbove(flat_net) returns the highest modnet, it
5034+
// changes the estimate_parasitics behavior.
5035+
return net;
5036+
}
5037+
5038+
if (modnet) {
5039+
if (dbNet* related_dbnet = modnet->findRelatedNet()) {
5040+
if (dbModNet* highest_modnet = related_dbnet->findModNetInHighestHier()) {
5041+
return dbToSta(highest_modnet); // Found the highest modnet
5042+
}
5043+
}
5044+
}
5045+
5046+
return net;
5047+
}
5048+
50275049
} // namespace sta

src/dbSta/test/cpp/TestDbSta.cc

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <cstdio>
66
#include <string>
77

8+
#include "db_sta/dbNetwork.hh"
89
#include "gtest/gtest.h"
910
#include "odb/db.h"
1011
#include "sta/NetworkClass.hh"
@@ -22,7 +23,7 @@ class TestDbSta : public tst::IntegratedFixture
2223
}
2324
};
2425

25-
TEST_F(TestDbSta, TestIsConnected)
26+
TEST_F(TestDbSta, TestHierarchyConnectivity)
2627
{
2728
std::string test_name = "TestDbSta_0";
2829
readVerilogAndSetup(test_name + ".v");
@@ -59,6 +60,41 @@ TEST_F(TestDbSta, TestIsConnected)
5960

6061
bool_return = db_network_->isConnected(sta_net, sta_modnet);
6162
ASSERT_TRUE(bool_return);
63+
64+
// Check Network::highestNetAbove(Net* net)
65+
odb::dbNet* dbnet_out2 = block_->findNet("out2");
66+
ASSERT_NE(dbnet_out2, nullptr);
67+
Net* sta_dbnet_out2 = db_network_->dbToSta(dbnet_out2);
68+
ASSERT_NE(sta_dbnet_out2, nullptr);
69+
Net* sta_highest_net = db_network_->highestNetAbove(sta_dbnet_out2);
70+
ASSERT_EQ(sta_highest_net, sta_dbnet_out2);
71+
72+
odb::dbModNet* modnet_mod_out = block_->findModNet("sub_inst/mod_out");
73+
ASSERT_NE(modnet_mod_out, nullptr);
74+
Net* sta_modnet_mod_out = db_network_->dbToSta(modnet_mod_out);
75+
ASSERT_NE(sta_modnet_mod_out, nullptr);
76+
odb::dbModNet* modnet_out2 = block_->findModNet("out2");
77+
ASSERT_NE(modnet_out2, nullptr);
78+
Net* sta_modnet_out2 = db_network_->dbToSta(modnet_out2);
79+
ASSERT_NE(sta_modnet_out2, nullptr);
80+
Net* sta_highest_modnet_out
81+
= db_network_->highestNetAbove(sta_modnet_mod_out);
82+
ASSERT_EQ(sta_highest_modnet_out, sta_modnet_out2);
83+
84+
// Check get_ports -of_object Net*
85+
NetTermIterator* term_iter = db_network_->termIterator(sta_dbnet_out2);
86+
while (term_iter->hasNext()) {
87+
Term* term = term_iter->next();
88+
Pin* pin = db_network_->pin(term);
89+
Port* port = db_network_->port(pin);
90+
ASSERT_EQ(db_network_->name(port), block_->findBTerm("out2")->getName());
91+
}
92+
93+
// Check dbBTerm::getITerm()
94+
odb::dbBTerm* bterm_clk = block_->findBTerm("in1");
95+
ASSERT_NE(bterm_clk, nullptr);
96+
// There is no related dbITerm for a dbBTerm
97+
ASSERT_EQ(bterm_clk->getITerm(), nullptr);
6298
}
6399

64100
} // namespace sta

src/est/src/EstimateParasitics.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,16 @@ void EstimateParasitics::updateParasitics(bool save_guides)
438438
break;
439439
}
440440

441+
// Router calls into the timer. This means the timer could be caching
442+
// delays calculated in the interim period before we had put new parasitic
443+
// annotations on the nets affected by a network edit. We need to explicitly
444+
// invalidate those delays. Do it in bulk instead of interleaving with each
445+
// groute call.
446+
if (parasitics_src_ != ParasiticsSrc::none) {
447+
for (const Net* net : parasitics_invalid_) {
448+
sta_->delaysInvalidFromFanin(net);
449+
}
450+
}
441451
parasitics_invalid_.clear();
442452
}
443453

src/gpl/src/nesterovBase.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,10 +1452,8 @@ void NesterovBaseCommon::updateDbGCells()
14521452
if (db_cbk_) {
14531453
db_cbk_->removeOwner();
14541454
}
1455-
assert(omp_get_thread_num() == 0);
1456-
#pragma omp parallel for num_threads(num_threads_)
1457-
for (auto it = getGCells().begin(); it < getGCells().end(); ++it) {
1458-
auto& gCell = *it; // old-style loop for old OpenMP
1455+
1456+
for (auto& gCell : getGCells()) {
14591457
if (gCell->isInstance()) {
14601458
for (Instance* inst : gCell->insts()) {
14611459
odb::dbInst* db_inst = inst->dbInst();
@@ -1468,6 +1466,7 @@ void NesterovBaseCommon::updateDbGCells()
14681466
}
14691467
}
14701468
}
1469+
14711470
if (db_cbk_) {
14721471
db_cbk_->addOwner(pbc_->db()->getChip()->getBlock());
14731472
}

src/gpl/test/simple01-rd.ok

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
7979
[INFO GPL-0065] TotalRouteOverflowV2: 0.0000
8080
[INFO GPL-0066] OverflowTileCnt2: 0
8181
[INFO GPL-0067] 0.5%RC: 0.9733
82-
[INFO GPL-0068] 1.0%RC: 0.9407
83-
[INFO GPL-0069] 2.0%RC: 0.8615
84-
[INFO GPL-0070] 5.0%RC: 0.7035
82+
[INFO GPL-0068] 1.0%RC: 0.9481
83+
[INFO GPL-0069] 2.0%RC: 0.8652
84+
[INFO GPL-0070] 5.0%RC: 0.6905
8585
[INFO GPL-0071] 0.5rcK: 1.00
8686
[INFO GPL-0072] 1.0rcK: 1.00
8787
[INFO GPL-0073] 2.0rcK: 0.00
8888
[INFO GPL-0074] 5.0rcK: 0.00
89-
[INFO GPL-0075] Final routing congestion: 0.95703703
89+
[INFO GPL-0075] Final routing congestion: 0.96074075
9090
[INFO GPL-0050] Weighted routing congestion is lower than target routing congestion(1.2500), end routability optimization.
9191
[INFO GPL-0090] Routability finished. Target routing congestion achieved succesfully.
9292
Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
@@ -103,7 +103,7 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
103103
[INFO GPL-1001] Global placement finished at iteration 355
104104
[INFO GPL-1003] Routability mode iteration count: 64
105105
[INFO GPL-0039] Number of routing layers: 0
106-
[INFO GPL-1005] Routability final weighted congestion: 0.4408
106+
[INFO GPL-1005] Routability final weighted congestion: 0.4360
107107
[INFO GPL-1002] Placed Cell Area 619.7347
108108
[INFO GPL-1003] Available Free Area 953.8760
109109
[INFO GPL-1004] Minimum Feasible Density 0.6500 (cell_area / free_area)

src/gpl/test/simple02-rd.ok

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
7979
[INFO GPL-0065] TotalRouteOverflowV2: 0.0000
8080
[INFO GPL-0066] OverflowTileCnt2: 0
8181
[INFO GPL-0067] 0.5%RC: 0.9733
82-
[INFO GPL-0068] 1.0%RC: 0.9407
83-
[INFO GPL-0069] 2.0%RC: 0.8615
84-
[INFO GPL-0070] 5.0%RC: 0.7035
82+
[INFO GPL-0068] 1.0%RC: 0.9481
83+
[INFO GPL-0069] 2.0%RC: 0.8652
84+
[INFO GPL-0070] 5.0%RC: 0.6905
8585
[INFO GPL-0071] 0.5rcK: 1.00
8686
[INFO GPL-0072] 1.0rcK: 1.00
8787
[INFO GPL-0073] 2.0rcK: 0.00
8888
[INFO GPL-0074] 5.0rcK: 0.00
89-
[INFO GPL-0075] Final routing congestion: 0.95703703
89+
[INFO GPL-0075] Final routing congestion: 0.96074075
9090
[INFO GPL-0050] Weighted routing congestion is lower than target routing congestion(1.0000), end routability optimization.
9191
[INFO GPL-0090] Routability finished. Target routing congestion achieved succesfully.
9292
Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
@@ -103,7 +103,7 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
103103
[INFO GPL-1001] Global placement finished at iteration 355
104104
[INFO GPL-1003] Routability mode iteration count: 64
105105
[INFO GPL-0039] Number of routing layers: 0
106-
[INFO GPL-1005] Routability final weighted congestion: 0.4408
106+
[INFO GPL-1005] Routability final weighted congestion: 0.4360
107107
[INFO GPL-1002] Placed Cell Area 619.7347
108108
[INFO GPL-1003] Available Free Area 953.8760
109109
[INFO GPL-1004] Minimum Feasible Density 0.6500 (cell_area / free_area)

src/gpl/test/simple03-rd.ok

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
7777
[INFO GPL-0041] Total routing overflow: 0.0000
7878
[INFO GPL-0042] Number of overflowed tiles: 0 (0.00%)
7979
[INFO GPL-0043] Average top 0.5% routing congestion: 0.4737
80-
[INFO GPL-0044] Average top 1.0% routing congestion: 0.4729
81-
[INFO GPL-0045] Average top 2.0% routing congestion: 0.4659
82-
[INFO GPL-0046] Average top 5.0% routing congestion: 0.4496
83-
[INFO GPL-0047] Routability iteration weighted routing congestion: 0.4733
80+
[INFO GPL-0044] Average top 1.0% routing congestion: 0.4651
81+
[INFO GPL-0045] Average top 2.0% routing congestion: 0.4568
82+
[INFO GPL-0046] Average top 5.0% routing congestion: 0.4382
83+
[INFO GPL-0047] Routability iteration weighted routing congestion: 0.4694
8484
[INFO GPL-0050] Weighted routing congestion is lower than target routing congestion(1.2500), end routability optimization.
8585
[INFO GPL-0090] Routability finished. Target routing congestion achieved succesfully.
8686
Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
@@ -96,7 +96,7 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
9696
---------------------------------------------------------------
9797
[INFO GPL-1001] Global placement finished at iteration 355
9898
[INFO GPL-1003] Routability mode iteration count: 64
99-
[INFO GPL-1005] Routability final weighted congestion: 0.4408
99+
[INFO GPL-1005] Routability final weighted congestion: 0.4360
100100
[INFO GPL-1002] Placed Cell Area 619.7347
101101
[INFO GPL-1003] Available Free Area 953.8760
102102
[INFO GPL-1004] Minimum Feasible Density 0.6500 (cell_area / free_area)

src/gpl/test/simple04-rd.ok

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
7777
[INFO GPL-0041] Total routing overflow: 0.0000
7878
[INFO GPL-0042] Number of overflowed tiles: 0 (0.00%)
7979
[INFO GPL-0043] Average top 0.5% routing congestion: 0.4737
80-
[INFO GPL-0044] Average top 1.0% routing congestion: 0.4729
81-
[INFO GPL-0045] Average top 2.0% routing congestion: 0.4659
82-
[INFO GPL-0046] Average top 5.0% routing congestion: 0.4496
83-
[INFO GPL-0047] Routability iteration weighted routing congestion: 0.4733
80+
[INFO GPL-0044] Average top 1.0% routing congestion: 0.4651
81+
[INFO GPL-0045] Average top 2.0% routing congestion: 0.4568
82+
[INFO GPL-0046] Average top 5.0% routing congestion: 0.4382
83+
[INFO GPL-0047] Routability iteration weighted routing congestion: 0.4694
8484
[INFO GPL-0050] Weighted routing congestion is lower than target routing congestion(0.6700), end routability optimization.
8585
[INFO GPL-0090] Routability finished. Target routing congestion achieved succesfully.
8686
Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
@@ -96,7 +96,7 @@ Iteration | Overflow | HPWL (um) | HPWL(%) | Penalty | Group
9696
---------------------------------------------------------------
9797
[INFO GPL-1001] Global placement finished at iteration 355
9898
[INFO GPL-1003] Routability mode iteration count: 64
99-
[INFO GPL-1005] Routability final weighted congestion: 0.4408
99+
[INFO GPL-1005] Routability final weighted congestion: 0.4360
100100
[INFO GPL-1002] Placed Cell Area 619.7347
101101
[INFO GPL-1003] Available Free Area 953.8760
102102
[INFO GPL-1004] Minimum Feasible Density 0.6500 (cell_area / free_area)

0 commit comments

Comments
 (0)