• 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. RF Design
  3. Calculator function to check conditions on 3 (or N) wav...

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 63
  • Views 14337
  • 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

Calculator function to check conditions on 3 (or N) waveforms

DKaraca
DKaraca over 6 years ago

Hello,

I have a question about the use of calculator functions.

As an output of an s-parameter (or ac) simulation, I have three custom waveforms a_w, b_w, c_w which are all functions of frequency, i.e.  a_w(f), b_w(f), c_w(f).

I would like to check these waveforms to see if there is any frequency point "f0" satisying:

1) a_w(f0)<0

2) b_w(f0)=0

3) c_w(f0)>0

without visual observation on the graph.

Is there a way to do this using cadence calculator?

My cadence version is IC6.1.7-64b.500.23.

Thanks in advance.

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

    This is a barely tested bit of SKILL that I think does what you want. You'd presumably pass it mag(VF("a")) etc (the magnitude) because it won't handle complex data. It finds all the crossing points for where signal b crosses 0, and then finds the value of a and c at each of those points until it finds one that matches the condition you've asked for. 

    procedure(CCFfindF0(a b c)
      cond(
        (drIsWaveform(a)
          ; main logic for a single waveform
          let((zeroPoints)
            zeroPoints=cross(b 0.0 0 "either")
            car(exists(zeroPoint zeroPoints
              value(a zeroPoint)<0.0 &&
              value(c zeroPoint)>0.0
            ))
          )
        )
        (famIsFamily(a)
          famMap('CCFfindF0 a b c)
        )
        (t
          error("CCFfindF0: can't handle %L\n" a)
        )
      )
    )
    

    You can add it as a function in the calculator by using the "fx" button in the Function Panel (from IC617 onwards) - you can then define the form (to set each of the three arguments as signals) and then having done that once, you can use the function in any future session, or in ADE.

    Regards,

    Andrew.

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

    Hi Andrew,

    Thanks for your quick reply. This does exactly what I needed.

    I will have a look at the skill language manual to further improve it -> return 1 if conditions met, return 0 otherwise

    Regards,

    Denizhan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • DKaraca
    DKaraca over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for your quick reply. This does exactly what I needed.

    I will have a look at the skill language manual to further improve it -> return 1 if conditions met, return 0 otherwise

    Regards,

    Denizhan

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to DKaraca

    As is, the function returns the first frequency if there's a match, or nil otherwise. You could change it to (and I didn't test this):

    procedure(CCFfindF0(a b c)
      cond(
        (drIsWaveform(a)
          ; main logic for a single waveform
          let((zeroPoints firstCross)
            zeroPoints=cross(b 0.0 0 "either")
            firstCross=car(exists(zeroPoint zeroPoints
              value(a zeroPoint)<0.0 &&
              value(c zeroPoint)>0.0
            ))
    if(firstCross then 1 else 0)
    )
    )
    (famIsFamily(a)
    famMap('CCFfindF0 a b c)
    )
    (t
    error("CCFfindF0: can't handle %L\n" a)
    )
    )
    )
    • 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