Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .trinity/seals/analog_AnalogBench.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"built_by": "t27c-bootstrap@0.5.2+9b556b7c3",
"closure": [],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:89195447f8fee90c8db58f4eee50988ada367390d06d6c41e171c817e16f2680",
"gen_hash_rust": "sha256:c26da9d6dd68f89c6d9e3d5b8b1ee978836bb638dd9130c6ad1d02d4f14b2b06",
"gen_hash_verilog": "sha256:1fb746ee68114b0e7506ec46cc0277e02a9ac9a7f2236a4f894032ede144f252",
"gen_hash_zig": "sha256:3cc22bec9ee00c4031f82679cb6acabba759bee6dd4538ffb35dbd5a025f9d14",
"module": "AnalogBench",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-18T16:09:11Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:daa6ede3a542d8bfe2ce93995f3808f0549037a0b63538f2179ec107dc2b2f60",
"spec_path": "specs/analog/bench.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 11,
"total": 11,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
"zig": "0.16.0"
}
}
348 changes: 348 additions & 0 deletions specs/analog/bench.t27

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions specs/analog/decks/lad10_adaptive.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
10-node RC ladder (beyond the M1 cell), ngspice default adaptive transient
* specs/analog/decks/lad10_adaptive.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* The same circuit and run as lad10_fixed.cir (not a circuit of specs/analog/linear.t27), written as a user would write
* it: a PWL source and the default options (trapezoidal integration, reltol 1e-3, ngspice's own step control). tmax is
* its default, min(tstep, tstop/50) = 50 ns.
* IN = 1 V until 5000 ns and 0 V from 5050 ns: step 99 of the run ends at 5000 ns, step 100 at 5050 ns, and the source
* carries the value of the step's END point, as the backward Euler recurrence does. uic with IC=0 starts all nodes at 0 V.
* Run: ngspice -b -r lad10_adaptive.raw lad10_adaptive.cir (the raw file holds float64 values)
V1 in 0 PWL(0 1 5000n 1 5050n 0)
R1 in 1 1k
R2 1 2 1k
R3 2 3 1k
R4 3 4 1k
R5 4 5 1k
R6 5 6 1k
R7 6 7 1k
R8 7 8 1k
R9 8 9 1k
R10 9 10 1k
C1 1 0 1n IC=0
C2 2 0 1n IC=0
C3 3 0 1n IC=0
C4 4 0 1n IC=0
C5 5 0 1n IC=0
C6 6 0 1n IC=0
C7 7 0 1n IC=0
C8 8 0 1n IC=0
C9 9 0 1n IC=0
C10 10 0 1n IC=0
.tran 50n 10000n uic
.end
35 changes: 35 additions & 0 deletions specs/analog/decks/lad10_fixed.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
10-node RC ladder (beyond the M1 cell), backward Euler on a fixed 50 ns grid
* specs/analog/decks/lad10_fixed.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* Circuit: R1..R10 = 1 kOhm in series from IN through nodes 1..10; C1..C10 = 1 nF from nodes 1..10 to ground; all
* capacitors start at 0 V. This is NOT a circuit of specs/analog/linear.t27 (its NMAX is 5): it is here so the ngspice
* wall time can be read against circuit size, and it has no board number.
* Run: 200 steps of 50 ns, IN = 1 V for the first 100 steps and 0 V for the next 100.
* The grid is made exact as in rc_fixed.cir: a B source declares no breakpoint, the circuit rests at 0 V while the source
* is 0, the source turns on at 425 ns (half a step from the nearest grid point) and turns off at 5425 ns, and from the
* first internal point after 425 ns every step is 50 ns. Step k (k = 0..199) ends at the k-th internal point after 425 ns.
* tstop = 425 ns + 201 steps. gear with maxord 1 is backward Euler; trtol = 1e7 stops the truncation test.
* Run: ngspice -b -r lad10_fixed.raw lad10_fixed.cir (the raw file holds float64 values)
B1 in 0 V = u(time-425n) - u(time-5425n)
R1 in 1 1k
R2 1 2 1k
R3 2 3 1k
R4 3 4 1k
R5 4 5 1k
R6 5 6 1k
R7 6 7 1k
R8 7 8 1k
R9 8 9 1k
R10 9 10 1k
C1 1 0 1n IC=0
C2 2 0 1n IC=0
C3 3 0 1n IC=0
C4 4 0 1n IC=0
C5 5 0 1n IC=0
C6 6 0 1n IC=0
C7 7 0 1n IC=0
C8 8 0 1n IC=0
C9 9 0 1n IC=0
C10 10 0 1n IC=0
.options method=gear maxord=1 trtol=1e7
.tran 50n 10475n 0 50n uic
.end
16 changes: 16 additions & 0 deletions specs/analog/decks/lad3_adaptive.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
M1 3-node RC ladder, ngspice default adaptive transient
* specs/analog/decks/lad3_adaptive.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* The same circuit and run as lad3_fixed.cir, written as a user would write it: a PWL source and the default options
* (trapezoidal integration, reltol 1e-3, ngspice's own step control). tmax is its default, min(tstep, tstop/50) = 50 ns.
* IN = 1 V until 5000 ns and 0 V from 5050 ns: step 99 of the run ends at 5000 ns, step 100 at 5050 ns, and the source
* carries the value of the step's END point, as the backward Euler recurrence does. uic with IC=0 starts all nodes at 0 V.
* Run: ngspice -b -r lad3_adaptive.raw lad3_adaptive.cir (the raw file holds float64 values)
V1 in 0 PWL(0 1 5000n 1 5050n 0)
R1 in 1 1k
R2 1 2 1k
R3 2 3 1k
C1 1 0 1n IC=0
C2 2 0 1n IC=0
C3 3 0 1n IC=0
.tran 50n 10000n uic
.end
20 changes: 20 additions & 0 deletions specs/analog/decks/lad3_fixed.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
M1 3-node RC ladder, backward Euler on a fixed 50 ns grid
* specs/analog/decks/lad3_fixed.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* Circuit: R1, R2, R3 = 1 kOhm in series from IN through nodes 1, 2 and 3; C1, C2, C3 = 1 nF from nodes 1, 2, 3 to
* ground; all capacitors start at 0 V (specs/analog/linear.t27, circuit 3).
* Run: 200 steps of 50 ns, IN = 1 V for the first 100 steps and 0 V for the next 100.
* The grid is made exact as in rc_fixed.cir: a B source declares no breakpoint, the circuit rests at 0 V while the source
* is 0, the source turns on at 425 ns (half a step from the nearest grid point) and turns off at 5425 ns, and from the
* first internal point after 425 ns every step is 50 ns. Step k (k = 0..199) ends at the k-th internal point after 425 ns.
* tstop = 425 ns + 201 steps. gear with maxord 1 is backward Euler; trtol = 1e7 stops the truncation test.
* Run: ngspice -b -r lad3_fixed.raw lad3_fixed.cir (the raw file holds float64 values)
B1 in 0 V = u(time-425n) - u(time-5425n)
R1 in 1 1k
R2 1 2 1k
R3 2 3 1k
C1 1 0 1n IC=0
C2 2 0 1n IC=0
C3 3 0 1n IC=0
.options method=gear maxord=1 trtol=1e7
.tran 50n 10475n 0 50n uic
.end
20 changes: 20 additions & 0 deletions specs/analog/decks/lad5_adaptive.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
M1 5-node RC ladder, ngspice default adaptive transient
* specs/analog/decks/lad5_adaptive.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* The same circuit and run as lad5_fixed.cir, written as a user would write it: a PWL source and the default options
* (trapezoidal integration, reltol 1e-3, ngspice's own step control). tmax is its default, min(tstep, tstop/50) = 50 ns.
* IN = 1 V until 5000 ns and 0 V from 5050 ns: step 99 of the run ends at 5000 ns, step 100 at 5050 ns, and the source
* carries the value of the step's END point, as the backward Euler recurrence does. uic with IC=0 starts all nodes at 0 V.
* Run: ngspice -b -r lad5_adaptive.raw lad5_adaptive.cir (the raw file holds float64 values)
V1 in 0 PWL(0 1 5000n 1 5050n 0)
R1 in 1 1k
R2 1 2 1k
R3 2 3 1k
R4 3 4 1k
R5 4 5 1k
C1 1 0 1n IC=0
C2 2 0 1n IC=0
C3 3 0 1n IC=0
C4 4 0 1n IC=0
C5 5 0 1n IC=0
.tran 50n 10000n uic
.end
24 changes: 24 additions & 0 deletions specs/analog/decks/lad5_fixed.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
M1 5-node RC ladder, backward Euler on a fixed 50 ns grid
* specs/analog/decks/lad5_fixed.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* Circuit: R1..R5 = 1 kOhm in series from IN through nodes 1..5; C1..C5 = 1 nF from nodes 1..5 to ground; all
* capacitors start at 0 V (specs/analog/linear.t27, circuit 4).
* Run: 200 steps of 50 ns, IN = 1 V for the first 100 steps and 0 V for the next 100.
* The grid is made exact as in rc_fixed.cir: a B source declares no breakpoint, the circuit rests at 0 V while the source
* is 0, the source turns on at 425 ns (half a step from the nearest grid point) and turns off at 5425 ns, and from the
* first internal point after 425 ns every step is 50 ns. Step k (k = 0..199) ends at the k-th internal point after 425 ns.
* tstop = 425 ns + 201 steps. gear with maxord 1 is backward Euler; trtol = 1e7 stops the truncation test.
* Run: ngspice -b -r lad5_fixed.raw lad5_fixed.cir (the raw file holds float64 values)
B1 in 0 V = u(time-425n) - u(time-5425n)
R1 in 1 1k
R2 1 2 1k
R3 2 3 1k
R4 3 4 1k
R5 4 5 1k
C1 1 0 1n IC=0
C2 2 0 1n IC=0
C3 3 0 1n IC=0
C4 4 0 1n IC=0
C5 5 0 1n IC=0
.options method=gear maxord=1 trtol=1e7
.tran 50n 10475n 0 50n uic
.end
12 changes: 12 additions & 0 deletions specs/analog/decks/rc_adaptive.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
M0 RC low-pass, ngspice default adaptive transient
* specs/analog/decks/rc_adaptive.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* The same circuit and run as rc_fixed.cir, written as a user would write it: a PWL source and the default options
* (trapezoidal integration, reltol 1e-3, ngspice's own step control). tmax is its default, min(tstep, tstop/50) = 50 ns.
* IN = 1 V until 5000 ns and 0 V from 5050 ns: step 99 of the run ends at 5000 ns, step 100 at 5050 ns, and the source
* carries the value of the step's END point, as the backward Euler recurrence does. uic with IC=0 starts OUT at 0 V.
* Run: ngspice -b -r rc_adaptive.raw rc_adaptive.cir (the raw file holds float64 values)
V1 in 0 PWL(0 1 5000n 1 5050n 0)
R1 in 1 1k
C1 1 0 1n IC=0
.tran 50n 10000n uic
.end
19 changes: 19 additions & 0 deletions specs/analog/decks/rc_fixed.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
M0 RC low-pass, backward Euler on a fixed 50 ns grid
* specs/analog/decks/rc_fixed.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* Circuit: R1 = 1 kOhm from IN to node 1 (OUT), C1 = 1 nF from node 1 to ground, OUT starts at 0 V
* (specs/fpga/rc_filter_ax7203.t27; node numbers as in specs/analog/linear.t27).
* Run: 200 steps of 50 ns, IN = 1 V for the first 100 steps and 0 V for the next 100 (vin_at of linear.t27).
* How the grid is made exact. ngspice opens every .tran with steps of tstep/100 that double up to tmax, and opens that
* ramp again after every breakpoint, so a PWL or PULSE source puts internal points off the grid. A B source declares no
* breakpoint. While the source is 0 V the circuit rests at 0 V and every step of the ramp leaves it at exactly 0 V, so the
* ramp cannot touch the state. The source turns on at 425 ns, half a step from the nearest grid point; from the first
* internal point after 425 ns every step is 50 ns. Step k of the run (k = 0..199) ends at the k-th internal point after
* 425 ns; the source is 1 V until 5425 ns and 0 V after. tstop = 425 ns + 201 steps.
* Integration: gear with maxord 1 is backward Euler. trtol = 1e7 stops the truncation test from shrinking a step.
* Run: ngspice -b -r rc_fixed.raw rc_fixed.cir (the raw file holds float64 values)
B1 in 0 V = u(time-425n) - u(time-5425n)
R1 in 1 1k
C1 1 0 1n IC=0
.options method=gear maxord=1 trtol=1e7
.tran 50n 10475n 0 50n uic
.end
14 changes: 14 additions & 0 deletions specs/analog/decks/rc_pwl_naive.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
M0 RC low-pass, backward Euler with a PWL source: the negative control of rc_fixed.cir
* specs/analog/decks/rc_pwl_naive.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* The same circuit, integration (gear, maxord 1 = backward Euler) and trtol as rc_fixed.cir, but the source is the
* natural PWL. The corners at 5000 ns and 5050 ns are breakpoints: ngspice reaches them exactly and restarts its step
* ramp after each (steps of a fraction of the interval that double up to tmax), and it also opens the run with such a
* ramp. So the internal points are NOT the 50 ns grid and the result is backward Euler on a different, nonuniform
* grid: v(1) at 5000 ns differs from the backward Euler recurrence at the 1e-5 level, not at the 1e-15 level.
* Run: ngspice -b -r rc_pwl_naive.raw rc_pwl_naive.cir (the raw file holds float64 values)
V1 in 0 PWL(0 1 5000n 1 5050n 0)
R1 in 1 1k
C1 1 0 1n IC=0
.options method=gear maxord=1 trtol=1e7
.tran 50n 10000n 0 50n uic
.end
14 changes: 14 additions & 0 deletions specs/analog/decks/rlc_adaptive.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
M1 series RLC, ngspice default adaptive transient
* specs/analog/decks/rlc_adaptive.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* The same circuit and run as rlc_fixed.cir, written as a user would write it: a PWL source and the default options
* (trapezoidal integration, reltol 1e-3, ngspice's own step control). tmax is its default, min(tstep, tstop/50) = 5 ns.
* IN = 1 V until 500 ns and 0 V from 505 ns: step 99 of the run ends at 500 ns, step 100 at 505 ns, and the source
* carries the value of the step's END point, as the backward Euler recurrence does. uic with IC=0 starts the capacitor
* voltage and the inductor current at 0.
* Run: ngspice -b -r rlc_adaptive.raw rlc_adaptive.cir (the raw file holds float64 values)
V1 in 0 PWL(0 1 500n 1 505n 0)
R1 in 1 100
L1 1 2 10u IC=0
C1 2 0 1n IC=0
.tran 5n 1000n uic
.end
17 changes: 17 additions & 0 deletions specs/analog/decks/rlc_fixed.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
M1 series RLC, backward Euler on a fixed 5 ns grid
* specs/analog/decks/rlc_fixed.cir -- test data for specs/analog/bench.t27 (#10505). A plain netlist, no .control block.
* Circuit: R1 = 100 Ohm from IN to node 1, L1 = 10 uH from node 1 to node 2 (the capacitor voltage), C1 = 1 nF from
* node 2 to ground; capacitor voltage and inductor current start at 0 (specs/analog/linear.t27, circuit 2).
* Run: 200 steps of 5 ns, IN = 1 V for the first 100 steps and 0 V for the next 100.
* The grid is made exact as in rc_fixed.cir: a B source declares no breakpoint, the circuit rests at 0 while the source
* is 0, the source turns on at 42.5 ns (half a step from the nearest grid point) and turns off at 542.5 ns, and from the
* first internal point after 42.5 ns every step is 5 ns. Step k (k = 0..199) ends at the k-th internal point after 42.5 ns.
* tstop = 42.5 ns + 201 steps. gear with maxord 1 is backward Euler; trtol = 1e7 stops the truncation test.
* Run: ngspice -b -r rlc_fixed.raw rlc_fixed.cir (the raw file holds float64 values)
B1 in 0 V = u(time-42.5n) - u(time-542.5n)
R1 in 1 100
L1 1 2 10u IC=0
C1 2 0 1n IC=0
.options method=gear maxord=1 trtol=1e7
.tran 5n 1047.5n 0 5n uic
.end
Loading