@@ -447,7 +447,7 @@ void ThreeDBlox::createConnection(const Connection& connection)
447447 conn->setThickness (connection.thickness * db_->getDbuPerMicron ());
448448}
449449
450- void ThreeDBlox::readBMap (const std::string& bmap_file, bool create_bpins )
450+ void ThreeDBlox::readBMap (const std::string& bmap_file)
451451{
452452 dbBlock* block = db_->getChip ()->getBlock ();
453453
@@ -459,90 +459,90 @@ void ThreeDBlox::readBMap(const std::string& bmap_file, bool create_bpins)
459459 bumps.push_back (createBump (entry, block));
460460 }
461461
462- if (create_bpins) {
463- struct BPinInfo
464- {
465- dbTechLayer* layer = nullptr ;
466- odb::Rect rect;
467- };
462+ struct BPinInfo
463+ {
464+ dbTechLayer* layer = nullptr ;
465+ odb::Rect rect;
466+ };
468467
469- // Populate where the bpins should be made
470- std::map<odb::dbMaster*, BPinInfo> bpininfo;
471- for (dbInst* inst : bumps) {
472- dbMaster* master = inst->getMaster ();
473- if (bpininfo.find (master) != bpininfo.end ()) {
474- continue ;
475- }
468+ // Populate where the bpins should be made
469+ std::map<odb::dbMaster*, BPinInfo> bpininfo;
470+ for (dbInst* inst : bumps) {
471+ dbMaster* master = inst->getMaster ();
472+ if (bpininfo.find (master) != bpininfo.end ()) {
473+ continue ;
474+ }
476475
477- odb::dbTechLayer* max_layer = nullptr ;
478- std::set<odb::Rect> top_shapes;
476+ odb::dbTechLayer* max_layer = nullptr ;
477+ std::set<odb::Rect> top_shapes;
479478
480- for (dbMTerm* mterm : master->getMTerms ()) {
481- for (dbMPin* mpin : mterm->getMPins ()) {
482- for (dbBox* geom : mpin->getGeometry ()) {
483- auto * layer = geom->getTechLayer ();
484- if (layer == nullptr ) {
485- continue ;
486- }
487- if (max_layer == nullptr
488- || max_layer->getRoutingLevel () <= layer->getRoutingLevel ()) {
489- if (max_layer->getRoutingLevel () < layer->getRoutingLevel ()) {
490- top_shapes.clear ();
491- }
492- max_layer = layer;
493- top_shapes.insert (geom->getBox ());
479+ for (dbMTerm* mterm : master->getMTerms ()) {
480+ for (dbMPin* mpin : mterm->getMPins ()) {
481+ for (dbBox* geom : mpin->getGeometry ()) {
482+ auto * layer = geom->getTechLayer ();
483+ if (layer == nullptr ) {
484+ continue ;
485+ }
486+ if (max_layer == nullptr ) {
487+ max_layer = layer;
488+ top_shapes.insert (geom->getBox ());
489+ } else if (max_layer->getRoutingLevel () <= layer->getRoutingLevel ()) {
490+ if (max_layer->getRoutingLevel () < layer->getRoutingLevel ()) {
491+ top_shapes.clear ();
494492 }
493+ max_layer = layer;
494+ top_shapes.insert (geom->getBox ());
495495 }
496496 }
497497 }
498+ }
498499
499- if (max_layer != nullptr ) {
500- odb::Rect master_box;
501- master->getPlacementBoundary (master_box);
502- const odb::Point center = master_box.center ();
503- const odb::Rect* top_shape_ptr = nullptr ;
504- for (const odb::Rect& shape : top_shapes) {
505- if (shape.intersects (center)) {
506- top_shape_ptr = &shape;
507- }
508- }
509-
510- if (top_shape_ptr == nullptr ) {
511- top_shape_ptr = &(*top_shapes.begin ());
500+ if (max_layer != nullptr ) {
501+ odb::Rect master_box;
502+ master->getPlacementBoundary (master_box);
503+ const odb::Point center = master_box.center ();
504+ const odb::Rect* top_shape_ptr = nullptr ;
505+ for (const odb::Rect& shape : top_shapes) {
506+ if (shape.intersects (center)) {
507+ top_shape_ptr = &shape;
512508 }
509+ }
513510
514- bpininfo.emplace (master, BPinInfo{max_layer, *top_shape_ptr});
511+ if (top_shape_ptr == nullptr ) {
512+ top_shape_ptr = &(*top_shapes.begin ());
515513 }
514+
515+ bpininfo.emplace (master, BPinInfo{max_layer, *top_shape_ptr});
516516 }
517+ }
517518
518- // create bpins
519- for (dbInst* inst : bumps) {
520- auto masterbpin = bpininfo.find (inst->getMaster ());
521- if (masterbpin == bpininfo.end ()) {
522- continue ;
523- }
519+ // create bpins
520+ for (dbInst* inst : bumps) {
521+ auto masterbpin = bpininfo.find (inst->getMaster ());
522+ if (masterbpin == bpininfo.end ()) {
523+ continue ;
524+ }
524525
525- const BPinInfo& pin_info = masterbpin->second ;
526+ const BPinInfo& pin_info = masterbpin->second ;
526527
527- const dbTransform xform = inst->getTransform ();
528- for (dbITerm* iterm : inst->getITerms ()) {
529- dbNet* net = iterm->getNet ();
530- if (net == nullptr ) {
531- continue ;
532- }
533- dbBTerm* bterm = net->get1stBTerm ();
534- dbBPin* pin = dbBPin::create (bterm);
535- Rect shape = pin_info.rect ;
536- xform.apply (shape);
537- dbBox::create (pin,
538- pin_info.layer ,
539- shape.xMin (),
540- shape.yMin (),
541- shape.xMax (),
542- shape.yMax ());
543- pin->setPlacementStatus (odb::dbPlacementStatus::FIRM);
544- break ;
528+ const dbTransform xform = inst->getTransform ();
529+ for (dbITerm* iterm : inst->getITerms ()) {
530+ dbNet* net = iterm->getNet ();
531+ if (net == nullptr ) {
532+ continue ;
545533 }
534+ dbBTerm* bterm = net->get1stBTerm ();
535+ dbBPin* pin = dbBPin::create (bterm);
536+ Rect shape = pin_info.rect ;
537+ xform.apply (shape);
538+ dbBox::create (pin,
539+ pin_info.layer ,
540+ shape.xMin (),
541+ shape.yMin (),
542+ shape.xMax (),
543+ shape.yMax ());
544+ pin->setPlacementStatus (odb::dbPlacementStatus::FIRM);
545+ break ;
546546 }
547547 }
548548}
0 commit comments