Skip to content

Detect and auto-rename duplicate cell names before writing#998

Open
joamatab wants to merge 217 commits into
release/2.5.3from
detect-duplicate-cell-names
Open

Detect and auto-rename duplicate cell names before writing#998
joamatab wants to merge 217 commits into
release/2.5.3from
detect-duplicate-cell-names

Conversation

@joamatab

Copy link
Copy Markdown
Collaborator

Summary

  • Detect duplicate cell names at write time (write_cells / write_oas / KCLayout.write) and auto-rename them with $1, $2, … suffixes to prevent corrupt GDS/OASIS output
  • Refactor name-conflict logging in TKCell.name setter — collapse duplicated branches into a single code path, raise DuplicateCellNameError (new exception) when debug_names is enabled
  • Add hasattr guard for os.sched_getaffinity in conf.py instead of catching AttributeError

Test plan

  • Verify layouts with duplicate cell names write successfully (cells get auto-renamed with $N suffix)
  • Verify kf.config.debug_names = True raises DuplicateCellNameError on name conflicts
  • Verify warning messages are logged for each renamed cell
  • Confirm existing tests pass

sebastian-goeldi and others added 30 commits February 3, 2026 02:58
add support for nets with more than two ports
sebastian-goeldi and others added 28 commits May 22, 2026 20:06
update to new kfnetlist and normalize netlist
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…ions/cache-5

Bump actions/cache from 4 to 5
rework factories, enclosure, and cross section registration
update taper and virtual cells to cross section bases
GDS/OASIS formats require unique cell names. Add a pre-write check
that raises DuplicateCellNameError with details about which names
collide, helping users diagnose the issue before it corrupts output.

Also suppress a ty type-checker false positive for os.sched_getaffinity
(platform-dependent attribute handled at runtime via AttributeError).
Deduplicate the repetitive name-conflict branches in TKCell.name
setter into a single code path. Also add _check_duplicate_cell_names
to KCLayout.write() so the layout-level write path catches duplicates
the same way ProtoTKCell.write() does.
Replaces try/except AttributeError with a hasattr check so that ty
can narrow the type on both macOS (attribute absent) and Linux
(attribute present) without needing a platform-specific ignore comment.
@sebastian-goeldi

Copy link
Copy Markdown
Collaborator

umm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants