• 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. Unable to open/find categories

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 142
  • Views 2984
  • 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

Unable to open/find categories

SrBraj
SrBraj over 5 years ago

I am writing a script, in which I am using the "libCatName = ddCatGetLibCats(dvId)" to find the categories in my library.

Now to get the object ID of the category, I tried using both the APIs "catId = ddCatOpen( dvId catName "r")" OR "catId = ddCatFindCat( dvId catName "r")"  

*catName : This variable is from the foreach loop "foreach( catName libCatName  .. ... ... ... )"

Both of these APIs are returning the nil object ID for few categories from the list libCatName.

Could you please explain that why I am getting the nil object ID for few categories that were found by ddCatGetLibCats

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    It is possible that sometimes you end up with categories listed in the "TopCat" file in the library which no longer exist as categories themselves - they may have been deleted. The library manager only lists the categories that actually exist. So for example, in this example:

    libId=ddGetObj("ether")
    cats=ddCatGetLibCats(libId)
    ("ADC" "AEQ" "BIAS" "BLW" "CUST_CELLS"
    "DIG" "LEVEL_SHIFTERS" "MDIX" "PI" "PLL"
    "SHEETS" "TBENCH_PARTS" "TENBT" "TOP" "TOP_PNR"
    "TRANS" "VIAs" "work"
    )

    Then I do:

    foreach(cat cats printf("CAT %s ID %L\n" cat ddCatOpen(libId cat "r")))

    I get:

    CAT ADC ID dd:0x2a188090
    CAT AEQ ID dd:0x2a1880c8
    CAT BIAS ID dd:0x2a188100
    CAT BLW ID dd:0x2a188138
    CAT CUST_CELLS ID dd:0x2a188170
    CAT DIG ID dd:0x2a1881a8
    CAT LEVEL_SHIFTERS ID dd:0x2a1881e0
    CAT MDIX ID nil
    CAT PI ID dd:0x2a188218
    CAT PLL ID dd:0x2a188250
    CAT SHEETS ID dd:0x2a188288
    CAT TBENCH_PARTS ID dd:0x2a1882c0
    CAT TENBT ID dd:0x2a1882f8
    CAT TOP ID dd:0x2a188330
    CAT TOP_PNR ID dd:0x2a188368
    CAT TRANS ID dd:0x2a1883a0
    CAT VIAs ID dd:0x2a1883d8
    CAT work ID nil

    Notice that both MDIX and work are returning nil, because they no longer exist on disk. Because of this a few years back I wrote this function which filters the list of categories to only those where the category definition file exists:

    /* abGetExistingCats.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       May 06, 2016 
    Modified   
    By         
    
    Wrapper around ddCatGetLibCats which returns only the categories
    that actually exist, similar to what is shown in the library manager
    
    ***************************************************
    
    SCCS Info: @(#) abGetExistingCats.il 05/06/16.12:54:01 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *                   abGetExistingCats(libId)                   *
    *                                                              *
    *         Return the category names that really exist          *
    *                                                              *
    ***************************************************************/
    
    procedure(abGetExistingCats(libId "b")
      let((catId)
        setof(catName ddCatGetLibCats(libId) 
          catId=ddCatOpen(libId catName "r")
          when(catId 
            ddCatClose(catId)
            t
          )
        )
      )
    )

    So in the above example, if I use:

    cats=abGetExistingCats(libId)
    ("ADC" "AEQ" "BIAS" "BLW" "CUST_CELLS"
    "DIG" "LEVEL_SHIFTERS" "PI" "PLL" "SHEETS"
    "TBENCH_PARTS" "TENBT" "TOP" "TOP_PNR" "TRANS"
    "VIAs"
    )

    Now you can see it's filtered out the two which returned nil and don't really exist on disk. As you can see from the screenshot here, this is what the library manager shows:

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    It is possible that sometimes you end up with categories listed in the "TopCat" file in the library which no longer exist as categories themselves - they may have been deleted. The library manager only lists the categories that actually exist. So for example, in this example:

    libId=ddGetObj("ether")
    cats=ddCatGetLibCats(libId)
    ("ADC" "AEQ" "BIAS" "BLW" "CUST_CELLS"
    "DIG" "LEVEL_SHIFTERS" "MDIX" "PI" "PLL"
    "SHEETS" "TBENCH_PARTS" "TENBT" "TOP" "TOP_PNR"
    "TRANS" "VIAs" "work"
    )

    Then I do:

    foreach(cat cats printf("CAT %s ID %L\n" cat ddCatOpen(libId cat "r")))

    I get:

    CAT ADC ID dd:0x2a188090
    CAT AEQ ID dd:0x2a1880c8
    CAT BIAS ID dd:0x2a188100
    CAT BLW ID dd:0x2a188138
    CAT CUST_CELLS ID dd:0x2a188170
    CAT DIG ID dd:0x2a1881a8
    CAT LEVEL_SHIFTERS ID dd:0x2a1881e0
    CAT MDIX ID nil
    CAT PI ID dd:0x2a188218
    CAT PLL ID dd:0x2a188250
    CAT SHEETS ID dd:0x2a188288
    CAT TBENCH_PARTS ID dd:0x2a1882c0
    CAT TENBT ID dd:0x2a1882f8
    CAT TOP ID dd:0x2a188330
    CAT TOP_PNR ID dd:0x2a188368
    CAT TRANS ID dd:0x2a1883a0
    CAT VIAs ID dd:0x2a1883d8
    CAT work ID nil

    Notice that both MDIX and work are returning nil, because they no longer exist on disk. Because of this a few years back I wrote this function which filters the list of categories to only those where the category definition file exists:

    /* abGetExistingCats.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       May 06, 2016 
    Modified   
    By         
    
    Wrapper around ddCatGetLibCats which returns only the categories
    that actually exist, similar to what is shown in the library manager
    
    ***************************************************
    
    SCCS Info: @(#) abGetExistingCats.il 05/06/16.12:54:01 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *                   abGetExistingCats(libId)                   *
    *                                                              *
    *         Return the category names that really exist          *
    *                                                              *
    ***************************************************************/
    
    procedure(abGetExistingCats(libId "b")
      let((catId)
        setof(catName ddCatGetLibCats(libId) 
          catId=ddCatOpen(libId catName "r")
          when(catId 
            ddCatClose(catId)
            t
          )
        )
      )
    )

    So in the above example, if I use:

    cats=abGetExistingCats(libId)
    ("ADC" "AEQ" "BIAS" "BLW" "CUST_CELLS"
    "DIG" "LEVEL_SHIFTERS" "PI" "PLL" "SHEETS"
    "TBENCH_PARTS" "TENBT" "TOP" "TOP_PNR" "TRANS"
    "VIAs"
    )

    Now you can see it's filtered out the two which returned nil and don't really exist on disk. As you can see from the screenshot here, this is what the library manager shows:

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • SrBraj
    SrBraj over 5 years ago in reply to Andrew Beckett

    Hi Andrew

    Thanks for your reply. I always find your replies very crisp and easy to understand.

    I have checked the *.TopCat file of our PDK, the following two categories for which the catID value was nil, are commented

    #PRIMLIB/_Legacy.Cat type="category"
    #PRIMLIB/Preliminary.Cat type="category"

    My doubt is that the prefix "#" is not identified as a comment for TopCat file. Is it true? Or the ddCatGetLibCats() skill API doesn't exclude the comments?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to SrBraj

    The library manager treats the # as a comment in the TopCat file, but the ddCatGetLibCats() simply ignores the #, so it returns it anyway. I think that's a bug with ddCatGetLibCats. 

    I've not found any reports of this - I would suggest you contact customer support to get this addressed.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SrBraj
    SrBraj over 5 years ago in reply to Andrew Beckett

    Hi Andrew

    Just received the reply from the customer support team. Using ";" instead of "#" will solve the problem.

    Thanks and Regards

    Saurabh Raj "SrB"

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to SrBraj

    Even so, you should still ask them to file a change request (CCR) because ddCatGetLibCats() should be consistent with the behaviour of the library manager. If the library manager treats it as a comment, so should ddCatGetLibCats.

    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