A problem with forcing re-evaluation of CDF callbacks on instances

Discussion in 'Cadence' started by Svenn Are Bjerkem, Nov 7, 2006.

  1. Hi,
    based on some SKILL I found here, I put together a snippet to force
    re-evaluation of callbacks on CDF parameters. The script does what it
    is supposed to do, at least on those CDF parameters that have a
    callback.

    I have a problem with the connection between the model name and the
    cellName in TSMC technology. In the kit that I have there is a
    connection between the cellName and the model name so that the model
    name is write protected in the object property form. It changes when
    the cellName change.

    I have some schematics that I have imported as skill code and in these
    cellviews this connection is lost so that when using a hierarchical
    search and replace to change from plain transistors to montecarlo
    transistors, the cellname is changed but the modelname not. If I
    manually change the cellname in the object property dialog back and
    forth a couple of times and press apply, then the connection seems to
    be reinserted.

    I am wondering how the connection between cellname and modelname of an
    instance is established.

    Here is the force CDF evaluation script. If you find something to
    improve, then I would be happy to know. I had to use a sprinf
    workaround because I didn't know how to make dbGetq accept a variable
    and not a symbol.

    ;==============================================================================
    ; SABforceCDFeval -- Force the reevaluation of a CDF callback
    ;
    ; Author : Svenn Are Bjerkem
    ; Date : 2006-11-05
    ; Modified : 2006-11-07
    ; Limitations : Currently only one level can be flattened
    ;
    ; Example of usage:
    ; (SABforceCDFeval "MyLib" 'w)
    ;==============================================================================
    (procedure (SABforceCDFeval libName paramName)
    (let (libId cvId viewName)
    (setq libId (ddGetObj libName ))
    (setq viewName "schematic")
    (setq listOfCells (dbGetq libId cells))
    (setq cellList (setof cell listOfCells (member viewName
    (dbGetq (dbGetq cell views) name))))
    (foreach cell cellList
    (setq cellName (dbGetq cell name))
    (setq cvId (dbOpenCellViewByType libName cellName viewName
    nil "a"))
    (foreach instRef (dbGetq cvId instances)
    (sprintf evalParam "(dbGetq instRef %s)" paramName)
    (when (setq value (evalstring evalParam))
    (printf "%s of %s is %L\n" paramName (dbGetq
    instRef name) value)
    ;(putpropq instRef (lowerCase value) cellName)
    (setq cdfgData (cdfGetInstCDF instRef))
    (setq callback (getq (get cdfgData paramName)
    callback))
    (when (and callback (nequal callback ""))
    (errset (evalstring callback) t))))
    (schCheck cvId)
     
    Svenn Are Bjerkem, Nov 7, 2006
    #1
  2. Svenn Are Bjerkem

    Andy Guest

    Dear Sveen

    Could you tell us what's kind of process you use?
    I guess you are using TSMC's PDK, right?

    Andy
    "Svenn Are Bjerkem дµÀ£º
    "
     
    Andy, Nov 7, 2006
    #2
  3. Hi Svenn,

    I can't give you a straight forward answer.
    Also I didn't understand quite well how the kit
    is organized in terms of cells and corresponding models.
    You mentioned the cellName and the model name were connected.
    Does this mean for every cell (master) there is a separate model?

    Maybe you could reattach the correct models by automatically
    querying through the instances of your schematic with SKILL and
    have a cellName | model table which holds the connection.

    Something like:

    foreach( d_inst cvId~>instances
    l_parameters = cdfGetInstCDF( d_inst )~>parameters
    foreach( d_parameter l_parameters
    when( d_parameter~>name == "model"
    case( d_inst~>cellName
    ( "cellA"
    d_parameter~>value = "modelA"
    )
    ....


    Bernd
     
    Bernd Fischer, Nov 8, 2006
    #3
  4. At least for each MOSFET there is a separate cell for each model, and
    the cellname and the modelname are equal. If you do a search and
    replace on a schematic, normally the modelname change when I change the
    cellname, but when I generate the schematic from skill, there modelname
    stays put. But I have experienced that the following procedure bring
    the cell back on track:

    Initial state: cellname: nch_18, modelname nch_18
    1st edit: cellname: nch_18_mac, modelname nch_18 (should have been
    nch_18_mac)
    2nd edit: cellname: nch_18, modelname nch_18
    3rd edit: cellname: nch_18_mac, modelname: nch_18_mac.
    The only thing I do is to add or delete _mac in the object property
    dialog and press apply inbetween each operation. So there must be some
    kind of "automatic" compare in the kit that takes care of the
    modification of the model parameter. (I once had the modelname NCH_18
    in capital letters, and then I could modify the cellname forever
    without any luck. Seems to be a string compare somewhere)
    This was exactly the way I did it in the end. I first did a selective
    search and replace on all MOS transistors that were to be simulated
    montecarlo, and then I fired of a skill snippet that changed the model
    name to that of the cell name. I think your way of using a case is an
    improvement as it is possible to not react on cells that have different
    model and cell name, like the PNP's.
    I had to manually change them back, but that was not so much work
    compared to the other way around. :)

    --
    Svenn

    ;==============================================================================
    ; SABsetModelByForce -- Force the model name to be the same as cellname
    ;
    ; Author : Svenn Are Bjerkem
    ; Date : 2006-11-08
    ; Modified : 2006-11-08
    ;
    ; Example of usage:
    ; (SABsetModelByForce "MyLib")
    ;==============================================================================
    (procedure (SABsetModelByForce libName)
    (let (libId cvId viewName modelName cellName cellRef)
    (setq libId (ddGetObj libName ))
    (setq viewName "schematic")
    (setq listOfCells (dbGetq libId cells))
    (setq cellRefList (setof cell listOfCells (member viewName
    (dbGetq (dbGetq cell views) name))))
    (foreach cellRef cellRefList
    (setq cellName (dbGetq cellRef name))
    (setq cvId (dbOpenCellViewByType libName cellName viewName
    nil "a"))
    (foreach instRef (dbGetq cvId instances)
    (setq entName (dbGetq instRef cellName))
    (when (setq modelName (dbGetq instRef model))
    (printf "%s has cellname %s and modelname %s\n"
    (dbGetq instRef name) entName modelName)
    (when (nequal entName modelName)
    (printf "before: %s, " (dbGetq instRef model))
    (putpropq instRef entName model)
    (printf "after: %s\n" (dbGetq instRef model))))
    (schCheck cvId)
    (dbSave cvId)
    (dbClose cvId)
    )))
    t)
     
    Svenn Are Bjerkem, Nov 9, 2006
    #4
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.