• 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 Design
  3. Case statements in Design Variables and AMS UNL

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 13976
  • 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

Case statements in Design Variables and AMS UNL

jehh
jehh over 4 years ago

Hi,

I have a fairly big mixed mode design, which has several configurations, (ie. different DC points, supplies, configurations etc). I've handled this with case-statements based on one variable, eg.:

variable conf = "A","B","X"

variable vdd = case(VAR("conf")("A" 1)("B" 2)("X" 3)(t 0))

etc.

Up until a recent update to the digital circuits this method has worked fine. Now, however it fails with the following:

ERROR (SFE-874): "path/to/input.scs" 8: 179: Unexpected open parenthesis "(". Expected close parenthesis or comma. Cannot run the simulation because of syntax error. Correct the error and rerun the simulation.

ERROR (SFE-683): "path/to/input.scs" 8: Badly formed parameters statement.

At line 179 in said input.scs, is just an ends to a subckt that holds some transistors, and not even any open parentheses.

Removing the case-statements solves the issue. However, I would really prefer to use the case statements, as they are very valuable in configuring my circuit for the roughly 360 configurations that I'm iterating through.

Any help is appreciated.

BR,
Christian

Versions information:

Virtuoso IC6.1.8-ISR14
Spectre 20.1
xrun 19.09
RH6

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 4 years ago

    Dear Christian,

    Without seeing the full input.scs, this is difficult for me to assess what the syntax error might mean.  The error codes, however, suggest it may be due to a missing comma in your case statement due to the ternary operator and if your design variable "conf"  is a local design variable. Have you seen the following Cadence on-line Support article Christian?

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nXT2EAM&pageName=ArticleContent

    This article provides a couple of workarounds that may. or may not(!), be helpful to you...

    I hope this helps!

    Shawn

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

    Dear Christian,

    Without seeing the full input.scs, this is difficult for me to assess what the syntax error might mean.  The error codes, however, suggest it may be due to a missing comma in your case statement due to the ternary operator and if your design variable "conf"  is a local design variable. Have you seen the following Cadence on-line Support article Christian?

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nXT2EAM&pageName=ArticleContent

    This article provides a couple of workarounds that may. or may not(!), be helpful to you...

    I hope this helps!

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to ShawnLogan

    Actually, the case statement is a SKILL function, and so should be evaluated before it even produces the netlist (case would not be understood by spectre). That suggests there is some kind of evaluation error - normally what happens is that ADE trues to evaluate it as SKILL, and if that fails, it passes it on to spectre with the hope that spectre can handle it (which would fail in this case).

    I initially thought that the missing spaces between the close and subsequent open parentheses would be an issue, but SKILL actually handles that without problem.

    I've not had a chance to test it - rather busy this week. I would advise customer support to follow this up... (you could always check with the latest hotfix first, given that there have been a few fixes related to how dependent expressions are handled due to something breaking recently due to trying to handle parameters locally within the simulator where possible - it's possible that this is confusing matters). The fix for that was in ISR15 (one after the version you're using). You could try doing:

    setenv AXL_NETLIST_WITH_VALUE 1

    or

    export AXL_NETLIST_WITH_VALUE=1

    (depending on the shell you're using) before starting virtuoso (in the version you have; in the later version this shouldn't be necessary).

    Note, this is a wild guess based on other issue with dependent expressions - I've not tested it. My theory is that the check for expressions that should be handled by the simulator is mistakenly passing the expression onto the simulator rather than evaluating it in SKILL, rather than it being due to an evaluation error.

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • jehh
    jehh over 4 years ago in reply to Andrew Beckett

    Hi Andrew -

    This morning I woke with the same hunch as you, and tested running more sweeps (in LSCS mode) - low and behold - it parses the netlist. I guess it then properly evaluates the SKILL code before parsing it to the input.scs? I still can't netlist using RMB -> netlist -> create..., only through starting a simulation does it pass.

    I tried to add setShellEnvVar("AXL_NETLIST_WITH_VALUE=1") to my cdsinit (per this suggestion), with no luck - it still doesn't evaluiate the SKILL code before parsing it to netlisting.

    Is there someway to force evaluation of SKILL before netlisting?

    BR,
    Christian

    ----

    EDIT: Per Shawns suggestion, I added the SKILL code to global variables, instead of local - now it works with a single run.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jehh
    jehh over 4 years ago in reply to ShawnLogan

    Hi Shawn,

    I've tried with several different syntax around the SKILL - it seems to be fine as shown, however, it is something to the evaluation of the SKILL.

    Thank you for the suggestion - I have tried to set the SKILL coded variables all to global variables, and it works! At least when pressing simulation, and not when netlisting. So that seemed to do the trick for now.

    Now I have a different issue with  ERROR(ASSEMBLER-2709) but I should have fixed that error with a env variable - I will contact cadence support about that issue.

    BR,

    Christian

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

    Christian,

    I suggest you follow this up with customer support - I think it should work as local (test) variables too. Hopefully it's resolved by the latest hotfix anyway, but if not, it would be good to ensure this is fixed.

    Andrew

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

    I will do that, thank you.

    • 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