File tree Expand file tree Collapse file tree 5 files changed +40
-1
lines changed
Expand file tree Collapse file tree 5 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ class ThreeDBlox
3838 dbChipRegionInst* resolvePath (const std::string& path,
3939 std::vector<dbChipInst*>& path_insts);
4040 void readHeaderIncludes (const std::vector<std::string>& includes);
41+ void calculateSize (dbChip* chip);
4142
4243 utl::Logger* logger_ = nullptr ;
4344 odb::dbDatabase* db_ = nullptr ;
Original file line number Diff line number Diff line change @@ -7072,6 +7072,8 @@ class dbChip : public dbObject
70727072
70737073 dbTech* getTech () const ;
70747074
7075+ Rect getBBox () const ;
7076+
70757077 // /
70767078 // / Create a new chip.
70777079 // / Returns nullptr if there is no database technology.
@@ -7181,6 +7183,8 @@ class dbChipInst : public dbObject
71817183
71827184 dbTransform getTransform () const ;
71837185
7186+ Rect getBBox () const ;
7187+
71847188 dbSet<dbChipRegionInst> getRegions () const ;
71857189
71867190 dbChipRegionInst* findChipRegionInst (dbChipRegion* chip_region) const ;
Original file line number Diff line number Diff line change @@ -77,10 +77,21 @@ void ThreeDBlox::readDbx(const std::string& dbx_file)
7777 for (const auto & [_, connection] : data.connections ) {
7878 createConnection (connection);
7979 }
80-
80+ calculateSize (db_-> getChip ());
8181 db_->triggerPostRead3Dbx (chip);
8282}
8383
84+ void ThreeDBlox::calculateSize (dbChip* chip)
85+ {
86+ Rect box;
87+ box.mergeInit ();
88+ for (auto inst : chip->getChipInsts ()) {
89+ box.merge (inst->getBBox ());
90+ }
91+ chip->setWidth (box.dx ());
92+ chip->setHeight (box.dy ());
93+ }
94+
8495void ThreeDBlox::readHeaderIncludes (const std::vector<std::string>& includes)
8596{
8697 for (const auto & include : includes) {
Original file line number Diff line number Diff line change @@ -591,6 +591,20 @@ dbTech* dbChip::getTech() const
591591 return (dbTech*) db->_tech_tbl ->getPtr (chip->tech_ );
592592}
593593
594+ Rect dbChip::getBBox () const
595+ {
596+ _dbChip* _chip = (_dbChip*) this ;
597+ const int llx = 0 - _chip->scribe_line_east_ - _chip->seal_ring_west_ ;
598+ const int lly = 0 - _chip->scribe_line_south_ - _chip->seal_ring_south_ ;
599+ const int urx
600+ = _chip->width_ + _chip->scribe_line_east_ + _chip->seal_ring_east_ ;
601+ const int ury
602+ = _chip->height_ + _chip->scribe_line_north_ + _chip->seal_ring_north_ ;
603+ Rect box (llx, lly, urx, ury);
604+ box.moveTo (_chip->offset_ .x (), _chip->offset_ .y ());
605+ return box;
606+ }
607+
594608dbChip* dbChip::create (dbDatabase* db_,
595609 dbTech* tech,
596610 const std::string& name,
Original file line number Diff line number Diff line change @@ -160,6 +160,15 @@ dbTransform dbChipInst::getTransform() const
160160 Point (obj->loc_ .x (), obj->loc_ .y ()));
161161}
162162
163+ Rect dbChipInst::getBBox () const
164+ {
165+ _dbChipInst* _chipinst = (_dbChipInst*) this ;
166+ Rect box = getMasterChip ()->getBBox ();
167+ box.moveTo (_chipinst->loc_ .x (), _chipinst->loc_ .y ());
168+ getTransform ().apply (box);
169+ return box;
170+ }
171+
163172dbSet<dbChipRegionInst> dbChipInst::getRegions () const
164173{
165174 _dbChipInst* _chipinst = (_dbChipInst*) this ;
You can’t perform that action at this time.
0 commit comments