• 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. Unbound variable error when PCell SKILL code gets too l...

Stats

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

Unbound variable error when PCell SKILL code gets too long

srauf
srauf over 2 years ago

Hello,

I am trying to make a PCell with SKILL, I have a somewhat working case, however the code is quite large and it looks like when I have too many lines added, I get the following error:

*Error* eval: unbound variable - ...

Is there anyway to bypass this?

Ver: ic201_isr26

  • Cancel
  • srauf
    srauf over 2 years ago

    Not sure how to attach a file, but here's a link to the code if that works:

    https://docs.google.com/document/d/1lEqRAYBRsZar-ZJD5E3xA5af9U6KeHzn/edit?usp=sharing&ouid=116273410392920446275&rtpof=true&sd=true

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to srauf

    I started trying to look at this, but opening a Word document which had (at the point I gave up opening it) over 2,200 pages is not something I was going to spend doing. No idea why you put it in a Word document rather than just attaching it in a text file (e.g. .txt suffix) - which you can also do via the Insert->File in the forum.

    Anyway, the code appears to be a modified version of something output from the old Graphical PCell Editor in Virtuoso Layout Suite - which is not really designed for such enormous cellViews. It's modified because lots of lines were commented out, and the code is not very optimally written. Anyway, I can't realistically check why this unbound variable problem might be occurring with the code in a Word file, but my guess is that maybe you're exceeding the code vector size - or (quite possibly) that you're hitting the limit that the code in the PCell gets dumped into a file and then loaded, and the normal pretty printer will struggle with a list that has more than 10,000 elements - it formats it like this:

    ...

    )

    and the ellipsis is like to be the challenge. I'd expect you to need to restructure the code to partition into functions rather than having quite so enormous in a single chunk. 

    I'll leave Word opening over lunch and see whether I can reproduce the problem.

    Andrew

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

    OK, 2423 pages was the length of the document. Having fixed all the layer numbers to be something suitable for a technology I have, I got the error about unbound variable.

    Quite simply, the code is too long. You can workaround that limit by surrounding blocks of code with curly brackets (start and end about every 20,000 lines) - and that buys you some margin. I was unable to comment out quite a few extra lines in the code, however if I uncommented everything (and put the curly brackets in - {}  every 20,000 lines), then eventually you get:

    *Error* unknown: Value stack overflow has occurred possibly because too many arguments have been specified in a call, deeply nested calls, or large functions. Change the function size, or number of arguments.
    *Error* load: error while loading file - "/tmp/pcGenx57139" at line 15
    *Error* load: error while loading file - "~/shared/xfer/crazyForumPCell.il" at line 116216

    The code is quite simply way too long. It's horribly inefficient because it's repeatedly setting pcLayer and pcPurpose over and over again. It makes no sense to do it this way with this machine-generated code. You may be able to take some of those code blocks and create simple functions containing those 20,000 blocks of code and then call these functions from the main function - but I have no idea how you realistically edit and maintain such machine-generated code anyway.

    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