Has anyone tried using the stdcells in xschem/ngsp...
# ihp-sg13g2
b
Has anyone tried using the stdcells in xschem/ngspice simulations? The ports that xschem netlists do not seem to match the cell definitions in /foss/pdks/sg13g2/libs.ref/sg13g2_stdcell/spice/sg13g2_stdcell.spice. Perhaps I am doing something wrong or this is not meant to work yet...
m
^^ @Stefan Schippers
b
I don't think it's an Xschem issue, probably just a mismatch between the symbol and the spice library subcircuit definition.
m
@Boris Murmann where did the symbols for use in xschem come from?
Or, more precisely, the installation in Harald's container.
👍 1
m
Yep, the power definitions don’t match. The symbols netlist with separate source and bulk connections but the spice subckts have them combined.
Copy code
format="@name @@A1 @@A2 @@B1 @VGND @VNB @VPB @VPWR @@X @prefix\\\\a21o_2"
versus
Copy code
.subckt sg13g2_a21o_1 A1 A2 B1 VDD VSS X
s
I haven't created the symbols for ihp-sg13g2 process. It seems the symbol does netlist pins with pwell and nwell connections that are non existent in the spice library. Since
VNB
and
VPB
ports are not drawn as symbol pins but passed as attributes (same as VPWR and VGND power rails) you can remove all references to
VNB
and
VPB
in
format
,
extra
and
template
attributes. Also reverse the order of
@VPWR
and
@VGND
in
format
attribute.
m
@Boris Murmann if you execute the next command in the
libs.tech/xschem/sg13g2_stdcells
directory, does it resolve the problem?
Copy code
sed -i -e 's/.VGND .VNB .VPB .VPWR/@VDD @VSS/' -e 's/VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR/VDD=VDD VSS=VSS/' -e 's/VGND VNB VPB VPWR/VDD VSS/' *
b
Thanks @Mitch Bailey! It almost works... For some reason the flipflops have a different pin order in the spice file:
.subckt sg13g2_dfrbp_1 CLK D Q Q_N RESET_B VDD VSS
😬 1
I am not sure if the symbol can be set up to netlist in this order (with the global supplies coming last).
m
@Boris Murmann The pin order in the (apparently Cadence generated) spice appears to be alphabetical (also the reason VDD now occurs before VSS) while xschem used the
input power output
order. However, for the standard cells in xschem, the pin order is explicitly defined in the symbol format statement.
Copy code
format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dfrbp_1"
Rearranging these should probably give you what you want. This slightly modified command might work.
Copy code
sed -i \
-e 's/@VGND @VNB @VPB @VPWR/@VDD @VSS/' \
-e 's/VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR/VDD=VDD VSS=VSS/' \
-e 's/VGND VNB VPB VPWR/VDD VSS/' \
-e 's/@VDD @VSS @@Q @@Q_N/@@Q @@Q_N @VDD @VSS/' *
👏 1
b
Thanks, @Mitch Bailey. Unfortunately this still doesn't solve the problem completely. For the flipflop, the spice model file has this pin order:
.subckt sg13g2_dfrbp_1 CLK D Q Q_N RESET_B VDD VSS
After running your sed (which fixes most other cells, the flipflop netlists like this:
CLK D RESET_B Q Q_N VDD VSS
😬 1
m
So looking at the pin order in the xschem symbol format statements, I see these have pins that are not in alphabetical order.
Copy code
sg13g2_dfrbp_1.sym: format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dfrbp_1"
sg13g2_dfrbp_2.sym: format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dfrbp_2"
sg13g2_dlhq_1.sym: format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dlhq_1"
sg13g2_dlhr_1.sym: format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dlhr_1"
sg13g2_dlhrq_1.sym: format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dlhrq_1"
sg13g2_dllr_1.sym: format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dllr_1"
sg13g2_dllrq_1.sym: format="@name @@CLK @@D @@RESET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\dllrq_1"
sg13g2_sdfbbp_1.sym: format="@name @@CLK @@D @@RESET_B @@SCD @@SCE @@SET_B @VGND @VNB @VPB @VPWR @@Q @@Q_N @prefix\\\\sdfbbp_1"
Maybe this will work
Copy code
sed -i .bak \
-e 's/@VGND @VNB @VPB @VPWR/@VDD @VSS/' \
-e 's/VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR/VDD=VDD VSS=VSS/' \
-e 's/VGND VNB VPB VPWR/VDD VSS/' \
-e 's/@VDD @VSS @@Q @@Q_N/@@Q @@Q_N @VDD @VSS/' \
-e 's/\(@@RESET.*\)@@Q @@Q_N /@@Q @@Q_N \1/' *.sym
b
Works, thank you! (minus .bak, though)
👍 1