0
\$\begingroup\$

I am using NGspice to simulate circuit. As you may know, the netlist format in ngspice is cir.

The following is my simple circuit.

* Title: Simple attenuator circuit
* Netlist
V1 a 0 100V
R1 a b 10
R2 b 0 10
V2 b x 0V
R3 x 0 10

I have tried to use Qucs (use .sch format) and Kicad, however, neither of them support schematics in CIR format.

Here is what I got from Ltspice when opening in Ltspice.

enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ You could use microcap v12 archive.org/details/mc12cd_202110 and import netlist. Just rename your circuit *.ckt file and add some commands. Or use LTSpice analog.com/en/resources/design-tools-and-calculators/… \$\endgroup\$
    – Antonio51
    Commented Aug 4 at 9:47
  • \$\begingroup\$ @Antonio51 Ltspice will not work. See my screenshot. i.imgur.com/xEjYOeH.png \$\endgroup\$
    – kile
    Commented Aug 4 at 10:01
  • \$\begingroup\$ @kile I don't see any problems at all: LTspice. What's the difficulty? The schematic produces the exact same netlist, as you can see. The operating point for both (with and without the schematic) is the same. What's the problem? Are you hoping for some kind of automatic beautifier that will turn a netlist into a pretty, nice-looking schematic??? I hope not. That's not going to happen, easily. \$\endgroup\$ Commented Aug 4 at 10:14
  • \$\begingroup\$ @periblepsis Do you draw this schematics manually i.sstatic.net/vFK9Ewo7.png? As far as I know, ltspice uses .asc instead of .cir format. \$\endgroup\$
    – kile
    Commented Aug 4 at 10:19
  • \$\begingroup\$ @kile You can just paste the netlist into LTspice. Uses as a special key, then paste in the netlist and drop it into the schematic page (the .ASC.) It will work just fine. LTspice does NOT need a schematic. A netlist is sufficient. The .ASC file is just a bunch of lines of text. That's all. If you don't do a schematic (this is fine if you don't) and just paste in Spice commands as lines of text, it will work just fine for you. No problems. \$\endgroup\$ Commented Aug 4 at 10:21

1 Answer 1

3
\$\begingroup\$

Use:

enter image description here

This gives:

enter image description here

Then hit s as a key:

enter image description here

After dropping that into the page, you will see:

enter image description here

Now use right-click on your mouse:

enter image description here

And select Run to get:

enter image description here

If you just want the operating point, then select the DC op pnt tab. You will then see:

enter image description here

That's all there is to it.

If you would prefer to see .TRAN (transient) run, then select Transient, instead. However, in this case you will see a blank plot chart. Here, mouse over to the blank plot and right-click to see:

enter image description here

You can choose what to see from there.

LTspice only uses simple ASCII text lines for everything. The schematic is just a means to an end. It's pretty. But it is just a meaningless drawing. The real work ONLY occurs with the ASCII text lines. Not the pretty drawing picture, which is only for you as a human to view. Not for Spice to work with. It doesn't care about the pretty picture. Just the netlist.

Here's the automatically generated netlist from LTspice from a hand-drawn schematic:

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ Thanks, how do you have this i.imgur.com/NvAPFot.png? Do you manually draw this in LTspice? \$\endgroup\$
    – kile
    Commented Aug 4 at 10:33
  • \$\begingroup\$ @kile Yes, I just used my shoddy brain to draw that picture. LTspice will NOT generate that for you. If you want a pretty picture, then you have to draw it yourself. If you want nice pictures from complicated netlists, then you will need to develop an AI for that. Of course LTspice doesn't care. All it cares about is the netlist. \$\endgroup\$ Commented Aug 4 at 10:33
  • \$\begingroup\$ How do I know if these two (schematics and netlist cir) matches? Is there a way to automatically check them? \$\endgroup\$
    – kile
    Commented Aug 4 at 10:35
  • \$\begingroup\$ @kile Yes. If you draw out a schematic by hand and then ask LTspice for the netlist, you can examine the netlist by hand to see if it matches some netlist you already have. You will need to name the nodes, appropriately, of course. Otherwise LTspice will automatically give its own names to nodes that aren't named by you, by hand. The example I show in my answer provides your netlist to start. But it also shows the automatically generated LTspice netlist, too. Just look there. I made sure they matched up. And they did, without any help from me. Just worked out perfectly. I'll add the pic. \$\endgroup\$ Commented Aug 4 at 10:36
  • \$\begingroup\$ @kile Added the final example. Note that it is identical, except that it adds the .end and the .backanno. \$\endgroup\$ Commented Aug 4 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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