• 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. [Solved] Trying to wrap a script in unwindProtect, progn...

Stats

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

[Solved] Trying to wrap a script in unwindProtect, progn complains: too many arguments

jriad
jriad over 4 years ago

My use case is that I'm trying to invoke some SKILL code from within Python. To that end, I'm spawning a "virtuoso -nograph" process and passing my skill code to its standard input.

To make sure the virtuoso process will exit no matter what (so that my Python script can continue), this is the SKILL code I'm sending it:

    (unwindProtect
      (progn
        ;; My code goes here
      )
    (exit))
The problem is, my code can be quite long so I sometimes get an error like:
      *Error* progn: too many arguments (at most 65535 expected, 174884 given)
How can I approach this so that my SKILL code always exits and doesn't hang around waiting for more input and hijacking control from my Python script?
I have also tried writing my code out to a file and tacking an (exit) at the end of it then invoking the process as "virtuoso -nograph -restore mycode.il", but the problem is, if there are any errors in the code, the (exit) call will never be reached and the REPL will keep waiting for input and not return control to the Python script.
Am I going about this all wrong? Is there a better approach to this?
  • Cancel
Parents
  • jriad
    jriad over 4 years ago

    Update: I tried splitting the code into many (unwindProtect ...) forms to make sure the number of arguments to (progn...) never exceeded the limit but I still got a "literal stack overflow" error because the code size was too large.

    The approach I ended up taking was different: I made my Python script write out all the annotation info to a text file and then I wrote a SKILL function that reads the text file line by line and creates annotations in the layout based on the info it reads from each line. I was then able to wrap this function call in an (unwindProtect...) from within Python with no issues. Not only did this work without overflow errors, it was blazing fast: it created ~44k annotations in under 2 minutes.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • jriad
    jriad over 4 years ago

    Update: I tried splitting the code into many (unwindProtect ...) forms to make sure the number of arguments to (progn...) never exceeded the limit but I still got a "literal stack overflow" error because the code size was too large.

    The approach I ended up taking was different: I made my Python script write out all the annotation info to a text file and then I wrote a SKILL function that reads the text file line by line and creates annotations in the layout based on the info it reads from each line. I was then able to wrap this function call in an (unwindProtect...) from within Python with no issues. Not only did this work without overflow errors, it was blazing fast: it created ~44k annotations in under 2 minutes.

    • 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