gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnucap-devel] Re: [Help-gnucap] "binning" of models


From: Al Davis
Subject: Re: [Gnucap-devel] Re: [Help-gnucap] "binning" of models
Date: Tue, 15 Jan 2002 00:28:25 -0700

Dan's mail actually covered more than just binning.  To simplify
things, I am limiting this reply to just binning.

Also, I have taken the liberty to forward it to the developer list,
where more people interested in development will see it.

My interpretation of binning in HSPICE:
(Dan: please correct me if I am wrong.)

You can have a group of models:

.MODEL nch.1 NMOS ( LMIN = 1.2E-06
+LMAX = 2.1E-05 WMIN = '1.01E-05-dxw' WMAX = 0.000101 
+NLEV = 3 AF = 0.8 KF = 9.3E-25
* rest of model not shown....
)

.MODEL nch.2 NMOS ( LMIN = 5E-07
+LMAX = '1.2E-06-dxl' WMIN = '1.01E-05-dxw' WMAX = 0.000101 
+NLEV = 3 AF = 0.82 KF = 9.9E-25
* rest of model not shown....
)

*and then there are a handful more models (nch.{3,4,5...}) and also
*ones for pmos.

Dan showed this inside a ".LIB .ENDL" block.  I believe this is
irrelevant to this issue.

>When you call out 'nch' as the model when you instantiate a NMOS in
>your netlist, hspice uses the LMIN,LMAX,WMIN,WMAX to figure out which
>model to actually use for that device. Also, the parameters listed in
>the process corner section are substituted to give an appropriate
>process skew.

So a device might look like:

M123 1 2 3 4 nch W=8e-6 L=600e-9 

This selects one of the models from the family nch.* .  I assume that
it selects the first one (by order? by suffix?) for which WMIN <= W <=
WMAX and LMIN <= L <= LMAX .

Is that necessarily a number after the dot? Must they be consectutive?

What happens if more than one match?  For now, I assume that any
matching choice would be ok, but it probably just takes the first.  Is
this an error?  Should it be reported?  (My guess and hope: no.)

What happens if none match?  error? take the closest?  (my guess and
hope: error.)

================================================
Some ideas on implememtation in Gnucap.

Existing model selection is as follows:

The function "expand" calls "attach_model", with a string name of the
model to be selected.

"attach_model" returns a pointer to the matching model, or throws an
exception if it fails.  This model is not guaranteed to be the correct
type.  It is checked for type, using dynamic_cast, and an exception is
thrown if it doesn't match.

done.

The "attach_model" function (in a base class COMPONENT_COMMON) uses a
linear search of a model list.  There is a known scope bug here.
Models are not scoped as they should be.  The linear search method is
not a problem because it is searching only models.  Even for a large
circuit, the list of models is short.

A possible approach to changes to implement binning:

Basic idea:

The "attach_model" function must validate the model - device
combination. If the validation fails, keep looking.  If it always
fails, throw an exception.

Matching is done by the implicitly called operator!=(string) member of
the model.  This function, or something related to parsing, needs to
be changed to check only the part before the dot, here, but the whole
thing on entry.

A new function "validate" is needed (member of model, taking a
COMMON_COMPONENT as an argument) to check the parameters.  It needs to
be generated by the model compiler.

Model files need a new section to specify this.  Call it "validate".
It is under "model".  The body will consist of a list of statements
that must be true. It might look something like:

model MOS_BASE {
  dev_type MOS;
  base;
  inherit DIODE;
  keys {
    NMOS polarity=pN;
    PMOS polarity=pP;
  }
  validate {
    return m->lmin <= c->l_in
        && m->lmax >= c->l_in
        && m->wmin <= c->w_in
        && m->wmax >= c->w_in;
  }
  // more model stuff....

The parameters must be listed like the other parameters.

Since the model compiler supports inheritance, doing it once in the
base makes it work for all mosfets, and still leaves open the option
to do each one differently.
==================================================

It seems easy to do, and is general, so it will happen, probably in
the next release.

I have asked some questions above in my reply.  I would appreciate an
answer in two forms.  1. What does HSPICE do?  2. What should Gnucap
do?


Comments?????


al.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]