Skip to content

Commit 03ae045

Browse files
authored
Merge pull request #8046 from osamahammad21/odb-chipregion
odb: dbChipRegion, dbChipRegionInst and dbChipConn
2 parents d9b0788 + 2e29187 commit 03ae045

28 files changed

+1459
-10
lines changed

src/odb/include/odb/db.h

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ class dbAccessPoint;
106106
class dbBusPort;
107107
class dbCellEdgeSpacing;
108108
class dbChip;
109+
class dbChipConn;
109110
class dbChipInst;
111+
class dbChipRegion;
112+
class dbChipRegionInst;
110113
class dbDatabase;
111114
class dbDft;
112115
class dbGCellGrid;
@@ -6994,6 +6997,8 @@ class dbChip : public dbObject
69946997

69956998
bool isTsv() const;
69966999

7000+
dbSet<dbChipRegion> getChipRegions() const;
7001+
69977002
// User Code Begin dbChip
69987003

69997004
ChipType getChipType() const;
@@ -7005,6 +7010,8 @@ class dbChip : public dbObject
70057010

70067011
dbSet<dbChipInst> getChipInsts() const;
70077012

7013+
dbSet<dbChipConn> getChipConns() const;
7014+
70087015
///
70097016
/// Create a new chip.
70107017
/// Returns nullptr if there is no database technology.
@@ -7025,6 +7032,38 @@ class dbChip : public dbObject
70257032
// User Code End dbChip
70267033
};
70277034

7035+
class dbChipConn : public dbObject
7036+
{
7037+
public:
7038+
std::string getName() const;
7039+
7040+
void setThickness(int thickness);
7041+
7042+
int getThickness() const;
7043+
7044+
// User Code Begin dbChipConn
7045+
7046+
dbChip* getParentChip() const;
7047+
7048+
dbChipRegionInst* getTopRegion() const;
7049+
7050+
dbChipRegionInst* getBottomRegion() const;
7051+
7052+
std::vector<dbChipInst*> getTopRegionPath() const;
7053+
7054+
std::vector<dbChipInst*> getBottomRegionPath() const;
7055+
7056+
static dbChipConn* create(const std::string& name,
7057+
dbChip* parent_chip,
7058+
const std::vector<dbChipInst*>& top_region_path,
7059+
dbChipRegionInst* top_region,
7060+
const std::vector<dbChipInst*>& bottom_region_path,
7061+
dbChipRegionInst* bottom_region);
7062+
7063+
static void destroy(dbChipConn* chipConn);
7064+
// User Code End dbChipConn
7065+
};
7066+
70287067
class dbChipInst : public dbObject
70297068
{
70307069
public:
@@ -7045,6 +7084,8 @@ class dbChipInst : public dbObject
70457084

70467085
dbTransform getTransform() const;
70477086

7087+
dbSet<dbChipRegionInst> getRegions() const;
7088+
70487089
static odb::dbChipInst* create(dbChip* parent_chip,
70497090
dbChip* master_chip,
70507091
const std::string& name);
@@ -7053,6 +7094,50 @@ class dbChipInst : public dbObject
70537094
// User Code End dbChipInst
70547095
};
70557096

7097+
class dbChipRegion : public dbObject
7098+
{
7099+
public:
7100+
enum class Side
7101+
{
7102+
FRONT,
7103+
BACK,
7104+
INTERNAL,
7105+
INTERNAL_EXT
7106+
};
7107+
7108+
std::string getName() const;
7109+
7110+
void setBox(const Rect& box);
7111+
7112+
Rect getBox() const;
7113+
7114+
// User Code Begin dbChipRegion
7115+
dbChip* getChip() const;
7116+
7117+
Side getSide() const;
7118+
7119+
dbTechLayer* getLayer() const;
7120+
7121+
static dbChipRegion* create(dbChip* chip,
7122+
const std::string& name,
7123+
Side side,
7124+
dbTechLayer* layer);
7125+
7126+
// User Code End dbChipRegion
7127+
};
7128+
7129+
class dbChipRegionInst : public dbObject
7130+
{
7131+
public:
7132+
// User Code Begin dbChipRegionInst
7133+
7134+
dbChipInst* getChipInst() const;
7135+
7136+
dbChipRegion* getChipRegion() const;
7137+
7138+
// User Code End dbChipRegionInst
7139+
};
7140+
70567141
class dbDatabase : public dbObject
70577142
{
70587143
public:
@@ -7064,6 +7149,10 @@ class dbDatabase : public dbObject
70647149

70657150
dbSet<dbChipInst> getChipInsts() const;
70667151

7152+
dbSet<dbChipRegionInst> getChipRegionInsts() const;
7153+
7154+
dbSet<dbChipConn> getChipConns() const;
7155+
70677156
// User Code Begin dbDatabase
70687157

70697158
void setTopChip(dbChip* chip);

src/odb/include/odb/dbCompare.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,15 @@ struct less<odb::dbChip*>
479479
}
480480
};
481481

482+
template <>
483+
struct less<odb::dbChipConn*>
484+
{
485+
bool operator()(const odb::dbChipConn* lhs, const odb::dbChipConn* rhs) const
486+
{
487+
return odb::compare_by_id(lhs, rhs);
488+
}
489+
};
490+
482491
template <>
483492
struct less<odb::dbChipInst*>
484493
{
@@ -488,6 +497,26 @@ struct less<odb::dbChipInst*>
488497
}
489498
};
490499

500+
template <>
501+
struct less<odb::dbChipRegion*>
502+
{
503+
bool operator()(const odb::dbChipRegion* lhs,
504+
const odb::dbChipRegion* rhs) const
505+
{
506+
return odb::compare_by_id(lhs, rhs);
507+
}
508+
};
509+
510+
template <>
511+
struct less<odb::dbChipRegionInst*>
512+
{
513+
bool operator()(const odb::dbChipRegionInst* lhs,
514+
const odb::dbChipRegionInst* rhs) const
515+
{
516+
return odb::compare_by_id(lhs, rhs);
517+
}
518+
};
519+
491520
template <>
492521
struct less<odb::dbDatabase*>
493522
{

src/odb/include/odb/dbObject.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ enum dbObjectType
6161
dbBusPortObj,
6262
dbCellEdgeSpacingObj,
6363
dbChipObj,
64+
dbChipConnObj,
6465
dbChipInstObj,
66+
dbChipRegionObj,
67+
dbChipRegionInstObj,
6568
dbDatabaseObj,
6669
dbDftObj,
6770
dbGCellGridObj,

src/odb/src/codeGenerator/schema.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,24 @@
171171
"orderReversed": "true",
172172
"sequential": 0,
173173
"includes": ["dbChipInst.h", "dbChip.h"]
174+
},
175+
{
176+
"name": "dbChipRegionInstItr",
177+
"parentObject": "dbChipRegionInst",
178+
"tableName": "chip_region_inst_tbl",
179+
"reversible": "true",
180+
"orderReversed": "true",
181+
"sequential": 0,
182+
"includes": ["dbChipInst.h", "dbChip.h"]
183+
},
184+
{
185+
"name": "dbChipConnItr",
186+
"parentObject": "dbChipConn",
187+
"tableName": "chip_conn_tbl",
188+
"reversible": "true",
189+
"orderReversed": "true",
190+
"sequential": 0,
191+
"includes": ["dbChipConn.h", "dbChip.h"]
174192
}
175193
],
176194
"relations":[
@@ -381,6 +399,14 @@
381399
"flags": ["no-serial", "private"],
382400
"tbl_name":"_prop_tbl"
383401
},
402+
{
403+
"parent":"dbChip",
404+
"child":"dbChipRegion",
405+
"type":"1_n",
406+
"flags": [],
407+
"schema":"db_schema_chip_region",
408+
"tbl_name":"chip_region_tbl_"
409+
},
384410
{
385411
"parent":"dbDatabase",
386412
"child":"dbChip",
@@ -404,6 +430,22 @@
404430
"tbl_name":"chip_inst_tbl_",
405431
"schema":"db_schema_chip_inst",
406432
"flags": ["no-serial"]
433+
},
434+
{
435+
"parent":"dbDatabase",
436+
"child":"dbChipRegionInst",
437+
"type":"1_n",
438+
"tbl_name":"chip_region_inst_tbl_",
439+
"schema":"db_schema_chip_region",
440+
"flags": ["no-serial"]
441+
},
442+
{
443+
"parent":"dbDatabase",
444+
"child":"dbChipConn",
445+
"type":"1_n",
446+
"tbl_name":"chip_conn_tbl_",
447+
"schema":"db_schema_chip_region",
448+
"flags": ["no-serial"]
407449
}
408450
]
409451
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@
148148
"type": "dbId<_dbChipInst>",
149149
"flags": ["private"],
150150
"schema":"db_schema_chip_inst"
151+
},
152+
{
153+
"name": "conns_",
154+
"type": "dbId<_dbChipConn>",
155+
"flags": ["private"],
156+
"schema": "db_schema_chip_region"
151157
}
152158
],
153159
"declared_classes": ["dbPropertyItr", "_dbNameCache","dbBlockItr"],
@@ -161,6 +167,7 @@
161167
"dbBlockItr.h",
162168
"dbBlock.h",
163169
"dbTech.h",
164-
"dbPropertyItr.h"
170+
"dbPropertyItr.h",
171+
"dbChipConn.h"
165172
]
166173
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "dbChipConn",
3+
"type": "dbObject",
4+
"fields": [
5+
{ "name": "name_", "type": "std::string", "flags": ["no-set"] },
6+
{ "name": "thickness_", "type": "int", "flags": [] },
7+
{ "name": "chip_", "type": "dbId<_dbChip>", "flags": ["private"] },
8+
{ "name": "chip_conn_next_", "type": "dbId<_dbChipConn>", "flags": ["private"] },
9+
{ "name": "top_region_", "type": "dbId<_dbChipRegionInst>", "flags": ["private"] },
10+
{ "name": "top_region_path_", "type": "std::vector<dbId<_dbChipInst>>", "flags": ["private"] },
11+
{ "name": "bottom_region_", "type": "dbId<_dbChipRegionInst>", "flags": ["private"] },
12+
{ "name": "bottom_region_path_", "type": "std::vector<dbId<_dbChipInst>>", "flags": ["private"] }
13+
],
14+
"h_includes": ["odb/dbId.h"],
15+
"cpp_includes": ["dbChipRegionInst.h", "dbChipInst.h", "dbChipRegion.h", "dbChip.h"]
16+
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
"name":"chipinst_next_",
3434
"type":"dbId<_dbChipInst>",
3535
"flags":["private"]
36+
},
37+
{
38+
"name":"chip_region_insts_",
39+
"type":"dbId<_dbChipRegionInst>",
40+
"flags":["private"],
41+
"schema":"db_schema_chip_region"
3642
}
3743
],
3844
"h_includes": [
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "dbChipRegion",
3+
"type": "dbObject",
4+
"enums": [
5+
{
6+
"name": "Side",
7+
"class": true,
8+
"values": [ "FRONT", "BACK", "INTERNAL", "INTERNAL_EXT" ],
9+
"public": true
10+
}
11+
],
12+
"fields": [
13+
{ "name": "name_", "type": "std::string", "flags": ["no-set"]},
14+
{ "name": "side_", "type": "uint8_t", "flags": ["private"] },
15+
{ "name": "layer_", "type": "dbId<_dbTechLayer>", "flags": ["private"] },
16+
{ "name": "box_", "type": "Rect", "flags": ["set-const-ref"]}
17+
],
18+
"h_includes": ["odb/geom.h", "odb/dbTypes.h", "odb/dbId.h"],
19+
"cpp_includes": ["dbTechLayer.h"]
20+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "dbChipRegionInst",
3+
"type": "dbObject",
4+
"fields": [
5+
{
6+
"name": "region_",
7+
"type": "dbId<_dbChipRegion>",
8+
"flags": ["private"]
9+
},
10+
{
11+
"name":"parent_chipinst_",
12+
"type":"dbId<_dbChipInst>",
13+
"flags":["private"]
14+
},
15+
{
16+
"name":"chip_region_inst_next_",
17+
"type":"dbId<_dbChipRegionInst>",
18+
"flags":["private"]
19+
}
20+
],
21+
"h_includes": [
22+
"odb/dbId.h"
23+
],
24+
"cpp_includes": [
25+
"dbChipRegion.h"
26+
]
27+
}

src/odb/src/db/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ add_library(db
8888
dbBusPort.cpp
8989
dbCellEdgeSpacing.cpp
9090
dbChip.cpp
91+
dbChipConn.cpp
9192
dbChipInst.cpp
93+
dbChipRegion.cpp
94+
dbChipRegionInst.cpp
9295
dbDatabase.cpp
9396
dbDft.cpp
9497
dbGCellGrid.cpp
@@ -145,7 +148,9 @@ add_library(db
145148
dbTechLayerTwoWiresForbiddenSpcRule.cpp
146149
dbTechLayerWidthTableRule.cpp
147150
dbTechLayerWrongDirSpacingRule.cpp
151+
dbChipConnItr.cpp
148152
dbChipInstItr.cpp
153+
dbChipRegionInstItr.cpp
149154
dbGroupInstItr.cpp
150155
dbGroupItr.cpp
151156
dbGroupModInstItr.cpp

0 commit comments

Comments
 (0)