Skip to content

Inherit unindexed PDN_* as templates for indexed channels - #46

Merged
anarthrous-eda merged 17 commits into
anarthrous-eda:mainfrom
contronix:feature/pdn-channel-templates
Sep 4, 2026
Merged

Inherit unindexed PDN_* as templates for indexed channels#46
anarthrous-eda merged 17 commits into
anarthrous-eda:mainfrom
contronix:feature/pdn-channel-templates

Conversation

@cs42

@cs42 cs42 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Motivation

Multi-path SERIES and multi-output REGULATOR parts often share one value or one side of the terminals (PDN_R, PDN_IN_*, a common return net) while each path has its own indexed nets. Today FYPA only auto-fills that pattern for a single unindexed 2-pad SERIES, so designers either duplicate every parameter per channel or get a misleading “N pads, not 2” / missing-channel failure when only the shared PDN_* form is present.

This change treats unset PDNn_* fields as inheriting from the unindexed PDN_* template, and only emits a legacy unindexed directive when that form still has a complete terminal set — so shared templates stay declarative and indexed channels resolve correctly.

Summary

  • Inherit unset indexed params from unindexed PDN_* templates via channel materialization
  • Omit template-only unindexed channels when indexed channels exist (complete terminal set required to keep a real legacy channel)
  • Scope channel discovery to active roles (no cross-role phantom channels)
  • Indexed-only parts (PDNn_ROLE without PDN_ROLE): unindexed params stay templates
  • Quiet dry-run role resolution for bridge / supply maps (report_errors=False)
  • Docs + regression tests for shared nets, SERIES, REGULATOR, and edge cases

Test plan

  • uv run pytest tests/test_annotations.py
  • Dual-path SERIES with shared PDN_R / return and per-channel nets → two SERIES directives
  • Dual REGULATOR with shared IN / PDN_V and per-channel OUTs → two regulators
  • Indexed-only PDNn_ROLE does not emit “missing PDN_ROLE” for template PDN_R/PDN_V
  • Leftover cross-role PDN1_* on another role does not invent a phantom channel

cs42 and others added 17 commits July 16, 2026 14:03
Generic script reads branch config from team/local via git show, fetches origin branches by default (--local-only to disable), auto-resolves .gitignore merge conflicts on throwaway test/combined.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pass a .PrjPcb path to launch FYPA gui directly after the combined test branch run. Also gitignore scripts/py314.local.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse test/combined when input SHAs match a git-note stamp, fall back to local refs when fetch fails, skip pytest via -SkipTests, and quiet fetch stderr so stamp matching works reliably from Altium.
PowerShell only accepts the PascalCase switch; the kebab-case form never matched a parameter.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Rebuild and publish the shared tip via maintain-test-combined.ps1
(origin tips only). test-combined.ps1 and launch-combined-gui.ps1
only check out origin/test/combined — no merges at Altium start.

Co-authored-by: Cursor <cursoragent@cursor.com>
First publish has no origin/test/combined yet; do not fail the
input fetch when that ref is absent.

Co-authored-by: Cursor <cursoragent@cursor.com>
Leave the in-progress merge on test/combined so conflicts can be
resolved without losing MERGE_HEAD.

Co-authored-by: Cursor <cursoragent@cursor.com>
Centralize test/combined maintain + launch
Default updates from origin/test/combined and merges only missing tips so
prior conflict resolutions survive. -Rebuild stays the clean recreate.
-Abort resets a stuck test/combined without forcing a dirty checkout.
Document the finish/abort conflict path in fork-workflow.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
maintain-test-combined: incremental + Abort
Shared values and nets (e.g. PDN_R, PDN_IN_*) apply to PDNn_* when unset, and a legacy channel is omitted when indexed terminals alone define the part — fixing multi-path SERIES and multi-output REGULATOR annotations.

Co-authored-by: Cursor <cursoragent@cursor.com>
Require a complete unindexed terminal pair before emitting a legacy channel, scope discovery to active roles to avoid cross-role phantoms, and quiet dry-run role resolution for bridge/supply maps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Indexed-only parts no longer emit a false missing-PDN_ROLE error for shared PDN_R/V/I values; document that unindexed PDN_NET stays a real legacy channel.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cs42
cs42 force-pushed the feature/pdn-channel-templates branch from 750395a to fbdc198 Compare September 2, 2026 09:48
@anarthrous-eda
anarthrous-eda merged commit 7e67653 into anarthrous-eda:main Sep 4, 2026
1 check failed
anarthrous-eda added a commit that referenced this pull request Sep 4, 2026
…nnels

Post-merge fixes for PR #46, where unindexed templates were inherited too
broadly and silently changed the solved model:

- role: a PDN1_ROLE=SERIES channel inherited a SINK part's terminals and
  dropped a resistor across its rail
- discovery: a stray PDN1_MIN_V / PDN1_QUIESCENT cloned the unindexed
  directive, double-counting the load
- terminal mode: PDN_NET beside an indexed PDN1_P_NET pair failed
  _terminal_mode and dropped the channel
- bridge graph: a shared PDN_P_NET resolved as a directive but produced no
  SERIES bridge pair, so Vin inference and rail grouping missed it

Also require the legacy channel's own value param before keeping it beside
indexed channels, so shared terminals no longer report a spurious
"missing PDN_I". 9 regression tests; docs updated to match.
@cs42
cs42 deleted the feature/pdn-channel-templates branch September 7, 2026 06:56
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.

2 participants