Revised the fix_device_models script (again) to correct the resistor to type R and diode to type D (from "X"), and to change the diode properties from "a" and "p" to "area" and "pj". Updated the magic technology file to also write the diodes as low-level devices to match this usage, and with the property names stated above.
diff --git a/VERSION b/VERSION index 15bcce9..b74bd0d 100644 --- a/VERSION +++ b/VERSION
@@ -1 +1 @@ -1.0.161 +1.0.162
diff --git a/sky130/custom/models/diode.spice b/sky130/custom/models/diode.spice index 81bee35..67744d6 100644 --- a/sky130/custom/models/diode.spice +++ b/sky130/custom/models/diode.spice
@@ -1,9 +1,9 @@ * For diodes called as a subcircuit * (backwards compatible with earlier PDK version) .subckt sky130_fd_pr__diode_pw2nd N P a=0 p=0 -D0 N P sky130_fd_pr__diode_pw2nd_05v5 area=a +D0 N P sky130_fd_pr__diode_pw2nd_05v5 area=a pj=p .ends * (corresponds to current PDK) -.subckt sky130_fd_pr__diode_pw2nd_05v5 N P area=0 -D0 N P sky130_fd_pr__diode_pw2nd_05v5 area=area +.subckt sky130_fd_pr__diode_pw2nd_05v5 N P area=0 perimeter=0 +D0 N P sky130_fd_pr__diode_pw2nd_05v5 area=area pj=perimeter .ends
diff --git a/sky130/custom/scripts/fix_device_models.py b/sky130/custom/scripts/fix_device_models.py index 90a8434..3cafe1f 100755 --- a/sky130/custom/scripts/fix_device_models.py +++ b/sky130/custom/scripts/fix_device_models.py
@@ -40,10 +40,16 @@ # Check for incorrect resistor reference smatch = shortrex.match(line) if dmatch: - fixedlines.append(re.sub('pw2nd', 'pw2nd_05v5', line)) + fline = re.sub('pw2nd', 'pw2nd_05v5', line) + fline = re.sub('^X', 'D', fline) + fline = re.sub('a=', 'area=', fline) + fline = re.sub('p=', 'pj=', fline) + fixedlines.append(fline) modified = True elif smatch: - fixedlines.append(re.sub('short', 'sky130_fd_pr__res_generic_po', line)) + fline = re.sub('short', 'sky130_fd_pr__res_generic_po', line) + fline = re.sub('^X', 'R', fline) + fixedlines.append(fline) modified = True else: fixedlines.append(line)
diff --git a/sky130/magic/sky130.tech b/sky130/magic/sky130.tech index 9a7bf6c..679f234 100644 --- a/sky130/magic/sky130.tech +++ b/sky130/magic/sky130.tech
@@ -5370,24 +5370,15 @@ device resistor sky130_fd_pr__res_generic_po rmp *poly device resistor sky130_fd_pr__res_generic_po mrp1 *poly - device subcircuit sky130_fd_pr__diode_pd2nw_05v5 *pdiode \ - nwell a=area - device subcircuit sky130_fd_pr__diode_pd2nw_05v5_lvt *pdiodelvt \ - nwell a=area - device subcircuit sky130_fd_pr__diode_pd2nw_05v5_hvt *pdiodehvt \ - nwell a=area - device subcircuit sky130_fd_pr__diode_pd2nw_11v0 *mvpdiode \ - nwell a=area + device pdiode sky130_fd_pr__diode_pd2nw_05v5 *pdiode nwell a=area p=pj + device pdiode sky130_fd_pr__diode_pd2nw_05v5_lvt *pdiodelvt nwell a=area p=pj + device pdiode sky130_fd_pr__diode_pd2nw_05v5_hvt *pdiodehvt nwell a=area p=pj + device pdiode sky130_fd_pr__diode_pd2nw_11v0 *mvpdiode nwell a=area p=pj - device msubcircuit sky130_fd_pr__diode_pw2nd_05v5 *ndiode \ - pwell,space/w a=area - device msubcircuit sky130_fd_pr__diode_pw2nd_05v5_lvt *ndiodelvt \ - pwell,space/w a=area - device msubcircuit sky130_fd_pr__diode_pw2nd_05v5_nvt *nndiode \ - pwell,space/w a=area - device msubcircuit sky130_fd_pr__diode_pw2nd_11v0 *mvndiode \ - pwell,space/w a=area - + device ndiode sky130_fd_pr__diode_pw2nd_05v5 *ndiode pwell,space/w a=area p=pj + device ndiode sky130_fd_pr__diode_pw2nd_05v5_lvt *ndiodelvt pwell,space/w a=area p=pj + device ndiode sky130_fd_pr__diode_pw2nd_05v5_nvt *nndiode pwell,space/w a=area p=pj + device ndiode sky130_fd_pr__diode_pw2nd_11v0 *mvndiode pwell,space/w a=area p=pj #ifdef MIM device csubcircuit sky130_fd_pr__cap_mim_m3_1 *mimcap *m3 w=w l=l