Stefan Schippers
08/30/2022, 2:23 PMstdcells.spice
to stdcells.xspice
using spi2xspice.py:
python3 <http://spi2xspice.py.in|spi2xspice.py.in> ~/share/pdk/sky130A/libs.ref/sky130_fd_sc_hd/lib/sky130_fd_sc_hd__tt_025C_1v80.lib stdcells.spice stdcells.xspice
Of course the location of sky130_fd_sc_hd__tt_025C_1v80.lib
liberty file depends on the open_pdks installation.
Attached the input spice file and the resulting xspice file.
Issues I found:
• rise_delay
, fall_delay
, input_load
are set to unreasonable values (1n delays, sometimes 10ns delays in a2d bridges, 1pF input load)
• flip-flop and latch spice lines are not translated correctly, the 'Q' net mapping is missing: The following flip flop :
x2 CLK A RESET_B VSS VSS VCC VCC IQ sky130_fd_sc_hd__dfrtp_1
is translated to:
A2 A CLK NULL ~RESET_B NULL NULL ddflop
as you can see the 'Q' net is not mapped. Same thing happens for the latch (dlatch):
x4 A CLK RESET_B VSS VSS VCC VCC IQLATCH net1 sky130_fd_sc_hd__dlrbn_1
translated to:
A4 A ~CLK NULL ~RESET_B NULL NULL dlatch
• The python script emits .models for d_dff but not for d_dlatch:
.model ddflop d_dff(ic=0 rise_delay=1n fall_delay=1n)
.model dzero d_pulldown(load=1p)
.model done d_pullup(load=1p)
I added the missing definition:
.model dlatch d_dlatch(ic=0 rise_delay=200p fall_delay=200p ...)
• NULL
is a special identifier that means Unconnected. From ngspice manual: "_*The literal string ‘null’, when included in a node list, is interpreted as no connection at that input to the model.*_"
• Anyway (although not needed as per above) I added a pulldown line to add a ZERO node: AZERO ZERO dzero
and used this ZERO node on unused inputs. Unused outputs have been connected to unique FLOAT1
, FLOAT2
, ... nodes to avoid contentions.
• I have added all delay and load parameters for xspice models with reasonable values since defaults are not for a modern vlsi process.
Attached the stdcells_fix.xspice with all the manual corrections.
@Rita with all above tweaks i was able to simulate a subcircuit with a bunch of digital gates both at transistor level and xspice level, with comparable outputs.
Example shown in image is in the xschem_sky130/sky130_tests/test_stdcells.schTim Edwards
08/30/2022, 2:43 PMTim Edwards
08/30/2022, 2:53 PM# -io_time=<value> Rise and fall time for signals in and out of the digital block
# -time=<value> Rise and fall time of gate outputs
# -idelay=<value> Input delay at gate inputs
# -odelay=<value> Throughput delay of the gate
# -cload=<value> Gate output load capacitance
In the qflow installation in sky130 from open_pdks (which is maybe usable with the OSU standard cells but definitely not with the SkyWater standard cells), I specified the following options to be passed to spi2xspice.py:
set xspice_options="-io_time=500p -time=50p -idelay=5p -odelay=50p -cload=250f"
Stefan Schippers
08/30/2022, 2:57 PMTim Edwards
08/30/2022, 2:58 PMStefan Schippers
08/30/2022, 3:14 PMTim Edwards
08/30/2022, 3:16 PMStefan Schippers
08/30/2022, 3:16 PMTim Edwards
08/30/2022, 3:17 PMStefan Schippers
08/30/2022, 3:19 PMTim Edwards
08/30/2022, 3:33 PMStefan Schippers
08/30/2022, 3:56 PMStefan Schippers
08/30/2022, 3:59 PMStefan Schippers
08/30/2022, 4:01 PMStefan Schippers
08/30/2022, 4:56 PM.subckt nand2_wrapper A B out
A1 [A B] out d_lut_sky130_fd_sc_hd__nand2_1
.ends
.subckt stdcells a_QLATCH a_A a_X a_B a_Y a_CLK a_Q a_RESET_B a_XSCHEM a_VCC a_VSS
...
AA2D1 [a_A] [A] todig_1v8
AA2D2 [a_B] [B] todig_1v8
...
...
XA1 A B IX nand2_wrapper
.ends
...
.model d_lut_sky130_fd_sc_hd__nand2_1 d_lut (rise_delay=200p
+ fall_delay=200p input_load=10f table_values "1110")
The netlist parser just flattens the hierarchy and doesn't care if subcircuit nodes are analog or digital.
After netlist expansion the nand2 call (from subcirtcuit stdcells instantiated in top as X1):
a.x1.xa1.a1 [ x1.a x1.b ] x1.ix d_lut_sky130_fd_sc_hd__nand2_1
Tim Edwards
08/30/2022, 5:00 PMStefan Schippers
08/30/2022, 5:09 PMMatt Venn
08/30/2022, 7:35 PM