How do I convert LTSpice netlist/asc to a pcb-lesstif netlist?

Oct 30, 2015 8 Replies

I've just found myself hand-copying a circuit from ltspice to gschem again for use with pcb. Is this really necessary or can it be automated? I don't actually need the gschem schematic either... What's the `proper' way to do that? Has anyone got a script or sthg for that? I've found only a tutorial for something called freePCB using LTSpices' PADS export, but that doesn't seem to work for pcb-lesstif. Any other export format I want to try? There's quite a few.. I don't wanna go thru all of them myself.



Then why do you want to do that?

It's probably hopeless. Spice isn't aware of the PCB parts library or symbols or footprints or pinouts.

because gsch2pcb

There may be ways...

It's far from hopeless if you know the format for pcb. Actually there is a commonly used format called PADS from a commercial package. While searching for this name I also found a converter program that may help you... gnetlist I'll let you look it up to see if it will convert for you.

Push come to shove you can figure out what formats your layout program will import you can write a program to convert from the simple LTspice format. Forth is a great language for this.

Rick

Sounds like a compound nightmare.

John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com

Thanks, that was what I was looking for...

PCB's netlist format is pretty trivial, but using it to import designs... there's a better way :-)

PCB has File->Import option that reads a script that builds the design by specifying all the footprints required, the netlist, and the attributes for everything. It's a plain text file made up of "actions" (pcb functions) which are documented in the PCB manual. You can hook the File->Import button to a Makefile if you want to import from something other than gschem.

PCB's manual is at

formatting link
(look for the "Action Reference" section, the Import() action)

I'll add a sample script from my "rainbow LED" project for reference.

formatting link
(all the nets are unnamed in this project, hence the "unnamed_netN" instead of names like "GND" or "VCC" :)

Netlist(Freeze) Netlist(Clear) Netlist(Add,unnamed_net12,LED8-2) Netlist(Add,unnamed_net12,TMINUS-1) Netlist(Add,unnamed_net12,LED7-2) Netlist(Add,unnamed_net11,LED7-1) Netlist(Add,unnamed_net11,LED6-2) Netlist(Add,unnamed_net10,R2-1) Netlist(Add,unnamed_net10,U2-7) Netlist(Add,unnamed_net10,U2-6) Netlist(Add,unnamed_net10,U2-3) Netlist(Add,unnamed_net10,U2-2) Netlist(Add,unnamed_net9,LED6-1) Netlist(Add,unnamed_net9,LED5-2) Netlist(Add,unnamed_net8,LED5-1) Netlist(Add,unnamed_net8,LED4-2) Netlist(Add,unnamed_net7,U2-4) Netlist(Add,unnamed_net7,R2-2) Netlist(Add,unnamed_net7,LED4-1) Netlist(Add,unnamed_net6,LED8-1) Netlist(Add,unnamed_net6,LED3-2) Netlist(Add,unnamed_net5,LED3-1) Netlist(Add,unnamed_net5,LED2-2) Netlist(Add,unnamed_net4,TPLUS-1) Netlist(Add,unnamed_net4,U2-1) Netlist(Add,unnamed_net4,U1-1) Netlist(Add,unnamed_net3,U1-7) Netlist(Add,unnamed_net3,U1-6) Netlist(Add,unnamed_net3,U1-3) Netlist(Add,unnamed_net3,U1-2) Netlist(Add,unnamed_net3,R1-1) Netlist(Add,unnamed_net2,LED2-1) Netlist(Add,unnamed_net2,LED1-2) Netlist(Add,unnamed_net1,U1-4) Netlist(Add,unnamed_net1,R1-2) Netlist(Add,unnamed_net1,LED1-1) Netlist(Sort) Netlist(Thaw) ElementList(Start) ElementList(Need,"R2","0603dj.fp","62") ElementSetAttr("R2","device","RESISTOR") ChangePinName("R2", 1, "1") ChangePinName("R2", 2, "2") ElementList(Need,"TMINUS","hole-43mil.fp","unknown") ElementSetAttr("TMINUS","device","terminal") ChangePinName("TMINUS", 1, "terminal") ElementList(Need,"TPLUS","hole-43mil.fp","unknown") ElementSetAttr("TPLUS","device","terminal") ChangePinName("TPLUS", 1, "terminal") ElementList(Need,"LED8","0603dj.fp","unknown") ElementSetAttr("LED8","device","LED") ChangePinName("LED8", 2, "K") ChangePinName("LED8", 1, "A") ElementList(Need,"LED7","0603dj.fp","unknown") ElementSetAttr("LED7","device","LED") ChangePinName("LED7", 2, "K") ChangePinName("LED7", 1, "A") ElementList(Need,"LED6","0603dj.fp","unknown") ElementSetAttr("LED6","device","LED") ChangePinName("LED6", 2, "K") ChangePinName("LED6", 1, "A") ElementList(Need,"U2","SO8","unknown") ChangePinName("U2", 7, "VOUT") ChangePinName("U2", 6, "VOUT") ChangePinName("U2", 4, "ADJ") ChangePinName("U2", 3, "VOUT") ChangePinName("U2", 2, "VOUT") ChangePinName("U2", 1, "VIN") ElementList(Need,"LED5","0603dj.fp","unknown") ElementSetAttr("LED5","device","LED") ChangePinName("LED5", 2, "K") ChangePinName("LED5", 1, "A") ElementList(Need,"LED4","0603dj.fp","unknown") ElementSetAttr("LED4","device","LED") ChangePinName("LED4", 2, "K") ChangePinName("LED4", 1, "A") ElementList(Need,"LED3","0603dj.fp","unknown") ElementSetAttr("LED3","device","LED") ChangePinName("LED3", 2, "K") ChangePinName("LED3", 1, "A") ElementList(Need,"LED2","0603dj.fp","unknown") ElementSetAttr("LED2","device","LED") ChangePinName("LED2", 2, "K") ChangePinName("LED2", 1, "A") ElementList(Need,"U1","SO8","unknown") ChangePinName("U1", 7, "VOUT") ChangePinName("U1", 6, "VOUT") ChangePinName("U1", 4, "ADJ") ChangePinName("U1", 3, "VOUT") ChangePinName("U1", 2, "VOUT") ChangePinName("U1", 1, "VIN") ElementList(Need,"R1","0603dj.fp","62") ElementSetAttr("R1","device","RESISTOR") ChangePinName("R1", 1, "1") ChangePinName("R1", 2, "2") ElementList(Need,"LED1","0603dj.fp","unknown") ElementSetAttr("LED1","device","LED") ChangePinName("LED1", 2, "K") ChangePinName("LED1", 1, "A") ElementList(Done)

This works too for importing LT-Spice .asc files into gschem .sym format:

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required