Skip to content

Commit 19a4507

Browse files
committed
odb: dbChipRegion::getChip
Signed-off-by: osamahammad21 <[email protected]>
1 parent 47ef041 commit 19a4507

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/odb/include/odb/db.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7112,6 +7112,8 @@ class dbChipRegion : public dbObject
71127112
Rect getBox() const;
71137113

71147114
// User Code Begin dbChipRegion
7115+
dbChip* getChip() const;
7116+
71157117
Side getSide() const;
71167118

71177119
dbTechLayer* getLayer() const;

src/odb/src/db/dbChipRegion.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ Rect dbChipRegion::getBox() const
9999
}
100100

101101
// User Code Begin dbChipRegionPublicMethods
102+
dbChip* dbChipRegion::getChip() const
103+
{
104+
_dbChipRegion* obj = (_dbChipRegion*) this;
105+
return (dbChip*) obj->getOwner();
106+
}
107+
102108
dbChipRegion::Side dbChipRegion::getSide() const
103109
{
104110
_dbChipRegion* obj = (_dbChipRegion*) this;

src/odb/test/cpp/TestChips.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ BOOST_FIXTURE_TEST_CASE(test_chip_regions, F_CHIP_HIERARCHY)
218218
BOOST_TEST(memory_chip_region_r1->getName() == "R1");
219219
BOOST_TEST((memory_chip_region_r1->getSide() == dbChipRegion::Side::FRONT));
220220
BOOST_TEST(memory_chip_region_r1->getLayer() == layer_l1);
221+
BOOST_TEST(memory_chip_region_r1->getChip() == memory_chip);
221222
BOOST_TEST(
222223
(memory_chip_region_r3->getSide() == dbChipRegion::Side::INTERNAL));
223224
BOOST_TEST(memory_chip_region_r3->getLayer() == nullptr);

0 commit comments

Comments
 (0)