Skip to content

Commit 53f5017

Browse files
committed
Merge remote-tracking branch 'origin/master' into ord-startup
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
2 parents 20a8599 + f0afca3 commit 53f5017

8 files changed

Lines changed: 65 additions & 20 deletions

File tree

bazel/tcl_wrap_cc.bzl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ cc_library or cc_binary rules. See below for expected usage.
99
cc_library(srcs=[":tcl_foo"])
1010
tcl_wrap_cc(name = "tcl_foo", srcs=["exception.i"],...)
1111
"""
12-
TclSwigInfo = provider("TclSwigInfo for taking dependencies on other swig info rules", fields = ["transitive_srcs", "includes", "swig_options"])
12+
TclSwigInfo = provider(
13+
"TclSwigInfo for taking dependencies on other swig info rules",
14+
fields = [
15+
"transitive_srcs",
16+
"includes",
17+
"swig_options",
18+
],
19+
)
1320

1421
def _get_transative_srcs(srcs, deps):
1522
return depset(

src/dpl/src/infrastructure/Grid.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ void Grid::paintPixel(Node* cell, GridX grid_x, GridY grid_y)
329329
for (GridX x{grid_x}; x < x_end; x++) {
330330
for (GridY y{grid_y}; y < y_end; y++) {
331331
Pixel* pixel = gridPixel(x, y);
332+
if (pixel == nullptr) {
333+
// This can happen if cell padding is larger than the grid.
334+
continue;
335+
}
332336
pixel->cell = cell;
333337
pixel->util = 1.0;
334338
}

src/odb/include/odb/db.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,9 +3271,13 @@ class dbInst : public dbObject
32713271
const char* name,
32723272
dbRegion* region,
32733273
bool physical_only = false,
3274-
dbModule* parent_module = nullptr
3274+
dbModule* parent_module = nullptr);
32753275

3276-
);
3276+
static dbInst* makeUniqueDbInst(dbBlock* block,
3277+
dbMaster* master,
3278+
const char* name,
3279+
bool physical_only,
3280+
dbModule* target_module);
32773281

32783282
///
32793283
/// Create a new instance of child_block in top_block.

src/odb/src/db/dbBlock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ class _dbBlock : public _dbObject
282282
dbPropertyItr* _prop_itr;
283283
dbBlockSearch* _searchDb;
284284

285-
std::map<std::string, int> _module_name_id_map;
285+
std::unordered_map<std::string, int> _module_name_id_map;
286+
std::unordered_map<std::string, int> _inst_name_id_map;
286287

287288
unsigned char _num_ext_dbs;
288289

src/odb/src/db/dbInst.cpp

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,22 +1222,17 @@ dbInst* dbInst::create(dbBlock* block_,
12221222
dbModule* parent_module)
12231223
{
12241224
_dbBlock* block = (_dbBlock*) block_;
1225+
if (block->_inst_hash.hasMember(name_)) {
1226+
return nullptr;
1227+
}
1228+
12251229
_dbMaster* master = (_dbMaster*) master_;
12261230
_dbInstHdr* inst_hdr = block->_inst_hdr_hash.find(master->_id);
1227-
12281231
if (inst_hdr == nullptr) {
12291232
inst_hdr
12301233
= (_dbInstHdr*) dbInstHdr::create((dbBlock*) block, (dbMaster*) master);
12311234
}
12321235

1233-
if (block->_inst_hash.hasMember(name_)) {
1234-
block->getImpl()->getLogger()->error(
1235-
utl::ODB,
1236-
385,
1237-
"Attempt to create instance with duplicate name: {}",
1238-
name_);
1239-
}
1240-
12411236
_dbInst* inst = block->_inst_tbl->create();
12421237

12431238
if (block->_journal) {
@@ -1354,6 +1349,35 @@ dbInst* dbInst::create(dbBlock* top_block,
13541349
return inst;
13551350
}
13561351

1352+
dbInst* dbInst::makeUniqueDbInst(dbBlock* block,
1353+
dbMaster* master,
1354+
const char* name,
1355+
bool physical_only,
1356+
dbModule* target_module)
1357+
{
1358+
dbInst* inst
1359+
= dbInst::create(block, master, name, physical_only, target_module);
1360+
if (inst) {
1361+
return inst;
1362+
}
1363+
1364+
std::unordered_map<std::string, int>& name_id_map
1365+
= ((_dbBlock*) block)->_inst_name_id_map;
1366+
std::string inst_base_name(name);
1367+
do {
1368+
std::string full_name = inst_base_name;
1369+
int& id = name_id_map[inst_base_name];
1370+
if (id > 0) {
1371+
full_name += "_" + std::to_string(id);
1372+
}
1373+
++id;
1374+
inst = dbInst::create(
1375+
block, master, full_name.c_str(), physical_only, target_module);
1376+
} while (inst == nullptr);
1377+
1378+
return inst;
1379+
}
1380+
13571381
void dbInst::destroy(dbInst* inst_)
13581382
{
13591383
_dbInst* inst = (_dbInst*) inst_;

src/odb/src/db/dbModule.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ dbModule* dbModule::makeUniqueDbModule(const char* cell_name,
548548
return module;
549549
}
550550

551-
std::map<std::string, int>& name_id_map
551+
std::unordered_map<std::string, int>& name_id_map
552552
= ((_dbBlock*) block)->_module_name_id_map;
553553
std::string orig_cell_name(cell_name);
554554
std::string module_name = orig_cell_name + '_' + std::string(inst_name);
@@ -729,11 +729,11 @@ void dbModule::copyModuleInsts(dbModule* old_module,
729729
? std::move(old_inst_name).substr(first_idx + 1)
730730
: std::move(old_inst_name);
731731

732-
dbInst* new_inst = dbInst::create(new_module->getOwner(),
733-
old_inst->getMaster(),
734-
new_inst_name.c_str(),
735-
/* phyical only */ false,
736-
new_module);
732+
dbInst* new_inst = dbInst::makeUniqueDbInst(new_module->getOwner(),
733+
old_inst->getMaster(),
734+
new_inst_name.c_str(),
735+
/* phyical only */ false,
736+
new_module);
737737
if (new_inst) {
738738
debugPrint(logger,
739739
utl::ODB,

src/rcx/include/rcx/ext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Ext
2424
{
2525
public:
2626
Ext();
27-
~Ext() = default;
27+
~Ext();
2828

2929
void init(odb::dbDatabase* db, Logger* logger, const char* spef_version);
3030
void setLogger(Logger* logger);

src/rcx/src/ext.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Ext::Ext()
2323
_ext = new extMain();
2424
}
2525

26+
Ext::~Ext()
27+
{
28+
delete _ext;
29+
}
30+
2631
void Ext::init(odb::dbDatabase* db, Logger* logger, const char* spef_version)
2732
{
2833
_db = db;

0 commit comments

Comments
 (0)