-
Notifications
You must be signed in to change notification settings - Fork 834
Description
Problem
dbBlock::makeNewNetName() only checked flat net uniqueness via findNet(), missing ModNet and ModBTerm names in the target module scope. This caused net name collisions in hierarchical designs.
Reproduction scenario (sky130hd/microwatt)
When SplitLoadMove called insertBufferBeforeLoads with a nullptr net base name (defaulting to "net") and IF_NEEDED uniquify mode:
- The target submodule already had a ModBTerm/ModNet named
"net"(a port) makeNewNetName()checked onlyfindNet("sub0/net")for the flat net — no collision detected- A new flat net
"sub0/net"was created, colliding with the existing ModNet"net"in the submodule - This produced duplicate wire declarations in the emitted Verilog
- The duplicate declarations caused CTS LEC (Logic Equivalence Check) failure in sky130hd/microwatt
Root cause
ODB had 4 separate functions generating unique net names, each with inconsistent collision detection:
| Function | Location | Flat net check | ModNet/ModBTerm check |
|---|---|---|---|
makeNewNetName |
dbBlock.cpp | unconditional findNet() |
missing |
makeNewModNetName |
dbBlock.cpp | conditional isInternalTo |
yes |
makeUniqueHierName |
dbInsertBuffer.cpp | conditional isInternalTo |
yes |
makeUniqueName |
dbEditHierarchy.cc | via db_network_->findNet() |
ModBTerm only |
makeNewNetName was the only one missing the ModNet/ModBTerm collision check, but it was the primary API used by dbNet::create() and dbNetwork::makeNet().
Fix
-
Extend collision detection (
73f3aafdd6): Add ModNet and ModBTerm checks tomakeNewNetName()'sexistslambda, matching the behavior already present inmakeNewModNetName(). AddcheckSanityNameCollision()to bothdbNetanddbModNet. -
Consolidate APIs (
5c67f15198): Replace all 4 functions with a single unifieddbBlock::makeNewNetName(dbModule*, ...)that handles both flat net and ModNet creation via acorresponding_flat_netparameter:nullptr(default): strict mode — anyfindNet()hit is a collision- non-null: lenient mode — only internal flat nets (excluding the corresponding one) collide