From 68359d9cebd78a14e45b65351ac19a74e7e01d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rp=C3=A1d=20B=C5=B1rmen?= Date: Tue, 7 Apr 2026 09:58:04 +0200 Subject: [PATCH] acsp symbol added. --- xschem_library/analyses/README.md | 1 + xschem_library/analyses/acsp.sym | 53 ++++++++++++++++++++++++++++ xschem_library/analyses/demo.sch | 22 ++++++++++-- xschem_library/analyses/lib_init.tcl | 17 +++++++++ 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 xschem_library/analyses/acsp.sym diff --git a/xschem_library/analyses/README.md b/xschem_library/analyses/README.md index 96959a45..9883b391 100644 --- a/xschem_library/analyses/README.md +++ b/xschem_library/analyses/README.md @@ -38,6 +38,7 @@ The following analyses are supported |ac.sym |small signal ac |ac |ac | |acxf.sym |small signal ac transfer function |acxf |- | |acstb.sym |small signal ac stability |acstb |- | +|acsp.sym |small signal ac S-parameters |acsp |- | |noise.sym |small signal noise |noise |noise | |tran.sym |transient |tran |tran | |hb.sym |harmonc balance |hb |- | diff --git a/xschem_library/analyses/acsp.sym b/xschem_library/analyses/acsp.sym new file mode 100644 index 00000000..73d95e4b --- /dev/null +++ b/xschem_library/analyses/acsp.sym @@ -0,0 +1,53 @@ +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_acsp +template="name=acsp1 +only_toplevel=false +order=\\"\\" +sweep=\\"\\" +ports=\\"[\\\\\\"v1\\\\\\",\\\\\\"r1\\\\\\"]\\" +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 SP} 5 -20 0 0 0.3 0.3 {} +T {tcleval([ ::analyses::display_acsp @name ])} 5 50 0 0 0.3 0.3 {} +T {tcleval([ ::analyses::display_order @name ])} 5 0 0 0 0.3 0.3 {} diff --git a/xschem_library/analyses/demo.sch b/xschem_library/analyses/demo.sch index 0227ee8f..70233eb6 100644 --- a/xschem_library/analyses/demo.sch +++ b/xschem_library/analyses/demo.sch @@ -160,7 +160,7 @@ writeop="" } C {noise.sym} 1190 1120 0 0 {name=noise1 only_toplevel=false -order="10" +order="11" sweep="" outp="\\"out\\"" outn="" @@ -179,7 +179,7 @@ writeop="" } C {hb.sym} 1190 1370 0 0 {name=hb1 only_toplevel=false -order="11" +order="12" sweep="" freq=[100k] nharm=10 @@ -196,7 +196,7 @@ write="" } C {postproc.sym} 1190 1560 0 0 {name=postproc1 only_toplevel=false -order="12" +order="20" tool="PYTHON" file="\\"script.py\\"" } @@ -227,3 +227,19 @@ store="" write="" writeop="" } +C {acsp.sym} 960 1530 0 0 {name=acsp1 +only_toplevel=false +order="10" +sweep="" +ports="[\\"v1\\", \\"r1\\"]" +from=10 +to=100k +step="" +mode="\\"dec\\"" +points="10" +values="" +nodeset="" +store="" +write="" +writeop="" +} diff --git a/xschem_library/analyses/lib_init.tcl b/xschem_library/analyses/lib_init.tcl index 8f97b75b..74aab759 100644 --- a/xschem_library/analyses/lib_init.tcl +++ b/xschem_library/analyses/lib_init.tcl @@ -169,6 +169,12 @@ proc display_acstb {symname} { return [format_props $symname $names] } +# Display ACSP analysis +proc display_acsp {symname} { + set names [list sweep N ports 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] @@ -398,6 +404,13 @@ proc format_analysis_acstb_spectre {name} { return [list "analysis $name acstb [parenthesize $args]" ""] } +proc format_analysis_acsp_spectre {name} { + set args "[format_args $name [list ports 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 acsp [parenthesize $args]" ""] +} + proc format_analysis_noise_spectre {name} { set args "out=[format_signal_output_spectre $name] " append args "[format_args $name [list in N]] " @@ -602,6 +615,10 @@ proc format_analysis_acstb_spice {name} { error "acstb is not supported by Ngspice" } +proc format_analysis_acsp_spice {name} { + error "acsp 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]"