Menu

#289 Monte Carlo Mismatch Bug

v1.0 (example)
closed-fixed
3
2018-11-04
2014-07-23
No

There is an issue with MC simulations whereby mismatch effects are seemingly ignored. In the example below, 2 identical resistors in parallel always give 1/2 the supply voltage. This is incorrect;

.SAVE all

XR1 pot1 vdd1 resno l=100u w=0.5u mf=1 scale=1 mismatchflag=1
XR2 0 pot1 resno l=100u w=0.5u mf=1 scale=1 mismatchflag=1
V1 vdd1 0 1V
XR3 pot2 vdd2 resno l=100u w=0.5u mf=1 scale=1 mismatchflag=0
XR4 0 pot2 resno l=100u w=0.5u mf=1 scale=1 mismatchflag=0
V2 vdd2 0 1V

.subckt resno n1 n2 l=length w=width scale=1 mf=1 mismatchflag=0
.param geo_fac ='1/sqrt(mflscalewscale1e12)'
.param factmis='0.01707
geo_facpar_resmismatchflag'
.param Rsh = 'r_resno(1+factmis)'
.param Rend0 = 'rend_resno
(1+factmis)'
.param dw = '0.027u + dxw_resno' dl = '0 + dxl_resno'
.param pvcp1 = -2.96E-01 pvcp2 = -8.04E-06 pvcp3 = -2.449 ptcp1 = 1.51E-03 ptcp2 = 1.10E-06
.param pvce1 = -6.89E-02 pvce2 = 1.12E+03 pvce3 = -1.82E-01 ptce1 = 1.25E-03 ptce2 = 2.50E-06
.param pt='temper'
.param tface='1.0+ptce1(pt-25.0)+ptce2(pt-25.0)(pt-25.0)'
.param tfacp='1.0+ptcp1
(pt-25.0)+ptcp2(pt-25.0)(pt-25.0)'
Rend1 n1 3 'Rend0/mf/w/scaletface(1+pvce1(tanh(pvce2abs(v(n1,3))+pvce3)-tanh(pvce3)))'
Rp 3 4 'Rsh/mf(lscale-dl)/(wscale-dw)tfacp(1+pvcp1(tanh(pvcp2abs(v(3,4)/(lscale-dl))+pvcp3)-tanh(pvcp3)))'
Rend2 4 n2 'Rend0/mf/w/scaletface(1+pvce1(tanh(pvce2abs(v(4,n2))+pvce3)-tanh(pvce3)))'
.ends resno

  • which requires at least
  • dxl_resno

.Param
+par_res=AGAUSS(0,1,1)
+par_rp=var_rp
+par_dwnod =var_dwnod
+par_rendnod=var_rendnod
+r_resno = '92.99(1+0.15/4par_rp)' rend_resno = '8.46u(1+0.4487par_rendnod)' dxl_resno = '0+0.0u' dxw_resno = '0.023u*par_dwnod'

.param
+random_rpsa=AGAUSS(0,1,1)
+random_rp=AGAUSS(0,1,1)
+random_dwnod =AGAUSS(0,1,1)
+random_rendnod=AGAUSS(0,1,1)
+var_rpsa=random_rpsa
+var_rp=random_rp
+var_dwnod =random_dwnod
+var_rendnod=random_rendnod

.END

Discussion

  • Justin Fisher

    Justin Fisher - 2014-08-11

    A bit of digging around the code by Robert has unearthed the following:

    If you massage the model in the following manner, Mote-Carlo will work for mismatch and process variations:

    Any line in the model that looks like this...

    random_rpsa=AGAUSS(0,1,1)

    should be changed to...

    .func
    +random_rpsa()={AGAUSS(0,1,1)}

    Anywhere a parameter is called by another parameter also needs to be re-written in the same manner. So....

    .param myparam=2*random_rpsa

    now becomes...

    .func myparam()={2*random_rpsa()}

    Use the 2 attached files, read the comments, adjust accordingly then run ngspice on the control file.

     

    Last edit: Justin Fisher 2014-08-11
  • Paolo Nenzi

    Paolo Nenzi - 2014-08-11
    • Priority: 2 --> 9
     
  • Justin Fisher

    Justin Fisher - 2015-09-29
    • Priority: 9 --> 3
     
  • Holger Vogt

    Holger Vogt - 2016-11-24
    • status: open --> open-fixed
     
  • Holger Vogt

    Holger Vogt - 2018-11-04
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB