Skip to content

Commit 01900ec

Browse files
author
osamahammad21
committed
odb: replace struct UnfoldedModel with dbObject-backed unfolded model
Signed-off-by: osamahammad21 <osama@precisioninno.com>
1 parent f8ecbda commit 01900ec

34 files changed

Lines changed: 2243 additions & 729 deletions

src/odb/include/odb/db.h

Lines changed: 111 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ class dbTechLayerTwoWiresForbiddenSpcRule;
178178
class dbTechLayerVoltageSpacing;
179179
class dbTechLayerWidthTableRule;
180180
class dbTechLayerWrongDirSpacingRule;
181+
class dbUnfoldedBump;
182+
class dbUnfoldedChip;
183+
class dbUnfoldedConn;
184+
class dbUnfoldedNet;
185+
class dbUnfoldedRegion;
181186
// Generator Code End ClassDeclarations
182187

183188
// Extraction Objects
@@ -186,8 +191,6 @@ class dbExtControl;
186191
// Custom iterators
187192
class dbModuleBusPortModBTermItr;
188193

189-
class UnfoldedModel;
190-
191194
///////////////////////////////////////////////////////////////////////////////
192195
///
193196
/// A box is the element used to represent layout shapes.
@@ -7587,6 +7590,16 @@ class dbDatabase : public dbObject
75877590

75887591
dbSet<dbChipNet> getChipNets() const;
75897592

7593+
dbSet<dbUnfoldedChip> getUnfoldedChips() const;
7594+
7595+
dbSet<dbUnfoldedRegion> getUnfoldedRegions() const;
7596+
7597+
dbSet<dbUnfoldedBump> getUnfoldedBumps() const;
7598+
7599+
dbSet<dbUnfoldedConn> getUnfoldedConns() const;
7600+
7601+
dbSet<dbUnfoldedNet> getUnfoldedNets() const;
7602+
75907603
// User Code Begin dbDatabase
75917604

75927605
void setHierarchy(bool value);
@@ -7637,7 +7650,6 @@ class dbDatabase : public dbObject
76377650

76387651
void constructUnfoldedModel();
76397652

7640-
UnfoldedModel* getUnfoldedModel() const;
76417653
////////////////////////
76427654
/// DEPRECATED
76437655
////////////////////////
@@ -7767,6 +7779,12 @@ class dbDatabase : public dbObject
77677779
/// Translate a database-id back to a pointer.
77687780
///
77697781
static dbDatabase* getDatabase(uint32_t oid);
7782+
7783+
///
7784+
/// Find an unfolded chip by its full path name (slash-joined chip-inst
7785+
/// names). Returns nullptr if no match.
7786+
///
7787+
dbUnfoldedChip* findUnfoldedChip(const std::string& path) const;
77707788
// User Code End dbDatabase
77717789
};
77727790

@@ -11350,6 +11368,96 @@ class dbTechLayerWrongDirSpacingRule : public dbObject
1135011368
// User Code End dbTechLayerWrongDirSpacingRule
1135111369
};
1135211370

11371+
class dbUnfoldedBump : public dbObject
11372+
{
11373+
public:
11374+
dbChipBumpInst* getChipBumpInst() const;
11375+
11376+
dbUnfoldedRegion* getParentRegion() const;
11377+
11378+
// User Code Begin dbUnfoldedBump
11379+
Point3D getGlobalPosition() const;
11380+
// User Code End dbUnfoldedBump
11381+
};
11382+
11383+
class dbUnfoldedChip : public dbObject
11384+
{
11385+
public:
11386+
const std::string& getName() const;
11387+
11388+
dbTransform getTransform() const;
11389+
11390+
// User Code Begin dbUnfoldedChip
11391+
Cuboid getCuboid() const;
11392+
11393+
dbSet<dbUnfoldedRegion> getRegions() const;
11394+
11395+
///
11396+
/// Return the chip-instance path that uniquely identifies this unfolded
11397+
/// chip in the folded hierarchy (top-most chip inst first, leaf last).
11398+
///
11399+
std::vector<dbChipInst*> getChipInstPath() const;
11400+
11401+
///
11402+
/// Find the unfolded region within this chip whose source region instance
11403+
/// matches `source`. Returns nullptr if no match.
11404+
///
11405+
dbUnfoldedRegion* findRegion(dbChipRegionInst* source) const;
11406+
// User Code End dbUnfoldedChip
11407+
};
11408+
11409+
class dbUnfoldedConn : public dbObject
11410+
{
11411+
public:
11412+
dbChipConn* getChipConn() const;
11413+
11414+
dbUnfoldedRegion* getTopRegion() const;
11415+
11416+
dbUnfoldedRegion* getBottomRegion() const;
11417+
};
11418+
11419+
class dbUnfoldedNet : public dbObject
11420+
{
11421+
public:
11422+
dbChipNet* getChipNet() const;
11423+
11424+
// User Code Begin dbUnfoldedNet
11425+
std::vector<dbUnfoldedBump*> getConnectedBumps() const;
11426+
// User Code End dbUnfoldedNet
11427+
};
11428+
11429+
class dbUnfoldedRegion : public dbObject
11430+
{
11431+
public:
11432+
enum class EffectiveSide
11433+
{
11434+
TOP,
11435+
BOTTOM,
11436+
INTERNAL,
11437+
INTERNAL_EXT
11438+
};
11439+
11440+
dbChipRegionInst* getChipRegionInst() const;
11441+
11442+
dbUnfoldedChip* getParentChip() const;
11443+
11444+
// User Code Begin dbUnfoldedRegion
11445+
Cuboid getCuboid() const;
11446+
11447+
EffectiveSide getEffectiveSide() const;
11448+
void setEffectiveSide(EffectiveSide side);
11449+
11450+
bool isTop() const;
11451+
bool isBottom() const;
11452+
bool isInternal() const;
11453+
bool isInternalExt() const;
11454+
11455+
int getSurfaceZ() const;
11456+
11457+
dbSet<dbUnfoldedBump> getBumps() const;
11458+
// User Code End dbUnfoldedRegion
11459+
};
11460+
1135311461
// Generator Code End ClassDefinition
1135411462
///
1135511463
/// dbProperty - Boolean property.

src/odb/include/odb/dbCompare.inc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,46 @@ struct less<odb::dbTechLayerWrongDirSpacingRule*>
819819
= delete;
820820
};
821821

822+
template <>
823+
struct less<odb::dbUnfoldedBump*>
824+
{
825+
bool operator()(const odb::dbUnfoldedBump* lhs,
826+
const odb::dbUnfoldedBump* rhs) const
827+
= delete;
828+
};
829+
830+
template <>
831+
struct less<odb::dbUnfoldedChip*>
832+
{
833+
bool operator()(const odb::dbUnfoldedChip* lhs,
834+
const odb::dbUnfoldedChip* rhs) const
835+
= delete;
836+
};
837+
838+
template <>
839+
struct less<odb::dbUnfoldedConn*>
840+
{
841+
bool operator()(const odb::dbUnfoldedConn* lhs,
842+
const odb::dbUnfoldedConn* rhs) const
843+
= delete;
844+
};
845+
846+
template <>
847+
struct less<odb::dbUnfoldedNet*>
848+
{
849+
bool operator()(const odb::dbUnfoldedNet* lhs,
850+
const odb::dbUnfoldedNet* rhs) const
851+
= delete;
852+
};
853+
854+
template <>
855+
struct less<odb::dbUnfoldedRegion*>
856+
{
857+
bool operator()(const odb::dbUnfoldedRegion* lhs,
858+
const odb::dbUnfoldedRegion* rhs) const
859+
= delete;
860+
};
861+
822862
// Generator Code End Less
823863

824864
} // namespace std

src/odb/include/odb/dbObject.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ enum dbObjectType
127127
dbTechLayerVoltageSpacingObj,
128128
dbTechLayerWidthTableRuleObj,
129129
dbTechLayerWrongDirSpacingRuleObj,
130+
dbUnfoldedBumpObj,
131+
dbUnfoldedChipObj,
132+
dbUnfoldedConnObj,
133+
dbUnfoldedNetObj,
134+
dbUnfoldedRegionObj,
130135
// Generator Code End DbObjectType
131136

132137
// Lib Objects

src/odb/include/odb/unfoldedModel.h

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)