* Auto-generated testbench for decoupling analysis: +5v rail
* 1 capacitor(s) in parallel, series R-L-C model
* Model: ESR/ESL from pdn_impedance (package-based)

R_esr_C2 rail n_esr_0 15.8m
L_par_C2 n_esr_0 n_lpar_0 900p
C2 n_lpar_0 0 10u

* 1A AC current source into the rail node — V(rail) = Z(f)
IAC 0 rail DC 0 AC 1

.control
ac dec 200 100 100Meg
let z_mag = vm(rail)
meas ac z_min min z_mag
meas ac f_at_zmin when z_mag=z_min
meas ac z_at_1M find vm(rail) at=1Meg
meas ac z_at_100k find vm(rail) at=100k
echo "z_min=$&z_min f_at_zmin=$&f_at_zmin z_at_1M=$&z_at_1M z_at_100k=$&z_at_100k n_caps=1" > analysis/spice_runs/decoupling_C2.out
quit
.endc

.end
