Skip to content

Commit 81baed1

Browse files
committed
odb: remove create_pins option
Signed-off-by: Peter Gadfort <[email protected]>
1 parent b77b839 commit 81baed1

File tree

8 files changed

+84
-88
lines changed

8 files changed

+84
-88
lines changed

include/ord/OpenRoad.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class OpenRoad
224224

225225
void read3Dbv(const std::string& filename);
226226
void read3Dbx(const std::string& filename);
227-
void read3DBloxBMap(const std::string& filename, bool create_bpins = false);
227+
void read3DBloxBMap(const std::string& filename);
228228

229229
void readDb(std::istream& stream);
230230
void readDb(const char* filename, bool hierarchy = false);

src/OpenRoad.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,10 @@ void OpenRoad::read3Dbx(const std::string& filename)
497497
parser.readDbx(filename);
498498
}
499499

500-
void OpenRoad::read3DBloxBMap(const std::string& filename, bool create_bpins)
500+
void OpenRoad::read3DBloxBMap(const std::string& filename)
501501
{
502502
odb::ThreeDBlox parser(logger_, db_);
503-
parser.readBMap(filename, create_bpins);
503+
parser.readBMap(filename);
504504
}
505505

506506
void OpenRoad::readDb(const char* filename, bool hierarchy)

src/OpenRoad.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ read_3dbx_cmd(const char *filename)
370370
}
371371

372372
void
373-
read_3dblox_bmap_cmd(const char *filename, bool create_bpins)
373+
read_3dblox_bmap_cmd(const char *filename)
374374
{
375375
OpenRoad *ord = getOpenRoad();
376-
ord->read3DBloxBMap(filename, create_bpins);
376+
ord->read3DBloxBMap(filename);
377377
}
378378

379379
void

src/OpenRoad.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ proc read_3dbx { args } {
197197
ord::read_3dbx_cmd $filename
198198
}
199199

200-
sta::define_cmd_args "read_3dblox_bmap" {[-create_pins] filename}
200+
sta::define_cmd_args "read_3dblox_bmap" {filename}
201201

202202
proc read_3dblox_bmap { args } {
203-
sta::parse_key_args "read_3dblox_bmap" args keys {} flags {-create_pins}
203+
sta::parse_key_args "read_3dblox_bmap" args keys {} flags {}
204204
sta::check_argc_eq1 "read_3dblox_bmap" $args
205205
set filename [file nativename [lindex $args 0]]
206206
if { ![file exists $filename] } {
@@ -209,7 +209,7 @@ proc read_3dblox_bmap { args } {
209209
if { ![file readable $filename] } {
210210
utl::error "ORD" 75 "$filename is not readable."
211211
}
212-
ord::read_3dblox_bmap_cmd $filename [info exists flags(-create_pins)]
212+
ord::read_3dblox_bmap_cmd $filename
213213
}
214214

215215
sta::define_cmd_args "write_db" {filename}

src/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,13 @@ report_logic_depth_histogram [-num_bins num_bins] [-exclude_buffers] [-exclude_i
340340
The `read_3dblox_bmap` command will read the bump map and place the bumps into the current design.
341341

342342
```tcl
343-
read_3dblox_bmap [-create_pins] filename
343+
read_3dblox_bmap filename
344344
```
345345

346346
##### Options
347347

348348
| Switch Name | Description |
349349
| ----- | ----- |
350-
| `-create_pins` | If specified, block pins will be created over each bump. |
351350
| `filename` | Path to the bump map. |
352351

353352
## TCL functions

src/odb/include/odb/3dblox.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ThreeDBlox
3434
~ThreeDBlox() = default;
3535
void readDbv(const std::string& dbv_file);
3636
void readDbx(const std::string& dbx_file);
37-
void readBMap(const std::string& bmap_file, bool create_bpins);
37+
void readBMap(const std::string& bmap_file);
3838

3939
private:
4040
void createChiplet(const ChipletDef& chiplet);

src/odb/src/3dblox/3dblox.cpp

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/odb/test/cpp/Test3DBloxParser.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ TEST_F(SimpleDbFixture, test_bump_map_reader)
142142

143143
// Create BUMP master
144144
dbLib* lib = db_->findLib("lib1");
145+
dbTechLayer* bot_layer
146+
= dbTechLayer::create(lib->getTech(), "BOT", dbTechLayerType::ROUTING);
145147
dbTechLayer* layer
146148
= dbTechLayer::create(lib->getTech(), "TOP", dbTechLayerType::ROUTING);
147149
dbMaster* master = dbMaster::create(lib, "BUMP");
@@ -151,6 +153,8 @@ TEST_F(SimpleDbFixture, test_bump_map_reader)
151153
master->setType(dbMasterType::COVER_BUMP);
152154
dbMTerm* term
153155
= dbMTerm::create(master, "PAD", dbIoType::INOUT, dbSigType::SIGNAL);
156+
dbMPin* bot_pin = dbMPin::create(term);
157+
dbBox::create(bot_pin, bot_layer, -1000, -1000, 1000, 1000);
154158
dbMPin* pin = dbMPin::create(term);
155159
dbBox::create(pin, layer, -2000, -2000, 2000, 2000);
156160
master->setFrozen();
@@ -165,7 +169,7 @@ TEST_F(SimpleDbFixture, test_bump_map_reader)
165169

166170
ThreeDBlox parser(&logger_, db_.get());
167171
std::string path = getFilePath(prefix + "data/example1.bmap");
168-
parser.readBMap(path, false);
172+
parser.readBMap(path);
169173

170174
// Check bumps were created
171175
EXPECT_EQ(block->getInsts().size(), 2);
@@ -176,13 +180,6 @@ TEST_F(SimpleDbFixture, test_bump_map_reader)
176180
EXPECT_EQ(inst2->getBBox()->getBox().xCenter(), 150 * 1000);
177181
EXPECT_EQ(inst2->getBBox()->getBox().yCenter(), 200 * 1000);
178182

179-
// Check that no BPins where added
180-
EXPECT_EQ(SIG1->getBPins().size(), 0);
181-
EXPECT_EQ(SIG2->getBPins().size(), 0);
182-
183-
// Read bmap again to add bpins
184-
parser.readBMap(path, true);
185-
186183
// Check that BPins where added
187184
EXPECT_EQ(SIG1->getBPins().size(), 1);
188185
EXPECT_EQ(SIG2->getBPins().size(), 1);

0 commit comments

Comments
 (0)