¿ªÔÆÌåÓý

Re: How to Set Up Permanent UniversalOpamp Doppelganger


 
Edited

On Sun, Feb 9, 2025 at 07:15 PM, eewiz wrote:
I have looked at manufacturer's .subckt code for decades going as far back as the scad3 days.
I don't remember ever seeing a .lib statement in the body of a .subckt definition.
It's unlikely (but not impossible) that a manufacturer's SPICE model includes .INC or .LIB commands, for the simple reason that they want their SPICE models to be all in one place.? You would use an .INC or .LIB command when there is more "stuff" that is in another file.? They try to simplify by having everything in one file where they can't end up separated.
?
An exception I've seen is when process models are in a file separate from the rest of the subcircuit -- especially when there are different process models for the process corners (Fast, Nominal, Slow), but the main part of the subcircuit model is fixed and does not depend on process corner.? I see that a lot with some BSIM and FinFET models.
?
For example, a typical subckt (abbreviated):
.SUBCKT MYSUB? 1 2 3 4 5
? ...
? QX ?? 1 3? 5 QIN
? .MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
? ...
.ENDS
QIN is home-rolled in a .model statement right there inside the subckt.
?
I have never seen anyone do this using a factory-rolled part.
.SUBCKT MYSUB? 1 2 3 4 5
? ...
? QX ?? 1 3? 5 MMBT3906
? ...
.ENDS
I venture to say that you probably have seen them in factory-rolled part models.? I see that kind of thing a lot.
?
Bear in mind that "QX" is no different than "Q1" or "Q004".? So you likely might have seen something like this:
? Q1? ? 1 3? 5 QIN
? .MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
...
? Q2? ? 1 3? 5 MMBT3906
which is no different than using "QX" or "QY" or "Qfoobar".
?
The Q-thing is the element name in the SPICE netlist.? Any netlist line starting with Q is a bipolar transistor.? If a SPICE model has bipolar transistors in it, and if those bipolar transistors were intrinsic SPICE models (not other subckts),?then you surely did see them.? They are no different than resistors, capacitors, and so on.? I think you saw them but did not realize it.
?
Andy
?

Join [email protected] to automatically receive all group messages.