Parameterized symbol for child schematic

Hi,
I was trying to recreate the following, in QSPICE, that one can do in LTspice as follows:

A1) Make circuit with parameters initialized to some value [ See A2.png ], encapsulate it [ NOT its netlist, as one does in defining a .subckt ] into a symbol, and then use multiple instances of the same child circuit by assigning different values to parameters.

See how X1, X2 are two instances of same circuit, and how one can “see the underlying circuit” by clicking on “Open Schematic”, [ as seen in the figure below ]and how one can provide values to parameters of X2 [ as shown in the figure above ]. X1 continues to run on default parameters.

Please note that I want to “see underlying circuit”, and not its netlist. Needless to say, the two instances are now configured to work on the same underlying circuit with different parameter values as one can see in the figure below:

B1) Now, coming to QSPICE, if I re-create the circuit:


and autogenerate its symbol and edit the symbol [ leaving the symbol type blank ]:

. Now, comes the problem: On right clicking X2, I see no option to assign parameters to this instance. All that one could do is to assign new values to child circuit. But that would change both X1, X2.
A6
Needless to say, X1, X2 are NOT two different instances of same underlying circuit. Yes, thanks to @KSKelvin, I know the procedure to solve this issue using parameterized subcircuit. But I want to “see underlying circuit” as one can in LTspice.

It would be great if someone could show me a way to provide new parameters to X2 while keeping X1 on default parameters.

Thanks in advance.

In Qspice, this is handled with Attribute (Instance Parameter)
Right click on hierarchy symbol > Add New Attribute
This method can work with hierarchy or sub-circuit symbol.
Is this what you looking for?

Parent.param-child.qsch (1.9 KB)
param-child.qsch (1.4 KB)

Oh! Ok. I forgot this “trick” in QSPICE. Thanks a lot @KSKelvin.

1 Like

Edit the symbol to contain all the desired parameters with defaults. Using the text attributes (see Keyboard Shortcuts/Programming Text Attributes) to set default values, types, ranges, and descriptions for comments. When the symbol is placed, the text attributes for each instance can be easily changed and are obvious to the casual observer. Note that subcircuits are hierarchical blocks are implemented as a single instance in the netlist, while symbols are repeated for each instance.

Later,
Carl
coax.qsym (11.2 KB)

Yes, this is another way. Thank you very much, @carlvanwormer for taking pains to illustrate this method by sharing this symbol.