Parsing of multi parameter fails for the Coupled Multiconductor Line (CPL)
Description
I'm simulating the effects of coupled multilines as intended in the following schematic:
For this I created a subcircuit file called "cpl_subc.lib" for the Coupled Multiconductor Line (CPL) as follows:
.subckt PLINE_SUBCIRUIT in1 in2 gnd1 out1 out2 gnd2 length=75.75m R11=0 R12=0 R22=0 L11=165n L12=82.5n L22=165n G11=0 G12=0 G22=0 C11=66p C12=33p C22=66p
.model PLINE CPL length={length} C={C11}{C12}{C22} L={L11}{L12}{L22} G={G11}{G12}{G22} R={R11}{R12}{R22}
P1 in1 in2 gnd1 out1 out2 gnd2 PLINE
.ends
and stumbled on following issue.
I see that the problem occures during parsing of multi parameter lines like for example "C={C11}{C12}{C22}" and following parameters.
No problems occure when I copy the KiCAD netlist into a file and simulate it directly with ngspice. Then I see properly:
Steps to reproduce
Attached is the KiCAD project and a ngspice folder demonstrating the problem.
KiCAD with error:
- open the KiCAD project
- open the schematic
- double click on T1 for the properties
- click in "Simulation Model..."
- the error message as shown above is generated.
ngspice:
- go to folder "ngspice_working"
- call ngspice by "ngspice clp.net"
- call ngspice command "tran 100p 200n"
- call ngspice command "plot v(Net-R3-Pad1)"
- call ngspice command "plot v(Net-R2-Pad1)"
Please note that in both cases the same file "cpl_subc.lib" is called (relative path in the "ngspice clp.net" file is one of the necessary modifications to the KiCAD spice netlist)
The ngspice version I used was:
******
** ngspice-42 : Circuit level simulation program
** Compiled with KLU Direct Linear Solver
** The U. C. Berkeley CAD Group
** Copyright 1985-1994, Regents of the University of California.
** Copyright 2001-2023, The ngspice team.
** Please get your ngspice manual from https://ngspice.sourceforge.io/docs.html
** Please file your bug-reports at http://ngspice.sourceforge.net/bugrep.html
** Creation Date: Fri Dec 29 00:00:00 UTC 2023
******\
And my system looks like follows:
OS: Linux version 6.8.6-200.fc39.x86_64 (mockbuild@123c7438b1ed42b3b926d06cfeba7397) (gcc (GCC) 13.2.1 20240316 (Red Hat 13.2.1-7), GNU ld version 2.40-14.fc39) #1 SMP PREEMPT_DYNAMIC Sat Apr 13 15:14:23 UTC 2024\
CPU: AMD Ryzen 9 7945HX with Radeon Graphics
Physical processors: 1, Logical processors: 32
Total DRAM available = 31289.144531 MB.
DRAM currently available = 20671.250000 MB.
KiCad Version
Application: KiCad Schematic Editor x86_64 on x86_64[CPL_example.zip](/uploads/9163fa49c08289be4c2642d10b6665b9/CPL_example.zip)
Version: 8.0.1, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.13.2
HarfBuzz 8.1.1
FontConfig 2.15.0
Platform: Freedesktop SDK 23.08 (Flatpak runtime), 64 bit, Little endian, wxGTK, X11, gnome, x11
wxWidgets: 3.2.4 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.84.0
OCC: 7.7.2
Curl: 8.6.0-DEV
ngspice: 42
Compiler: GCC 13.2.0 with C++ ABI 1018
Build settings: