Skip to content

Commit a5a8b30

Browse files
committed
Merge remote-tracking branch 'private/master' into gui-tcl-worst-path-image
2 parents 37a88b0 + 0aa3f6a commit a5a8b30

File tree

207 files changed

+5672
-3150
lines changed

Some content is hidden

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

207 files changed

+5672
-3150
lines changed

.gemini/config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
memory_config:
2+
disabled: false
3+
code_review:
4+
pull_request_opened:
5+
help: false
6+
summary: false
7+
code_review: true
8+
include_drafts: true

.github/workflows/github-actions-lint-tcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install Dependencies
2020
run: |
2121
python3 -m venv venv
22-
venv/bin/pip install tclint==0.6.1
22+
venv/bin/pip install tclint==0.7.0
2323
2424
- name: Lint
2525
run: |

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ bazel_dep(name = "bazel-orfs")
146146
# To bump version, run: bazelisk run @bazel-orfs//:bump
147147
git_override(
148148
module_name = "bazel-orfs",
149-
commit = "e96d7d2a4405a99fc689b4f2f676d3bda7b9430b",
149+
commit = "1e862b169d97dc0fec5db106559640886e7fd7d0",
150150
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
151151
)
152152

@@ -155,10 +155,10 @@ orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
155155
# To bump version, run: bazelisk run @bazel-orfs//:bump
156156
orfs.default(
157157
# Official image https://hub.docker.com/r/openroad/orfs/tags
158-
image = "docker.io/openroad/orfs:v3.0-4362-gaec1d8d35",
158+
image = "docker.io/openroad/orfs:v3.0-4367-g79b6a48ab",
159159
# Use OpenROAD of this repo instead of from the docker image
160160
openroad = "//:openroad",
161-
sha256 = "5f94f0481d1339493918208060be116da101405251bce22691ac4b2d662d276e",
161+
sha256 = "0d0dd3d8d346360a71f6325ce776a984c5a6296fc6e51956b53f136e1dd13462",
162162
)
163163
use_repo(orfs, "com_github_nixos_patchelf_download")
164164
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/OpenRoad.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,16 +504,21 @@ void OpenRoad::read3DBloxBMap(const std::string& filename)
504504
odb::ThreeDBlox parser(logger_, db_);
505505
parser.readBMap(filename);
506506
}
507+
507508
void OpenRoad::write3Dbv(const std::string& filename)
508509
{
509510
odb::ThreeDBlox writer(logger_, db_, sta_);
510511
writer.writeDbv(filename, db_->getChip());
511512
}
513+
512514
void OpenRoad::write3Dbx(const std::string& filename)
513515
{
514516
odb::ThreeDBlox writer(logger_, db_, sta_);
515517
writer.writeDbx(filename, db_->getChip());
516518
}
519+
520+
// TODO: bool hierarchy should be removed in the future.
521+
// It is retained for a while for backward compatibility.
517522
void OpenRoad::readDb(const char* filename, bool hierarchy)
518523
{
519524
try {
@@ -523,7 +528,7 @@ void OpenRoad::readDb(const char* filename, bool hierarchy)
523528
logger_->error(ORD, 54, "odb file {} is invalid: {}", filename, f.what());
524529
}
525530
// treat this as a hierarchical network.
526-
if (hierarchy) {
531+
if (hierarchy || db_->hasHierarchy()) {
527532
logger_->warn(
528533
ORD,
529534
12,

src/OpenRoad.tcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ sta::define_cmd_args "write_db" {filename}
233233
sta::define_cmd_args "read_db" {[-hier] filename}
234234

235235
proc read_db { args } {
236+
# TODO: -hier is not needed anymore.
237+
# - It will be removed in a future release.
238+
# - It is currently retained for backward compatibility.
236239
sta::parse_key_args "read_db" args keys {} flags {-hier}
237240
sta::check_argc_eq1or2 "read_db" $args
238241
set filename [file nativename [lindex $args 0]]

src/cts/src/TechChar.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
950950
odb::dbNet* net = nullptr;
951951
// clang-format off
952952
debugPrint(logger_, CTS, "tech char", 1, "*createPatterns for #nodes = {}"
953-
" #topologies = {}", setupWirelength, numberOfNodes, numberOfTopologies);
953+
" #topologies = {}", numberOfNodes, numberOfTopologies);
954954
// clang-format on
955955
// For each possible topology...
956956
for (unsigned solutionCounterInt = 0; solutionCounterInt < numberOfTopologies;
@@ -1051,9 +1051,6 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
10511051
tmp << "OUT";
10521052
debugPrint(logger_, CTS, "tech char", 1, tmp.str());
10531053
topology.outPort = outPortPin;
1054-
if (isPureWire) {
1055-
topology.instVector.push_back(nullptr);
1056-
}
10571054
topology.isPureWire = isPureWire;
10581055
topology.netVector.push_back(net);
10591056
topology.nodesWithoutBufVector.push_back(nodesWithoutBuf);
@@ -1478,6 +1475,7 @@ std::vector<TechChar::ResultData> TechChar::characterizationPostProcess()
14781475
unsigned maxResultCapacitance = 0;
14791476
unsigned minResultSlew = std::numeric_limits<unsigned>::max();
14801477
unsigned maxResultSlew = 0;
1478+
14811479
std::vector<ResultData> convertedSolutions;
14821480
for (ResultData solution : selectedSolutions) {
14831481
if (solution.pinSlew <= options_->getMaxCharSlew()) {
@@ -1530,6 +1528,7 @@ std::vector<TechChar::ResultData> TechChar::characterizationPostProcess()
15301528
convertedSolutions.push_back(convertedResult);
15311529
}
15321530
}
1531+
15331532
// Sets the min and max values and returns the result vector.
15341533
minSlew_ = minResultSlew;
15351534
maxSlew_ = maxResultSlew;
@@ -1631,10 +1630,10 @@ void TechChar::create()
16311630
masterNames_.size(), solution.instVector.size());
16321631
// clang-format on
16331632
// For each possible buffer combination (different sizes).
1634-
unsigned buffersUpdate
1633+
unsigned buffersCombinations
16351634
= getBufferingCombo(masterNames_.size(), solution.instVector.size());
16361635

1637-
if (buffersUpdate == 0) {
1636+
if (buffersCombinations == 0) {
16381637
continue;
16391638
}
16401639

@@ -1697,12 +1696,13 @@ void TechChar::create()
16971696
}
16981697
}
16991698
// If the solution is not a pure-wire, update the buffer topologies.
1700-
if (!solution.isPureWire) {
1699+
if (!solution.isPureWire && buffersCombinations > 1) {
17011700
updateBufferTopologies(solution);
17021701
}
1703-
// For pure-wire solution buffersUpdate == 1, so it only runs once.
1704-
buffersUpdate--;
1705-
} while (buffersUpdate != 0);
1702+
// For pure-wire solution buffersCombinations == 1, so it only runs
1703+
// once.
1704+
buffersCombinations--;
1705+
} while (buffersCombinations != 0);
17061706
}
17071707
openStaChar_.reset(nullptr);
17081708
}

src/dbSta/include/db_sta/dbNetwork.hh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ class dbNetwork : public ConcreteNetwork
394394

395395
// hierarchy handler, set in openroad tested in network child traverserser
396396

397-
void setHierarchy() { hierarchy_ = true; }
398-
void disableHierarchy() { hierarchy_ = false; }
399-
bool hasHierarchy() const { return hierarchy_; }
397+
void setHierarchy() { db_->setHierarchy(true); }
398+
void disableHierarchy() { db_->setHierarchy(false); }
399+
bool hasHierarchy() const { return db_->hasHierarchy(); }
400400
bool hasHierarchicalElements() const;
401401
void reassociateHierFlatNet(dbModNet* mod_net,
402402
dbNet* new_flat_net,
@@ -470,7 +470,6 @@ class dbNetwork : public ConcreteNetwork
470470
static constexpr unsigned DBIDTAG_WIDTH = 0x4;
471471

472472
private:
473-
bool hierarchy_ = false;
474473
std::set<const Cell*> hier_modules_;
475474
std::set<const Port*> concrete_ports_;
476475
std::unique_ptr<dbEditHierarchy> hierarchy_editor_;

src/dbSta/src/dbEditHierarchy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void dbEditHierarchy::hierarchicalConnect(dbITerm* source_pin,
252252
//
253253
dbNet* source_db_net = source_pin->getNet();
254254
dbNet* dest_db_net = dest_pin->getNet();
255-
if (db_network_->hierarchy_ == false) {
255+
if (db_network_->hasHierarchy() == false) {
256256
// If both source pin and dest pin do not have a corresponding flat net,
257257
// Create a new net and connect it with source pin.
258258
if (source_db_net == nullptr && dest_db_net == nullptr) {

src/dbSta/src/dbNetwork.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ ObjectId dbNetwork::id(const Port* port) const
768768
return std::numeric_limits<ObjectId>::max();
769769
}
770770

771-
if (hierarchy_) {
771+
if (hasHierarchy()) {
772772
if (isConcretePort(port)) {
773773
return ConcreteNetwork::id(port);
774774
}
@@ -790,7 +790,7 @@ ObjectId dbNetwork::id(const Port* port) const
790790
ObjectId dbNetwork::id(const Cell* cell) const
791791
{
792792
// in hierarchical flow we use the object id for the index
793-
if (hierarchy_) {
793+
if (hasHierarchy()) {
794794
if (!isConcreteCell(cell)) {
795795
const dbObject* obj = reinterpret_cast<const dbObject*>(cell);
796796
return getDbNwkObjectId(obj);
@@ -808,7 +808,7 @@ ObjectId dbNetwork::id(const Instance* instance) const
808808
if (instance == top_instance_) {
809809
return 0;
810810
}
811-
if (hierarchy_) {
811+
if (hasHierarchy()) {
812812
const dbObject* obj = reinterpret_cast<const dbObject*>(instance);
813813
return getDbNwkObjectId(obj);
814814
}
@@ -840,7 +840,7 @@ const char* dbNetwork::name(const Port* port) const
840840
return nullptr;
841841
}
842842

843-
if (hierarchy_) {
843+
if (hasHierarchy()) {
844844
size_t last_idx = name.find_last_of('/');
845845
if (last_idx != std::string::npos) {
846846
name = name.substr(last_idx + 1);
@@ -887,7 +887,7 @@ const char* dbNetwork::name(const Instance* instance) const
887887
name = mod_inst->getName();
888888
}
889889

890-
if (hierarchy_) {
890+
if (hasHierarchy()) {
891891
size_t last_idx = std::string::npos;
892892
size_t pos = name.length();
893893
while ((pos = name.rfind('/', pos)) != std::string::npos) {
@@ -1096,7 +1096,7 @@ Instance* dbNetwork::parent(const Instance* instance) const
10961096

10971097
Port* dbNetwork::findPort(const Cell* cell, const char* name) const
10981098
{
1099-
if (hierarchy_) {
1099+
if (hasHierarchy()) {
11001100
dbMaster* db_master;
11011101
dbModule* db_module;
11021102
staToDb(cell, db_master, db_module);
@@ -1125,7 +1125,7 @@ bool dbNetwork::isLeaf(const Instance* instance) const
11251125
if (instance == top_instance_) {
11261126
return false;
11271127
}
1128-
if (hierarchy_) {
1128+
if (hasHierarchy()) {
11291129
dbMaster* db_master;
11301130
dbModule* db_module;
11311131
Cell* cur_cell = cell(instance);
@@ -1140,7 +1140,7 @@ bool dbNetwork::isLeaf(const Instance* instance) const
11401140

11411141
Instance* dbNetwork::findInstance(const char* path_name) const
11421142
{
1143-
if (hierarchy_) { // are we in hierarchical mode ?
1143+
if (hasHierarchy()) { // are we in hierarchical mode ?
11441144
// find a hierarchical module instance first
11451145
dbModInst* mod_inst = block()->findModInst(path_name);
11461146
if (mod_inst) {
@@ -1395,7 +1395,7 @@ ObjectId dbNetwork::id(const Pin* pin) const
13951395

13961396
staToDb(pin, iterm, bterm, moditerm);
13971397

1398-
if (hierarchy_) {
1398+
if (hasHierarchy()) {
13991399
// get the id for hierarchical objects using dbid.
14001400
std::uintptr_t tag_value
14011401
= reinterpret_cast<std::uintptr_t>(pin) & kPointerTagMask;
@@ -1784,7 +1784,7 @@ ObjectId dbNetwork::id(const Net* net) const
17841784
dbModNet* modnet = nullptr;
17851785
dbNet* dnet = nullptr;
17861786
staToDb(net, dnet, modnet);
1787-
if (hierarchy_) {
1787+
if (hasHierarchy()) {
17881788
const dbObject* obj = reinterpret_cast<const dbObject*>(net);
17891789
return getDbNwkObjectId(obj);
17901790
}
@@ -1865,7 +1865,7 @@ const char* dbNetwork::name(const Net* net) const
18651865
// strip out the parent name in hierarchy mode
18661866
// turn this off to get full flat names
18671867

1868-
if (hierarchy_) {
1868+
if (hasHierarchy()) {
18691869
//
18701870
// If this is not a hierarchical name, return it
18711871
//
@@ -2054,7 +2054,7 @@ const Net* dbNetwork::highestConnectedNet(Net* net) const
20542054

20552055
ObjectId dbNetwork::id(const Term* term) const
20562056
{
2057-
if (hierarchy_) {
2057+
if (hasHierarchy()) {
20582058
const dbObject* obj = reinterpret_cast<const dbObject*>(term);
20592059
return getDbNwkObjectId(obj);
20602060
}
@@ -3408,7 +3408,7 @@ we can decide whether or not to use the ConcreteNetwork api.
34083408
*/
34093409
bool dbNetwork::isConcreteCell(const Cell* cell) const
34103410
{
3411-
if (!hierarchy_) {
3411+
if (!hasHierarchy()) {
34123412
return true;
34133413
}
34143414

@@ -3426,7 +3426,7 @@ void dbNetwork::registerConcretePort(const Port* port)
34263426

34273427
bool dbNetwork::isConcretePort(const Port* port) const
34283428
{
3429-
if (!hierarchy_) {
3429+
if (!hasHierarchy()) {
34303430
return true;
34313431
}
34323432
if (concrete_ports_.find(port) != concrete_ports_.end()) {
@@ -3494,7 +3494,7 @@ int dbNetwork::toIndex(const Port* port) const
34943494

34953495
bool dbNetwork::hasMembers(const Port* port) const
34963496
{
3497-
if (hierarchy_) {
3497+
if (hasHierarchy()) {
34983498
dbMTerm* mterm = nullptr;
34993499
dbBTerm* bterm = nullptr;
35003500
dbModBTerm* modbterm = nullptr;
@@ -3580,7 +3580,7 @@ PortMemberIterator* dbNetwork::memberIterator(const Port* port) const
35803580
{
35813581
// top-level port is concrete port. DbNetworkPortMemberIterator cannot handle
35823582
// it.
3583-
if (!hierarchy_ || isConcretePort(port)) {
3583+
if (!hasHierarchy() || isConcretePort(port)) {
35843584
return ConcreteNetwork::memberIterator(port);
35853585
}
35863586

0 commit comments

Comments
 (0)