@@ -1468,27 +1468,26 @@ dbBox* dbBlock::getBBox()
14681468 _dbBlock* block = (_dbBlock*) this ;
14691469
14701470 if (block->_flags ._valid_bbox == 0 ) {
1471- ComputeBBox ();
1471+ block-> ComputeBBox ();
14721472 }
14731473
14741474 _dbBox* bbox = block->_box_tbl ->getPtr (block->_bbox );
14751475 return (dbBox*) bbox;
14761476}
14771477
1478- void dbBlock ::ComputeBBox ()
1478+ void _dbBlock ::ComputeBBox ()
14791479{
1480- _dbBlock* block = (_dbBlock*) this ;
1481- _dbBox* bbox = block->_box_tbl ->getPtr (block->_bbox );
1480+ _dbBox* bbox = _box_tbl->getPtr (_bbox);
14821481 bbox->_shape ._rect .reset (INT_MAX, INT_MAX, INT_MIN, INT_MIN);
14831482
1484- for (dbInst* inst : getInsts ( )) {
1483+ for (dbInst* inst : dbSet<dbInst>( this , _inst_tbl )) {
14851484 if (inst->isPlaced ()) {
14861485 _dbBox* box = (_dbBox*) inst->getBBox ();
14871486 bbox->_shape ._rect .merge (box->_shape ._rect );
14881487 }
14891488 }
14901489
1491- for (dbBTerm* bterm : getBTerms ( )) {
1490+ for (dbBTerm* bterm : dbSet<dbBTerm>( this , _bterm_tbl )) {
14921491 for (dbBPin* bp : bterm->getBPins ()) {
14931492 if (bp->getPlacementStatus ().isPlaced ()) {
14941493 for (dbBox* box : bp->getBoxes ()) {
@@ -1499,17 +1498,17 @@ void dbBlock::ComputeBBox()
14991498 }
15001499 }
15011500
1502- for (dbObstruction* obs : getObstructions ( )) {
1501+ for (dbObstruction* obs : dbSet<dbObstruction>( this , _obstruction_tbl )) {
15031502 _dbBox* box = (_dbBox*) obs->getBBox ();
15041503 bbox->_shape ._rect .merge (box->_shape ._rect );
15051504 }
15061505
1507- for (dbSBox* box : dbSet<dbSBox>(block, block-> _sbox_tbl )) {
1506+ for (dbSBox* box : dbSet<dbSBox>(this , _sbox_tbl)) {
15081507 Rect rect = box->getBox ();
15091508 bbox->_shape ._rect .merge (rect);
15101509 }
15111510
1512- for (dbWire* wire : dbSet<dbWire>(block, block-> _wire_tbl )) {
1511+ for (dbWire* wire : dbSet<dbWire>(this , _wire_tbl)) {
15131512 const auto opt_bbox = wire->getBBox ();
15141513 if (opt_bbox) {
15151514 bbox->_shape ._rect .merge (opt_bbox.value ());
@@ -1520,7 +1519,7 @@ void dbBlock::ComputeBBox()
15201519 bbox->_shape ._rect .reset (0 , 0 , 0 , 0 );
15211520 }
15221521
1523- block-> _flags ._valid_bbox = 1 ;
1522+ _flags._valid_bbox = 1 ;
15241523}
15251524
15261525dbDatabase* dbBlock::getDataBase ()
@@ -3694,24 +3693,27 @@ void _dbBlock::ensureConstraintRegion(const Direction2D& edge,
36943693 }
36953694}
36963695
3697- std::string dbBlock::makeNewName (dbModInst* parent,
3698- const char * base_name,
3699- const dbNameUniquifyType& uniquify,
3700- uint& unique_index,
3701- const std::function<bool (const char *)>& exists)
3696+ std::string _dbBlock::makeNewName (
3697+ dbModInst* parent,
3698+ const char * base_name,
3699+ const dbNameUniquifyType& uniquify,
3700+ uint& unique_index,
3701+ const std::function<bool (const char *)>& exists)
37023702{
3703+ dbBlock* block = (dbBlock*) this ;
3704+
37033705 // Decide hierarchical name without unique index
37043706 fmt::memory_buffer buf;
37053707 if (parent) {
37063708 fmt::format_to (std::back_inserter (buf),
37073709 " {}{}" ,
37083710 parent->getHierarchicalName (),
3709- getHierarchyDelimiter ());
3711+ block-> getHierarchyDelimiter ());
37103712 }
37113713 buf.append (base_name, base_name + std::strlen (base_name));
37123714 buf.push_back (' \0 ' ); // Null-terminate for find* functions
37133715
3714- // If uniquify is IF_NEEDED*, check for uniqueness before adding a postfix .
3716+ // If uniquify is IF_NEEDED*, check for uniqueness before adding a suffix .
37153717 bool uniquify_if_needed
37163718 = (dbNameUniquifyType::IF_NEEDED == uniquify)
37173719 || (dbNameUniquifyType::IF_NEEDED_WITH_UNDERSCORE == uniquify);
@@ -3749,16 +3751,16 @@ std::string dbBlock::makeNewName(dbModInst* parent,
37493751// Currently all nets are scoped within a dbBlock.
37503752//
37513753
3752- // If uniquify is IF_NEEDED, unique postfix will be added only when
3753- // necessary. This is added to cover the existing multiple use cases of making a
3754- // new net name w/ and w/o unique postfix .
3754+ // If uniquify is IF_NEEDED, unique suffix will be added when necessary.
3755+ // This is added to cover the existing multiple use cases of making a
3756+ // new net name w/ and w/o unique suffix .
37553757std::string dbBlock::makeNewNetName (dbModInst* parent,
37563758 const char * base_name,
37573759 const dbNameUniquifyType& uniquify)
37583760{
37593761 _dbBlock* block = reinterpret_cast <_dbBlock*>(this );
37603762 auto exists = [this ](const char * name) { return findNet (name) != nullptr ; };
3761- return makeNewName (
3763+ return block-> makeNewName (
37623764 parent, base_name, uniquify, block->_unique_net_index , exists);
37633765}
37643766
@@ -3777,7 +3779,7 @@ std::string dbBlock::makeNewInstName(dbModInst* parent,
37773779 auto exists = [this ](const char * name) {
37783780 return findInst (name) != nullptr || findModInst (name) != nullptr ;
37793781 };
3780- return makeNewName (
3782+ return block-> makeNewName (
37813783 parent, base_name, uniquify, block->_unique_inst_index , exists);
37823784}
37833785
0 commit comments