Skip to content

Add sheet-symbol PDN overrides and multi-instance SMPS Vin inference - #42

Merged
anarthrous-eda merged 22 commits into
anarthrous-eda:mainfrom
contronix:feature/sheet-symbol-pdn-overrides
Sep 4, 2026
Merged

Add sheet-symbol PDN overrides and multi-instance SMPS Vin inference#42
anarthrous-eda merged 22 commits into
anarthrous-eda:mainfrom
contronix:feature/sheet-symbol-pdn-overrides

Conversation

@cs42

@cs42 cs42 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Allow PDN_<Des>_* parameters on sheet symbols to override child-sheet PDN directives per PCB instance (e.g. different sink currents or regulator voltages for reused sheets).
  • Bind overrides via SOURCEUNIQUEID path (preferred) or hierarchical-path / sheet-name fallback; support indexed channels and REPEAT slot forms (PDN_J1_I.N).
  • Merge sheet-symbol value overrides onto PCB-ECO / Blanket directives for the same placement (no duplicate sources; clearer partial-coverage warnings).
  • When repeated regulator sheets publish different PDN_V onto a shared local output name, expand that net per instance for SMPS Vin inference so rails do not collide or drop from the supply map; propagate along placed SERIES edges (including 2-pin autoinfer) and expand PDN_IN_P_NET per placement.

Motivation

Reusable child sheets are often placed several times on one board. The shared schematic can only hold one default PDN_* value, but real loads and rail voltages differ per placement. Editing each physical instance only in the FYPA viewer or via PCB ECO does not keep that intent in the schematic. Sheet-symbol overrides (PDN_<Des>_* on each sheet symbol) keep per-instance values in Altium.

Different per-placement regulator voltages on a shared local switch/output label then require instance-scoped supply-map keys and SERIES-aware Vin lookup; otherwise SMPS gain inference can fail for downstream regulators on the filtered rails.

Test plan

  • uv run pytest tests/test_annotations.py -q
  • Spot-check a project with ≥2 placements of the same child sheet and different PDN_<Des>_I (or _V) on each sheet symbol; confirm distinct directives per PCB instance
  • Confirm UniqueID binding when present; hierpath fallback only when SOURCEUNIQUEID is empty
  • Spot-check repeated regulator sheets with a shared local OUT name and a SERIES filter inductor; confirm downstream SMPS Vin / gain without “cannot infer input voltage”

cs42 and others added 6 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>
@cs42 cs42 changed the title Add sheet-symbol PDN overrides for per-instance currents Add sheet-symbol PDN overrides and multi-instance SMPS Vin inference Aug 5, 2026
cs42 and others added 16 commits August 5, 2026 14:53
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
Allow PDN_<Des>_* parameters on sheet symbols to override child-sheet directives per PCB instance (UniqueID path, hierarchical-path fallback, REPEAT slots), with extract/diagnostics and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Merge PDN_<Des>_* onto pcb_index-pinned sources, dedupe sheet-only synthesis against PCB-ECO placements, and clarify partial-coverage warnings (sheet symbol vs PCB-ECO).

Co-authored-by: Cursor <cursoragent@cursor.com>
Register REGULATOR PDN_V under instance-expanded OUT nets (LX.1/LX.2) and copy unique voltages across SERIES P→N so rails like VDD_12V resolve for downstream SMPS gain.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use _series_channel_indices so parts without part-wide PDN_ROLE still propagate rail voltages across SERIES.

Co-authored-by: Cursor <cursoragent@cursor.com>
Propagate supply voltages along SERIES edges to fixpoint (multi-hop order-independent), include 2-pin autoinfer via bridge pairs, and pair one primary expanded net per side instead of an alias cross-product.

Co-authored-by: Cursor <cursoragent@cursor.com>
Try instance-expanded PDN_IN_P_NET aliases for gain lookup, treat 2-pin autoinfer SERIES as undirected for voltage copy (pad order is not power-flow), and cover local IN plus reversed-pad regressions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Do not emit global P/N supply-flow edges for schematic SERIES parts with no PCB instance, so DNI/unplaced bridges cannot poison rail voltages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep declared-vs-propagated supply-map keys distinct for SMPS gain lookup, strip propagated values on ambiguous rails, and rebuild tests from main plus sheet-symbol-only cases.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cs42
cs42 force-pushed the feature/sheet-symbol-pdn-overrides branch from d4eb9ba to d90871c Compare September 2, 2026 11:50
@anarthrous-eda
anarthrous-eda merged commit 4f07e92 into anarthrous-eda:main Sep 4, 2026
1 check failed
@cs42
cs42 deleted the feature/sheet-symbol-pdn-overrides 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