• 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. Asynchronous Child Process postFunc Handler and the CIW

Stats

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

Asynchronous Child Process postFunc Handler and the CIW

Palenzuela18
Palenzuela18 over 1 year ago

Hi everyone. Still kind of a beginner in this SKILL thing. I need to invoke a process asynchronously and run a cutom function when it ends. Below I add an equivalent simple script that simplifies my situation. As you can see, I'm using the "ipcBeginProcess(...)" function to invoke a simple Python command, specifying as an argument the tsu_postFunc handler. From my limited understanding (Cadence Interprocess Communication SKILL Reference IC23.1), the function specified as tsu_postFunc is invoked when the child process ends it's execution. I have two questions about it.

----------------------------------------------------------------------------------

procedure( launchAsynchronousCMD( cmd )
   let( (cid)
      ; Launch process
         cid = ipcBeginProcess(
         cmd ;; command
         "" ;; locally
         nil ;; data handler function
         nil ;; error handler function
         'pFuncHandler ;; post func
          ""
      )
      cid
   )
)


defun( pFuncHandler ( cid exitStatus )
   ipcSleep(1)
   printf( "** FINISHED ** [%A - %A]: %A\n" cid cid->processPid exitStatus )
)


cid = launchAsynchronousCMD("python -c 'import time; time.sleep(5)'")

----------------------------------------------------------------------------------


1. If I do not add the call to ipcSleep(1), why doesn't the finish message get printed in the CIW until I execute another SKILL command?

2. If I intentionally add an error to the code of tsu_postFunc, why doesn't the error get printed in the CIW? How can I get it printed?

Details about the under the hood explanation are more than welcome. Thanks before hand.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    Answers to your questions:

    1. This should not be necessary - and when I tried it, I don't need the ipcSleep - I get the message as soon as the process has finished. It might not get executed immediately because it's done when the SKILL top-level is available (so if there's something actively running in Virtuoso, it will happen once that's finished as there's only a single thread), but in general the delay will not make a difference.
    2. See Errors in an IPC done handler or postfunction are trapped but not displayed

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Palenzuela18
    Palenzuela18 over 1 year ago in reply to Andrew Beckett

    Thanks Andrew, really appreciate the quick and clear response.

    About the linked resource, it perfectly solves my problem.

    About the top-level topic, I have stumbled with this term more than a couple times in SKILL documentation. The only usefull resource I found was the little said on the "Cadence SKILL User Guide". Do you know where can I get a clear understanding of this concept?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to Palenzuela18

    There's not really that much that covers this (other than the documentation for the SKILL function toplevel but even that doesn't really). In essence, there's a REPL (Read-Eval-Print-Loop) that is the interface to the SKILL engine; SKILL itself is single-threaded, and so any input from the CIW, from bindkeys, from menu callbacks, form interactions, IPC callbacks etc feed into the the top-level SKILL engine. If Virtuoso is busy (e.g. executing some lengthy SKILL code or something at the C++ level) the top-level is blocked and so execution of any SKILL code (which might be enqueued into it to) happens as soon as the blocking function returns and the top-level becomes available again. Hopefully that's a simple enough conceptional description of how it works!

    Andrew 

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to Palenzuela18

    There's not really that much that covers this (other than the documentation for the SKILL function toplevel but even that doesn't really). In essence, there's a REPL (Read-Eval-Print-Loop) that is the interface to the SKILL engine; SKILL itself is single-threaded, and so any input from the CIW, from bindkeys, from menu callbacks, form interactions, IPC callbacks etc feed into the the top-level SKILL engine. If Virtuoso is busy (e.g. executing some lengthy SKILL code or something at the C++ level) the top-level is blocked and so execution of any SKILL code (which might be enqueued into it to) happens as soon as the blocking function returns and the top-level becomes available again. Hopefully that's a simple enough conceptional description of how it works!

    Andrew 

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • Palenzuela18
    Palenzuela18 over 1 year ago in reply to Andrew Beckett

    As always, more than enough. Thank you 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