docs: README, example and SPEC checklist

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
thomasandClaude Sonnet 5.5 committed 2026-09-30 08:46:57 +02:00
1 parent 33da569e2b
commit f05d29e090
2 files changed
+139 -33

No files matched your search

+33 -33
View File
@@ -3,52 +3,52 @@
Verilog-Modul → per Verilator + nanobind → importierbares Python-Modul.
## CLI
- [ ] `pip install dlv`, Einstieg `dlv` (console_scripts)
- [ ] argparse + argcomplete, schwere Imports erst nach autocomplete()
- [ ] `dlv init` → bash/zsh/fish-Completion nach ~/.local/share/… installieren
- [ ] `dlv build FILE.v --clock PORT [-o DIR] [--module M] [--trace] [-v]`
- [ ] Modulname ≠ Dateiname und kein --module → Fehler
- [ ] --clock ist Pflicht (v0.1: Module ohne Master-Clock unzulässig)
- [ ] --clock muss 1-Bit-Input sein, sonst Fehler
- [ ] -o DIR (Default: cwd), Ergebnis: DIR/counter.cpython-3xx-….so
- [ ] Completion: --module → Module aus FILE, --clock → 1-Bit-Inputs
- [x] `pip install dlv`, Einstieg `dlv` (console_scripts)
- [x] argparse + argcomplete, schwere Imports erst nach autocomplete()
- [x] `dlv init` → bash/zsh/fish-Completion nach ~/.local/share/… installieren
- [x] `dlv build FILE.v --clock PORT [-o DIR] [--module M] [--trace] [-v]`
- [x] Modulname ≠ Dateiname und kein --module → Fehler
- [x] --clock ist Pflicht (v0.1: Module ohne Master-Clock unzulässig)
- [x] --clock muss 1-Bit-Input sein, sonst Fehler
- [x] -o DIR (Default: cwd), Ergebnis: DIR/counter.cpython-3xx-….so
- [x] Completion: --module → Module aus FILE, --clock → 1-Bit-Inputs
## Build-Ausgabe
- [ ] Verilator/Compiler via subprocess, Output wird gepuffert
- [ ] Output nur im Fehlerfall ausgeben (oder mit -v)
- [ ] Hübscher Fortschritt mit `rich`: Schritte mit Spinner → ✓ / ✗
- [x] Verilator/Compiler via subprocess, Output wird gepuffert
- [x] Output nur im Fehlerfall ausgeben (oder mit -v)
- [x] Hübscher Fortschritt mit `rich`: Schritte mit Spinner → ✓ / ✗
(Verilator prüfen, Ports lesen, Binding generieren, verilieren, kompilieren)
## Mini-Verilog-Parser (nur Completion/Vorprüfung)
- [ ] Regex-Tokenizer + kleiner Automat, Kommentare/Strings/`ifdef grob ignorieren
- [ ] ANSI- und Nicht-ANSI-Ports, Breite nur als Text/Best Effort
- [ ] Cache nach (pfad, mtime, größe) in .dlv/
- [x] Regex-Tokenizer + kleiner Automat, Kommentare/Strings/`ifdef grob ignorieren
- [x] ANSI- und Nicht-ANSI-Ports, Breite nur als Text/Best Effort
- [x] Cache nach (pfad, mtime, größe) in .dlv/
## Build-Kette (Quelle der Wahrheit = Verilator)
- [ ] `verilator` aus PATH, Version ≥ 5.022 prüfen
- [ ] `verilator --json-only` → Ports (Name, Richtung, Breite)
- [ ] Ports > 64 Bit → klarer Fehler (v0.1)
- [ ] Jinja2-Template → nanobind-Binding (C++)
- [ ] `verilator --cc --build` + g++ direkt mit nanobind-Flags → .so
- [x] `verilator` aus PATH, Version ≥ 5.022 prüfen
- [x] `verilator --json-only` → Ports (Name, Richtung, Breite)
- [x] Ports > 64 Bit → klarer Fehler (v0.1)
- [x] Jinja2-Template → nanobind-Binding (C++)
- [x] `verilator --cc --build` + g++ direkt mit nanobind-Flags → .so
## Binding-API
- [ ] `counter.Model()` für mehrere Instanzen
- [ ] Modul-Funktionen auf Default-Instanz: info, proc_ris, proc_fal, cycle_ris, cycle_fal, get, step
- [ ] info() → {name, inputs:{p:w}, outputs:{p:w}, clock}
- [ ] proc_ris(dict) → Inputs setzen, 1 Takt mit führender steigender Flanke
- [ ] cycle_ris(n) → n weitere Takte; _fal-Varianten analog
- [ ] get() → dict aller Outputs
- [ ] step(n, {in: np.array}) → {out: np.array}, Taktschleife in C++
- [ ] --trace: m.trace_open("x.fst") / m.trace_close()
- [x] `counter.Model()` für mehrere Instanzen
- [x] Modul-Funktionen auf Default-Instanz: info, proc_ris, proc_fal, cycle_ris, cycle_fal, get, step
- [x] info() → {name, inputs:{p:w}, outputs:{p:w}, clock}
- [x] proc_ris(dict) → Inputs setzen, 1 Takt mit führender steigender Flanke
- [x] cycle_ris(n) → n weitere Takte; _fal-Varianten analog
- [x] get() → dict aller Outputs
- [x] step(n, {in: np.array}) → {out: np.array}, Taktschleife in C++
- [x] --trace: m.trace_open("x.fst") / m.trace_close()
## Doku
- [ ] README.md: Installation, Voraussetzungen, Quickstart (counter.v), API, Completion
- [x] README.md: Installation, Voraussetzungen, Quickstart (counter.v), API, Completion
## Qualität
- [ ] pytest: Parser gegen Verilator-JSON als Orakel
- [ ] Integrationstest: counter.v bauen, importieren, zählen
- [ ] Tests ohne Verilator → skip
- [ ] kein Code aus dspsim (AGPL)
- [x] pytest: Parser gegen Verilator-JSON als Orakel
- [x] Integrationstest: counter.v bauen, importieren, zählen
- [x] Tests ohne Verilator → skip
- [x] kein Code aus dspsim (AGPL)
## Repo & Packaging (festgelegt)
- Lizenz: MIT