• 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. if statement error in adexl

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 10456
  • 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 error in adexl

Holz
Holz over 3 years ago

Hi everyone,

I use if statement to define some global parameters, I get error:

In input.scs, the error position (line 10 column 22 and line 12 column 41) are showed in flowing code with red background.

I_cout=if(IFL==11 if((cin_1==0 && a_1==vdd && b_1==vdd) || (cin_1==vdd \
&& a_1==0 && b_1==vdd) || (cin_1==vdd && a_1==vdd && b_1==0) || \
(cin_1==vdd && a_1==vdd && b_1==vdd) current -current) 0) \

And the definition of I_cout in global variables in adexl is:

if(IFL==11 if((cin_1==0 && a_1==vdd && b_1==vdd) || (cin_1==vdd && a_1==0 && b_1==vdd) || (cin_1==vdd && a_1==vdd && b_1==0) || (cin_1==vdd && a_1==vdd && b_1==vdd) current -current) 0)

How can I solve this problem? Thanks for help.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    OK, so it appears you are trying to use a SKILL expression for the condition. This only works if the expression can be fully evaluated inside ADE XL (or the newer supported Explorer/Assembler; ADE XL is obsolete), and if some of the variable references are not understood by ADE (e.g. they are being set in an external spectre include file or varied in Monte Carlo), ADE attempts to evaluate the expression and if it fails, passes it through to the netlist. Since it's not a valid Spectre expression (it's not in Spectre's language), it will fail, unsurprisingly.

    You'd need to use the Spectre ternary expression as I showed in one of your previous posts. 

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    OK, so it appears you are trying to use a SKILL expression for the condition. This only works if the expression can be fully evaluated inside ADE XL (or the newer supported Explorer/Assembler; ADE XL is obsolete), and if some of the variable references are not understood by ADE (e.g. they are being set in an external spectre include file or varied in Monte Carlo), ADE attempts to evaluate the expression and if it fails, passes it through to the netlist. Since it's not a valid Spectre expression (it's not in Spectre's language), it will fail, unsurprisingly.

    You'd need to use the Spectre ternary expression as I showed in one of your previous posts. 

    Andrew

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

    Hi Andrew,

    actually with ternary expression(following code) I already get the right result, before this I tried to use "if statement" but I failed, I just want to know why.

    I_cout = (IFL !=11) ? 0 : (IFL==11) &&(cin_1==0 && a_1==vdd && b_1==vdd) || (cin_1==vdd && a_1==0 && b_1==vdd)  ||  (cin_1==vdd && a_1==vdd && b_1==0)  ||  (cin_1==vdd && a_1==vdd && b_1==vdd) ? current : -current

    In user guide of spectre I found how to write if statement, so in adexl I wrote my code like:

    I_cout =  if(IFL==11) {if((cin_1==0 && a_1==vdd && b_1==vdd) || (cin_1==vdd && a_1==0 && b_1==vdd) || (cin_1==vdd && a_1==vdd && b_1==0) || (cin_1==vdd && a_1==vdd && b_1==vdd)) {current} else {-current}} else {0}

    And in "Run summary" I got 4 points sweep, which is not supported in monte carlo simulation. I didn't know where these points come from. So I tired to change the code like what I have posted, it's SKILL and but no point sweeps. It's weird

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

    Huh? Where in the Spectre User Guide does it say that an if statement like that is supported? Spectre has a "structural if" which is used for conditionally instantiating instances - it is not for use in expressions (as far as I can see there's nothing that says that - in Spectre 20.1 docs it's on page 190).

    I was able to enter (in IC6.1.8 ISR21, in ADE XL) the I_cout ternary expression - although it doesn't like it if you try to add the variable and add it on the "Create Global Variable" form. Best to add a simple value, and then in the box in the Global Variables section in the Data View assistant, click, erase the simple value, and then paste in your long expression.

    I suspect that's why it's getting confused as a sweep - the colons might be confusing matters.

    Which IC sub-version are you using? It may be that it's something old (which might also explain why you're using the obsolete ADE XL) and there's an issue there?

    It might just be simplest to put the expression into an include file (using ternary) rather than trying to enter it into the ADE XL global variables. The challenge here is that you're mixing some things in a spectre file and some in the UI and things are getting a bit mixed up.

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Holz
    Holz over 3 years ago in reply to Andrew Beckett

    Thanks andrew. Yes you are right, I confused the "structure if" and "if statement" in expression. Ternary expression solved my problem

    • 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