Skip to content

feat(packaging): add chipflow pin swap and chipflow pin show#168

Merged
lanserge merged 2 commits intomainfrom
feat/pin-swap-show
May 8, 2026
Merged

feat(packaging): add chipflow pin swap and chipflow pin show#168
lanserge merged 2 commits intomainfrom
feat/pin-swap-show

Conversation

@lanserge
Copy link
Copy Markdown
Contributor

@lanserge lanserge commented May 8, 2026

Summary

  • chipflow pin swap <a> <b> exchanges two integer pin assignments in pins.lock; refuses bringup pins (under _core) and non-integer-pin packages (GA/BareDie) with clear errors.
  • chipflow pin show [-f text|svg] [-o FILE] renders the current allocation. Text view works for any package type; SVG view draws a perimeter layout for Quad/Block, with empty slots shown as .
  • Together these cover ad-hoc pin rearrangement without hand-editing JSON.

Test plan

  • pdm run pytest tests/test_pin_swap_show.py — 12 new tests pass (swap happy path, multi-bit-port swap, bringup refusal, unallocated pin refusal, persistence, non-int-pin refusal; text table contents/order; SVG basic shape, em-dash for empty slots, refusal for unsupported package types).
  • Existing tests/test_pin_lock.py, tests/test_block_package.py, tests/test_package_pins.py still pass.
  • ruff check clean; pyright clean on chipflow/packaging.
  • End-to-end smoke test against a 16×16 BlockPackageDef project: text table, SVG output (~200 lines), swap of two user pins, and bringup-pin refusal all behave correctly.

Notes

  • SVG renderer currently supports QuadPackageDef and BlockPackageDef (perimeter geometry). Other types fall through to text cleanly.
  • Swap is restricted to int-pin packages for now; GA/BareDie can be added later if needed.

Provide a primitive for editing pin allocations after `pin lock`:

- `pin swap <a> <b>` exchanges two integer pin assignments in
  pins.lock. Bringup pins (everything under `_core`) are
  package-defined and refused. Non-integer pin packages
  (GA/BareDie) are reported clearly as not yet supported.

- `pin show [-f text|svg] [-o FILE]` renders the current
  allocation. Text view works for any package type. SVG view
  draws a perimeter layout for Quad/Block, with empty slots
  rendered as `—`.

Together these cover ad-hoc pin rearrangement without touching the
JSON by hand.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Tests Skipped Failures Errors Time
102 10 💤 0 ❌ 0 🔥 35.560s ⏱️

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-08 12:27 UTC

The S edge used text-anchor="end" + rotate(90) so the START of each
label landed inside the block (the rest dangling below). Switched to
text-anchor="start" + rotate(90), matching the N edge's
text-anchor="start" + rotate(-90), so glyphs always extend OUTWARD
from the block on both edges.

Also size canvas padding from the longest label so neither rotated
labels nor the title get clipped at the canvas edge.
@lanserge lanserge merged commit ec605f2 into main May 8, 2026
6 checks passed
@lanserge lanserge deleted the feat/pin-swap-show branch May 8, 2026 12:25
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