Skip to content

Commit 1f0b987

Browse files
authored
Merge pull request #8922 from The-OpenROAD-Project-staging/odb-refactor2
Odb refactor - name, next_entry, oid rename, dbBPin cleanup
2 parents 663acb0 + 4bd902b commit 1f0b987

File tree

147 files changed

+1850
-1921
lines changed

Some content is hidden

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

147 files changed

+1850
-1921
lines changed

src/Design.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "ord/Design.h"
55

6+
#include <algorithm>
67
#include <cmath>
78
#include <cstdint>
89
#include <istream>
@@ -224,7 +225,7 @@ std::uint64_t Design::getNetRoutedLength(odb::dbNet* net)
224225
for (odb::dbSWire* swire : net->getSWires()) {
225226
for (odb::dbSBox* wire : swire->getWires()) {
226227
if (wire != nullptr && !(wire->isVia())) {
227-
route_length += wire->getLength();
228+
route_length += std::max(wire->getDX(), wire->getDY());
228229
}
229230
}
230231
}

src/grt/src/GlobalRouter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ std::vector<LayerId> GlobalRouter::findTransitionLayers()
14081408
int via_width = 0;
14091409
for (const auto box : default_vias[tech_layer]->getBoxes()) {
14101410
if (box->getTechLayer() == tech_layer) {
1411-
via_width = vertical ? box->getWidth() : box->getLength();
1411+
via_width = vertical ? box->getDY() : box->getDX();
14121412
break;
14131413
}
14141414
}
@@ -3487,17 +3487,17 @@ void getViaDims(std::map<odb::dbTechLayer*, odb::dbTechVia*> default_vias,
34873487
if (default_vias.find(tech_layer) != default_vias.end()) {
34883488
for (auto box : default_vias[tech_layer]->getBoxes()) {
34893489
if (box->getTechLayer() == tech_layer) {
3490-
width_up = std::min(box->getWidth(), box->getLength());
3491-
prl_up = std::max(box->getWidth(), box->getLength());
3490+
width_up = std::min(box->getDX(), box->getDY());
3491+
prl_up = std::max(box->getDX(), box->getDY());
34923492
break;
34933493
}
34943494
}
34953495
}
34963496
if (default_vias.find(bottom_layer) != default_vias.end()) {
34973497
for (auto box : default_vias[bottom_layer]->getBoxes()) {
34983498
if (box->getTechLayer() == tech_layer) {
3499-
width_down = std::min(box->getWidth(), box->getLength());
3500-
prl_down = std::max(box->getWidth(), box->getLength());
3499+
width_down = std::min(box->getDX(), box->getDY());
3500+
prl_down = std::max(box->getDX(), box->getDY());
35013501
break;
35023502
}
35033503
}

src/odb/include/odb/db.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ class dbBox : public dbObject
264264
/// Get the height (yMax-yMin) of the box.
265265
///
266266
uint getDY() const;
267-
uint getWidth(uint dir = 1) const;
268-
uint getLength(uint dir = 1) const;
269267

270268
///
271269
/// Set temporary flag visited
@@ -1674,7 +1672,7 @@ class dbBPin : public dbObject
16741672
///
16751673
/// Get the placement status of this block-terminal.
16761674
///
1677-
dbPlacementStatus getPlacementStatus();
1675+
dbPlacementStatus getPlacementStatus() const;
16781676

16791677
///
16801678
/// Set the placement status of this block-terminal.
@@ -1699,7 +1697,7 @@ class dbBPin : public dbObject
16991697
///
17001698
/// Returns true if this bpin has an effective-width rule.
17011699
///
1702-
bool hasEffectiveWidth();
1700+
bool hasEffectiveWidth() const;
17031701

17041702
///
17051703
/// Set the effective width rule.
@@ -1709,12 +1707,12 @@ class dbBPin : public dbObject
17091707
///
17101708
/// Return the effective width rule.
17111709
///
1712-
int getEffectiveWidth();
1710+
int getEffectiveWidth() const;
17131711

17141712
///
17151713
/// Returns true if this bpin has an min-spacing rule.
17161714
///
1717-
bool hasMinSpacing();
1715+
bool hasMinSpacing() const;
17181716

17191717
///
17201718
/// Set the min spacing rule.
@@ -1724,7 +1722,7 @@ class dbBPin : public dbObject
17241722
///
17251723
/// Return the min spacing rule.
17261724
///
1727-
int getMinSpacing();
1725+
int getMinSpacing() const;
17281726

17291727
std::vector<dbAccessPoint*> getAccessPoints() const;
17301728

src/odb/src/codeGenerator/gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def make_parent_hash_field(parent, relation, parent_field):
8989

9090
def make_child_next_field(child, relation):
9191
"""Adds a next entry field to the child of a hashed relationsip"""
92-
inChildNextEntry = {"name": "_next_entry"}
92+
inChildNextEntry = {"name": "next_entry_"}
9393
inChildNextEntry["type"] = "dbId<_" + relation["child"] + ">"
9494
inChildNextEntry["flags"] = ["private"]
9595
inChildNextEntry["flags"].extend(relation.get("flags", []))

src/odb/src/codeGenerator/schema/chip/dbBusPort.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"needs_non_default_destructor" : "true",
44
"fields": [
55
{
6-
"name":"_flags",
6+
"name":"flags_",
77
"type":"uint",
88
"flags":["private"],
99
"default":"0",

src/odb/src/codeGenerator/schema/chip/dbChip.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"fields": [
2121
{
22-
"name": "_name",
22+
"name": "name_",
2323
"type": "char *",
2424
"schema": "db_schema_chip_extended",
2525
"default": "nullptr",
@@ -197,4 +197,4 @@
197197
"dbPropertyItr.h",
198198
"dbChipConn.h"
199199
]
200-
}
200+
}

src/odb/src/codeGenerator/schema/chip/dbGroup.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type":"dbObject",
44
"fields":[
55
{
6-
"name":"_name",
6+
"name":"name_",
77
"type":"char *",
88
"default": "nullptr",
99
"flags":["no-set"]
@@ -15,7 +15,7 @@
1515
"flags":["no-set","no-get"]
1616
},
1717
{
18-
"name":"_next_entry",
18+
"name":"next_entry_",
1919
"type":"dbId<_dbGroup>",
2020
"flags":["no-set","no-get"]
2121
},

src/odb/src/codeGenerator/schema/chip/dbIsolation.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"type":"dbObject",
44
"fields":[
55
{
6-
"name":"_name",
6+
"name":"name_",
77
"type":"char *",
88
"default": "nullptr",
99
"flags":["no-set"]
1010
},
1111
{
12-
"name":"_next_entry",
12+
"name":"next_entry_",
1313
"type":"dbId<_dbIsolation>",
1414
"flags":["no-set","no-get"]
1515
},

src/odb/src/codeGenerator/schema/chip/dbLevelShifter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"type": "dbObject",
44
"fields": [
55
{
6-
"name": "_name",
6+
"name": "name_",
77
"type": "char *",
88
"default": "nullptr",
99
"flags": ["no-set"]
1010
},
1111
{
12-
"name": "_next_entry",
12+
"name": "next_entry_",
1313
"type": "dbId<_dbLevelShifter>",
1414
"flags": ["no-set", "no-get"]
1515
},

src/odb/src/codeGenerator/schema/chip/dbLogicPort.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"type":"dbObject",
44
"fields":[
55
{
6-
"name":"_name",
6+
"name":"name_",
77
"type":"char *",
88
"default": "nullptr",
99
"flags":["no-set"]
1010
},
1111
{
12-
"name":"_next_entry",
12+
"name":"next_entry_",
1313
"type":"dbId<_dbLogicPort>",
1414
"flags":["no-set","no-get"]
1515
},

0 commit comments

Comments
 (0)