Altium import, nets, canonical pins, component kinds, set/$var, scrollback, source modal.

Major additions, all wired end-to-end with doctest coverage:

- Altium netlist importer (`imports/import_altium.{hpp,cpp}`): two-pass
  parser for `[ ]` parts and `( )` signals; `System::Load` no longer has
  the IMPORT_ALTIUM hole.
- `duplicate <src> <dst>` deep-copies a module (signals, parts, pins,
  rewired signals); connections excluded by design.
- Nets (`system/nets.{hpp,cpp}`): BFS over `Connection::pin_map` to
  return the transitive (Module, Signal) closure. `verify` extended with
  a second pass flagging Power↔GndShield inconsistencies in bridged
  nets; new `net <module> <signal>` command for inspection.
- Canonical pin names (`system/pin_name.{hpp,cpp}`): zero-padded digit
  suffix lets A1 ↔ A001 pair via `IdentityTransform` and
  `CheckIdentityCompatible` without losing the imported notation.
- Component classification (`system/component_kind.{hpp,cpp}`):
  `Part::kind` inferred at construction from the reference-designator
  prefix (longest-match: LED/TP/SW/FB/MK/MP/MH/HS/RA/RN/RP/RV first,
  then R/C/L/F/D/Q/U/J/P/Y/X/S).
- Identity wiring tolerance: `CheckIdentityCompatible` accepts the
  subset case (typical when one importer drops NC pins, e.g. Altium)
  and surfaces orphans as an info string. `FillIdentityNCs`
  materialises orphan canonical positions as NC pins on the missing
  side at connect time.
- Connector layout preparation: `pin_layout(kind)` and
  `FillPartFromLayout(part, kind)` stubs in `pin_role`, called from
  `set-type`. Empty today; populate alongside `vpx_3u_role`.
- TUI scrollback: PageUp/PageDown step 10 lines, Home/End jump to
  ends; `Print()` snaps back to the tail.
- `set <name> <value>` declares session variables; `$name` / `${name}`
  expanded inside `Finalize` between canonical-form recording and the
  action call — history and script-save preserve `$var` references.
- Long `source` scripts now show a centred "Computing…" modal with a
  N/M progress counter. Driven by a ticker thread that posts one
  paced `Event::Special` per processed line, ack'd by the main thread,
  so heavy lines don't backlog ticks and freeze the counter.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 20:28:21 +02:00
parent 477f3abd40
commit c3bb00cb4d
24 changed files with 1163 additions and 61 deletions

86
test/system.essim Normal file
View File

@@ -0,0 +1,86 @@
# essim system bring-up script.
new
# ---------------------------------------------------------------- variables
set test_dir /home/francois/Projets/essim_test
set bpb_nets $test_dir/BPB-2177-10222_NETLIST_3_1.qcv
set bkp_nets $test_dir/MERCVPX3UBPA_20221122.NET
set cb3p_nets $test_dir/CB3P-6359-10232_NETLIST_3_0.qcv
set vdn_nets $test_dir/VDN-2910.qcv
set cob_nets $test_dir/COB-2277_NETLIST_10211_2_0.qcv
set ssu_nets $test_dir/SSU-2134_PCB873.qcv
# ---------------------------------------------------------------- modules
load vdn1 $vdn_nets mentor
duplicate vdn1 vdn2
duplicate vdn1 vdn3
load bpb $bpb_nets mentor
load bkp $bkp_nets altium
load cb3p $cb3p_nets mentor
load cob $cob_nets mentor
load ssu $ssu_nets mentor
# ---------------------------------------------------------------- VPX tags
# Backplane payload-side connectors on BKP, one slot per (Jx0,Jx1,Jx2):
# J2x → VDN1, J3x → VDN2, J4x → VDN3, J5x → CB3P.
set-type bkp J20 vpx-3u-bkp-p0
set-type bkp J21 vpx-3u-bkp-p1
set-type bkp J22 vpx-3u-bkp-p2
set-type bkp J30 vpx-3u-bkp-p0
set-type bkp J31 vpx-3u-bkp-p1
set-type bkp J32 vpx-3u-bkp-p2
set-type bkp J40 vpx-3u-bkp-p0
set-type bkp J41 vpx-3u-bkp-p1
set-type bkp J42 vpx-3u-bkp-p2
set-type bkp J50 vpx-3u-bkp-p0
set-type bkp J51 vpx-3u-bkp-p1
set-type bkp J52 vpx-3u-bkp-p2
# Payload connectors on each plug-in card.
set-type vdn1 P0 vpx-3u-payload-p0
set-type vdn1 P1 vpx-3u-payload-p1
set-type vdn1 P2 vpx-3u-payload-p2
set-type vdn2 P0 vpx-3u-payload-p0
set-type vdn2 P1 vpx-3u-payload-p1
set-type vdn2 P2 vpx-3u-payload-p2
set-type vdn3 P0 vpx-3u-payload-p0
set-type vdn3 P1 vpx-3u-payload-p1
set-type vdn3 P2 vpx-3u-payload-p2
set-type cb3p P0 vpx-3u-payload-p0
set-type cb3p P1 vpx-3u-payload-p1
set-type cb3p P2 vpx-3u-payload-p2
# ---------------------------------------------------------------- VPX wiring
# Each connect dispatches via the registered vpx-3u transform.
connect bkp J20 vdn1 P0
connect bkp J21 vdn1 P1
connect bkp J22 vdn1 P2
connect bkp J30 vdn2 P0
connect bkp J31 vdn2 P1
connect bkp J32 vdn2 P2
connect bkp J40 vdn3 P0
connect bkp J41 vdn3 P1
connect bkp J42 vdn3 P2
connect bkp J50 cb3p P0
connect bkp J51 cb3p P1
connect bkp J52 cb3p P2
# ---------------------------------------------------------------- non-VPX
# Both ends untagged → IdentityTransform (matches by canonical pin name,
# so e.g. A1 ↔ A001 is paired thanks to canonical_pin_name).
connect cob P3 ssu P6
connect bkp J1 ssu P1
# BPB ↔ BKP
connect bkp P100 bpb J100
connect bkp P101 bpb J101
connect bkp P102 bpb J102
# BPB ↔ COB
connect bpb J0 cob P0
connect bpb J1 cob P1
connect bpb J2 cob P2