• 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. Equality operators in Spectre

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 125
  • Views 14075
  • 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

Equality operators in Spectre

svcher
svcher over 10 years ago

Hello,

What is a non-equality operator in Spectre?  Help says it is "!=".  However, this Spectre deck errors out:

simulator lang=spectre
opt options rawfmt=psfascii
v1 (1 0) vsource dc=x1
v2 (2 0) vsource dc=x2
parameters x = 0
parameters x1 = (x==0)
parameters x2 = (x!=0)
dc dc
save 1 2

The error message says:

Error found by spectre during circuit read-in.
    ERROR (SFE-874): "test.scs" 8: Unexpected equals "=". Expected close
        parenthesis.
    ERROR (SFE-683): "test.scs" 8: Badly formed parameters statement.

Line number 8 is the one where "x2" is defined.

Spectre version is "13.1.1.252.isr11 32bit -- 14 Aug 2014"

  Thank you for your help.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Sergey,

    This appears to be a bug in the parser to me. If I use this:

    parameters x=0
    parameters x1=(x)==0
    parameters x2=(x)!=0

    then it works. I filed CCR 1446809 to get this corrected.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • svcher
    svcher over 10 years ago
    Thank you Andrew, I will use the workaround you suggested while this gets fixed. BTW, this also works: parameters x2= x !=0. Notice an extra space before the "!=".
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Actually it turns out that this is expected behaviour. It's a consequence that identifiers (net names, instance names, parameter names etc) are allowed to have exclamation marks in them - this is because Virtuoso uses the convention such as vdd! to indicate a global node, and many years ago we decided to allow such net names to be used in spectre unchanged (i.e. not mapped to something else). Because identifiers are found by the tokeniser, it can't use different rules for different identifiers (so an identifier can't only allow exclamation for net names). Partly this is because at the point of tokenisation it wouldn't know the context, but also because certain parameter values can be net names.

    So actually x2=x!=0 looks like ident1=ident2=0 which is not legal. So the solution is to add a space or surround with parentheses which separates the ! from the identifier.

    I'll write this up as a solution, as there's nothing we can fix here.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • svcher
    svcher over 10 years ago
    Thanks Andrew, I understand now that this is a feature, not a bug.
    • 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