The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Question about Mote Carlo mismatch model file
https://designers-guide.org/forum/YaBB.pl?num=1066706959

Message started by BSIM4 on Oct 20th, 2003, 8:29pm

Title: Question about Mote Carlo mismatch model file
Post by BSIM4 on Oct 20th, 2003, 8:29pm

Hi,

I am trying to modify a Spectre model file in order to run Monte Carlo simulation with mismatch. However, I have a problem.

According to the user's guide, I can specify a fixed standard deviation for the mismatch of a parameter. However, in reality mismatch changes with device size. How can I put the size-sensitive coefficient into the model file?

Thanks.

Title: Re: Question about Mote Carlo mismatch model file
Post by Paul on Oct 21st, 2003, 2:38am

The workarounds I found to this limitation are
1) using different model files for the different device sizes, or
2) using subcircuits instead of primitives for the devices. In the subcircuit you can compute the mismatch parameters according to the dimensions and then call the model with the right parameter values. This requires creating subcircuit definitions for your devices, so I hope you have some CAD people who can handle this.

Paul

Title: Re: Question about Mote Carlo mismatch model file
Post by BSIM4 on Oct 21st, 2003, 7:41pm

Thanks Paul. I will try it.

Title: Re: Question about Mote Carlo mismatch model file
Post by BSIM4 on Oct 31st, 2003, 6:03pm

Paul,

Thanks for your advice. I tried the subcircuit method, it works fine with one problem:

The multiplicity factor m. m is not accessable in subcircuits. The result is that standard variation of m devices in parallel generates m times of variation rather than sqrt(m).

Any comments?

Title: Re: Question about Mote Carlo mismatch model file
Post by Paul on Nov 3rd, 2003, 8:23am

I must admit that I did not face that problem because we were using some customized design kit. Can you give more details on the way you did it exactly and the tools you are using? Are you using your primitive device inside the subcircuit? In that case you should be able to set a parameter on the subcircuit symbol which will be propagated to the primitive symbol. That parameter can be accessed in the subcircuit to compute the sigma value.

The way I see it:
subcircuit (parameters W, L, M)
 calculations for sigma and modified parameters
 primitive device with modified parameter values
end subcircuit

The parameters W,L and M shall be propagated from the subcircuit symbol to the primitive symbol.

Does this help?

Paul

Title: Re: Question about Mote Carlo mismatch model file
Post by BSIM4 on Nov 11th, 2003, 11:34am

Paul,

Thank you very much for your help. I am using Spectre and modifying a TSMC Sige BiCMOS design kit.

Now I can do Monte Carlo simulation on most devices. However, It seems that there is an ultimate barrier:

The Monte Carlo simulation will fail if model binning is used. In my case, MOS devices are modeled in many bins.

I have no clue on how to work around this problem.

Title: Re: Question about Monte Carlo mismatch model file
Post by Mighty Mouse on Nov 11th, 2003, 9:13pm

I'm not aware of any such limitation. Can you tell us why you think that is true?

Spectre also provides a non-Monte Carlo based mismatch analysis. Have you tried it?

- MM -

Title: Re: Question about Mote Carlo mismatch model file
Post by BSIM4 on Nov 12th, 2003, 4:20pm

The problem was:

When I used monte carlo simulation to simulate CMOS devices in sub-circuits which instanciate a MOS device with model binning, the first run is fine. But the second run fails with a message citing "segmentation fault".

It is fine if I do not use model binning.

Title: Re: Question about Monte Carlo mismatch model file
Post by Mighty Mouse on Nov 12th, 2003, 10:20pm

Any segmentation fault implies a bug. You should report it to Cadence and have them fix it.

- MM -

Title: Re: Question about Monte Carlo mismatch model file
Post by Paul on Nov 13th, 2003, 12:10am

> Spectre also provides a non-Monte Carlo based mismatch analysis. Have you tried it?

Mighty Mouse,

I am not aware of this analysis. I am mostly using ELDO, but I would be interested in this Spectre feature. What Analog Environment menu can I find it in?

For the binning problem, I don't have any solution, I used this with non-binned models (older technology). I agree that you should try to get support from Cadence for this bug. BTW, there is a third possibility I didn't mention in my first answers. If you have an EKV model (instead of BSIM), this model contains the mismatch parameters in the model, so there's no need to go the subcircuit way... Unfortunately, EKV doesn't seem to become an foundry standard.

Paul

Title: Re: Question about Mote Carlo mismatch model file
Post by BSIM4 on Nov 14th, 2003, 2:30pm

Paul and Mighty Mouse,

Thank you very much for your help.

Title: Re: Question about Mote Carlo mismatch model file
Post by EVI on Dec 1st, 2003, 7:26am

You have to place the expressions into every model section of your binned models. Here is an example of how to do this with binned modls:

parameters vth0mis_n=0.0
parameters vth0mis_p=0.0
parameters u0mis_n=0.0
parameters u0mis_p=0.0

statistics{
 process{
   vary vth0mis_n dist=gauss std=0
   vary vth0mis_p dist=gauss std=0
   vary u0mis_n dist=gauss std=0
   vary u0mis_p dist=gauss std=0
 }
 mismatch{
   vary vth0mis_n dist=gauss std=4e-3
   vary vth0mis_p dist=gauss std=5e-3
   vary u0mis_n dist=gauss std=0.4e-2
   vary u0mis_p dist=gauss std=0.6e-2
 }
}

inline subckt nmos (d g s b)
        parameters w=1u l=1u wd=0.6e-6 ws=0.6e-6 ad=wd*w as=ws*w pd=(2*wd) + (2*w) ps=(2*ws) + (2*w)
        nmos (d g s b) nmos w=w l=l ad=ad as=as pd=pd ps=ps


model nmos bsim3v3  {
    1: type=n minr=.... lmin=.... lmax=.... wmin=..... wmax=.....  
+ ............    vth0=0.5 + dvthn + vth0mis_n/sqrt(w*l*1e12)    ..............    
+ ......         u0=0.04*(1+u0mis_n/sqrt(w*l*1e12))   ......................

   2:    // same way

}  

Eugene

Title: Re: Question about Mote Carlo mismatch model file
Post by EVI on Dec 1st, 2003, 11:51am

Just a comment about the efect of multiplier on Monte-Carlo sim results. You cannot pass the multplier down to the subcircuit in Spectre (I'm not sure about spice), Spectre doesn't allow you to do that. But this is not a problem for Monte-Carlo simulations because the laws of statistics will take care of this - you will have m devices connected in parallel, each device producing some drain current statistical variation dI, so the total variation (standard deviation) will be sqrt(m)*dI, not m*dI.

Eugene.    

Title: Re: Question about Mote Carlo mismatch model file
Post by uncle_ezra on May 11th, 2005, 7:56pm


EVI wrote on Dec 1st, 2003, 7:26am:
inline subckt nmos (d g s b)
        parameters w=1u l=1u wd=0.6e-6 ws=0.6e-6 ad=wd*w as=ws*w pd=(2*wd) + (2*w) ps=(2*ws) + (2*w)
        nmos (d g s b) nmos w=w l=l ad=ad as=as pd=pd ps=ps


Can you explain the above line is doing? Do you include only once or you need for every MOS

Title: Re: Question about Mote Carlo mismatch model file
Post by Ken Kundert on May 11th, 2005, 9:48pm

First of all, I believe that subcircuit definition is incorrect. I don't think you can have a subcircuit name and a model name both being the same name.

However, what this does is define a parameterized subcircuit nmos that contains a single nmos transistor. The subcircuit is used simply to customize the parameters taken by the nmos transistor. In particular, it is adding two new parameters, wd and ws.

The 'inline' designator tells Spectre not to add an additional level of hierarchy for the subcircuit.

-Ken

Title: Re: Question about Mote Carlo mismatch model file
Post by uncle_ezra on May 11th, 2005, 10:49pm

Hi all,

How do I vary vth without actually using a voltage source and varying it by delta? Below is what I tried to do but it does not work. What name should I give to subckt?


statistics{
mismatch{
vary vth0mis_n dist=gauss std=3e-3
}

inline subckt nmos (d g s b)
   parameters w=1u l=1u
   nmos (d g s b) nmos w=w l=l

model n_bpw_33_mm bsim3v3
type=n
+ vth0 = 0.6+dvth0+vth0mis_n/(w*l)


Thanks

Title: Re: Question about Mote Carlo mismatch model file
Post by uncle_ezra on May 12th, 2005, 12:55am

Actually could someone provide a working template for monte carlo simulation.  It would be very helpful.

thanks

Title: Re: Question about Mote Carlo mismatch model file
Post by uncle_ezra on May 12th, 2005, 1:37am

So this is the model provided in Cadence help:

library monteLib

section param
simulator lang=spectre
parameters PiRho=2500 PbRho=200 npnbeta=145.5 pnpbeta=200parameters rin1=1000 rin2=5000 rout1=1000 rout2=3000parameters cin=1.7e-08 cloop=1e-09parameters mmstat=1 initstat=1
function Rpb(l,w)=(PbRho*l/w)function Rpi(l,w)=(PiRho*l/w)
endsection param

section stats
simulator lang=spectre

statistics {      
process {               vary PiRho     dist=gauss std=350               vary PbRho     dist=gauss std=50               vary npnbeta   dist=lnorm std=.9               vary pnpbeta   dist=lnorm std=1.1               vary Rin       dist=gauss std=150               vary cin       dist=gauss std=20p               vary rin2      dist=gauss std=100               vary Cfb       dist=gauss std=.58n               vary rout1     dist=gauss std=30               vary rout2     dist=gauss std=50       }      

mismatch {               vary PiRho   dist=gauss std=19               vary PbRho   dist=gauss std=3.75               vary npnbeta dist=gauss std=4               vary pnpbeta dist=gauss std=6       ]
endsection stats

section models
simulator lang=spectre
inline subckt npn (C B E S)
parameters brvbe=.6model
mynpn bjt type=npn is=5.771e-17 bf=npnbeta nf=0.9895 vaf=201.6
+ ikf=0.01573 ise=8.976e-18 ne=1.179 br=3.204 nr=0.9944
+ var=27.03 ikr=0.0003047 isc=1.505e-13 nc=1.912 rb=8.706
+ irb=0.001509 rbm=5.833 re=111.8 rc=54.97 xtb=1.5 eg=1.11
+ xti=3 cje=1.983e-12 vje=0.4818 mje=0.2486 tf=0.33e-9
+ xtf=4.359 itf=0.01753 ptf=176.2 cjc=1.749e-12 vjc=0.5989
+ mjc=0.3349 xcjc=0.5 tr=400e-9 cjs=1e-12 vjs=0.75
+ mjs=0.33 fc=0.5 bvbe=brvbe bvce=1

npn (C B E S) mynpn
ends npn

inline subckt pnp (C B E S)
model mypnp bjt type=pnp
+is=1.2e-16 bf=pnpbeta nf=1.00 vaf=26.00
+ikf=70e-06 ise=1.1e-15 ne=2.00 br=13
+nr=1.00 var=10.00 ikr=100e-06 isc=7.0e-15
+nc=2.50 rb=100
+re=15 rc=150 cje=33e-15 vje=740e-03
+mje=330e-03 tf=2.50e-09 xtf=1.00
+itf=2.00e-03 ptf=5.0 cjc=130e-15 vjc=690e-03
+mjc=440.00e-03 xcjc=500.00e-03 tr=5.00e-09 cjs=200e-15
+vjs=590e-03 mjs=440.00e-03 xtb=780e-03 eg=1.200
+xti=1.80 kf=1.60e-15 af=1.00 fc=850.00e-03

pnp (C B E S) mypnp
ends pnp

endsection models

endlibrary monteLib


Where does the name "subckt npn (C B E S)" come from?
Also isnt the model file in a separate file? Can you just modify it???

Title: Re: Question about Mote Carlo mismatch model file
Post by Andrew Beckett on May 17th, 2005, 10:24am

Did you read http://www.designers-guide.org/Modeling/montecarlo.pdf?

Regards,

Andrew.

Title: Re: Question about Mote Carlo mismatch model file
Post by jimi on Sep 6th, 2005, 10:03pm

A working example for TSMC 0.13 um process.

section tt
...
// add following
parameters avt_nch=0
parameters avt_pch=0
statistics {
  process {
     vary avt_nch dist=gauss std=0
     vary avt_pch dist=gauss std=0
  }
  mismatch {
     vary avt_nch dist=gauss std=4.6
     vary avt_pch dist=gauss std=3.95
  }
}
inline subckt nch (d g s b)
parameters w=1u l=1u
nch (d g s b) nch_mc w=w l=l m=1 region=triod
include "cl013g_fsg_mc.scs" section=mos
ends nch

inline subckt pch (d g s b)
parameters w=1u l=1u
pch (d g s b) pch_mc w=w l=l m=1 region=triod
// end of jimi's code
include "cl013g_fsg_mc.scs" section=mos
ends pch

endsection tt

// then change model name nch in setion mos to nch_mc

The monte carlo works well for m=1, but for m=n, the std is n times instead of sqrt(n), still need some help and feedback to correct it!
Good luck!

Title: Re: Question about Mote Carlo mismatch model file
Post by manohar.b.n on Dec 29th, 2007, 5:53pm

Hi all,
I am trying to do a mismatch analysis (monte carlo simulation). I am using the Chartered semiconductor 180nm library using BSIM3v3,

I want to vary the threshold voltage for each transistor in my circuit for each simulation. However, I am getting the same delay for all 20 runs of the monte carlo simulation.

From reading the topic (and also some of the other related topics in this forum), I understand that in order to vary the threshold voltage (device paramater), I need to vary the width/ length of the transistor. Is this correct? or i can vary the threshold voltage directly.

My Library file is like this:

library MyLib

section param                             // I added this section
simulator lang = spectre             // I added this section
parameters vth_variable1 = 1     // I added this section
parameters vth_variable2 = 1    // I added this section
endsection param                      // I added this section

section stats                              // I added this section
simulator lang = spectre
statistics {
          mismatch {
           vary vth_variable1 dist=gauss std=0.1
           vary vth_variable2 dist=gauss std=0.1
           }
}
endsection stats                               // I added this section

section monte_carlo                                             // I added this section
include "sm093001-1k.scs" section=param
include "sm093001-1k.scs" section=ntn_typ
include "sm093001-1k.scs" section=stats
include "sm093001-1k.scs" section=ptn_typ
include "sm093001-1k.scs" section=hdif
endsection monte_carlo                                       // I added this section

section ntn_typ                                                             // section already provided in the library
//
// model = bsim3
// NewModel =   3
// MetaSoftware Compatibility Mode
// These are BSIM3v3 Model Parameters
// LotName=LOT_NAME UserName=USER Date=03-01-2001
model nmos_1p8 bsim3v3  {
    1: type=n lmin=1.8000000e-07 lmax=0.00000025 wmin=2.19999998807907e-07 wmax=4.39999997615814e-07
+ tnom=25.0 paramchk=1 version=3.2   ......... and all other parmaters

// model = bsim3
// NewModel =   3
// MetaSoftware Compatibility Mode
// These are BSIM3v3 Model Parameters
// LotName=LOT_NAME UserName=USER Date=03-01-2001
//   Typical Models nmos_1p8 ***
    2: type=n lmin=1.8000000e-07 lmax=0.00000025 wmin=4.39999997615814e-07 wmax=8.00000011920929e-07
+ tnom=25.0 paramchk=1.................................and all other paramaters

/ /
    }
endsection ntn_typ


Now in this model, there are paramteres defined for each width and length like if i give the width of the transistor as 3u then it picks up the the 4th part in the model ntn_typ
So in the 4th part where vth0 was defined, I changed it to "vth0=0.3340089*vth_variable1".

However, i am getting the same delay in all simulations.


Please help me on this.

Manohar

Title: Re: Question about Mote Carlo mismatch model file
Post by Geoffrey_Coram on Jan 2nd, 2008, 4:52am


xtal wrote on Dec 29th, 2007, 5:53pm:
From reading the topic (and also some of the other related topics in this forum), I understand that in order to vary the threshold voltage (device paramater), I need to vary the width/ length of the transistor. Is this correct? or i can vary the threshold voltage directly.


You can vary the threshold voltage directly; you seem to have done this in your example.


Quote:
Now in this model, there are paramteres defined for each width and length like if i give the width of the transistor as 3u then it picks up the the 4th part in the model ntn_typ
So in the 4th part where vth0 was defined, I changed it to "vth0=0.3340089*vth_variable1".



I think there's something wrong with your section set-up.  In your netlist, what is your library statement?

Title: Re: Question about Mote Carlo mismatch model file
Post by John O Donovan on Jan 16th, 2008, 9:35am

Hi,

You can vary some model parameters directly on the instance using the following parameters

 delvto   : shift in zero-bias threshold voltage  (default = 0.0)
 delk1    : shift in body bias coefficient (default = 0.0)
 delnfct  : shift in subthreshold swing factor (default = 0.0)

These are valid parameters for bsim3v3 and bsim4

So if you have a model file that defines a model nmos_1p8 as in your example (which contains multiple bins), you could simply do the following

parameter mm_vto = 0.0
statistics {
 mismatch {
   vary mm_vto dist=gauss std=0.1
 }
}

inline subckt nmos_1p8_mm d g s b
 parameters l w
 nmos_1p8_mm d g s b nmos_1p8 l=l w=w delvto=mm_vto
ends nmos_1p8_mm

m1 1 2 3 4 nmos_1p8_mm l=1u w=0.2u
m2 1 2 3 4 nmos_1p8_mm l=1u w=0.2u

Here you create a mismatch variable "mm_vto", and use the instance "delvto" parameter to directly modify vt0 of the instance. By creating the subckt nmos_1p8_mm, m1 and m2 in the example will have different values for "delvto" during mismatch analysis.

Regards,
 John

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.