Posted to sci.electronics.design,alt.binaries.schematics.electronic,sci.electronics.cad,sci.electronics.basics
|
|
Interesting Spice Netlisting Quirk
Jim Thompson wrote:
This time I'll try not to hit "Send" before I enter some content :-(
In developing Spice models/subcircuits it's useful to include within
the subcircuit declaration the models used.
But if you add a line to your development schematic...
.MODEL D D
It doesn't appear in the netlist, it appears in the .CIR file (this
applies to all Berkeley-adhering Spices, but not to LTspice... LTspice
doesn't use a .CIR file, and the .NET file doesn't function quite the
same way: .NET is more like a .CIR file, everything is in it,
components _and_ test bench, and only exists after a "Run").
Appearing in the .CIR requires going back and manually adding whatever
models you want included to your distribution subcircuit.
Anything manual is a nuisance as well as a possible source of error.
Experimenting I found that creating a part with a two-line "template"
(PSpice speak ...
** Force Text **
TEXT
causes it to appear in the .NET file exactly like that. Make text...
.MODEL D D
In the netlist, voila, it appears as...
** Force Text **
.MODEL D D
in spite of (in LTspice speak), .MODEL is a "Spice directive"
So I've invented the "dual" of what I devised many years ago where I
wanted to force non-circuit (e.g., test bench) elements out of the
netlist into the .CIR file, I did this "template"...
.INC "C:\PSpice\DeviceLib\Spacer.txt"
Test Bench Element 1
Test Bench Element 2
Test Bench Element 3
| | |
(Taking advantage that "Spice directives" go into the .CIR file,
_unless_ you do the "Force Text" scheme.
...Jim Thompson
Much better..
|