• 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. A rather unconventional schematic symbol question/issue

Stats

  • Locked Locked
  • Replies 25
  • Subscribers 126
  • Views 10977
  • 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

A rather unconventional schematic symbol question/issue

Composter
Composter over 16 years ago

 Hi,

 I'm using Cadence 5.1 and am trying to make some schematic symbols that display context dependent information when instantiated. Onthe symbol itself, I have several ILLabels such as "ilInst~>myvar" and I have edited the cdf such that "myvar" contains some skill code that evaluates to the string of what I want displayed on the symbol. I'm accessing the data about the selected instance through expressions like "cdfgData->width->value". Much of this is based on code I've seen used elsewhere and I've just adapted it to suit my needs.

 

So I'm running aground because I don't know how to access the instance name (as opposed tthe cell name) within an expression. I've already tried cdsName() but that does not return the current instance name of the selected instance. Can anybody out there please provide me with the skill magic to do this. I figure it has to be available via cdfgData but I don't the access name. Many thanks in advance.

 

  • Cancel
  • Composter
    Composter over 16 years ago

     I believe I see light at the end of the tunnel!
    I set the ILLabel to:

    {if(ilInst~>flag==1 ilInst~>name ilInst~>size1)}

    and the cdf flag parameter according to:

        cdfCreateParam( cdfId
            ?name           "flag"
            ?prompt         "flag"
            ?type           "int"
            ?display        "nil"
            ?editable       "nil"
            ?storeDefault   "yes"
            ?defValue       "letseq( ( \
        (curWN1 cdfgData~>WN1->value) \
        (curLN1 cdfgData~>LN1->value) \
        (curWN2 cdfgData~>WN2->value) \
        (curLN2 cdfgData~>LN2->value) \
        (sameWidth cdfParseFloatString(curWN1)==cdfParseFloatString(curWN2) ) \
        (sameLength cdfParseFloatString(curLN1)==cdfParseFloatString(curLN2) ) \
      ) \
      if( sameWidth&&sameLength cdfgData->flag->value=0 cdfgData->flag->value=1 ) \
    )"
        )

    However, I'm still having trouble with the label evaluating itself properly. It's always printing size1, but if I change the label to:
    {if(ilInst~>flag==1 ilInst~>name ilInst~>name)}
    then it does show the name, so it appears the "==1" side of the if statement has a problem...

    Finally, you're definitely right about the keeping the label text compact. Back when I was starting out and I put all the code in the label itself, doing a full view yielded a microscopic schematic. That's why I've put all the heavy lifting into the cdf.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 16 years ago

    What I think you need here is a doneProc on the cdf that will recalculate the value of the flag. Currently, you have only calculated the defValue for flag, so when you change WN1, LN1, etc, the flag doesn't change.

    At the bottom of your CDF, you need:

    cdfId->doneProc = "{if(cdfParseFloatString(cdfgData->WN1->value)==cdfParseFloatString(cdfgData->WN2->value) && cdfParseFloatString(cdfgData->LN1->value)==cdfParseFloatString(cdfgData->LN2->value) cdfgData->flag->value=0 cdfgData->flag->value=1)}"

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Composter
    Composter over 16 years ago

    Happy Days!

     Item 1:
    I'm currently using (for now) a formInitProc in the cdf (to stuff all the W/L's with default values so that the symbols are technology independent) and I was unable to put the code for the procedure into that field - it would *only* hold the NAME of a procedure. The procedure itself needed to be in a file that I had to load (in fact, that's the current thorn in my approach). I'd have thought doneProc would be the same way. In fact, by setting the doneProc as you suggest, I see this in the icfb window all the time:

    *WARNING* icInstMoveTrigFunc: '{if(cdfParseFloatString(cdfgData->WN1->value)==cdfParseFloatString(cdfgData->WN2->value) && cdfParseFloatString(cdfgData->LN1->value)==cdfParseFloatString(cdfgData->LN2->value) cdfgData->flag->value=0 cdfgData->flag->value=1)}' is not a function.

    Item 2:
    In every callback, I currently have:

      evalstring(cdfgData->flag->defValue) \

    and I was relying on that to deal with evaluating the flag parameter (in the same way that I also evalstring all the other parameters like size1, size2 etc). However, I have defined flag as per my recent post, and I'm seeing errors in the callbacks. This is presumably because I'm doing an evalstring on flag but flag (unlike the rest) is declared as an int instead of a string. It's defValue being a string is messing things up. So I declared flag as string and set it to "0" & "1" instead. I also modified the ILLabel if statement to test for "1" instead of 1 and ... it works!!!

    At this point I am a very happy camper :-). Thank you (all of you) very much for your help. But wait - there's more...

    Going back to item 1 for a moment, I'd be in hog heaven if I could find ANY way to stuff the code I need into formInitProc instead of referencing a file that people must load. Is there any back door way to do this?

    and is there a more compact way to define the ILLabel expression below other than reducing the size of the parameter names. This is to keep effective size of the instantiated cell to a minimum.

    {if(ilInst~>flag=="1" ilInst~>name ilInst~>size1)}

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 16 years ago

    I don't work much with cdfs, so sorry about all the trial and error. I saw the same problem in my test after I had already made the post. I did test the following and it works:

        cdfCreateParam( cdfId
            ?name           "WN1"
            ?prompt         "WN1"
            ?defValue       "5"
            ?type           "string"
            ?parseAsNumber  "yes"
            ?parseAsCEL     "yes"
            ?callback       "
        cdfgData~>size1~>value = sprintf(nil \"%s/%s\" cdfgData~>WN1~>value cdfgData~>LN1~>value)
        if(cdfParseFloatString(cdfgData->WN1->value)==cdfParseFloatString(cdfgData->WN2->value)
        && cdfParseFloatString(cdfgData->LN1->value)==cdfParseFloatString(cdfgData->LN2->value)
            cdfgData->flag->value=0
            cdfgData->flag->value=1
        )"
        )
        cdfCreateParam( cdfId
            ?name           "LN1"
            ?prompt         "LN1"
            ?defValue       "1"
            ?type           "string"
            ?parseAsNumber  "yes"
            ?parseAsCEL     "yes"
            ?callback       "
        cdfgData~>size1~>value = sprintf(nil \"%s/%s\" cdfgData~>WN1~>value cdfgData~>LN1~>value)
        if(cdfParseFloatString(cdfgData->WN1->value)==cdfParseFloatString(cdfgData->WN2->value)
        && cdfParseFloatString(cdfgData->LN1->value)==cdfParseFloatString(cdfgData->LN2->value)
            cdfgData->flag->value=0
            cdfgData->flag->value=1
        )"
        )

    Maybe callbacks instead of an initproc will meet your needs.

    For the simpler iLLabel, you might try:

    old:   {if(ilInst~>flag=="1" ilInst~>name ilInst~>size1)}
    new: {i=ilInst if(i~>f="1" i~>name i~>s1)}

    The risk here is i is now global.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Composter
    Composter over 16 years ago

     At this point, I have everything solved except for the need to have a procedure NAME specified in the formInitProc field of the cdf. I do not want to hard code any default W's and L's into the defValues because then everything needs editing when migrating to another process. I can get access to the standard NMOS and PMOS defaults easily enough and currently the procedure specified by formInitProc takes care of that. HOWEVER, it does mean that I need one lousy file I need to give to everybody and I'm also therefore exposed to people copying schematics and not knowing about that file. If anybody out there knows how to put real live working cdf code into the formInitProc field then I totally have everything I need. That's my final issue.

    Aside from that, I have my original question solved and I sure learned a lot along the way. This forum is fantastic and I very much appreciate all the assistance everybody has given me.

    • 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