Open or Convert an LTspice Schematic?

Can QSPICE provide any assistance to convert an LTspice schematic so it can be opened in QSPICE?
Especially hierarchical schematics.

Thank You

2 Likes

I was able to copy the netlist (subckt) of a hierarchial schemtics and simulate in QSPICE.

If you go that way you probably can too.

Akillion, thanks for the reply.

This did not work for me.
I opened my project in LTspice and simulated.
I copied the net list that LTSPICE created and renamed it from Sch.net to Sch.qsch.

In the file is:

.subckt drv8876 CPH CPL EN_IN1 VGND IMODE IPROPI nFAULT nSLEEP OUT1 OUT2 PGND PAD PH_IN2 PMODE VCP VM_Pin VREF
BE_U_ISENSE_ABM1 0 U_ISENSE_N246869 I=IF ((V(IMON1)+V(IMON2))>{ILIM}, 1, 0) Rpar=1 Cpar=1n
... More Code
XDRV8876_PMODE_PIN PMODE U_LOGIC_PH_EN_D U_LOGIC_HALF_BRDG_D U_LOGIC_PWM_D U_LOGIC_TSLEEP_OK drv8876_pmode_pin
XDRV8876_IMODE_PIN IMODE U_LOGIC_LATCH_D U_LOGIC_FIXOFF_D U_LOGIC_RETRY_D U_LOGIC_CBC_D U_LOGIC_TSLEEP_OK drv8876_imode_pin
XDRV8876_OUT_1 VM_UV_OK PRE_HS1 PRE_LS1 VM U_ISENSE_CUR_TRIP U_ISENSE_LIM_CUR1_BUF IMON1 N001 drv8876_out_pin
XDRV8876_OUT_2 VM_UV_OK PRE_HS2 PRE_LS2 VM U_ISENSE_CUR_TRIP U_ISENSE_LIM_CUR2_BUF IMON2 N002 drv8876_out_pin
.ends drv8876

.subckt drv8876_pmode_pin PMODE U_LOGIC_PH_EN_D U_LOGIC_HALF_D U_LOGIC_PWM_D U_LOGIC_TSLP_OK
R_R1 0 PMODE 44k TC=0,0
... More Code
.model DRV88xx D(is=1e-15 n=1 tt=1e-11)
.ends drv8876_pmode_pin

.subckt drv8876_imode_pin IMODE U_LOGIC_LATCH_D U_LOGIC_FIXOF_D U_LOGIC_RETRY_D U_LOGIC_CBC_D U_LOGIC_TSLP_OK
R_R1 0 IMODE 136k TC=0,0
... More Code
.model DRV88xx D(is=1e-15 n=1 tt=1e-11)
.ends drv8876_imode_pin

.subckt drv8876_out_pin VM_UV_OK PRE_HS PRE_LS VM U_ISENSE_CUR_TRIP U_ISENSE_LIM_CUR IMON OUTPUT
BG_U_MOS_ABMII2 U_MOS_GATE1 OUTPUT I=IF (V(HS)>0.3 & V(VM_UV_OK)>0.5, 0,100m)
... More Code
.MODEL SW_U_MOS_GATE_L VSWITCH Roff=100 Ron=1G Vt=0.3 Vh=-0.1
.ends drv8876_out_pin

.model D D
.lib C:\Users\eewiz\AppData\Local\LTspice\lib\cmp\standard.dio
.model NMOS NMOS
.model PMOS PMOS
.lib C:\Users\eewiz\AppData\Local\LTspice\lib\cmp\standard.mos
.backanno
.end

I double-click the Sch.qsch file and QSPICE opens but does nothing.
Nothing appears in the drawing window.
QSPICE say’s nothing, no warning, no error, just a blank drawing window.

All for now

I remember I had some problems too, but in my case I had previously converted a hierarchial block to a subckt in Ltspice created a symbol for it and debugded it there.
Today when I got the QSPICE beta invite I did just copied that debugd subckt created for a hierarchial block within LTspice and it worked.

Maybe you could also try making the subckt extracted from the netlist work in LTspice before moving it too QSPICE aswell? There is more documentation avalible on how to debug for LTspice.

Akillion said:
I remember I had some problems too, but in my case I had previously converted a
hierarchial block to a subckt in Ltspice created a symbol for it and debugded it there.

It sounds like you’re describing conversion of a hierarchical schematic to a text-based spice model before attempting to use it in QSPICE.
At this point I will assume that QSPICEhas no issue with using text-based spice models.

My question was about conversion of LTspice .asc files to QSPICE .qsch files.
LTspice schematic files contain data such as:

Version 4
SHEET 1 10780 25256
WIRE 1024 -5488 720 -5488
... More Wires
WIRE 1120 -5488 1024 -5488
FLAG 1008 -2032 0
IOPIN 720 -3968 BiDir
... More Flags and IOPINS
FLAG 720 -3856 CPH
IOPIN 720 -3856 BiDir
SYMBOL and 6944 -4320 R0
WINDOW 0 -51 16 Left 0
WINDOW 3 -56 107 Left 0
SYMATTR InstName XUX_U_ISENSE_U10
... More Symbols

There is no marker of EOF.

A schematic in any SPICE program has nothing to do with a SPICE netlist except that it is the top level instruction that a SPICE program uses to create a net list to feed to it’s SPICE engine.

I need to convert an LTspice SCHEMATIC to a QSPICE SCHEMATIC.
Wires, flags, symbols, etc… to appear in the drawing window.
I admit that many symbols may not be available, models may not be findable, etc…
But I need a schematic with all of these issues apparent to begin to eliminate those issues.
I probably will do very little with QSPICE if I have to re-draw by hand any of my many LTspice schematics to use them in QSPICE.

All for now

Good day.

How can I simply import LTSpice schematics into Qspice???

I want to take existing LTSpice schematics and open them and run them in Qspice. I do not want to redo all of my LTSpice schematics.

Michael

2 Likes

I think KiCad 7.99 supports importing of some LTspice files. Maybe you can use it to generate a netlist and call QSPICE with it (using menu File → Export → Netlist… → Add Generator…).

1 Like

You can netlist the schema using the extended output to the output log file. Then put a dedicated text netlist on the Qspice schema and do a simulation.

1 Like

I’m also having issues about converting things from LTspice to work in QSPICE, specifically schematics (.asc) and Symbols (.asy). I have some symbols that are based on schematics, and I have schematics that use these custom symbols. To get familiar with QSPICE, I thought it would be a good exercise to try and make them work.

So, as others have tried, in LTspice, it seems to recommend generating a netlist from a schematic (to start). I’ve never had the need to do this in LTspice before, so this is all new to me. What intrigues me is that you can do it in two ways:

  1. Under View, you can generate a SPICE netlist. Then, right click and either edit as independent netlist or Generate Expanded Listing.
  2. Under Tools, you can export a netlist for a bunch of other programs (yeah, this method got me some errors with the comments)

I used the second option, which may have been contributing to all my concerns thus far, but I wonder why the two options are so different.

Now, symbols from LTspice to QSPICE is tricky. From the looks of it, you’re going to have to recreate the symbol in QSPICE as a .QSYM file. At least this seems workable, provided that there’s no problem linking the corresponding schematic netlist as a library file associated with the symbol.

I’m still working on this, but I wanted to share what I’ve learned so far. Perhaps this may help others as well.

I wrote a comment below about what I’ve done, but I managed to generate a netlist with a “.end” thing at the end of my file. I saved the resulting netlist and managed to open it in QSPICE. With a slight modification, running it was no problem, though as a netlist, it simply ran with no graphs or anything remotely helpful.

Kind of defeats the purpose if you can’t see graphs, but perhaps I’m doing something wrong.

With a text netlist in QSPICE, did you just get text results, or was QSPICE able to generate graphs from your netlist simulation?

You just need to know the name of the output node. Then just add this signal to the plot window. You can just use the .plot command before the simulation.

One can run an LTspice XVII netlist (*.net) with Qspice. It is not so easy anymore as LTspice deliberately deletes netlists when you close it, however, conversion using the LTspice commandline interface still works. As Qspice is not 100% compatible with LTspice, and Qspice’s *.qraw files aren’t compatible with LTspice *.raw format, not everything / not much will work. I have high hopes this will change in the future.

-marcel

Someone needs to write a Python program to convert LTspice file to QSPICE file, even if it’s a rats nest

I believe your hopes are likely vain ones. I don’t see where the motivation would come from.