reg passing parameter value from skill

Discussion in 'Cadence' started by noreply, Jun 29, 2009.

  1. noreply

    noreply Guest

    Dear all,
    i tried to pass the value of the width of an mosfet(layout) from my
    skill program. The mosfet accepted the parameter and the changes were
    seen in the layout but the total width of the mosfet remains unchanged
    (this i saw in the "properties" form of the instance).
    Does this mean that we have to change the total width also with skill
    program?.
    Why doesnt Skill automatically calculate and update the
    parameters?.Like in my case it should have done, totalwidth= number of
    fingers* Width of a single finger.

    Thanks and regards,
    Lokesh rajendran.
     
    noreply, Jun 29, 2009
    #1
  2. noreply

    Riad KACED Guest

    Hi Lokesh,

    But when this kind of things is done programmatically, i.e. by Skill,
    then the CDF callbacks that calculates the total width upon the change
    of W are not triggered. You need then to call those callbacks in your
    skill. search cdf callbacks in this forum for more info.

    Regards,
    Riad.
     
    Riad KACED, Jun 29, 2009
    #2
  3. noreply

    noreply Guest

    Hi Riad,
    I tried the following after going through the posts in our forum.
    ;to do callback
    callback=cdfFindParamByName(cdfId "w")->callback
    errset(evalstring("callback") t)
    By doing this i expected the totalwidth parameter to be changed.But it
    didnt happen, I'm sure there is something wrong in the above code.
    Could somebody please point out.
    Regards,
    Lokesh rajendran.
     
    noreply, Jun 29, 2009
    #3
  4. noreply

    noreply Guest

    Adding to the above post:
    ;the cdfId variable is got from the following code:
    myId=caar(geGetObjectSelectedSet())
    cdfId = cdfGetInstCDF(myId)
    Regards,
    Lokesh rajendran.
     
    noreply, Jun 29, 2009
    #4
  5. noreply

    Riad KACED Guest

    Hi Lokesh,

    Please try the Andrew's abInvokeCdfCallbacks.il and let me know ...
    http://groups.google.com/group/comp...read/thread/ed9411ac41eeb868/4dae4e6c08b6278d

    I have just written a light version of the above where you invoke the
    callback for one given parameter on a particular device. Andrew's
    skill triggers all callbacks for all devices. My skill is just a quick
    one you might improve at you convenience.
    Give a try by running something similar to:
    ; Trigger the noms/w callback in cells myLib/myCell/schematic
    RKinvokeCdfCallbacks("myLib" "myCell" "nmos" "w")

    ; RKinvokeCdfCallbacks.il
    ;----------------------------------------------------------------
    ; Function : RKinvokeCdfCallbacks
    ; This is the main entry
    ;----------------------------------------------------------------
    procedure( RKinvokeCdfCallbacks(libName cellName
    devName param)
    let((cv devToUpdate)
    printf("Processing cell: %s - %s - %s ... \n"
    libName cellName "schematic")
    cv=dbOpenCellViewByType(libName cellName "schematic" nil "a")
    devToUpdate=setof(x cv~>instances x~>cellName == devName)
    foreach( instance devToUpdate
    RKinvokeInstCdfCallbacks(instance param)
    )
    schCheck(cv)
    dbSave(cv)
    dbClose(cv)
    )
    )
    ;----------------------------------------------------------------
    ; Function : RKinvokeInstCdfCallbacks
    ;----------------------------------------------------------------
    procedure( RKinvokeInstCdfCallbacks(instance param)
    let((cdf)
    printf("Processing instance: %s of %s:%s ... \n"
    instance~>name instance~>libName instance~>cellName)
    cdf=cdfGetInstCDF( instance)
    RKinvokeObjCdfCallbacks(cdf param)
    )
    )
    ;----------------------------------------------------------------
    ; Function : RKinvokeObjCdfCallbacks
    ;----------------------------------------------------------------
    procedure( RKinvokeObjCdfCallbacks(cdf param)
    let( (cdfgData cdfparam cdfparamCallback (success t))
    cdfgData=cdf
    cdfparam=cdfFindParamByName(cdfgData param)
    cdfparamCallback=cdfparam~>callback
    printf("The Callback for CDF parameter %s is: %s\n"
    cdfparam~>name cdfparamCallback)
    unless( errset( evalstring(cdfparamCallback) t)
    (success=nil)
    )
    if(success
    printf("Callbck %s has been successfully run.\n"
    cdfparamCallback)
    printf("Callbck %s has failed.\n" cdfparamCallback)
    )
    )
    )
    ;----------------------------------------------------------------


    Please let us know if you need further assistance.
    I can provide more help later on (after working hours, i.e. 6PM GMT)
    if needed.

    Regards,
    Riad.
     
    Riad KACED, Jun 29, 2009
    #5
  6. noreply

    noreply Guest

    Hi Riad,
    Thanks for the code...
    I played around it and understood it.
    Now i have the solution for my problem.
    But i have doubt in the meaning/working of the following line in the
    code:
    ;;;;;;;;;;;;;;;;;;;;;;;
    unless( errset( evalstring(cdfparamCallback) t)
    (success=nil)
    )
    if(success
    printf("Callbck %s has been successfully run.\n"
    cdfparamCallback)
    printf("Callbck %s has failed.\n" cdfparamCallback)
    ;;;;;;;;;;;;;;;;;;;;
    What i understood is that you have purposefully intialised the
    variable "success" to "nil".Hence regardless of the fact the "errset"
    execution is done or not. The statement "printf("Callbck %s has failed.
    \n" cdfparamCallback) " will only be executed(Because of the "if"
    statement and the value of "success").
    Do i sound clear?.If so, Please do explain

    Regards,
    Lokesh rajendran.
     
    noreply, Jun 30, 2009
    #6
  7. noreply

    Riad KACED Guest

    Hi Lokesh,

    Variable 'success' is initialized to t right when created: (success
    t).
    In the snippet you mentioned, success id getting st to nil whenever an
    error occurs at the evaluation of the callback. In fact, the callback
    evaluation is wrapped by the evalstring to provide a safe running
    environment. If an error occurs in the evaluation of the callback,
    then errset would return nil which makes the unless loop getting
    evaluated, hence success setup to nil. Please look ate the skill doc
    for more information about the functions involved in here. the if loop
    would print either messages depending on the value of success. Note
    that then/else keywords are missing, This is just a short writing
    style when there is only one command to executed for each of the then/
    else blocks.

    Hope it is clearer ...
    Regards,
    Riad.
     
    Riad KACED, Jun 30, 2009
    #7
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.