Skip to content

Connectivity: instantiate each document once under flat/global net scope - #51

Open
Andrei-Errapart wants to merge 1 commit into
issus:masterfrom
Andrei-Errapart:FlatScopeSheetRefDedupe
Open

Connectivity: instantiate each document once under flat/global net scope#51
Andrei-Errapart wants to merge 1 commit into
issus:masterfrom
Andrei-Errapart:FlatScopeSheetRefDedupe

Conversation

@Andrei-Errapart

@Andrei-Errapart Andrei-Errapart commented Aug 25, 2026

Copy link
Copy Markdown

Summary

Block-diagram overview pages routinely reference the working sheets a second time for
navigation (a micromodules project references one sheet 17 times from its top-level
overview). The hierarchy walker treated every reference as a multi-channel instance, so
the project netlist invented per-reference channels with channel-private power nets —
GND fell apart into per-sheet islands.

Under the flat and global net-identifier scopes Altium does not clone channels:
identifiers merge by name and components exist once per document. The walker now
instantiates each document once under those scopes. Repeat() channels and
hierarchical-scope projects are unaffected.

Changes

  • HierarchyWalker.Walk gains an optional dedupeDuplicateSheetRefs parameter
    (default false, preserving current behavior). When set, a document referenced by
    several plain sheet symbols is instantiated once; later references are skipped with an
    Info diagnostic, and the surviving instance is not flagged as a repeated channel.
  • ProjectNetlistBuilder enables the flag when the resolved net-identifier scope is
    Flat or Global; hierarchical-scope projects walk exactly as before.

Test Plan

  • Existing tests pass (dotnet test) — 850 passed, 0 failed, 10 skipped (tests requiring local sample files)
  • New tests added for new behavior

Checklist

  • Code follows existing style and conventions
  • Public API changes are documented with XML doc comments
  • No breaking changes (dedupeDuplicateSheetRefs is optional; the default keeps existing behavior)

Block-diagram overview pages routinely reference the working sheets a
second time for navigation (a micromodules project references one sheet
17 times from its top-level overview). The hierarchy walker treated
every reference as a multi-channel instance, so the project netlist
invented per-reference channels with channel-private power nets - GND
fell apart into per-sheet islands.

Under the flat and global net-identifier scopes Altium does not clone
channels: identifiers merge by name and components exist once per
document. HierarchyWalker.Walk now takes dedupeDuplicateSheetRefs
(passed by ProjectNetlistBuilder from the resolved scope): a document
referenced by several plain sheet symbols is instantiated once, later
references are skipped with an Info diagnostic, and the surviving
instance is not flagged as a repeated channel. Repeat() channels and
hierarchical-scope projects are unaffected.
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.

1 participant