0
\$\begingroup\$

I am trying to port a behavioral device model from Cadence Spectre to Spice. In Spectre it is very easy to instantiate multiple parallel instances of a subcircuit automatically - one just calls the subcircuit - an it works for any subcircuit - with an M factor. I have seen that Spice has this functionality for some components - e.g. capacitors, but I could not find anywhere any documentation on how to do it for my on subcircuits. Does anyone know if it is is possible in Spice and how to enable multiplicity in subcircuits?

\$\endgroup\$
1
\$\begingroup\$

That m is nothing but a convenient shortcut to adding several subcircuits/symbols in parallel. Internally, that's how the circuit is expanded/flattened. If your simulator doesn't have this option, then about the only alternative is to simply add, possibly ad nauseam, several subcircuits and connect them all in parallel. I don't know if m can be a float (as opposed to an int), but if so, then, obviously, you'll have to restrict yourself to a fixed number of subcircuits.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

I figured out how it works in Spice. Some Spice implementations, like LTSpice don't seem to have native support for subcircuit multiplicity, and some like ngspice do (see section 3.2 of ngspice v32 manual). This means that for a portable model the multiplicity in the subcircuit has to be implemented like in e.g. a Verilog-A module - explicitly in your model. In the end the multiplicity factor "m" becomes just a parameter of the model.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ It's possible that m is a reserved keyword. In LTspice it isn't, since both m, and n (which denotes the series multiplier for some elements), can be valid variables, and so they are not restricted. If you think this is the answer to your question, mark it down so that others, in the future, searching for similar problems, will see this answer with an accepted answer. \$\endgroup\$ – a concerned citizen Aug 10 at 9:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.