dbSta: fix ObjectId collision between ConcreteCell and dbModule#9674
dbSta: fix ObjectId collision between ConcreteCell and dbModule#9674openroad-ci wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
Conversation
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Code Review
This pull request aims to resolve an ObjectId collision between ConcreteCell and dbModule that causes hierarchical instances to be dropped during Verilog generation, by introducing unique tags for ConcreteCell and ConcretePort IDs. While the fix for dbNetwork::id(const Cell* cell) is correct, the corresponding fix for dbNetwork::id(const Port* port) is incomplete. It fails to apply the necessary tagging logic to ConcretePort objects when hierarchy is enabled, allowing ID collisions to persist for ports and potentially leading to similar integrity issues in the generated output. Consistent application of the tagging logic across all concrete objects is required to ensure the robustness of the fix.
|
Checking ORFS QoR impact w/ The-OpenROAD-Project/OpenROAD-flow-scripts#3957. |
Tag ConcreteCell/ConcretePort IDs with CONCRETE_OBJECT_ID (0xF) in dbNetwork::id() to prevent collisions with dbModule IDs (tag 0x8). Previously, ConcreteCell used raw sequential id_ (0,1,2,...) which could collide with dbModule computed IDs ((db_id << 4) | 0x8), causing CellSet::contains() to treat different Cell* types as equal. This led to write_verilog -remove_cells silently dropping hierarchical module instances. Also guard against top_cell_ in id(Cell*), which is a ConcreteCell but isConcreteCell() returns false for it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
8ce762a to
758a57d
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
I don't see an actual use of this bit? How is it checked? |
Fixes #9661
Summary
CONCRETE_OBJECT_ID(0xF) indbNetwork::id()to prevent collisions with dbModule IDs (tag 0x8)top_cell_inid(Cell*)— it is a ConcreteCell butisConcreteCell()returns false for it, causing a crash when reinterpret_cast is called to dbObjectTestWriteVerilog.RemoveCellsIdCollision(CMake + Bazel)Problem
write_verilog -remove_cellssilently drops hierarchical module instances due to an ObjectId collision.CellSetusesCellIdLess(comparing bynetwork_->id(cell)) for ordering.Two different
Cell*types produce overlapping IDs:ccell->id_(0, 1, 2, ...)(db_id << 4) | 0x8(24, 40, 56, ...)When these IDs collide,
CellSet::contains()treats a dbModule as equal to a ConcreteCell, causingwriteChild()to silently drop hierarchical instances.Solution
Introduce a new tag
CONCRETE_OBJECT_IDforConcreteCellandConcretePortto avoid the ID collision.Tag allocation
🤖 Generated with Claude Code