Skip to content

odb: net name collision in makeNewNetName causes Verilog LEC failure (sky130hd/microwatt) #9760

@jhkim-pii

Description

@jhkim-pii

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:

  1. The target submodule already had a ModBTerm/ModNet named "net" (a port)
  2. makeNewNetName() checked only findNet("sub0/net") for the flat net — no collision detected
  3. A new flat net "sub0/net" was created, colliding with the existing ModNet "net" in the submodule
  4. This produced duplicate wire declarations in the emitted Verilog
  5. 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

  1. Extend collision detection (73f3aafdd6): Add ModNet and ModBTerm checks to makeNewNetName()'s exists lambda, matching the behavior already present in makeNewModNetName(). Add checkSanityNameCollision() to both dbNet and dbModNet.

  2. Consolidate APIs (5c67f15198): Replace all 4 functions with a single unified dbBlock::makeNewNetName(dbModule*, ...) that handles both flat net and ModNet creation via a corresponding_flat_net parameter:

    • nullptr (default): strict mode — any findNet() hit is a collision
    • non-null: lenient mode — only internal flat nets (excluding the corresponding one) collide

PR references

Metadata

Metadata

Assignees

Labels

odbOpenDB

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions