Fix incorrect extracted parameters in spice files.
Magic was updated to fix the extracted parameter values.
Fixes https://github.com/google/skywater-pdk/issues/192
Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
diff --git a/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_1.model.spice b/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_1.model.spice
index 0eeb95b..bff2319 100644
--- a/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_1.model.spice
+++ b/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_1.model.spice
@@ -20,12 +20,10 @@
.param num_contacts = '(wc*lc/via3_spacing)'
.param r1 = 'rm3*(lc)/(wc)'
.param r2 = 'rcvia3/num_contacts'
-.param vc1 = -25.0e-6
-.param vc2 = 90.0e-6
.param carea = 'camimc*(wc)*(lc)'
.param cperim = 'cpmimc*((wc)+(lc))*2'
.param czero = 'carea + cperim' dev/gauss='0.01*2.8*(carea + cperim)/sqrt(wc*lc*mf)'
-c1 c0 a 'czero*(1+vc1*(v(c0)-v(c1))+vc2*(v(c0)-v(c1))*(v(c0)-v(c1)))' tc1 = 0 tc2 = 0.0
+c1 c0 a 'czero' tc1 = 0 tc2 = 0.0
rs1 a b1 'r1' tc1 = {tc1rm3} tc2 = {tc2rm3}
rs2 b1 c1 'r2' tc1 = {tc1rvia3} tc2 = {tc2rvia3}
.ends sky130_fd_pr__cap_mim_m3_1
diff --git a/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_2.model.spice b/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_2.model.spice
index 635c780..195a865 100644
--- a/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_2.model.spice
+++ b/cells/cap_mim_m3/sky130_fd_pr__cap_mim_m3_2.model.spice
@@ -20,12 +20,10 @@
.param num_contacts = '(wc*lc/via4_spacing)'
.param r1 = 'rm4*(lc)/(wc)'
.param r2 = 'rcvia4/num_contacts'
-.param vc1 = -25.0e-6
-.param vc2 = 90.0e-6
.param carea = 'camimc*(wc)*(lc)'
.param cperim = 'cpmimc*((wc)+(lc))*2'
.param czero = 'carea + cperim' dev/gauss='0.01*2.8*(carea + cperim)/sqrt(wc*lc*mf)'
-c1 c0 a 'czero*(1+vc1*(v(c0)-v(c1))+vc2*(v(c0)-v(c1))*(v(c0)-v(c1)))' tc1 = 0 tc2 = 0.0
+c1 c0 a 'czero' tc1 = 0 tc2 = 0.0
rs1 a b1 'r1' tc1 = {tc1rm4} tc2 = {tc2rm4}
rs2 b1 c1 'r2' tc1 = {tc1rvia4} tc2 = {tc2rvia4}
.ends sky130_fd_pr__cap_mim_m3_2
diff --git a/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p35.model.spice b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p35.model.spice
new file mode 100644
index 0000000..3a0a593
--- /dev/null
+++ b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p35.model.spice
@@ -0,0 +1,24 @@
+* Copyright 2020 The SkyWater PDK Authors
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+
+* SKY130 Spice File.
+* statistics {
+* mismatch {
+* }
+* }
+.subckt sky130_fd_pr__res_xhigh_po_0p35 r0 r1 b
++
+.param w = 0.35 l = 5 mult = 1.0
+Xsky130_fd_pr__res_xhigh_po_0p35 r0 r1 b sky130_fd_pr__res_xhigh_po__base w = {w} l = {l} mult = {mult}
+.ends sky130_fd_pr__res_xhigh_po_0p35
diff --git a/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p69.model.spice b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p69.model.spice
new file mode 100644
index 0000000..c7956dd
--- /dev/null
+++ b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p69.model.spice
@@ -0,0 +1,24 @@
+* Copyright 2020 The SkyWater PDK Authors
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+
+* SKY130 Spice File.
+* statistics {
+* mismatch {
+* }
+* }
+.subckt sky130_fd_pr__res_xhigh_po_0p69 r0 r1 b
++
+.param w = 0.69 l = 5 mult = 1.0
+Xsky130_fd_pr__res_xhigh_po_0p69 r0 r1 b sky130_fd_pr__res_xhigh_po__base w = {w} l = {l} mult = {mult}
+.ends sky130_fd_pr__res_xhigh_po_0p69
diff --git a/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_1p41.model.spice b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_1p41.model.spice
new file mode 100644
index 0000000..fd6311f
--- /dev/null
+++ b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_1p41.model.spice
@@ -0,0 +1,24 @@
+* Copyright 2020 The SkyWater PDK Authors
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+
+* SKY130 Spice File.
+* statistics {
+* mismatch {
+* }
+* }
+.subckt sky130_fd_pr__res_xhigh_po_1p41 r0 r1 b
++
+.param w = 1.41 l = 5 mult = 1.0
+Xsky130_fd_pr__res_xhigh_po_1p41 r0 r1 b sky130_fd_pr__res_xhigh_po__base w = {w} l = {l} mult = {mult}
+.ends sky130_fd_pr__res_xhigh_po_1p41
diff --git a/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_2p85.model.spice b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_2p85.model.spice
new file mode 100644
index 0000000..69abb02
--- /dev/null
+++ b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_2p85.model.spice
@@ -0,0 +1,24 @@
+* Copyright 2020 The SkyWater PDK Authors
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+
+* SKY130 Spice File.
+* statistics {
+* mismatch {
+* }
+* }
+.subckt sky130_fd_pr__res_xhigh_po_2p85 r0 r1 b
++
+.param w = 2.85 l = 5 mult = 1.0
+Xsky130_fd_pr__res_xhigh_po_2p85 r0 r1 b sky130_fd_pr__res_xhigh_po__base w = {w} l = {l} mult = {mult}
+.ends sky130_fd_pr__res_xhigh_po_2p85
diff --git a/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_5p73.model.spice b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_5p73.model.spice
new file mode 100644
index 0000000..f7586fc
--- /dev/null
+++ b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_5p73.model.spice
@@ -0,0 +1,24 @@
+* Copyright 2020 The SkyWater PDK Authors
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+
+* SKY130 Spice File.
+* statistics {
+* mismatch {
+* }
+* }
+.subckt sky130_fd_pr__res_xhigh_po_5p73 r0 r1 b
++
+.param w = 5.73 l = 5 mult = 1.0
+Xsky130_fd_pr__res_xhigh_po_5p73 r0 r1 b sky130_fd_pr__res_xhigh_po__base w = {w} l = {l} mult = {mult}
+.ends sky130_fd_pr__res_xhigh_po_5p73
diff --git a/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po__base.model.spice b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po__base.model.spice
new file mode 100644
index 0000000..c1f470e
--- /dev/null
+++ b/cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po__base.model.spice
@@ -0,0 +1,52 @@
+* Copyright 2020 The SkyWater PDK Authors
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* https://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+
+* SKY130 Spice File.
+* statistics {
+* mismatch {
+* }
+* }
+.subckt sky130_fd_pr__res_xhigh_po__base r1 r2 b
++
++ w=1 l=1 mult=1
++
+.param rsheet = 2000.0
++ vc1_body = -1.00e-3
++ vc2_body = -1.00e-4
++ vc1_raw_end = -2.02e-2
++ vc2_raw_end = 1.55e-1
++ vc3_raw_end = 4.61e-2
++ body_pelgrom = 0.0347
++ r0_var = {17.23/w+2.318}
++ r1_var = {11.76/w}
++ rcon = {-46.62/(w*w)+331.73/w+20.576}
++ rend_mm = {0.0472/sqrt(w)}
++ tc1_voltco = -7.1e-3
++ rend_var = {sky130_fd_pr__res_high_po__var_mult*sqrt(2)*r0_var}
++ rtot_var = {sky130_fd_pr__res_high_po__var_mult*sqrt(2*pow(r0_var,2)+pow((r1_var*l),2))}
++ res_match = {(body_pelgrom/sqrt(w*l*mult))*sky130_fd_pr__res_high_po__slope_spectre}
++ rbody_var = {rtot_var-rend_var}
++ rend = {(rcon+rend_var)*(1+rend_mm/sqrt(mult)*sky130_fd_pr__res_high_po__con_slope_spectre)}
++ vc1_end = {vc1_raw_end/pwr(l,0.5)*(1+tc1_voltco*(temp-30))}
++ vc2_end = {vc2_raw_end/pwr(l,0.5)*(1+tc1_voltco*(temp-30))}
++ vc3_end = {vc3_raw_end/pwr(l,0.5)*(1+tc1_voltco*(temp-30))}
++ rbody = {(l*rsheet+rbody_var)*(1+res_match)/w}
+rbody ra r2 resbody r = {rbody*(1+abs(v(r1,r2))*vc1_body+abs(v(r1,r2))*abs(v(r1,r2))/(l*l)*vc2_body)}
+rend r1 ra r = {rend*(1+vc1_raw_end*(1-exp(-abs(v(r2,r1))))+
++ vc2_raw_end*(1 - exp(-abs(v(r2,r1)))) * (1 - exp(-abs(v(r2,r1)))) +
++ vc3_raw_end*(1 - exp(-abs(v(r2,r1)))) * (1 - exp(-abs(v(r2,r1)))) * (1 - exp(-abs(v(r2,r1)))) ) }
+c1 r2 b c = {((l+2*2.08)*w*crpf_precision*1e-12+2*(l+2*2.08+w)*crpfsw_precision_1_1*1e-6)/2}
+c2 r1 b c = {((l+2*2.08)*w*crpf_precision*1e-12+2*(l+2*2.08+w)*crpfsw_precision_1_1*1e-6)/2}
+.model resbody r tc1 = -1.47e-3 tc2 = 2.7e-6 tnom = 30.0
+.ends sky130_fd_pr__res_xhigh_po__base
diff --git a/models/sky130_fd_pr__model__linear.model.spice b/models/sky130_fd_pr__model__linear.model.spice
index eaa3d2a..3dbd8e8 100644
--- a/models/sky130_fd_pr__model__linear.model.spice
+++ b/models/sky130_fd_pr__model__linear.model.spice
@@ -21,6 +21,12 @@
* vary sky130_fd_pr__res_high_po__con_slope_spectre dist=gauss std=1.0
* }
* }
+.include "../cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p35.model.spice"
+.include "../cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_0p69.model.spice"
+.include "../cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_1p41.model.spice"
+.include "../cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_2p85.model.spice"
+.include "../cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po_5p73.model.spice"
+.include "../cells/res_xhigh_po/sky130_fd_pr__res_xhigh_po__base.model.spice"
.include "../cells/res_high_po/sky130_fd_pr__res_high_po_0p35.model.spice"
.include "../cells/res_high_po/sky130_fd_pr__res_high_po_0p69.model.spice"
.include "../cells/res_high_po/sky130_fd_pr__res_high_po_1p41.model.spice"