multi-model CDF for transistor symbol

Discussion in 'Cadence' started by Gerd, Mar 31, 2005.

  1. Gerd

    Gerd Guest

    Hi,

    I'm trying to create a symbol view that's usable for 2 transistor
    models, named X and Y. To do this i started modifying a CDF file which
    i dumped from an existing symbol. The idea is to be able to specify
    which model i want when doing 'Add->Instance' in the Composer window.
    This is working fine, and with the callback routine 'EvaluateStuff()' i
    can alter other parameters depending on the choice i click.

    cdfCreateParam( cdfId
    ?name "ModelName"
    ?prompt "Model name"
    ?defValue "X"
    ?choices '("X" "Y")
    ?type "radio"
    ?callback "EvaluateStuff()"
    )
    cdfCreateParam( cdfId
    ?name "A"
    ?display "cdfgData->ModelName->value==\"X\""
    ...
    )
    cdfCreateParam( cdfId
    ?name "B"
    ?display "cdfgData->ModelName->value==\"Y\""
    ...
    )

    I also have two parameters A and B which need to be activated when,
    respectively, X or Y is selected.

    Now, what is not working is changing the A and B label values attached
    to the symbol after it has been instantiated.

    cdfId->paramLabelSet = "-ModelName W L ..."

    The dots should be A or B, depending on parameter ModelName.
    (there are 4 cdsParam() labels specified in the symbol view)

    I tried the following:

    if(cdfFindParamByName(cdfId "ModelName")~>value == "X"
    then
    cdfId->paramLabelSet = "-ModelName W L A"
    else
    cdfId->paramLabelSet = "-ModelName W L B"
    )

    but it does not work on the schematic.

    When i specify 5 labels and enter this, both A and B are displayed
    simultaneously, but it isn't really what i want...

    cdfId->paramLabelSet = "-ModelName W L A B"


    Is it even possible to do something like this?
    (what i can't seem to force is to specify 'cdfId->paramLabelSet' from
    the callback routine 'EvaluateStuff()'...)

    Any help is very much appreciated!

    Gerd.
     
    Gerd, Mar 31, 2005
    #1
  2. Gerd

    S.Badel Guest

    if this is just about displaying the correct one, you may try using an
    ilLabel, with something like this:

    if( ilInst~>model=="X"
    aelSuffixNotation(ilInst~>A)
    aelSuffixNotation(ilInst~>B)
    )

    but i noticed, the ilLabels are often updated only after you do a
    redraw, which may not please you.

    even though i never tried what you tried, i'm not really surprised it
    does not work. cdf callback are to be seen as 'user interface', just to
    show some feedback to the user - but don't rely on them. you never know
    when they will be called and when they won't, what they can do and what
    they can't. (this is my secure approach to cdf)

    if you need to netlist different parameters depending on the model type,
    however, it may be more tricky. it may necessitate a custom netlist
    procedure.

    stéphane
     
    S.Badel, Apr 1, 2005
    #2
  3. Gerd

    Gerd Guest

    Well, i'm trying with these IL labels and i can indeed print the value
    of a CDF parameter. But is it also possible to print something like
    this?

    "A = 2u"

    I mean, printing the parameter name + its value, the way cdsParam()
    does it.

    Stephane, you mentioned the possibility of writing a custom netlist
    procedure. Out of curiosity, do you know in which manual i can find
    information on how to do this?

    thanks,
    Gerd
     
    Gerd, Apr 1, 2005
    #3
  4. Gerd

    Gerd Guest

    Found the answer:

    if( ilInst~>model=="X"
    strcat("A=" aelSuffixNotation(ilInst~>A))
    strcat("B=" aelSuffixNotation(ilInst~>B))
    )
     
    Gerd, Apr 1, 2005
    #4
  5. Gerd

    S.Badel Guest

    yes! or play with sprintf("A=%g" ilInst~>A)
     
    S.Badel, Apr 1, 2005
    #5
  6. Gerd

    S.Badel Guest

    this one includes some information: "Direct SImulation Modeling Guide"

    this one, chapter 4, describes the classes/functions used in this:
    "Cadence Analog Design Environment SKILL Language Reference"

    also this one, chapter 13, for examples : "Virtuoso AMS Environment User
    Guide"


    cheers,

    stéphane
     
    S.Badel, Apr 1, 2005
    #6
  7. Gerd

    S.Badel Guest

    yes! or play with sprintf("A=%g" ilInst~>A)

    sorry the correct syntax is sprintf(nil "A=%g" ilInst~>A)
     
    S.Badel, Apr 1, 2005
    #7
  8. Gerd

    Gerd Guest

    Ok, i will have a look.

    Do you know if you can make the model name a variable in the CDF data
    for auCdl netlisting?

    cdfId->simInfo->auCdl = '( nil
    netlistProcedure ansCdlCompPrim
    instParameters (m L W)
    termOrder (D G S B)
    propMapping (nil m VarProp)
    namePrefix "M"
    modelName "N"
    )

    Whatever i put for modelName (names, variables, quotes, no quotes), it
    is always printed literally in the CDL netlist...
     
    Gerd, Apr 1, 2005
    #8
  9. Gerd

    S.Badel Guest

    Try using 'model' or 'modelName' instead of 'ModelName'.
    also try putting this parameter in the list of 'otherParameters' in the
    CDF simInfo.

    This is from "Cadence Analog Design Environment User Guide", chapter 3,
    "Design Variables and Simulation Files for Direct Simulation":

    By convention, if the parameter model (with prompt Model Name) is set,
    the value is used as the component name.

    I remember having done this successfully ; if this doesn't work i can
    dig in my archives...

    stéphane
     
    S.Badel, Apr 1, 2005
    #9
  10. Gerd

    Guest Guest

    The single quote preceding the paren opening the list means "do not evaluate
    members", so in the above everything inside the parens (included lists) will
    consist of nil, a symbol, a string or a list of nil, symbol and/or string.
    Nothing will be evaluated.

    If you want a variable to be evaluated, use list():

    cdfId->simInfo->auCds = list( nil
    'netlistProcedure 'ansCdsCompPrim
    'instParameters '(m L W)
    'termOrder '(D G S B)
    'proMapping '(nil m VarProp)
    'namePrefix "M"
    'modelName variableName
    )

    -Pete Zakel
    ()

    The Third Law of Photography:
    If you did manage to get any good shots, they will be ruined
    when someone inadvertently opens the darkroom door and all of
    the dark leaks out.
     
    Guest, Apr 1, 2005
    #10
  11. Gerd

    Gerd Guest

    Another question: my pmos cell has a symbol view (with customized Base
    CDF, see before) and a layout view. The layout view is actually a
    Pcell, created graphically. Now it seems that the layout Pcell
    parameters are not visible in the Parameter-section when instantiating
    it. All visible parameters are those of the Base CDF instead... Is
    there a way to separate these within a single cell?
     
    Gerd, Apr 4, 2005
    #11
  12. Gerd

    Gerd Guest

    This is the only combination i can get working:

    cdfId->simInfo->auCdl = '( nil
    netlistProcedure ansCdlCompPrim
    instParameters (m L W model)
    termOrder (D G S B)
    propMapping (nil model ModelName)
    namePrefix "M"
    )

    I'm happy now ;)
     
    Gerd, Apr 4, 2005
    #12
  13. Gerd

    S. Badel Guest

    i think i you use CDF then you have to give your pcell parameters
    the same name as existing cdf parameters. this creates the "link".

    stéphane
     
    S. Badel, Apr 4, 2005
    #13
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.