Corrections to the PDK, especially in support of the Caravel design
for the MPW-7 tapeout. (1) Correct the pin order of instances in the
macro_sparecell in the HD library. (2) Correct the netlists of the
EF overlay I/O cells. (3) Adds missing diode devices to the vendor
I/O netlist for the gnd2gnd_120x2_lv_isosub cell, and adds length and
width values to generic (net-splitting) resistors.
diff --git a/VERSION b/VERSION
index 2587cf1..819d259 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.345
+1.0.346
diff --git a/sky130/Makefile.in b/sky130/Makefile.in
index cfa5571..35dc218 100644
--- a/sky130/Makefile.in
+++ b/sky130/Makefile.in
@@ -1352,8 +1352,10 @@
rename=sky130_fd_sc_hd__nom.tlef \
-spice %l/latest/cells/*/*.spice compile-only \
sort=../common/sort_pdkfiles.py \
+ filter=custom/scripts/fix_sparecell_spice.py \
filter=custom/scripts/fix_device_models.py \
-cdl %l/latest/cells/*/*.cdl ignore=topography compile-only \
+ filter=custom/scripts/fix_sparecell_cdl.py \
sort=../common/sort_pdkfiles.py \
-lef %l/latest/cells/*/*.lef \
exclude=*.magic.lef,sky130_ef_sc_hd.lef lefopts=-toplayer \
diff --git a/sky130/custom/scripts/fix_sparecell_cdl.py b/sky130/custom/scripts/fix_sparecell_cdl.py
new file mode 100755
index 0000000..3252b23
--- /dev/null
+++ b/sky130/custom/scripts/fix_sparecell_cdl.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+#
+# fix_sparecell_cdl ---
+#
+# This script fixes problems in the SkyWater HD library "macro_sparecell".
+# The pin order of the instances in the macro are incorrect and need to be
+# reordered to match the pin order of the individual standard cells in the
+# macro.
+#
+# This script is a filter to be run by setting the name of this script as
+# the value to "filter=" for the model install in the sky130 Makefile.
+
+import re
+import os
+import sys
+
+def filter(inname, outname):
+
+ # Read input
+ try:
+ with open(inname, 'r') as inFile:
+ spitext = inFile.read()
+ # (Don't) unwrap continuation lines
+ # spilines = spitext.replace('\n+', ' ').splitlines()
+ spilines = spitext.splitlines()
+ except:
+ print('fix_sparecell_cdl.py: failed to open ' + inname + ' for reading.', file=sys.stderr)
+ return 1
+
+ macrolines = [
+ 'XI1 VGND VNB VPB VPWR net59 LO / sky130_fd_sc_hd__conb_1',
+ 'XI2 LO LO VGND VNB VPB VPWR nd2right / sky130_fd_sc_hd__nand2_2',
+ 'XI3 LO LO VGND VNB VPB VPWR nd2left / sky130_fd_sc_hd__nand2_2',
+ 'XI4 nd2right nd2right VGND VNB VPB VPWR nor2right / sky130_fd_sc_hd__nor2_2',
+ 'XI5 nd2left nd2left VGND VNB VPB VPWR nor2left / sky130_fd_sc_hd__nor2_2',
+ 'XI6 nor2right VGND VNB VPB VPWR invright / sky130_fd_sc_hd__inv_2',
+ 'XI7 nor2left VGND VNB VPB VPWR invleft / sky130_fd_sc_hd__inv_2']
+
+ fixedlines = []
+ modified = False
+ inmacro = False
+
+ # NOTE: The text "I LO:" appears only in the PININFO line of macro_sparecell
+
+ for line in spilines:
+ if inmacro == True:
+ if '.ENDS' in line:
+ inmacro = False
+ fixedlines.append(line)
+ elif 'I LO:' in line:
+ inmacro = True
+ fixedlines.append(line)
+ for mline in macrolines:
+ fixedlines.append(mline)
+ modified = True
+ else:
+ fixedlines.append(line)
+
+ # Write output
+ if outname == None:
+ for i in fixedlines:
+ print(i)
+ else:
+ # If the output is a symbolic link but no modifications have been made,
+ # then leave it alone. If it was modified, then remove the symbolic
+ # link before writing.
+ if os.path.islink(outname):
+ if not modified:
+ return 0
+ else:
+ os.unlink(outname)
+ try:
+ with open(outname, 'w') as outFile:
+ for i in fixedlines:
+ print(i, file=outFile)
+ except:
+ print('fix_sparecell_cdl.py: failed to open ' + outname + ' for writing.', file=sys.stderr)
+ return 1
+
+
+if __name__ == '__main__':
+
+ # This script expects to get one or two arguments. One argument is
+ # mandatory and is the input file. The other argument is optional and
+ # is the output file. The output file and input file may be the same
+ # name, in which case the original input is overwritten.
+
+ options = []
+ arguments = []
+ for item in sys.argv[1:]:
+ if item.find('-', 0) == 0:
+ options.append(item[1:])
+ else:
+ arguments.append(item)
+
+ if len(arguments) > 0:
+ infilename = arguments[0]
+
+ if len(arguments) > 1:
+ outfilename = arguments[1]
+ else:
+ outfilename = None
+
+ result = filter(infilename, outfilename)
+ sys.exit(result)
diff --git a/sky130/custom/scripts/fix_sparecell_spice.py b/sky130/custom/scripts/fix_sparecell_spice.py
new file mode 100755
index 0000000..b323e14
--- /dev/null
+++ b/sky130/custom/scripts/fix_sparecell_spice.py
@@ -0,0 +1,111 @@
+#!/usr/bin/env python3
+#
+# fix_sparecell_spice ---
+#
+# This script fixes problems in the SkyWater HD library "macro_sparecell".
+# The pin order of the instances in the macro are incorrect and need to be
+# reordered to match the pin order of the individual standard cells in the
+# macro.
+#
+# This script is a filter to be run by setting the name of this script as
+# the value to "filter=" for the model install in the sky130 Makefile.
+
+import re
+import os
+import sys
+
+def filter(inname, outname):
+
+ # Read input
+ try:
+ with open(inname, 'r') as inFile:
+ spitext = inFile.read()
+ # (Don't) unwrap continuation lines
+ # spilines = spitext.replace('\n+', ' ').splitlines()
+ spilines = spitext.splitlines()
+ except:
+ print('fix_sparecell_spice.py: failed to open ' + inname + ' for reading.', file=sys.stderr)
+ return 1
+
+
+ macrolines = [
+ 'Xsky130_fd_sc_hd__nand2_2_0 LO LO VGND VNB VPB VPWR sky130_fd_sc_hd__nor2_2_0/B',
+ '+ sky130_fd_sc_hd__nand2_2',
+ 'Xsky130_fd_sc_hd__nand2_2_1 LO LO VGND VNB VPB VPWR sky130_fd_sc_hd__nor2_2_1/B',
+ '+ sky130_fd_sc_hd__nand2_2',
+ 'Xsky130_fd_sc_hd__inv_2_0 sky130_fd_sc_hd__inv_2_0/A VGND VNB VPB VPWR',
+ '+ sky130_fd_sc_hd__inv_2_0/Y sky130_fd_sc_hd__inv_2',
+ 'Xsky130_fd_sc_hd__inv_2_1 sky130_fd_sc_hd__inv_2_1/A VGND VNB VPB VPWR',
+ '+ sky130_fd_sc_hd__inv_2_1/Y sky130_fd_sc_hd__inv_2',
+ 'Xsky130_fd_sc_hd__nor2_2_0 sky130_fd_sc_hd__nor2_2_0/B sky130_fd_sc_hd__nor2_2_0/B',
+ '+ VGND VNB VPB VPWR sky130_fd_sc_hd__inv_2_0/A sky130_fd_sc_hd__nor2_2',
+ 'Xsky130_fd_sc_hd__nor2_2_1 sky130_fd_sc_hd__nor2_2_1/B sky130_fd_sc_hd__nor2_2_1/B',
+ '+ VGND VNB VPB VPWR sky130_fd_sc_hd__inv_2_1/A sky130_fd_sc_hd__nor2_2',
+ 'Xsky130_fd_sc_hd__conb_1_0 VGND VNB VPB VPWR sky130_fd_sc_hd__conb_1_0/HI LO',
+ '+ sky130_fd_sc_hd__conb_1']
+
+ fixedlines = []
+ modified = False
+ inmacro = False
+
+ for line in spilines:
+ if 'sparecell' in line:
+ inmacro = True
+ fixedlines.append(line)
+ for mline in macrolines:
+ fixedlines.append(mline)
+ modified = True
+ elif inmacro == True:
+ if '.ends' in line:
+ inmacro = False
+ fixedlines.append(line)
+ else:
+ fixedlines.append(line)
+
+ # Write output
+ if outname == None:
+ for i in fixedlines:
+ print(i)
+ else:
+ # If the output is a symbolic link but no modifications have been made,
+ # then leave it alone. If it was modified, then remove the symbolic
+ # link before writing.
+ if os.path.islink(outname):
+ if not modified:
+ return 0
+ else:
+ os.unlink(outname)
+ try:
+ with open(outname, 'w') as outFile:
+ for i in fixedlines:
+ print(i, file=outFile)
+ except:
+ print('fix_sparecell_spice.py: failed to open ' + outname + ' for writing.', file=sys.stderr)
+ return 1
+
+
+if __name__ == '__main__':
+
+ # This script expects to get one or two arguments. One argument is
+ # mandatory and is the input file. The other argument is optional and
+ # is the output file. The output file and input file may be the same
+ # name, in which case the original input is overwritten.
+
+ options = []
+ arguments = []
+ for item in sys.argv[1:]:
+ if item.find('-', 0) == 0:
+ options.append(item[1:])
+ else:
+ arguments.append(item)
+
+ if len(arguments) > 0:
+ infilename = arguments[0]
+
+ if len(arguments) > 1:
+ outfilename = arguments[1]
+ else:
+ outfilename = None
+
+ result = filter(infilename, outfilename)
+ sys.exit(result)
diff --git a/sky130/custom/sky130_fd_io/cdl/sky130_ef_io.cdl b/sky130/custom/sky130_fd_io/cdl/sky130_ef_io.cdl
index af6f5d5..aa141bd 100644
--- a/sky130/custom/sky130_fd_io/cdl/sky130_ef_io.cdl
+++ b/sky130/custom/sky130_fd_io/cdl/sky130_ef_io.cdl
@@ -120,6 +120,10 @@
+ SRC_BDY_HVC VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_power_hvc_wpadv2
+Rtest0 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest1 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest2 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest3 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
.ENDS
@@ -202,6 +206,10 @@
+ VDDIO SRC_BDY_HVC VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_ground_hvc_wpad
+Rtest0 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest1 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest2 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest3 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
.ENDS
@@ -422,6 +430,10 @@
+ VSSIO VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_power_hvc_wpadv2
+Rtest0 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest1 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest2 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest3 VDDIO_Q VDDIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
.ENDS
@@ -442,6 +454,10 @@
+ VDDIO VSSIO VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_ground_hvc_wpad
+Rtest0 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest1 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest2 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
+Rtest3 VSSIO_Q VSSIO sky130_fd_pr__res_generic_m3 w=23.9 l=0.2
.ENDS
@@ -541,9 +557,9 @@
* Instantiate the underlying power pad (connects P_PAD to VCCD)
Xsky130_fd_io__top_power_lvc_base
-+ AMUXBUS_A AMUXBUS_B VSSD1 VCCD1 VCCD1 VDDIO
++ AMUXBUS_A AMUXBUS_B VSSIO VCCD1 VCCD1 VDDIO
+ VCCD1 VCCD_PAD
-+ VSSIO VSSD1 VCCD VCCHIB VDDA VDDIO VDDIO_Q
++ VSSD1 VSSD1 VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_power_lvc_wpad
@@ -565,7 +581,7 @@
Xsky130_fd_io__top_ground_lvc_base
+ AMUXBUS_A AMUXBUS_B VSSIO VCCD1 VCCD1
+ VSSD1 VSSD_PAD
-+ VDDIO VSSIO VSSD VCCD VCCHIB VDDA VDDIO VDDIO_Q
++ VDDIO VSSD1 VSSD1 VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_ground_lvc_wpad
@@ -584,9 +600,9 @@
* Instantiate the underlying power pad (connects P_PAD to VCCD)
Xsky130_fd_io__top_power_lvc_base
-+ AMUXBUS_A AMUXBUS_B VSSIO VCCD VCCD VDDIO
++ AMUXBUS_A AMUXBUS_B VSSA VCCD VCCD VDDIO
+ VCCD VCCD_PAD
-+ VSSD VSSD VCCD VCCHIB VDDA VDDIO VDDIO_Q
++ VSSIO VSSD VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_power_lvc_wpad
@@ -605,9 +621,9 @@
* Instantiate the underlying ground pad (connects G_PAD to VSSD)
Xsky130_fd_io__top_ground_lvc_base
-+ AMUXBUS_A AMUXBUS_B VSSIO VCCD VCCD
++ AMUXBUS_A AMUXBUS_B VSSA VCCD VCCD
+ VSSD VSSD_PAD
-+ VDDIO VSSD VSSD VCCD VCCHIB VDDA VDDIO VDDIO_Q
++ VDDIO VSSIO VSSD VCCD VCCHIB VDDA VDDIO VDDIO_Q
+ VSSA VSSD VSSIO VSSIO_Q VSWITCH
+ sky130_fd_io__top_ground_lvc_wpad
diff --git a/sky130/custom/sky130_fd_io/spice/sky130_fd_io.spice b/sky130/custom/sky130_fd_io/spice/sky130_fd_io.spice
index 218e648..ce57405 100644
--- a/sky130/custom/sky130_fd_io/spice/sky130_fd_io.spice
+++ b/sky130/custom/sky130_fd_io/spice/sky130_fd_io.spice
@@ -19,6 +19,10 @@
.SUBCKT sky130_fd_io__condiode NEG POS
.ENDS
+.SUBCKT sky130_fd_io__gnd2gnd_120x2_lv_isosub BDY2_B2B SRC_BDY_LVC1 VSSD
+D0 SRC_BDY_LVC1 BDY2_B2B sky130_fd_pr__diode_pd2nw_05v5 area=90 pj=33
+D1 BDY2_B2B SRC_BDY_LVC1 sky130_fd_pr__diode_pd2nw_05v5 area=90 pj=33
+.ENDS
.SUBCKT sky130_fd_io__amuxsplitv2_delay ENABLE_VDDA_H HLD_VDDA_H_N HOLD RESET
+ VCC_IO VGND
@@ -3061,8 +3065,8 @@
XI70 net531 en VCC_IO VCC_IO sky130_fd_pr__pfet_g5v0d10v5 m=4 w=5.0 l=0.5 mult=1
+ sa=0.265 sb=0.265 sd=0.28 topography=normal area=0.063 perim=1.14
RI221 net420 vr sky130_fd_pr__res_generic_po W=0.75 L=513.445 m=1
-RI186 SLEW_CTL_H_N[0] mode4b sky130_fd_pr__res_generic_m1
-RI157 net247 mode2b sky130_fd_pr__res_generic_m1
+RI186 SLEW_CTL_H_N[0] mode4b sky130_fd_pr__res_generic_m1 L=1 W=1
+RI157 net247 mode2b sky130_fd_pr__res_generic_m1 L=1 W=1
.ENDS sky130_fd_io__gpio_ovtv2_pdpredrvr_strong_leak_fix
* Copyright 2020 The SkyWater PDK Authors
@@ -4847,9 +4851,9 @@
* Rshort<1> hld_i_h_n_net<1> HLD_I_H_N short
* Rshort<0> hld_i_h_n_net<0> HLD_I_H_N short
* Rshort_hld_i_h enable_vdda_h_n HLD_I_H short
-Rshort<1> hld_i_h_n_net<1> HLD_I_H_N sky130_fd_pr__res_generic_m1
-Rshort<0> hld_i_h_n_net<0> HLD_I_H_N sky130_fd_pr__res_generic_m1
-Rshort_hld_i_h enable_vdda_h_n HLD_I_H sky130_fd_pr__res_generic_m1
+Rshort<1> hld_i_h_n_net<1> HLD_I_H_N sky130_fd_pr__res_generic_m1 L=1 W=1
+Rshort<0> hld_i_h_n_net<0> HLD_I_H_N sky130_fd_pr__res_generic_m1 L=1 W=1
+Rshort_hld_i_h enable_vdda_h_n HLD_I_H sky130_fd_pr__res_generic_m1 L=1 W=1
.ENDS sky130_fd_io__gpiov2_ctl_hld
* Copyright 2020 The SkyWater PDK Authors
@@ -6362,8 +6366,8 @@
+ sa=0.0 sb=0.0 sd=0.0 topography=normal area=0.048 perim=0.94
* RI9 net18 NBODY short
* RI8 net16 NWELLRING short
-RI9 net18 NBODY sky130_fd_pr__res_generic_m1 W=0.02 L=0.005
-RI8 net16 NWELLRING sky130_fd_pr__res_generic_m1 W=0.02 L=0.005
+*RI9 net18 NBODY sky130_fd_pr__res_generic_m1 W=0.02 L=0.005
+*RI8 net16 NWELLRING sky130_fd_pr__res_generic_m1 W=0.02 L=0.005
.ENDS sky130_fd_io__signal_5_sym_hv_local_5term
* Copyright 2020 The SkyWater PDK Authors
@@ -7151,7 +7155,7 @@
Xpre_p1_q0 g_nclamp g_pdpre DRN_HVC DRN_HVC sky130_fd_pr__pfet_g5v0d10v5 m=50
+ w=7.0 l=0.5 mult=1 sa=0.265 sb=0.265 sd=0.28 topography=normal area=0.063
+ perim=1.14
-RI13 G_PAD G_CORE sky130_fd_pr__res_generic_m5 W=1 L=1
+RI13 G_PAD G_CORE sky130_fd_pr__res_generic_m5 w=2.5385e+08u l=100000u
.ENDS sky130_fd_io__top_ground_hvc_wpad
* Copyright 2020 The SkyWater PDK Authors
@@ -7240,7 +7244,7 @@
Xcxtor2_q0 DRN_HVC g_nclamp SRC_BDY_HVC SRC_BDY_HVC sky130_fd_pr__nfet_g5v0d10v5
+ m=22 w=10.0 l=0.5 mult=1 sa=0.265 sb=0.265 sd=0.28 topography=normal area=0.063
+ perim=1.14
-RI13 P_PAD P_CORE sky130_fd_pr__res_generic_m5 W=1 L=1
+RI13 P_PAD P_CORE sky130_fd_pr__res_generic_m5 w=2.5385e+08u l=100000u
.ENDS sky130_fd_io__top_power_hvc_wpadv2
* Copyright 2020 The SkyWater PDK Authors
@@ -7727,7 +7731,7 @@
Xesd_q0 BDY2_B2B SRC_BDY_LVC1 VSSD sky130_fd_io__gnd2gnd_120x2_lv_isosub
xI54 SRC_BDY_LVC2 VDDIO sky130_fd_io__condiode
xI50 SRC_BDY_LVC1 VDDIO sky130_fd_io__condiode
-RI21 G_PAD G_CORE sky130_fd_pr__res_generic_m5 W=1 L=1
+RI21 G_PAD G_CORE sky130_fd_pr__res_generic_m5 w=2.5385e+08u l=100000u
Xpre_p1_q0 g_nclamp_lvc1 g_pdpre_lvc1 DRN_LVC1 DRN_LVC1 sky130_fd_pr__pfet_01v8
+ m=20 w=7.0 l=0.18 mult=1 sa=0.265 sb=0.265 sd=0.28 topography=normal area=0.063
+ perim=1.14
@@ -7797,7 +7801,7 @@
Xesd_q0 BDY2_B2B SRC_BDY_LVC1 VSSD sky130_fd_io__gnd2gnd_120x2_lv_isosub
xI54 SRC_BDY_LVC2 VDDIO sky130_fd_io__condiode
xI50 SRC_BDY_LVC1 VDDIO sky130_fd_io__condiode
-RI21 P_PAD P_CORE sky130_fd_pr__res_generic_m5 W=1 L=1
+RI21 P_PAD P_CORE sky130_fd_pr__res_generic_m5 w=2.5385e+08u l=100000u
Xpre_p1_q0 g_nclamp_lvc1 g_pdpre_lvc1 DRN_LVC1 DRN_LVC1 sky130_fd_pr__pfet_01v8
+ m=20 w=7.0 l=0.18 mult=1 sa=0.265 sb=0.265 sd=0.28 topography=normal area=0.063
+ perim=1.14