Merge pull request #466 from arpadbuermen/master

visual setup for acstb analysis
This commit is contained in:
StefanSchippers 2026-03-20 17:24:05 +01:00 committed by GitHub
commit 9fbc922a77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 96 additions and 7 deletions

View File

@ -37,6 +37,7 @@ The following analyses are supported
|dcxf.sym |small signal dc transfer function |dcxf |tf |
|ac.sym |small signal ac |ac |ac |
|acxf.sym |small signal ac transfer function |acxf |- |
|acstb.sym |small signal ac stability |acstb |- |
|noise.sym |small signal noise |noise |noise |
|tran.sym |transient |tran |tran |
|hb.sym |harmonc balance |hb |- |

View File

@ -0,0 +1,54 @@
v {xschem version=3.4.8RC file_version=1.3
*
* Analyses library for visual circuit analysis setup.
* Copyright (C) 2025 Arpad Buermen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
}
G {}
K {type=netlist_command_analysis_acstb
template="name=acstb1
only_toplevel=false
order=\\"\\"
sweep=\\"\\"
probe=\\"\\\\\\"vfb\\\\\\"\\"
localgnd=\\"\\"
from="10"
to="100k"
step=\\"\\"
mode=\\"\\\\\\"dec\\\\\\"\\"
points=\\"10\\"
values=\\"\\"
nodeset=\\"\\"
store=\\"\\"
write=\\"\\"
writeop=\\"\\"
"}
V {}
S {}
F {}
E {}
L 4 0 -30 140 -30 {}
L 4 0 -30 0 30 {}
L 4 140 -30 140 30 {}
L 4 0 30 140 30 {}
L 4 10 40 150 40 {}
L 4 150 -10 150 40 {}
L 4 10 30 10 40 {}
L 4 140 -10 150 -10 {}
T {@name} 5 -50 0 0 0.3 0.3 {}
T {AC STB} 5 -20 0 0 0.3 0.3 {}
T {tcleval([ ::analyses::display_acstb @name ])} 5 50 0 0 0.3 0.3 {}
T {tcleval([ ::analyses::display_order @name ])} 5 0 0 0 0.3 0.3 {}

View File

@ -141,7 +141,7 @@ store=""
write=""
writeop=""
}
C {acxf.sym} 960 1100 0 0 {name=acxf1
C {acxf.sym} 960 1120 0 0 {name=acxf1
only_toplevel=false
order="8"
sweep=""
@ -158,9 +158,9 @@ store=""
write=""
writeop=""
}
C {noise.sym} 960 1340 0 0 {name=noise1
C {noise.sym} 1190 1120 0 0 {name=noise1
only_toplevel=false
order="9"
order="10"
sweep=""
outp="\\"out\\""
outn=""
@ -177,9 +177,9 @@ store=""
write=""
writeop=""
}
C {hb.sym} 960 1590 0 0 {name=hb1
C {hb.sym} 1190 1370 0 0 {name=hb1
only_toplevel=false
order="10"
order="11"
sweep=""
freq=[100k]
nharm=10
@ -194,7 +194,7 @@ nodeset=""
store=""
write=""
}
C {postproc.sym} 1160 1100 0 0 {name=postproc1
C {postproc.sym} 1190 1560 0 0 {name=postproc1
only_toplevel=false
order="12"
tool="PYTHON"
@ -210,3 +210,20 @@ verbatim="* A comment
C {command_block.sym} 470 1110 0 0 {name=CMD
only_toplevel=false
}
C {acstb.sym} 960 1320 0 0 {name=acstb1
only_toplevel=false
order="9"
sweep=""
probe="\\"vfb\\""
localgnd=""
from=10
to=100k
step=""
mode="\\"dec\\""
points="10"
values=""
nodeset=""
store=""
write=""
writeop=""
}

View File

@ -157,12 +157,18 @@ proc display_ac {symname} {
return [format_props $symname $names]
}
# Display XF analysis
# Display ACXF analysis
proc display_acxf {symname} {
set names [list sweep N outp N outn N from N to N step N mode N points N values N nodeset SG store N write N writeop N]
return [format_props $symname $names]
}
# Display ACSTB analysis
proc display_acstb {symname} {
set names [list sweep N probe N localgnd N from N to N step N mode N points N values N nodeset SG store N write N writeop N]
return [format_props $symname $names]
}
# Display NOISE analysis
proc display_noise {symname} {
set names [list sweep N outp N outn N in N from N to N step N mode N points N values N ptssum N nodeset SG store N write N writeop N]
@ -385,6 +391,13 @@ proc format_analysis_acxf_spectre {name} {
return [list "analysis $name acxf [parenthesize $args]" ""]
}
proc format_analysis_acstb_spectre {name} {
set args "[format_args $name [list probe N localgnd N]] "
append args "[format_sweep_spectre_range $name] "
append args [format_args $name [list nodeset N store N write N writeop N]]
return [list "analysis $name acstb [parenthesize $args]" ""]
}
proc format_analysis_noise_spectre {name} {
set args "out=[format_signal_output_spectre $name] "
append args "[format_args $name [list in N]] "
@ -585,6 +598,10 @@ proc format_analysis_acxf_spice {name} {
error "acxf is not supported by Ngspice"
}
proc format_analysis_acstb_spice {name} {
error "acstb is not supported by Ngspice"
}
proc format_analysis_noise_spice {name} {
set output "[format_signal_output_spice $name]"
set swp "[format_sweep_spice_range true $name]"