• 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. How to set the order of a PCell's Parameters?

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 143
  • Views 5595
  • 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

How to set the order of a PCell's Parameters?

aakhavan
aakhavan over 13 years ago

In Cadence 5, the order of the pcells parameters in the Create Instance form was set by the order of the parameters in the pcDefinePCell function. However, using the same code in Cadence 6.1.5 results in the parameters being in a seemingly arbitrary order in the Create Instance form. Has anyone experienced this or found a work around?

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago
    I've not looked into the precise issue you're talking about, but the best solution is to create CDF for the cell, and then you can have the parameters in any order you like - as well as having more meaningful prompts.

    I'd say it's fairly uncommon to have pcells without CDF.

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • aakhavan
    aakhavan over 13 years ago
    Thanks for the quick response. That was my initial thought, but I hoped there was an easier solution. I tried a CDF, but I had a problem where the CDF parameters weren't being passed to the pcell code. I would change the parameters in the Create Instance form, but the pcell wouldn't change. I assume the CDF parameter names must match the pcell parameter names. Any quick ideas? I'll keep digging and see if I can make it work.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 13 years ago

     Hi,

    Yes, the CDF parameter names must match the pcell parameter names.  Instance level CDF is more specific than the cell CDF that you would create for the the parameters, so these values should be passed down to the pcDefinePCell statement.  If you are using IC615 then the SKILL IDE can handle PCell SKILL code so you might debug the issue that way?  Otherwise, you can create labels in the PCell code or use global variables for better visibility of what is going on.

    Regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago
    Yes, the CDF parameter names must match the pcell parameter names, and importantly it is really wise to have the CDF default match the pcell default (otherwise you have to set storeDefault=yes, because if the parameter's value is the same as the CDF's default then it won't get stored on the instance, and the pcell will thus get evaluated with the pcell's default - which is almost certainly not what you want; storeDefault=yes forces it to store even the CDF default on the instance. Note that this is only necessary if the two defaults differ, and it's best by far just to make them consistent).

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • aakhavan
    aakhavan over 13 years ago

    Thank you both for the help. I'm running into a different problem now-
    My parameters in the pcell definition are as follows:

    (
    (NX int 1)
    (NY int 2)
    (B1 boolean "FALSE")
    (B2 boolean "FALSE")
    )

    I'm using the code from here to generate the cdf. It works great, except the ordering is incorrect. If I take the reverse() out, the booleans are in the correct order, but I end up with:

    NY, B1, B2, NX

    Instead of the correct order. Looking at the cellview: cv~>parameters~>value~>name shows the same, incorrect order. I can fix this by manually coding the CDF, but I'd like to avoid that. Any ideas why it's throwing off the order?

     Thanks.

     

    Edit: I hacked around this by manually adding the cdf for car(reverse(cv~>parameters~>value)), then running the foreach() loop on reverse(cdr(reverse(cv~>parameters~>value)). This will work assuming the first one is always shifted last for some reason. I'd still appreciate some input though!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 13 years ago

     I wrote the Solution that you are referring to. I'm not sure that the 'boolean' parameters are coded correctly?  Shouldn't it be:

    
    (
    (NX "int" 1)
    (NY "int" 2)
    (B1 "boolean" nil)
    (B2 "boolean" nil)
    )
    

    ?  I have not tried this, but if you can try changing the code and see if it helps.  Boolean parameters are a bit awkward if I recall correctly, since the way that they are treated in CDF is not the same as the pcDefinePCell statement.

    I hope that this helps!

    regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • aakhavan
    aakhavan over 13 years ago

     Gave that a shot, but it didn't work. It seems that its an issue with having multiple types in there because if I only have booleans it works fine.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    OK, I took a look at the solution, and it is assuming that the parameters hierProp is ordered. I don't think there is anywhere which says that this is the case - that the order matches the order the parameters were defined in the pcDefinePCell. You might have made that empirical observation in IC5141, but it was never guaranteed - and with the change in the database to OA, it doesn't appear to be the case any more (I didn't try, I'm just basing this on what you've observed). Regardless of whether it is true or not, it is not a valid assumption to have made.

    That said, it would be easy to modify the code in Lawrence's solution to define the order without "manually" coding it. Sure, you have to define the order, but apart from that it would be straightforward:

        foreach(param foreach(mapcar paramName '("NX" "NY" "B1" "B2") dbFindProp(cv~>parameters paramName))
          ;; create the cdf in the same basic way, but depending on the
          ;; parameter do some things differently
          cdfCreateParam(cdf
    ...

    So you are just explicitly listing the order you want when you do the CDF parameter creation.

    Hope that helps,

    Regards,

    Andrew.

    Note - if you can't see all the code above because it's truncated in your browser, selected it and copy/paste into an editor.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • aakhavan
    aakhavan over 13 years ago

    I see what you mean. If I do a cv~>parameters~>value~>name in the IC615 CIW, the parameter order comes up in the strange way where the first one defined is last (i.e. NY B1 B2 NX). In IC5141, however, it comes up reversed, i.e. B2 B1 NY NX, thus that solution would work.

    Is there any way to set the hierProp order? In the meantime, I'll try the code you posted; thanks.

    Edit: The code works great. Thanks again for the help.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago
    No, there's no way to order them. As I said, they've never really been ordered, but in the old database the order appeared to be the reverse of how they were defined. They may be hashed now (not sure, I've not checked) but there is not a way as far as I know to make them ordered (there are some data structures in the database which are ordered, but not properties).

    Regards,

    Andrew
    • 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