User-facing docs: --commands-md flag, doc/user/ tree, anonymised script.

- `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>
This commit is contained in:
2026-05-12 08:29:45 +02:00
parent 66460262af
commit 043fef0a31
16 changed files with 825 additions and 242 deletions

242
doc/user/commands.md Normal file
View File

@@ -0,0 +1,242 @@
# essim — command reference
Auto-generated from the live command registry. Regenerate with
`cmake --build build --target doc` after adding or changing
commands; the binary itself is the single source of truth.
Keys global to the shell: `Esc` cancels a multi-step prompt or
leaves an interactive screen; `Tab` completes commands/paths
(top-level prompt) or cycles focus inside an interactive
screen; `PageUp` / `PageDown` scroll output by 10 lines,
`Home` / `End` jump to top / bottom; ↑ / ↓ walk command
history.
## Interactive commands
### `connect` *(interactive)*
connect a part across two modules (interactive screen if no args)
**Arguments**
1. `module1`
2. `part1 (name or pattern)`
3. `module2`
4. `part2 (name or pattern)`
**Notes**
- bare form opens an interactive screen; inline form (all args) is scriptable
---
### `explore` *(interactive)*
browse modules → parts/signals/connections → details (interactive)
**No arguments.**
**Notes**
- bare form opens an interactive screen; inline form (all args) is scriptable
- not recorded by `script-save` and rejected by `source`
---
### `net` *(interactive)*
show all signals reachable from <module>/<signal> through connections (interactive screen if no args)
**Arguments**
1. `module`
2. `signal name`
**Notes**
- bare form opens an interactive screen; inline form (all args) is scriptable
---
### `search` *(interactive)*
list parts/signals matching a pattern (interactive screen if no args)
**Arguments**
1. `module`
2. `kind [parts|signals]`
3. `pattern`
**Notes**
- bare form opens an interactive screen; inline form (all args) is scriptable
---
### `set-type` *(interactive)*
tag a part's connector type for transform lookup
**Arguments**
1. `module`
2. `part (name or pattern)`
3. `connector type (free string, e.g. vpx-bp, vpx-payload)`
**Notes**
- bare form opens an interactive screen; inline form (all args) is scriptable
---
## Other commands
### `clear`
clear the visualization area
**No arguments.**
---
### `duplicate`
clone a module under a new name (parts, pins, signals; no connections)
**Arguments**
1. `source module`
2. `new module name`
**Notes**
- missing args trigger one prompt each
---
### `exit`
leave essim (alias of quit)
**No arguments.**
---
### `help`
show command help (optionally for a specific command)
**Arguments**
1. `command name (optional)` *(Tab → command completion)*
**Notes**
- no per-arg prompt: pass all args inline (or run bare for an empty-args path)
---
### `load`
load a module from a netlist / pinout file (mentor, altium, ods)
**Arguments**
1. `module name`
2. `filename` *(Tab → path completion)*
3. `import type [mentor|altium|ods]`
**Notes**
- missing args trigger one prompt each
---
### `new`
create a new (empty) system; resets the script-save buffer and $vars
**No arguments.**
---
### `quit`
leave essim
**No arguments.**
---
### `restore`
replace the current system with a saved snapshot
**Arguments**
1. `filename` *(Tab → path completion)*
**Notes**
- missing args trigger one prompt each
---
### `save`
write the current system snapshot to a file
**Arguments**
1. `filename` *(Tab → path completion)*
**Notes**
- missing args trigger one prompt each
---
### `script-save`
write commands run since last 'new' as a replay-ready script
**Arguments**
1. `filename` *(Tab → path completion)*
**Notes**
- missing args trigger one prompt each
---
### `set`
define a $variable for substitution in subsequent commands (no args = list defined vars)
**Arguments**
1. `name`
2. `value`
**Notes**
- no per-arg prompt: pass all args inline (or run bare for an empty-args path)
---
### `set-signal-type`
override the auto-detected signal type (power | gnd | other)
**Arguments**
1. `module`
2. `signal name`
3. `type [power|gnd|other]`
**Notes**
- missing args trigger one prompt each
---
### `source`
execute a file of commands line by line (interactive cmds rejected)
**Arguments**
1. `filename` *(Tab → path completion)*
**Notes**
- missing args trigger one prompt each
---
### `verify`
check pin roles locally and signal-type consistency across bridged nets
**No arguments.**
---