Post Go back to editing

bug with parameter passing in nested subcircuits

Thread Summary

The user reported a bug in LTspice where passing parameters to nested subcircuits fails, causing a 'Can't resolve .param' warning. The final answer confirmed it as a bug and stated that a fix is in development. QSPICE, while handling this correctly, has other issues such as inaccessible internal nodes and flattened netlists.
AI Generated Content
Category: Software
Software Version: latest

Hello,

there is a bug with parameter passing in nested subcircuits.

It is not limited to the netlist form, but to provide the minimal problem I have used the netlist below.

For the problem see the comment below.

.subckt top params: V=1
V1 1 0 {V}
.ends top

.subckt sub params: V=1

* passing parameter, working ok
V1 1 0 {V}

.subckt nested params: V=1
V1 1 0 {V}
.ends nested

* top level with parameter passing, working ok
X1 top params: V={V}

* nested with default parameter, working ok
X2 nested

* nested with fixed parameter, working ok
X3 nested params: V=2

***************************************************
********************bug in LTspice********************
* QSPICE has no problems with that (but other problems)
***************************************************
* nested with parameter passing, not working ok
* => WARNING: Can't resolve .param v=v
X4 nested params: V={V}
***************************************************

.ends sub

.op

X1 sub params: V=1

I tested it with QSPICE also and it has no problem here (but another).

problem-nested_subckt_parameter.asc