- New `src/system/analysis.{hpp,cpp}` — stateless post-processing pass
`analyze_system(System*) → AnalysisReport`. Per-module detection of
signal groups and anomalies; pure read, re-runnable.
- Groups: diff pairs (`*_P` / `*_N`, case-insensitive), buses
(`NAME[N]` or strict `NAME_N` — the `_` before digits is required
so names like `GETH_01_VDD12` are not misread as a bus).
- Anomalies: `DiffPairOrphan` (asymmetric: only `_P` without `_N` is
reported — `_N` alone is overloaded with active-low semantics and
floods the output with false positives), `BusGap` (missing index
inside a detected `[lo..hi]`).
- Noise filters: signals starting with `$` (Mentor internals) are
skipped wholesale.
- New `analyze` shell command — prints groups sorted by module +
label, then anomalies. Sized for the upcoming dashboard.
- `tests/test_analysis.cpp` — 8 cases covering both detectors, false-
positive guards (no-underscore digits, `$`-prefixed internals), and
per-module scoping.
- `tests/test_nc_origin.cpp` — completes the prior NC-tagging commit
with round-trip + drop_singleton_signals coverage.
- DESIGN.md updated: layout entry for `analysis.{hpp,cpp}` and new
section explaining the pass; NC-origin paragraph aligned with the
actual tag semantics and the verify three-pass summary.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Enter on a signal entry (net / explore) opens a modal popup to pick
power / gnd / other. Recording is deduped: a sequence of toggles on
the same signal collapses to a single `set-signal-type` line; no-op
selections record nothing.
- Bare interactive commands (the ones that open a full-screen mode)
are no longer recorded by `script-save`. Their inline forms still
are. Mutating actions inside a screen record their own canonical
line.
- Mentor importer treats signals whose name starts with `unconnected`
as no-connect — the pin is kept on the part without a signal and
tagged `ImportedUnconnected`.
- `drop_singleton_signals` runs at the end of `load`: any signal with
exactly one pin is detached (singletons are NC by definition); the
pin is tagged `DroppedSingleton`. Count is reported inline.
- `verify` gains a one-line orphan summary (imported NC / dropped
singleton totals). Pins materialised by `FillIdentityNCs` are
excluded via a `pin_map` filter — they are bridged to a real signal
on the peer module and are not real NCs at system level.
- NcOrigin tag is serialized in save snapshots as an optional 4th
field on N records (backward-compatible).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- `essim --commands-md [file]` instantiates the Tui, calls
`Tui::DumpCommandsMd(ostream&)` which iterates the live registry and
emits Markdown grouped by interactive/other, then exits. Single
source of truth: a new `CommandSpec` field surfaces automatically.
- CMake `doc` target now `DEPENDS essim` and chains:
doxygen → gen_api_md.py → doc/api/
essim --commands-md → doc/user/commands.md
- `doc/user/` adds:
- index.md (hand-written) — first session, interactive-screen
conventions, save/restore/replay overview.
- scripting.md (hand-written) — `set`/`$var` expansion semantics,
`source` event-paced execution, script-save denylist, worked
example pointing at test/system.essim.
- commands.md (auto-generated, regenerated by the `doc` target).
- Top-level README refocused on quick start; pointers to the new
doc tree (user/, api/, DESIGN.md) instead of an inline command table.
- doc/README.md and DESIGN.md document the two-pipeline doc workflow.
- `test/system.essim` and user docs anonymised: bkp → backplane,
vdn1/2/3 → payload1/2/3, cb3p → payload4, bpb/cob/ssu →
peripheral1/2/3; netlist file names + variable names + paths all
replaced with generic equivalents.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
`cmake --build build --target doc` runs Doxygen to produce XML, then
`doc/gen_api_md.py` (~330 lines, stdlib-only) emits a Markdown tree
under `doc/api/` that gitea renders directly in its file browser.
- 24 class/struct pages + 51 source-file pages + indices, with source
links of the form `../../../../src/...#L42` that gitea turns into
clickable line-anchored links.
- Doxyfile.in templated by CMake (XML-only output to build/doc/xml/).
- Pure Python emitter, zero external deps — no doxybook2 (not packaged
on Arch) and no moxygen (avoids Node).
- Target gracefully disabled if Doxygen or Python 3 is missing at
configure time; regular build target unaffected.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- New `net` full-screen layout (`screen_net.cpp`, `screen_idx = 5`): three
columns (module menu / signal filter + menu / live BFS result). Bare
`net` opens the screen; `net <m> <s>` keeps the inline path.
- Main screen grows a title bar: " essim — system digital twin "
(bold + dim) on the left, live "N module(s), M connection(s)" on
the right.
- Every interactive screen now renders the same breadcrumb at the top:
" essim → <name> — <short description> ", followed by a separator.
- `tui_helpers.hpp` exports `FocusLabel(elem, focused)`. Every
interactive screen wraps its field labels with it so the active
field's label flips to inverted video. Buttons (Connect, Apply)
invert as a whole.
- `CommandSpec` gains a `bool interactive`. `help` (no args) splits
the listing into "Interactive (open a full-screen mode)" and
"Other". `help <name>` tags interactive entries with [interactive]
and explains the bare-vs-inline duality.
- `DESIGN.md` (renamed from `CLAUDE.md`): refreshed Layout, TUI, and
screen-recipe sections to cover the new field, the title idiom,
FocusLabel, the `net` screen, and the event-paced `Computing…`
modal during `source`.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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>
Add LICENSE (full EUPL v1.2 text from the SPDX archive) and a README
covering build, commands, tests, project layout, and the licence
notice. Project is now declared open-source under EUPL-1.2.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Domain
- Signal carries a SignalType (Power/GndShield/Other), auto-inferred
from the name in Signal::Signal via infer_signal_type. Override with
the new `set-signal-type` command.
- SignalType extracted to its own header so Pin can store an
`expected_signal_type` without a pins↔signals include cycle.
- pin_role(connector_type, pin_name) → SignalType lookup, called from
set-type to populate each Pin's expected_signal_type. The VPX 3U
table is currently a stub (returns Other).
- New `verify` command walks typed parts and reports pins whose
connected signal's type doesn't match the expectation.
- ODS importer no longer drops pins with empty signal column — they
stay in the part as NC, matching the rule "a pin is either NC or
connected to a signal".
- persist: new S tag for non-default signal type overrides.
Tests
- doctest v2.4.11 via FetchContent (with CMAKE_POLICY_VERSION_MINIMUM
shim, doctest's CMakeLists has a too-old floor for current CMake).
- Source files moved into a static library `essim_lib` so both `essim`
and `essim_tests` reuse the same compilation. main.cpp is the only
file kept out of the lib.
- Layer 1 (pure helpers): ToLower, LongestCommonPrefix, Tokenize,
NaturalLess (numeric/case/leading-zero edge cases + total-order
invariants), signal_type round-trips and infer_signal_type families,
VpxTransform registry + symmetry + reference-table mapping for
connector P0 row 1, IdentityTransform same-name wiring.
- Layer 2 (round-trip): build a synthetic 2-module system in code,
save → restore → assert modules / parts / connector_types / NC pins
/ signal type overrides / connections + pin_map are all preserved.
- Tui::Tokenize moved to a free function in tui_helpers so tests can
call it without dragging ftxui into the unit-test layer.
- 27 test cases, 123 assertions, ~150 ms.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- ODS importer (libzip + pugixml): each sheet → Part, rows → Pin/Signal.
- save / restore commands: tab-delimited snapshot of modules, parts,
signals, connections + pin_map. `restore` replaces the System.
- source / script-save: replay a file of commands; record canonical
commands since last `new` for replay later. Interactive screens
refused during source. `explore` marked non-scriptable.
- TUI screen_explore: 4 columns (modules, type, children, detail) with
filters on children and detail; detail is a Menu so arrows scroll
long pin lists.
- Connector types & transforms: each Part carries a `connector_type`
string. `set-type` validates the part's pin layout against the type
(cols set check). `connect` strict pair: rejects when lookup falls
back to identity unless types are both empty AND pin sets match.
- VPX 3U transforms: 3 registered pairs (vpx-3u-bkp-pN ↔ vpx-3u-payload-pN,
N=0/1/2) with row-pattern correspondence tables ported from the user's
Python reference.
- Code split for maintainability: src/tui/{shell,completion,commands,
screen_main,screen_search,screen_connect,screen_settype,screen_explore,
tui_helpers}.cpp.
- Bug fixes: Module::add(Part*) override sets part->prnt (was always
null, breaking save's W lines). Defensive guards in explore against
empty Menu lists. Renderer wrapped in try/catch so domain throws
surface as on-screen errors instead of SIGABRT.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- ftxui v6.1.9 fetched at configure time; vendored .a + headers dropped.
- TUI: visualisation area on top, input prompt at the bottom; ↑/↓ history,
Tab completion (commands + file paths), Esc cancels prompts. History is
persisted (XDG on Linux, %LOCALAPPDATA% on Windows when ported).
- Command registry: `new`, `load`, `search`, `clear`, `help`, `quit`/`exit`.
Inline params or interactive prompts; either way the canonical inline
form is what gets stored in history.
- `search`: second full-screen mode with module + parts/signals menus and
a live-filtered list; Tab cycles focus, Esc returns to the main shell.
- Domain: `System::modules()` accessor + `SystemElementContainer::size()`
to support load summary + search.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>