• 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. I have correct cell name still it is throwing error.

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 8492
  • 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

I have correct cell name still it is throwing error.

Purbayan
Purbayan over 3 years ago

I wanted to check if library and cell exist or not

my code works like this first it checks if library exist or not, if library doesn't exists it throws an library error dialogue box, if library exist  then it goes to check if cell exist or not, if it exist it will print correct if not it will throw cell error dialogue box.

The problem i am facing is even if cell name is correct it is still throwing cell error dialogue box and also printing correct

Here is my code

case(ddGetObj(Lib_name)
(nil
hiDisplayAppDBox(
?name 'ERRORBOX1
?dboxBanner "ERROR"
?dboxText sprintf(nil "Incorrect Library name")
?dialogType hicInformationDialog
?dialogStyle 'modal
?buttonLayout 'Close))

(t
if(equal(ddGetObj(Lib_name CELL_name) nil) then
hiDisplayAppDBox(
?name 'ERRORBOX2
?dboxBanner "ERROR"
?dboxText sprintf(nil "Incorrect Cell name")
?dialogType hicInformationDialog
?dialogStyle 'modal
?buttonLayout 'Close)
else printf("COREECT"))
)))

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    I can't see how that would happen - it doesn't when I try it. The code is a little odd - it's a rather strange use a case function. There is an extra close parenthesis in the code, but that shouldn't cause the problem.

    Anyway, a better way would be to do this with a cond() function which is conceptually similar to an if/elseif/elseif/elseif/else construct:

    cond(
      (!ddGetObj(Lib_name) 
        hiDisplayAppDBox(
          ?name 'ERRORBOX1
          ?dboxBanner "ERROR"
          ?dboxText sprintf(nil "Incorrect Library name")
          ?dialogType hicInformationDialog
          ?dialogStyle 'modal
          ?buttonLayout 'Close
        )
      )
      (!ddGetObj(Lib_name CELL_name)
        hiDisplayAppDBox(
          ?name 'ERRORBOX2
          ?dboxBanner "ERROR"
          ?dboxText sprintf(nil "Incorrect Cell name")
          ?dialogType hicInformationDialog
          ?dialogStyle 'modal
          ?buttonLayout 'Close
        )
      )
      (t
        printf("CORRECT")
      )
    )

    BTW, I'm not sure if your code has indentation in it normally and it just got lost during pasting, but code is much easier to understand with indentation (see my code above).

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Purbayan
    Purbayan over 3 years ago in reply to Andrew Beckett

    Thank you Andrew very much for the response.

    Even i also ended up using if else if else way.

    Thanks

    Purbayan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 3 years ago in reply to Andrew Beckett

    Be careful with

    ddGetObj(Lib_name CELL_name)

    as it will return a non-nil value (the dd_lib actually) even if CELL_name is nil or a blank string

    you should use 

    ddGetObj(Lib_name CELL_name)->type == 'ddCellType

    instead

    Cheers

    Aurélien

    • 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