Skip to content

Commit 432ca51

Browse files
committed
1. Added physical-only cell instances in the top module to match the behavior b/w flat and hier flows.
2. Removed the temporary HOLD_SLACK_MARGIN as it is no longer needed. Signed-off-by: Jaehyun Kim <[email protected]>
1 parent f3b0aa5 commit 432ca51

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

src/odb/include/odb/db.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class dbBlock : public dbObject
617617
///
618618
/// Returns the top module of this block.
619619
///
620-
dbModule* getTopModule();
620+
dbModule* getTopModule() const;
621621

622622
///
623623
/// Get the child blocks of this block.
@@ -2947,8 +2947,8 @@ class dbInst : public dbObject
29472947

29482948
///
29492949
/// Create a new instance.
2950-
/// If physical_only is true the instance can't bee added to a dbModule.
2951-
/// If false, it will be added to the top module.
2950+
/// If physical_only is true, the instance can only be added to a top module.
2951+
/// If false, it will be added to the parent module.
29522952
/// Returns nullptr if an instance with this name already exists.
29532953
/// Returns nullptr if the master is not FROZEN.
29542954
/// If dbmodule is non null the dbInst is added to that module.
@@ -8343,6 +8343,7 @@ class dbModule : public dbObject
83438343

83448344
const dbModBTerm* getHeadDbModBTerm() const;
83458345
bool canSwapWith(dbModule* new_module) const;
8346+
bool isTop() const;
83468347

83478348
static dbModule* create(dbBlock* block, const char* name);
83488349

src/odb/src/db/dbBlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ dbInst* dbBlock::getParentInst()
15811581
return (dbInst*) parent_inst;
15821582
}
15831583

1584-
dbModule* dbBlock::getTopModule()
1584+
dbModule* dbBlock::getTopModule() const
15851585
{
15861586
_dbBlock* block = (_dbBlock*) this;
15871587
return (dbModule*) block->_module_tbl->getPtr(block->_top_module);

src/odb/src/db/dbInst.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,10 @@ dbInst* dbInst::create(dbBlock* block_,
13221322
block->add_rect(box->_shape._rect);
13231323

13241324
inst->_flags._physical_only = physical_only;
1325-
if (!physical_only) {
1325+
1326+
// Add the new instance to the parent module.
1327+
bool parent_is_top = parent_module == nullptr || parent_module->isTop();
1328+
if (physical_only == false || parent_is_top) {
13261329
if (parent_module) {
13271330
parent_module->addInst((dbInst*) inst);
13281331
} else {

src/odb/src/db/dbModule.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void dbModule::addInst(dbInst* inst)
201201
_dbInst* _inst = (_dbInst*) inst;
202202
_dbBlock* block = (_dbBlock*) module->getOwner();
203203

204-
if (_inst->_flags._physical_only) {
204+
if (isTop() == false && _inst->_flags._physical_only) {
205205
_inst->getLogger()->error(
206206
utl::ODB,
207207
297,
@@ -620,6 +620,16 @@ bool dbModule::canSwapWith(dbModule* new_module) const
620620
return true;
621621
}
622622

623+
bool dbModule::isTop() const
624+
{
625+
const _dbModule* obj = reinterpret_cast<const _dbModule*>(this);
626+
const dbBlock* block = static_cast<dbBlock*>(obj->getOwner());
627+
if (block == nullptr) {
628+
return false;
629+
}
630+
return (block->getTopModule() == this);
631+
}
632+
623633
// Do a "deep" copy of old_module based on its instance context into new_module.
624634
// All ports, instances, mod nets and parent/child IO will be copied.
625635
// Connections that span multiple modules needs to be done outside this API.

test/orfs/mock-array/BUILD

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,6 @@ VARIANTS = [
141141
"IO_PLACER_H": "M4 M6",
142142
"DETAILED_ROUTE_END_ITERATION": "6",
143143
"OPENROAD_HIERARCHICAL": "1" if variant == "base" else "0",
144-
# FIXME HOLD_SLACK_MARGIN should be removed after CTS engine improvement.
145-
# - There are many hold violations due to large clock skew.
146-
# - It leads to max buffer count limit error.
147-
# - To avoid the error, large hold slack margin is temporarily set.
148-
"HOLD_SLACK_MARGIN": "-30",
149144
},
150145
macros = ["Element_generate_abstract"],
151146
sources = {

0 commit comments

Comments
 (0)