• 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. if statement in ade xl

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 125
  • Views 15695
  • 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

if statement in ade xl

Holz
Holz over 4 years ago

Hello everyone,

is it possible to write if expression like following codes when I define global variables in adexl:

   if (a==b) then

          if (c==d) then

               expression 

          else 

               expression 

   else 

           expression

I know its possible to write something like out= if( (a==b) then 1 else 0), so I write like:

if (  (a==b) then ( if ( (c==d) then current else -current) )   else 0)

But I get error:

"input.scs" 9: Parameter `I_ainv': Cannot run the simulation because an unknown parameter `if' has been specified in expression `if'

Does anyone know why it happens? Thanks a lot for help

Warm regards,

Holz

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 4 years ago

    Dear Holz,

    Holz said:

    I know its possible to write something like out= if( (a==b) then 1 else 0), so I write like:

    if (  (a==b) then ( if ( (c==d) then current else -current) )   else 0)

    But I get error:

    "input.scs" 9: Parameter `I_ainv': Cannot run the simulation because an unknown parameter `if' has been specified in expression `if'

    Does anyone know why it happens?

    A couple of comments if I may...not sure they will help...but came to mind

    1. Did you try to remove the space character between the "if" and left parenthesis "("? In SKILL or in ocean/VIvA, the syntax of an if statement requires there be no white character between a function - such as the condition if expression - and the following left parenthesis. Your error message suggests ADEX-L is not recognizing the "if" as the SKILL conditional expression and treating it as a global variable. Hence, you might try the following (note missing spaces after "if"):

    if(  (a==b) then ( if( (c==d) then current else -current) )   else 0)

     

    2. As I am sure you know, ADE-XL is no longer actively supported by Cadence. I might suggest you consider the relatively painless transition to the more modern Assembler/Explorer views. Assembler behavior is very very similar with the capability to easily import any ADEX-L state(s) you may have created. It also supports a lot more functionality than ADE-XL.

    3. I and not sure what version of the tool you are using, but there a way tf you have not seen them, there is a Cadecnce On-line support article entitled 

    "How to set value of global variables based on the value of other global variable" at URL:

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

    This might be helpful to you as it provides a SKILL based function.

    4. There is also a second application note concerning the use of conditional expressions with local variables and a workaround for earlier versions of Virtuoso (IC 6.1.6)

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

    I hope these help Holz!

    Shawn

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

    This is most likely to be the erroneous spaces (plus having some unnecessary parentheses may not help). In essence, ADE XL tries to evaluate global variables as SKILL expressions first (ADE Assembler does the same), and if that fails to evaluate, it assumes the expression can be handled by the simulator - and that's why it fails in the simulator (since that doesn't have such an if expression). So you can simplify it as follows:

    if(a==b then if(c==d then current else -current) else 0)

    In fact, you can take advantage of the fact that the SKILL if function can omit the then/else keywords if there is only a single statement for the then and else parts:

    if(a==b if(c==d current -current) 0)

    although you might find that less readable.

    Regards,

    Andrew

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

    This is most likely to be the erroneous spaces (plus having some unnecessary parentheses may not help). In essence, ADE XL tries to evaluate global variables as SKILL expressions first (ADE Assembler does the same), and if that fails to evaluate, it assumes the expression can be handled by the simulator - and that's why it fails in the simulator (since that doesn't have such an if expression). So you can simplify it as follows:

    if(a==b then if(c==d then current else -current) else 0)

    In fact, you can take advantage of the fact that the SKILL if function can omit the then/else keywords if there is only a single statement for the then and else parts:

    if(a==b if(c==d current -current) 0)

    although you might find that less readable.

    Regards,

    Andrew

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

    Hi Andrew,

    I have solved this problem use skill, thanks

    • 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