• 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 Design
  3. Parameter passing hygiene

Stats

  • Locked Locked
  • Replies 10
  • Subscribers 125
  • Views 15531
  • 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

Parameter passing hygiene

CADcasualty
CADcasualty over 7 years ago

I'm trying to make a parent schematic/symbol wrapper cell around a confusing looking child cell that has parameters e.g. a, b, c and displays those parameters via labels on its symbol. Note also that entering the parameters on the child passes them into some code via callbacks. All parameters are text fields.

I want my wrapper cell to have exactly the same parameter names and just pass them down to the confusing child cell, so I create parameters a, b, c on the parent and in the child cell I set it's parameters to [@a], [@b] and [@c].

I have two problems:

1. Because the parameter names are identical for the parent and child, I seem to be getting an illegal loop when in the child cell I set parameter "a" to "[@a]". I really want the parameter names to be the same on both the parent and child cells. How would I do this?

2. When I enter the parameters on the parent (e.g. set a to 1, b to 2, c to 3) and then descend in to reveal the child cell, the child symbol parameter labels aren't showing 1, 2 and 3 - they're showing [@a], [@b] and [@c]. How can I have the child symbol show be the actual values passed down from above? Remember, the child cell operates on its parameters via callbacks and the callback is receiving “[@parent_param]” or “pPar(\“parent_param\”)” depending on what I've tried so far.

I'd really appreciate some help on this and I'm sure this is a silly newbie question, so apologies in advance.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Most design kits are normally CDF-based these days, and so you should not be using NLP expressions but using pPar("a") - that wouldn't suffer from the loop.

    The annotation setup can show the evaluated expressions (this is the "Display Type" column I think from memory - you can set it to show "Full" evaluation). That would show the resolved values as you push down the hierarchy.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CADcasualty
    CADcasualty over 7 years ago in reply to Andrew Beckett

    Hi Andrew. Many thanks for your reply. I think in trying to distill my question into it's most basic form I left out some important info. Here's some additional info:

    I have defined the following procedure:

    procedure( myProc(ilInst)
    if(cdfParseFloatString(ilInst~>c))>1 then
    sprintf(nil "%g" cdfParseFloatString(ilInst~>c)))
    )
    )

    On the child cell I have set it's c parameter to pPar("c") so that it receives the value of c from above, and on the child symbol I placed an ILLabel:
    myProc(ilInst)
    I want the child symbol to show the value of the parameter c passed down from above, however myProc isn't receiving the value of c from above, it's receiving the text pPar("c").

    How can I fix this to do what I want?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to CADcasualty

    Try using the abIPar function in this other forum post for your label display - that is something I wrote a few years ago to do precisely this.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CADcasualty
    CADcasualty over 7 years ago in reply to Andrew Beckett

    This is works, but this onion has more layers :-). I'll make the passing comment though that I would surely have thought your solution would have been a built-in function - it's such an obvious thing to do! I also noticed that the value that made it's way into the child parameter did not subsequently get processed by the child's callback code. I think now what I want is for the parameter to be set in the parent, it passes down to child, goes through the child's callback and gets modified accordingly, and then that result makes its way back up to the parent i.e. I want the parent to behave just like I'm editing the child.

    I could replicate the child's callback details in the cdf of the parent, but when I tried that it didn't work (the function was returning some errors that I can provide if you want). Not sure if the scope of the callbacks in the child (which is in a different library) are valid in my library. Do you have any more magic up your sleeve :-)?

    I think I'm at the point where I'm not appreciating the complexity of what I'm asking for...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to CADcasualty

    I think you need to read my article The Dangers of CDF Callbacks. CDF callbacks do not (and cannot) work the way you are expecting them to.

    It is also already possible to show the evaluated value of any CDF parameter via the cdsParam() labels using the annotation setup - you can ask it to fully evaluate any expression and show what it would resolve to - so the abIPar isn't really necessary in that case. I just wrote it to provide a convenient means of showing the evaluated label if that was what you wanted all the time.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CADcasualty
    CADcasualty over 7 years ago in reply to Andrew Beckett

    I finally got around to using the abIPar function you wrote and it pretty much solved all of my problems! Many thanks for your assistance and I'm really happy with the way the cells that use it turned out.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CADcasualty
    CADcasualty over 7 years ago in reply to CADcasualty

    Hi Andrew. I spoke too soon about abIPar fixing ALL of my problems. If I set my parent parameter to a number then abIPar nicely shows the final value on the symbol instead of the string pPar("whatever"). However, if I set the parent parameter to a string (e.g. "myVar") then abIPar just returns nil (instead of just the original string) and my symbol doesn't show anything useful. I tried to be daring and edit abIPar to cater for it receiving a non-number, but it's written in Lisp and I just couldn't get deep enough into it before drowning in my own vomit :-). Is there any chance you could tweak abIPar for this condition, or maybe even convert it to skill and I'll take over from there. Sorry about this hassle...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to CADcasualty

    I originally wrote it over 14 years ago, so I'd have to construct some test data to test it again in this situation.

    My guess is that you'd need to change the line:

    (setq evaluated (aelNumber (aelEnvExecute compiled)))

    to:

    (setq evaluated  (aelEnvExecute compiled))

    Note that the code is written in SKILL. It's just in LISP syntax rather than the C-style. You can always use pp(abIPar) to print out in C-style but the formatting isn't pretty (a shame for a pretty printer) and also you lose all the comments.

    I'll have a look next week (may not have time over the weekend) to check the behaviour with string-valued parameters.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • CADcasualty
    CADcasualty over 7 years ago in reply to Andrew Beckett

    Wow - that was quick! Note that there is a weird exception to the string rule in that I might give assign the string parameter "Ibias" (which yields a string in cdfParseFloatString") and on another instance I might assign the string parameter "Ibias*2" (which also yields a string in cdfParseFloatString") or but I could have used the string parameter "2*Ibias" (which yields a nil in cdfParseFloatString"). In similar code I've written, I just check to see if cdfParseFloatString is a number (via the numberp function) and if it's not then I just interpret it as a string.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to CADcasualty

    So is this a string or the name of a design variable that you set in ADE? The code gets design variable values from the top cell (if my memory is correct) so you may just neee to do Variables->Copy to cellview in ADE to makthe this work. 

    This is one of those things where it would be better if I can see the actual data that isn’t working. If the above doesn’t fix it can you log a case on support.cadence.com and ask the AE to contact me?

    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