• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Change ?choice value for cdfCreateParam , cyclic type

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 148
  • Views 8419
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Change ?choice value for cdfCreateParam , cyclic type

amaru
amaru over 2 years ago

I am working on a pcell. In cdfCreateParam, Cyclic type option, I want to alter choices for that parameter. I will try to explain in brief, what I am trying to do :  There are 5 layers in pcell. I want to to give user option to change the some values corresponding to each layer. In first option I am asking user, out of these 5 layers, how many layers they want to edit, the layers chosen by  user should get reflected in cyclic field and other layers should disappear (to avoid confusion). Now I am able to do it with cdfgData->myCyclicParam->choices=<layer Choosen By user> through a callback. But the issue I am facing is that these choices are getting updated for all instances of that pcell, not only for that particular instance. Now in real case I might have 30-40 layers, So I don't want to show every layer in cyclic parameter, I want only those layer selected by user in other cdf parameter to display in cyclic parameter only for that particular pcell instance. Please help me in solving this issue. In case it is not possible by design, is there any other way in pcell to do that?

I have tried to explain in detail, if there is anything left or confusing, let me know.

Thanks in advance

Amar

  • Cancel
  • p94todorov
    p94todorov over 2 years ago

    Hello Amar,

    what comes to my mind is to create a dummy CDF parameter, which can contain the valid choices for a given instance. Let's name it dummyChoices and you can make it of a type ILList for convenience. You can hide this parameter and change it's values directly from whatever triggers the change of choices for your myCyclicParam and then the callback of the hidden dummyChoices parameter will update the actual choices available for myCyclicParam in your given instance.

    You will also need a custom formInitProc that will execute the callback of the dummyChoices parameter when the Property Editor GUI is invoked and it will load the valid values for each instance independently, sine they will be read from it's own CDFs. This should be enough to decouple the described behaviour and since you always only have one Property editor form active for a given device, no one will notice the side effects described by you above.

    There might be a better solution to this and I will check this thread in the next few days. Let me know in case what I've written is unclear, so I can elaborate.

    Regards,

    Petar

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to p94todorov

    I think (I didn't test this) that you could also just update the choices in both the formInitProc and the callback on whatever parameter is controlling the change of choices; I don't believe you'd need t add a dummy parameter to do this (the only reason would be if you want to avoid repeating the same logic in the formInitProc as in the callback, but a shared function could be used in both places so that doesn't seem particularly problematic; probably safer than relying on caching the choices in another parameter, I'd have thought).

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • amaru
    amaru over 2 years ago in reply to Andrew Beckett

    Thanks Petar and Andrew for your responses.

    By trying Petar's methods, what I observed is- When I select few layers in my pcell, it is reflected in cyclic options but when I click OK and reopens the edit window, It again shows all the layers. It is not saving previous values (the layers). Do you have any idea, how can I resolve this?

    I have tried Andrew's method as well - My procedures are different for forminitProc and SelecLayer procedure. It was not working directly, What I did was I added enable cdf variable for each layer of the original set with default nil - When user selects the layer by SelectLayer Procedure, those cdf variable are marked t. So next time when I will open the edit window by "query" , forminitProc , it will check which layers are marked t, Those layers list it will set to choices of cyclic values. Right now it is working as expected. Is this the correct approach?  Can it create any issue in future ?

     

    Please let me know, if any other information is needed.

    Thanks

    Amar

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to amaru

    Amar,

    It's not clear to me what you're doing here. Perhaps you could share your code? Otherwise we're having to guess from your description, and I don't quite get what you're saying.

    Here's what I just tried:

    /****************************************************/
     LIBRARY = "mylib"
     CELL    = "layerCyclic"
    /****************************************************/
    
    let( ( libId cellId cdfId )
        unless( cellId = ddGetObj( LIBRARY CELL )
            error( "Could not get cell %s." CELL )
        )
        when( cdfId = cdfGetBaseCellCDF( cellId )
            cdfDeleteCDF( cdfId )
        )
        cdfId  = cdfCreateBaseCellCDF( cellId )
    
        ;;; Parameters
        cdfCreateParam( cdfId
            ?name           "bottom"
            ?prompt         "bottom"
            ?defValue       "Metal1"
            ?choices        '("Metal1" "Metal2" "Metal3" "Metal4" "Metal5")
            ?type           "cyclic"
            ?callback       "CCFlayerCyclicSetTopLayer()"
        )
        cdfCreateParam( cdfId
            ?name           "top"
            ?prompt         "top"
            ?defValue       "Metal4"
            ?choices        '("Metal3" "Metal4" "Metal5" "Metal6")
            ?type           "cyclic"
        )
    
        ;;; Simulator Information
        cdfId->simInfo = list( nil )
    
        ;;; Properties
        cdfId->formInitProc            = "CCFlayerCyclicInitProc"
        cdfId->doneProc                = ""
        cdfId->buttonFieldWidth        = 340
        cdfId->fieldHeight             = 35
        cdfId->fieldWidth              = 350
        cdfId->promptWidth             = 175
        cdfId->instNameType            = "schematic"
        cdfId->instDisplayMode         = "cellName"
        cdfId->netNameType             = "schematic"
        cdfId->termSimType             = "DC"
        cdfId->termDisplayMode         = "none"
        cdfId->paramSimType            = "DC"
        cdfId->paramDisplayMode        = "parameter"
        cdfSaveCDF( cdfId )
    )

    Here's the callbacks:

    procedure(CCFlayerCyclicSetTopLayer()
      let((currentValue)
        currentValue=cdfgData->top->value
        ;printf("currentValue is %L\n" currentValue)
        cdfgData->top->choices=
          cdr(
            member(
              cdfgData->bottom->value
              list("Metal1" "Metal2" "Metal3" "Metal4" "Metal5" "Metal6")
            ))
    ;    unless(member(currentValue cdfgData->top->choices)
    ;      cdfgData->top->value=car(cdfgData->top->choices)
    ;    )
        t
      )
    )
    
    procedure(CCFlayerCyclicInitProc(cdfgData)
      CCFlayerCyclicSetTopLayer()
    )
    

    One small niggle is that it can mess up the current value if you select different instances with the edit properties from open. Doesn't really matter if the commented out bit is included or not. This is because the edit properties tries to sort out a value not in the choices when it populates the form, before the formInitProc is executed.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • amaru
    amaru over 2 years ago in reply to Andrew Beckett

    Thanks Andrew for your answer. I have done a workaround using a dummy cdf variable and it is working for me now. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information