0
\$\begingroup\$

This spice file

.include ntyp.md
.include ptyp.md

vvdd VDD GND_ 5
vgnd GND_ 0 0

vin IN GND_ pwl(0 0 100n 0 101n 5 200n 5 201n 0 300n 0 301n 5 400n 5)
.tran 1p 400n
.print tran v(IN) v(OUT)

M1 OUT IN GND_ GND_ EN l=5e-07 w=1.2e-06  $ (44 7.4 44.5 8.6)
M2 OUT IN VDD VDD EP l=5e-07 w=2.4e-06  $ (44 12.1 44.5 14.5)

gives the error unknown parameter ($) when I run it locally. I've tried this on AIM-spice and LTspice. However, when another person runs the same code on another computer it doesn't give this error. ntyp.md & ptype.md are located in the same folder as the spice file. I also tried an absolute path to no avail.

What am I doing wrong?

\$\endgroup\$
15
  • \$\begingroup\$ not all spice dialects are created equally \$\endgroup\$ – PlasmaHH May 28 '18 at 9:59
  • \$\begingroup\$ This spice was automatically generated by means of a L-edit extract. How would I know the "dialect" I extracted it to and how to run it? \$\endgroup\$ – Runge Kutta May 28 '18 at 10:00
  • \$\begingroup\$ read the documentation of whatever software you used to create it. \$\endgroup\$ – PlasmaHH May 28 '18 at 10:03
  • \$\begingroup\$ L-edit documentation seems to be non-existing. \$\endgroup\$ – Runge Kutta May 28 '18 at 10:05
  • \$\begingroup\$ In the M1 and M2 lines (last two) you have that sign. If it's meant to be a comment or some sort, then LTspice only accepts ; or * (I think also #, not sure now). Solution: simply replace the offending character. Else, if they're meant to be parameters, then they're missing their designator (i.e. Vto=1.5, instead of simply 1.5), otherwise I have no idea what they're meant to represent. \$\endgroup\$ – a concerned citizen May 28 '18 at 10:25
1
\$\begingroup\$

In LTspice, $ has a special significance which is not related to comments. The only availabel characters for comments are ; and * (it seems also #). The rest following the $ char in your code is not a valid SPICE syntax, so you could try to replace $ with one of the aforementioned allowed characters, to comment the rest.

One other thing: .plot in LTspice doesn't do what you want, so if you want traces to be automatically plotted, one way to do it is to run the simulation (no need to fully run it, in case it takes hours or so), plot the desired waveforms, then activate the waveform viewer by L-Click on it and then either choose File > Save, or click on the Save icon on the toolbar. This will create an additional .plt file, holding the plot settings. From now on, whenever you first simulate the schematic, or when you open up the waveform viewer, the saved traces will be displayed.

\$\endgroup\$

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.