I have an extracted spice file that has like 40 pi...
# xschem
t
I have an extracted spice file that has like 40 pins and trying to create that using https://xschem.sourceforge.io/stefan/xschem_man/tutorial_create_symbol.html seem like it would take me forever.
s
@tnt one problem with spice files is that a spice netlist does not provide any information about the direction of pins. CDL netlists in some cases provide this info as commented metadata, like:
.subckt tt_asw_1v8 VPWR ctrl mod bus VGND
`.PININFO VPWR:B VGND:B mod:B bus:B ctrl:I`*
XM4 tgon tgon_n VGND VGND sky130_fd_pr__nfet_01v8 L=0.15 W=1.5 nf=1 m=1
XM3 tgon tgon_n VPWR VPWR sky130_fd_pr__pfet_01v8 L=0.15 W=3 nf=2 m=1
XM2 tgon_n ctrl VGND VGND sky130_fd_pr__nfet_01v8 L=0.15 W=1.5 nf=1 m=1
XM1 tgon_n ctrl VPWR VPWR sky130_fd_pr__pfet_01v8 L=0.15 W=3 nf=2 m=1
XM6 bus tgon mod VGND sky130_fd_pr__nfet_01v8_lvt L=0.5 W='12 * 4 ' nf=4 m=1
XM5 bus tgon_n mod VPWR sky130_fd_pr__pfet_01v8_lvt L=0.5 W='21 * 7 ' nf=7 m=1
.ends
in the xschem installation (
.../share/xschem/make_sym_from_spice.awk
) there is a script. Given a spice netlist containing one or more subckts it will create the related sym files:
.../.../make_sym_from_spice.awk opamp.spice
if
opamp.spice
contains an
opamp
subcircuit a
opamp.sym
file will be created. However if netlist does not provide information on pin direction the symbols will be generated with all ports declared as '`inout`' and all on the right. You can quickly edit the symbol to reposition pins. see short video.
1