Skip to content

[Fix] Add specialized linear layout for decoupling capacitor partitions#104

Open
adminlip wants to merge 1 commit into
tscircuit:mainfrom
adminlip:fix/specialized-decoupling-caps-layout
Open

[Fix] Add specialized linear layout for decoupling capacitor partitions#104
adminlip wants to merge 1 commit into
tscircuit:mainfrom
adminlip:fix/specialized-decoupling-caps-layout

Conversation

@adminlip
Copy link
Copy Markdown

What

Added DecouplingCapsPackingSolver — a specialized solver that creates optimized linear layouts for decoupling capacitor partitions.

Why

Decoupling capacitors need a different packing strategy than regular chip partitions. They should be arranged in a horizontal line near their associated IC, sorted by net connection proximity to the IC pins, for optimal routing and minimal trace length.

Fixes #15

How

  • New DecouplingCapsPackingSolver: Dedicated solver for partitionType: "decoupling_caps" partitions

    • Identifies the main IC chip (non-capacitor) in the partition
    • Sorts decoupling caps by their connected pin proximity on the main chip
    • Places caps in a horizontal line below the main chip, aligned by net proximity
    • Supports decouplingCapsGap parameter for spacing control
    • Falls back to simple horizontal layout when no main chip exists
  • Updated PackInnerPartitionsSolver: Routes decoupling_caps partitions to the new solver instead of SingleInnerPartitionPackingSolver

  • Added 3 comprehensive tests covering:

    • Linear layout with main chip + caps
    • Caps-only partition (no main chip)
    • Custom decouplingCapsGap parameter

Testing

bun test tests/DecouplingCapsPackingSolver.test.ts     # 3 pass
bun test tests/ChipPartitionsSolver.test.ts              # 4 pass
bun test tests/IdentifyDecouplingCapsSolver/             # 1 pass

All core tests pass. 9 pre-existing failures are unrelated @tscircuit/core dependency issues.

- Created DecouplingCapsPackingSolver for decoupling capacitor partitions
- Caps are sorted by net connection proximity to main chip pins
- Linear horizontal layout below main chip for optimal routing
- Supports custom decouplingCapsGap parameter
- Added comprehensive test coverage

Fixes tscircuit#15
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

@Ouuuuuuuuuuu is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

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.

Specialized Layout for Decoupling Capacitors

2 participants