• 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. How do I implement this offset logic in ocean script?

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 126
  • Views 13271
  • 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

How do I implement this offset logic in ocean script?

chaosatom
chaosatom over 12 years ago
I have a ramp in my input of comparator and I am getting the offset by implementing this logic in ocean script. If clock= 1 and output= 1 in an transient response, then get the x-value for the first time that it happens. From that x-value, get the y-value of input. How would I accomplish this?

Do I need to loop through each time step and see where it occurs? Or is there an easier implementation for it? I am new to ocean script. 
  • Cancel
  • chaosatom
    chaosatom over 12 years ago
    I have this code that works in ocean: (Basically I sweep time and store the Vin value on to a text file)
    for(tt 1 1200
      time = (tt*.0005)-.0005
              if( (value(VT("/Vout"), time)<=.8 && value(VT("/clk"), time)>=1) && (value(VT("/Vout"), time)>=.1)
                     then fprintf(of "Vin = %1.3f \n" value(VT("/Vn"),time))
                )
           

    )

    I want to add this ocean script to a calculator and display the Vin value on the output of ADE window (then run Monte carlo). Can anybody give me a step by step guide on how to proceed?   

     Thanks,

    Vipul
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    Vipul,

    Probably I'd do this using the code in this post (also in this post). You could also define:

    procedure(abWithinRange(wave min max)
      abApplyToWave(
        lambda((val)
          cond(
            (val<max 1)
            (val>min 1)
            (t 0)
          )
        )
      )
    )

    In conjunction with abPositive in the earlier post, you'd do:

    value(VT("/Vin") cross(abPositive(VT("/clk")-1)*abWithinRange(VT("/Vout") 0.1 0.8) 0.5 "rising"))

    Something like that.

    I'll link your earlier question to this, because I think it answers both. Your above approach won't really work because it doesn't output a single value - but you could of course alter the logic to return a single value and encapsulate it in a function definition.

    Kind Regards,

    Andrew.

     

    • 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