<@U01819B63HP> I know one can create a symbol from a schematic, but can one also automatically creat...
h
@Stefan Schippers I know one can create a symbol from a schematic, but can one also automatically create a symbol from a SPICE netlist?
👀 1
s
Creating a symbol from a textual netlist description is easy, however spice netlists lack in general the direction of pins, so a symbol could be created assuming
inout
type for all ports. It is possible to create a correct symbol from a CDL netlist with the
*.PININFO
metadata. These are additional lines placed after a .SUBCKT definition specifying the direction of pins:
Copy code
.subckt mos_power_ampli PLUS VNN OUT MINUS VSS VPP
*.PININFO PLUS:I VNN:I OUT:O MINUS:I VSS:I VPP:I
...
...
.ends
h
@Stefan Schippers OK, so assuming I add the
.PININFO
to the SPICE netlist, how can I do this in
xschem
?
s
This script can do the translation:
./make_sym_from_spice.awk netlist.cdl
I have tested it on the whole standard cell cdl netlist:
./make_sym_from_spice.awk sky130_fd_sc_hd.cdl
, and it produced 437 symbols. Image below shows the result for
sky130_fd_sc_hd__dfrbp_1.sym
. There are 4 lines at the beginning of the script with a list of pins that should not be generated in the symbol but kepts as attributes (typically done for power ports in standard cells):
Copy code
inherited_pin["VGND"]=1
  inherited_pin["VPWR"]=1
  inherited_pin["VNB"]=1
  inherited_pin["VPB"]=1
h
@Krzysztof Herman Maybe very interesting for you…
k
@Harald Pretl @Stefan Schippers looks great, tomorrow I will give it a try. By the way have you tried Digital (yes the name is not so fortune) https://github.com/hneemann/Digital but it is a Digital logic simulator that is kind of continuation of Logisim and Logisim-Evolution. It is something I consider valuable, especially thinking about tools for high-school students.
h
@Krzysztof Herman I was not aware of Digital.
s
Digital has a very nice graphic output. Some "educational" logic simulation capabilities are also present in Xschem. This feature came almost for free when I was developing the net highlight / tracer.
k
@Stefan Schippers thank you for this video, I have not known those features of xschem. Great job !
@Harald Pretl maybe it is a good idea to include Digital in your Docker. I will have a meeting with the developer next Monday to see if it is possible to chain it with yosys and OpenROAD/OpenLANE.
h
@Krzysztof Herman definitely an option, let me know how the discussion goes.
👍 1
v
Hello @Stefan Schippers , What is the best option to use separate symbol for pex simulation ? Pex netlist can be attached to this symbol to be used for pex simulation only without modifying original schematic symbol. Any option to generate multiple symbol for same schematic where one of the symbol can be used for pex simulation?
@Stefan Schippers Facing some issue with symbol for pex simulation. Subcircuit definition is not getting generated as seen in attached steps.
s
@vks, may be the following video shows the best option for you.
👍 1
v
Thanks @Stefan Schippers this is what I wanted. Will implement it tomorrow.
s
@vks it is strange your pex netlist is not itself enclosed into a .
subckt ....  / .ends.
However letting xschem generate the .subckt /.ends lines will ensure that port order matches between instance line and subckt definition.
@vks an even easier method to simulate a pex netlist is shown in this second video. In this case you don't even need to create a schematic. Just add tome attributes to the instance.
@vks see a more detailed video on youtube:

https://www.youtube.com/watch?v=zs6JPXk074c

👍 1
v
Thanks @Stefan Schippers this was quite useful. But I am not able to see pex netlist attached to symbol by pressing
ctrl + H
?
s
Ctrl-h
will execute the
tclcommand
attribute on the instance if it exists. to view a file add this:
tclcommand="textwindow [abs_sym_path pex_netlist.cir]"
you can give the full path, if you prefer:
tclcommand="textwindow  /path of/pex_netlist.cir"
the command
[abs_sym_path pex_netlist.cir]
will calculate the full path of
pex_netlist.cir
if it can be found by xschem in one of the directories listed in
XSCHEM_LIBRARY_PATH
. This approach is more portable since you dont specify absolute pathnames in the schematic.
👍 1