• 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. If condition failure

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 17158
  • 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

If condition failure

LaksNanu
LaksNanu over 9 years ago

Hi,

I am new to skill,

I am checking if any of the windows are opened, if windows are available, then check if particular (lib,cell,view) are opened,
if the layout is not already opened then print the statement. (i will substitute print statement to deopencellview later).

I am unable to find the problem with the below code. As it is not working properly, when i open cell view, it prints absent statement.

procedure( lpFgOpenDB()

   let( (openWin svw)

      openWin=cdr(hiGetWindowList())

      foreach(svw (openWin~>cellView)

         if( !(((svw~>libName) == "lp_amr") && ((svw~>cellName) == "apple") && ((svw~>viewName) == "layout"))

          then

           printf( "apple is absent\n" )

         else if( !(((svw~>libName) == "lp_amr") && ((svw~>cellName) == "orange") && ((svw~>viewName) == "layout"))

          then

           printf( "orange is absent\n" )

         );else if

         );if

      );foreach

   );lef

);proc

An alternative to the above code is also helpful

Thanks & Regards,

Lakshmiprashanth

((svw~>libName) == "lp_amr" && (svw~>cellName) == "fromlayout" && (svw~>viewName) == "layout")

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

    Your code will always say either "apple is absent" or "orange is absent" because for each window, it will check first that it is not "apple" - if so, it will print that, otherwise if it's not "orange" it will print that. Put another way, if the window contained "apple", it would tell you that orange was absent. If it contained "orange", it would tell you that apple is absent. That's not really a specific SKILL issue, it's a programming logic issue.

    I suspect what  you really want to do is find out for a particular lib/cell/view whether it's in a window already. You could do:

    procedure(CCFfindExistingWindow(libName cellName viewName)
      let((svw)
        car(exists(win hiGetWindowList()
         {
           svw=win~>cellView
           svw~>libName==libName && svw~>cellName==cellName svw~>viewName==viewName
         }
        ))
      )
    )

    If you then do CCFfindExistingWindow("lp_amr" "apple" "layout") it would return the window id of the window containing it, or nil if not found.

    Alternatively, you could use these built-in functions instead:

    procedure(CCFfindExistingWindow(libName cellName viewName)
      let((cv)
        cv=dbFindOpenCellView(ddGetObj(libName) cellName viewName)
        cv && geGetEditCellViewWindow(cv)
      )
    )

    That's probably a bit more direct.

    Regards,

    Andrew.

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

    Your code will always say either "apple is absent" or "orange is absent" because for each window, it will check first that it is not "apple" - if so, it will print that, otherwise if it's not "orange" it will print that. Put another way, if the window contained "apple", it would tell you that orange was absent. If it contained "orange", it would tell you that apple is absent. That's not really a specific SKILL issue, it's a programming logic issue.

    I suspect what  you really want to do is find out for a particular lib/cell/view whether it's in a window already. You could do:

    procedure(CCFfindExistingWindow(libName cellName viewName)
      let((svw)
        car(exists(win hiGetWindowList()
         {
           svw=win~>cellView
           svw~>libName==libName && svw~>cellName==cellName svw~>viewName==viewName
         }
        ))
      )
    )

    If you then do CCFfindExistingWindow("lp_amr" "apple" "layout") it would return the window id of the window containing it, or nil if not found.

    Alternatively, you could use these built-in functions instead:

    procedure(CCFfindExistingWindow(libName cellName viewName)
      let((cv)
        cv=dbFindOpenCellView(ddGetObj(libName) cellName viewName)
        cv && geGetEditCellViewWindow(cv)
      )
    )

    That's probably a bit more direct.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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