aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorVaino Kauppila <vaino@vke.fi>2026-10-11 15:21:53 +0300
committerVaino Kauppila <vaino@vke.fi>2026-10-11 15:21:53 +0300
commitabe94972619bcd48fa928ccefdff9a814971a5a5 (patch)
treefaa4dde335e64e895927828b080a6685cf7185e4 /README.md
parent6dc0271b39acf1ec5049b7f378c2cf7ba7259362 (diff)
downloadkisim-abe94972619bcd48fa928ccefdff9a814971a5a5.tar.gz
kisim-abe94972619bcd48fa928ccefdff9a814971a5a5.zip
examples: runnable RC low-pass demo on a plain netlist (no KiCad)
rc_lp.cir + rc_lp.py: 5 V step into 1k + 100n, prints V(out) at one time constant and writes a plot. README updated for netlist support; results/ output dir ignored.
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 18 insertions, 5 deletions
diff --git a/README.md b/README.md
index da5996c..b44856e 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,9 @@
-# kisim — run KiCad schematics in ngspice from Python
+# kisim — run KiCad schematics or plain netlists in ngspice from Python
`kisim.py` is a single-file simulation framework with no project knowledge. It:
-1. exports a `.kicad_sch` to a SPICE netlist with `kicad-cli`,
+1. exports a `.kicad_sch` to a SPICE netlist with `kicad-cli` (or takes a plain
+ ngspice netlist — `.cir`/`.spice`/`.net` — and uses it as-is),
2. edits the netlist (instance parameters, source waveforms, regex substitutions),
3. runs `ngspice -b`, and
4. hands the results back as numpy arrays addressed by the schematic's own net
@@ -26,7 +27,8 @@ micromamba run -n kicad_work python my_sim.py
Required on the system (not in the env):
-- `kicad-cli` — schematic → SPICE netlist export (KiCad ≥ 7; developed on 10.0.6)
+- `kicad-cli` — schematic → SPICE netlist export (KiCad ≥ 7; developed on 10.0.6).
+ Only needed for `.kicad_sch` inputs.
- `ngspice` — the simulator (developed on ngspice-47)
## Usage
@@ -49,8 +51,19 @@ r.plot(["+28V", "i(V1)", "Q2:power"])
using for big vendor models, where thousands of internal nodes make huge, slow
raw files.
+## Example
+
+`examples/` is a small runnable demo:
+
+- `rc_lp.cir` — a plain ngspice netlist: 5 V step into 1 kΩ + 100 nF
+- `rc_lp.py` — runs it with kisim and plots V(in)/V(out)
+
+```sh
+micromamba run -n kicad_work python examples/rc_lp.py
+```
+
## Notes
-- `results/*.raw` and regenerated `results/*.cir` files are gitignored; they
- are rebuilt by running the sims.
+- `results/` directories (sim output, plots) are gitignored; rebuilt by running
+ the sims.
- Initially developed for the ASPECT+ payload board sims (2026).