• 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. Opening, modifying, done commands on a form in a SKILL ...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 11257
  • 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

Opening, modifying, done commands on a form in a SKILL script

StephanieIFX
StephanieIFX over 3 years ago

Whenever I write a SKILL script that calls a Cadence function that opens a Cadence form, the form takes some time to open while the script keeps running.  I would like the script to wait for the form to open, but instead the script runs through the code that set form options and calls the ok done button as the form is sill being opened.  The form finally opens but the script has already completed without using the form.  How do I get the script to wait for the form to open before completing form related commands?

Thanks!

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

    Most commands with forms block, so this wouldn't usually happen (unless it's truly a script rather than a program). Can you give an example of the code that has this problem and then maybe I can give some advice on how to avoid it?

    Andrew

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

    procedure( importLayoutDevices(cellName libName)
    let(((area 0))
    deNewCellView(libName cellName "layout" "maskLayout" nil)
    deInstallApp(getCurrentWindow() "Virtuoso XL")
    rep = geGetEditCellView()
    lxHiReInitDesign()
    hiFormDone(lxTemplateForm)
    foreach(inst rep->instances
    when( inst->libName == "tsmcN22"
    bBox = inst->bBox
    area = area + (((caadr bBox) - (caar bBox)) * ((cadadr bBox) - (cadar bBox)))
    )
    )
    area
    )
    )

    I call the function with this command and predefined variables for cellName and libName
    importLayoutDevices(cellName libName)

    It works if the layout window is already created and open and I get the popup asking if it is ok to overwrite the layout with the Generate Layout tool lxHiReInitDesign().  It does not work if the layout is not created and open, as it must take too long to create the layout, switch to XL and open the Generate Layout GUI before the script runs through the rest of the code

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephanieIFX
    StephanieIFX over 3 years ago in reply to StephanieIFX

    Actually I can't get it to consistently work, mostly it just doesn't work and I am left with the Generate Layout GUI open and an empty layout window

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

    OK, there are two main issues here:

    1. The function is using lxHiReInitDesign() which is a blocking function - it displays the generate all from source form and stops execution until the OK button or Cancel button is pressed. It doesn't get to the next line in the code until you've done that
    2. It prompts you to overwrite the layout if it exists already. May not be a problem, but if you don't want that you can code around it.

    In general, writing code that interacts with forms is the method of last resort - you do it if there's no dedicate procedural interface, and it's always complicated if you end up going down that route. If the form is blocking, then in general you have to use this kind of approach:

    hiEnqueueCmd("hiFormDone(lxTemplateForm)")
    lxHiReInitDesign()

    That does work, but it's clunky. Since there's a dedicated procedural interface (lxGenerateStart/Finish) which avoids the form, why not use that instead - for example:

    procedure( importLayoutDevices(cellName libName @optional (viewName "layout"))
      let(((area 0) rep connRef schCv ddId bBox)
        ; prevent the initial popup about overwriting by deleting the
        ; cellView if it exists already
        when(ddId=ddGetObj(libName cellName viewName)
          ddDeleteObj(ddId)
        )
        deNewCellView(libName cellName viewName "maskLayout" nil) 
        deInstallApp(getCurrentWindow() "Virtuoso XL")
        rep = geGetEditCellView()
        ; rather than using a blocking form command, use the procedural API 
        ; instead
        connRef = lxGetConnRef(rep)
        schCv=dbOpenCellViewByType(cadr(connRef) caddr(connRef) cadddr(connRef))
        lxGenerateStart(schCv rep)
        lxGenerateFinish(schCv rep)
        foreach(inst rep->instances
          when( inst->libName == "gpdk090"
    	bBox = inst->bBox
    	area = area + (((caadr bBox) - (caar bBox)) * ((cadadr bBox) - (cadar bBox)))
          )
        )
        area
      )
    )

    I also included the code at the beginning to delete the layout view if it exists already so that you don't get the dialog asking you to overwrite it.

    Regards,

    Andrew

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

    OK, there are two main issues here:

    1. The function is using lxHiReInitDesign() which is a blocking function - it displays the generate all from source form and stops execution until the OK button or Cancel button is pressed. It doesn't get to the next line in the code until you've done that
    2. It prompts you to overwrite the layout if it exists already. May not be a problem, but if you don't want that you can code around it.

    In general, writing code that interacts with forms is the method of last resort - you do it if there's no dedicate procedural interface, and it's always complicated if you end up going down that route. If the form is blocking, then in general you have to use this kind of approach:

    hiEnqueueCmd("hiFormDone(lxTemplateForm)")
    lxHiReInitDesign()

    That does work, but it's clunky. Since there's a dedicated procedural interface (lxGenerateStart/Finish) which avoids the form, why not use that instead - for example:

    procedure( importLayoutDevices(cellName libName @optional (viewName "layout"))
      let(((area 0) rep connRef schCv ddId bBox)
        ; prevent the initial popup about overwriting by deleting the
        ; cellView if it exists already
        when(ddId=ddGetObj(libName cellName viewName)
          ddDeleteObj(ddId)
        )
        deNewCellView(libName cellName viewName "maskLayout" nil) 
        deInstallApp(getCurrentWindow() "Virtuoso XL")
        rep = geGetEditCellView()
        ; rather than using a blocking form command, use the procedural API 
        ; instead
        connRef = lxGetConnRef(rep)
        schCv=dbOpenCellViewByType(cadr(connRef) caddr(connRef) cadddr(connRef))
        lxGenerateStart(schCv rep)
        lxGenerateFinish(schCv rep)
        foreach(inst rep->instances
          when( inst->libName == "gpdk090"
    	bBox = inst->bBox
    	area = area + (((caadr bBox) - (caar bBox)) * ((cadadr bBox) - (cadar bBox)))
          )
        )
        area
      )
    )

    I also included the code at the beginning to delete the layout view if it exists already so that you don't get the dialog asking you to overwrite it.

    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