Skip to content

Commit 5ccb32a

Browse files
committed
odb: generate database and chip
Signed-off-by: Osama <[email protected]>
1 parent e50a364 commit 5ccb32a

File tree

12 files changed

+1182
-546
lines changed

12 files changed

+1182
-546
lines changed

src/odb/include/odb/db.h

Lines changed: 277 additions & 224 deletions
Large diffs are not rendered by default.

src/odb/include/odb/dbCompare.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ struct less<odb::dbDoubleProperty*>
7575
}
7676
};
7777

78-
template <>
79-
struct less<odb::dbDatabase*>
80-
{
81-
bool operator()(const odb::dbDatabase* lhs, const odb::dbDatabase* rhs) const
82-
{
83-
return odb::compare_by_id(lhs, rhs);
84-
}
85-
};
86-
8778
template <>
8879
struct less<odb::dbBox*>
8980
{
@@ -102,15 +93,6 @@ struct less<odb::dbSBox*>
10293
}
10394
};
10495

105-
template <>
106-
struct less<odb::dbChip*>
107-
{
108-
bool operator()(const odb::dbChip* lhs, const odb::dbChip* rhs) const
109-
{
110-
return odb::compare_by_id(lhs, rhs);
111-
}
112-
};
113-
11496
template <>
11597
struct less<odb::dbBlock*>
11698
{
@@ -488,6 +470,24 @@ struct less<odb::dbCellEdgeSpacing*>
488470
}
489471
};
490472

473+
template <>
474+
struct less<odb::dbChip*>
475+
{
476+
bool operator()(const odb::dbChip* lhs, const odb::dbChip* rhs) const
477+
{
478+
return odb::compare_by_id(lhs, rhs);
479+
}
480+
};
481+
482+
template <>
483+
struct less<odb::dbDatabase*>
484+
{
485+
bool operator()(const odb::dbDatabase* lhs, const odb::dbDatabase* rhs) const
486+
{
487+
return odb::compare_by_id(lhs, rhs);
488+
}
489+
};
490+
491491
template <>
492492
struct less<odb::dbDft*>
493493
{

src/odb/include/odb/dbObject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ class _dbObject;
3131
///
3232
enum dbObjectType
3333
{
34-
dbDatabaseObj,
3534

3635
// Design Objects
37-
dbChipObj,
3836
dbGdsLibObj,
3937
dbBlockObj,
4038
dbInstHdrObj,
@@ -62,6 +60,8 @@ enum dbObjectType
6260
dbAccessPointObj,
6361
dbBusPortObj,
6462
dbCellEdgeSpacingObj,
63+
dbChipObj,
64+
dbDatabaseObj,
6565
dbDftObj,
6666
dbGCellGridObj,
6767
dbGDSARefObj,

src/odb/src/codeGenerator/schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,21 @@
364364
"type":"1_n",
365365
"tbl_name":"categories_tbl_",
366366
"hash":true
367+
},
368+
{
369+
"parent":"dbChip",
370+
"child":"dbProperty",
371+
"type":"1_n",
372+
"flags": ["no-serial", "private"],
373+
"tbl_name":"_prop_tbl"
374+
},
375+
{
376+
"parent":"dbDatabase",
377+
"child":"dbChip",
378+
"type":"1_n",
379+
"tbl_name":"_chip_tbl",
380+
"flags": ["no-serial"],
381+
"page_size": 2
367382
}
368383
]
369384
}
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
{
2+
"name": "dbChip",
3+
"type": "dbObject",
4+
"ostream_scope": true,
5+
"enums": [
6+
{
7+
"name": "ChipType",
8+
"class": true,
9+
"values": [
10+
"DIE",
11+
"RDL",
12+
"IP",
13+
"SUBSTRATE",
14+
"HIER"
15+
],
16+
"public": true
17+
}
18+
],
19+
"fields": [
20+
{
21+
"name": "name_",
22+
"type": "std::string",
23+
"schema": "db_schema_chip_extended",
24+
"flags": ["no-set"]
25+
},
26+
{
27+
"name": "type_",
28+
"type": "uint",
29+
"default": 0,
30+
"schema": "db_schema_chip_extended",
31+
"flags": ["private"]
32+
},
33+
{
34+
"name": "offset_",
35+
"type": "Point",
36+
"default": "{}",
37+
"schema": "db_schema_chip_extended"
38+
},
39+
{
40+
"name": "width_",
41+
"type": "int",
42+
"default": "0",
43+
"schema": "db_schema_chip_extended"
44+
},
45+
{
46+
"name": "height_",
47+
"type": "int",
48+
"default": "0",
49+
"schema": "db_schema_chip_extended"
50+
},
51+
{
52+
"name": "thickness_",
53+
"type": "int",
54+
"default": "0",
55+
"schema": "db_schema_chip_extended"
56+
},
57+
{
58+
"name": "shrink_",
59+
"type": "float",
60+
"default": "0.0",
61+
"comment": "// range ]0, 1]",
62+
"schema": "db_schema_chip_extended"
63+
},
64+
{
65+
"name": "seal_ring_east_",
66+
"type": "int",
67+
"default": "0",
68+
"schema": "db_schema_chip_extended"
69+
},
70+
{
71+
"name": "seal_ring_west_",
72+
"type": "int",
73+
"default": "0",
74+
"schema": "db_schema_chip_extended"
75+
},
76+
{
77+
"name": "seal_ring_north_",
78+
"type": "int",
79+
"default": "0",
80+
"schema": "db_schema_chip_extended"
81+
},
82+
{
83+
"name": "seal_ring_south_",
84+
"type": "int",
85+
"default": "0",
86+
"schema": "db_schema_chip_extended"
87+
},
88+
{
89+
"name": "scribe_line_east_",
90+
"type": "int",
91+
"default": "0",
92+
"schema": "db_schema_chip_extended"
93+
},
94+
{
95+
"name": "scribe_line_west_",
96+
"type": "int",
97+
"default": "0",
98+
"schema": "db_schema_chip_extended"
99+
},
100+
{
101+
"name": "scribe_line_north_",
102+
"type": "int",
103+
"default": "0",
104+
"schema": "db_schema_chip_extended"
105+
},
106+
{
107+
"name": "scribe_line_south_",
108+
"type": "int",
109+
"default": "0",
110+
"schema": "db_schema_chip_extended"
111+
},
112+
{
113+
"name": "tsv_",
114+
"type": "bool",
115+
"default": "false",
116+
"schema": "db_schema_chip_extended"
117+
},
118+
{
119+
"name": "_top",
120+
"type": "dbId<_dbBlock>",
121+
"flags": ["private", "cmpgt"],
122+
"parent": "dbBlock"
123+
},
124+
{
125+
"name": "_block_tbl",
126+
"type": "dbTable<_dbBlock>*",
127+
"flags": ["private", "no-serial"]
128+
},
129+
{
130+
"name": "_name_cache",
131+
"type": "_dbNameCache*",
132+
"flags": ["private", "no-cmp", "no-serial"]
133+
},
134+
{
135+
"name": "_block_itr",
136+
"type": "dbBlockItr*",
137+
"flags": ["private", "no-cmp", "no-serial"]
138+
},
139+
{
140+
"name": "_prop_itr",
141+
"type": "dbPropertyItr*",
142+
"flags": ["private", "no-cmp", "no-serial"]
143+
}
144+
],
145+
"declared_classes": ["dbPropertyItr", "_dbNameCache","dbBlockItr"],
146+
"h_includes": [
147+
"odb/geom.h"
148+
],
149+
"cpp_includes": [
150+
"dbTable.h",
151+
"dbTable.hpp",
152+
"dbNameCache.h",
153+
"dbBlockItr.h",
154+
"dbBlock.h",
155+
"dbTech.h",
156+
"dbPropertyItr.h"
157+
]
158+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "dbDatabase",
3+
"type": "dbObject",
4+
"ostream_scope": true,
5+
"hash" : "0x0",
6+
"fields": [
7+
{
8+
"name": "_magic1",
9+
"type": "uint",
10+
"flags": ["private", "no-cmp", "no-serial"]
11+
},
12+
{
13+
"name": "_magic2",
14+
"type": "uint",
15+
"flags": ["private", "no-cmp", "no-serial"]
16+
},
17+
{
18+
"name": "_schema_major",
19+
"type": "uint",
20+
"flags": ["private", "no-cmp", "no-serial"]
21+
},
22+
{
23+
"name": "_schema_minor",
24+
"type": "uint",
25+
"flags": ["private", "no-cmp", "no-serial"]
26+
},
27+
{
28+
"name": "_master_id",
29+
"type": "uint",
30+
"flags": ["private", "no-serial"]
31+
},
32+
{
33+
"name": "_chip",
34+
"type": "dbId<_dbChip>",
35+
"flags": ["private", "no-serial"]
36+
}
37+
]
38+
}

src/odb/src/db/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ add_library(db
1010
dbBlockItr.cpp
1111
dbBox.cpp
1212
dbBoxItr.cpp
13-
dbChip.cpp
14-
dbDatabase.cpp
1513
dbITerm.cpp
1614
dbITermItr.cpp
1715
dbInst.cpp
@@ -89,6 +87,8 @@ add_library(db
8987
dbAccessPoint.cpp
9088
dbBusPort.cpp
9189
dbCellEdgeSpacing.cpp
90+
dbChip.cpp
91+
dbDatabase.cpp
9292
dbDft.cpp
9393
dbGCellGrid.cpp
9494
dbGDSARef.cpp

0 commit comments

Comments
 (0)