Commit 45f3037
odb: makeNewNetName must avoid instance name collisions
dbBlock::makeNewNetName uniquified a new net/port name against ModNets,
ModBTerms, and flat nets in the scope, but not against instance names.
A net/port and an instance cannot share a name in one Verilog scope.
OpenROAD's hierarchical flow promotes some anonymous nets ("_NNNNN_") to
module boundary ports, and yosys/ABC name anonymous cells "_NNNNN_" too,
so a promoted boundary port could be handed a name already owned by a
leaf (dbInst) or hierarchical (dbModInst) instance in the same module.
write_verilog then emits a module with a port and an instance of the
same name -- illegal Verilog that Verilator rejects with "Instance has
the same name as port", breaking gate-level (e.g. SAIF) simulation of
the placed netlist.
Extend the collision check in makeNewNetName to also reject names that
match a dbModInst or dbInst in the scope, so the generated name is
uniquified (suffixed) when it would collide with an instance.
Add a TestModule regression covering both the leaf-instance and
module-instance collision cases, plus the no-collision passthrough.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>1 parent 28a1229 commit 45f3037
2 files changed
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3883 | 3883 | | |
3884 | 3884 | | |
3885 | 3885 | | |
3886 | | - | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
3887 | 3895 | | |
3888 | 3896 | | |
3889 | 3897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
294 | 327 | | |
295 | 328 | | |
296 | 329 | | |
| |||
0 commit comments