velxio/frontend/src/simulation/spice
David Montero dd62b94c1d feat(sim): custom chips read inputs (buttons/switches/sensors) with no board
The chip-output board-less path existed (chipPinDrives -> SPICE voltage sources
-> LEDs). The INPUT direction was missing: a chip pin wired to a pushbutton had
its net solved by ngspice, but nothing fed that net's state back to the
PinManager key the chip reads via vx_pin_read. So a board-less chip could light
LEDs but never read a button (verified: i8080 counter stayed at 0 on press).

connectChipInputsToSolve subscribes to the electrical store and, after each
solve, thresholds every wired chip input pin's net voltage to HIGH/LOW and
triggerPinChange()s the chip's synthetic pin — updating getPinState (polling)
and firing onPinChange edges. Pins the chip is actively driving are skipped so
it never fights its own outputs. Hooked alongside connectAnalogInputsToMcu in
start.ts. Solver-agnostic; reads only the electrical store shape.

Also gives the board-less button examples a pull-down on each chip BTN pin so
they read a clean LOW when open (a button-to-VCC floats HIGH otherwise):
i8080-button-counter (2) and i8080-killbits (8).

- new connectChipInputsToSolve.ts; start.ts wiring.
- examples-retro-intel: pull-down resistors + wires for the button examples.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 05:09:51 +02:00
..
adapters feat(sim): Phase 1d #6 — listCurrentVectors in Worker adapter, no more heuristic parsing 2026-05-15 22:31:08 +02:00
models
ports
wasm feat(sim): Phase 1d #6 — listCurrentVectors in Worker adapter, no more heuristic parsing 2026-05-15 22:31:08 +02:00
CircuitSimulationService.ts fix(circuit-sim): stop() guard + drop edges with no V-source post-rebuild 2026-05-20 03:49:29 +02:00
MixedModeScheduler.ts fix(spice+pipeline): LED visualization, INPUT_PULLUP, ESP32-C3, PWM fade, examples 2026-05-18 21:52:07 -03:00
NetlistBuilder.ts fix(spice+pipeline): LED visualization, INPUT_PULLUP, ESP32-C3, PWM fade, examples 2026-05-18 21:52:07 -03:00
boardPinGroups.ts feat(boards): expose Raspberry Pi 4 and Pi 5 in the picker (UI + pin wiring) 2026-05-23 04:46:59 +02:00
collectPinStates.ts feat(attiny85+customchip): full ATtiny85 ADC/Timer0 + custom-chip pipeline fixes 2026-05-19 18:10:08 -03:00
componentToSpice.ts feat(custom-chip): make chip pins first-class circuit nodes (digital + SPICE) 2026-06-03 05:40:49 +02:00
connectAnalogInputsToMcu.ts feat(attiny85+customchip): full ATtiny85 ADC/Timer0 + custom-chip pipeline fixes 2026-05-19 18:10:08 -03:00
connectChipInputsToSolve.ts feat(sim): custom chips read inputs (buttons/switches/sensors) with no board 2026-06-04 05:09:51 +02:00
connectMcuEdgesToService.ts fix(spice+pipeline): LED visualization, INPUT_PULLUP, ESP32-C3, PWM fade, examples 2026-05-18 21:52:07 -03:00
electricalResolveHook.ts feat(custom-chip): make chip pins first-class circuit nodes (digital + SPICE) 2026-06-03 05:40:49 +02:00
probes.ts
runNetlist.ts feat(sim): Phase 1d #6 — listCurrentVectors in Worker adapter, no more heuristic parsing 2026-05-15 22:31:08 +02:00
start.ts feat(sim): custom chips read inputs (buttons/switches/sensors) with no board 2026-06-04 05:09:51 +02:00
storeAdapter.ts
types.ts
unionFind.ts
valueParser.ts
waveformStats.ts