Harald Pretl
11/02/2023, 3:21 PMStefan Schippers
11/02/2023, 4:32 PMinout
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:
.subckt mos_power_ampli PLUS VNN OUT MINUS VSS VPP
*.PININFO PLUS:I VNN:I OUT:O MINUS:I VSS:I VPP:I
...
...
.ends
Harald Pretl
11/02/2023, 5:02 PM.PININFO
to the SPICE netlist, how can I do this in xschem
?Stefan Schippers
11/02/2023, 6:54 PM./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):
inherited_pin["VGND"]=1
inherited_pin["VPWR"]=1
inherited_pin["VNB"]=1
inherited_pin["VPB"]=1
Harald Pretl
11/02/2023, 8:33 PMKrzysztof Herman
11/02/2023, 8:45 PMHarald Pretl
11/02/2023, 8:57 PMStefan Schippers
11/02/2023, 10:00 PMKrzysztof Herman
11/03/2023, 8:51 AMKrzysztof Herman
11/03/2023, 8:54 AMHarald Pretl
11/03/2023, 8:56 AMvks
03/05/2024, 11:43 AMvks
03/05/2024, 12:19 PMStefan Schippers
03/05/2024, 1:20 PMvks
03/05/2024, 4:01 PMStefan Schippers
03/05/2024, 4:35 PMsubckt .... / .ends.
However letting xschem generate the .subckt /.ends lines will ensure that port order matches between instance line and subckt definition.Stefan Schippers
03/05/2024, 5:32 PMvks
03/06/2024, 9:00 AMctrl + H
?Stefan Schippers
03/06/2024, 3:35 PMCtrl-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.