• 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. Mixed-Signal Design
  3. Eye opening center

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 65
  • Views 7380
  • 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

Eye opening center

Kadian
Kadian over 2 years ago

Is there any function in cadence calculator. for finding the center of eye opening of a signal? Currently using eyeHeightAtXY function I was able to get the value of the vertical opening of the eye at a point (x.y), can we do sweep x maintaining y as constant and find x such that value of this function eyeHeightAtXY is maximum.

  • Cancel
Parents
  • ShawnLogan
    ShawnLogan over 2 years ago

    Dear Kadian,

    I am not aware of a specific calculator function to locate the maximum eye height (something analagous to eyeAperture). But, perhaps a simple linear sweep in an ocean script might accomplish what you want. You might consider something like this ocean script that you can run from the command line or CIW. I usually use the file extension ".ocn" for ocean scripts, but the Forum requires me to use ".txt" in order to upload the file. Hence, if you care to try the script, you might consider changing its extension from ".txt" to ".ocn". You may invoke it from the command line in your working directory as:

    ocean -nograph < eye_hieght_sweep_052523v1p0.ocn > run.out

    or from the CIW:

    load( "eye_hieght_sweep_052523v1p0.ocn")

    Shawn

    ---------------------------------------------------

    Fullscreen eye_hieght_sweep_052523v1p0.txt Download
    
    simulator('spectre)
    
    PERIOD = <your_clock_period_for_NRZ_data>
    TSTART = <start_time_for_eye_diagram_analysis>
    TSTART = <stop_time_for_eye_diagram_analysis>
    vthreshold = <your desired threshold voltage>
    
    simulator_results = strcat("<path_to_your_results_directory")
    
    eye_waveform = eyeDiagram(v("vout" ?result "tran-tran" ?resultsDir simulator_results) TSTART TSTOP 2*PERIOD ?autoCenter t )
    
    sprintf(fname_csv "eye_height_measurements.csv")
    fp = outfile(fname_csv "w")
    fprintf(fp "Time (sec),Eye height (V)\n")
    
    delta_t = PERIOD/10.0
    time = 0.50*PERIOD
    max_eye_height = -1.0
    max_eye_height_time = 0.0
    
    while(time < (1.50*PERIOD + 0.10*delta_t)
    
    eye_height = eyeHeightAtXY(eye_waveform time vthreshold ?output "total")
    fprintf(fp "%1.6e,%1.6e\n" time eye_height)
    
    if( (eye_height > max_eye_height) then
    	max_eye_height = eye_height
    	max_eye_height_time = time
    	)
    time = time + delta_t) ; end while loop
    
    fprintf(fp "Maximum eye height of %1.6e V at %1.6e s\n" max_eye_height max_eye_height_time)
    close(fp)
    
    exit()

    ---------------------------------------------------

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kadian
    Kadian over 2 years ago in reply to ShawnLogan

    Dear Shawn, 

    Thanks for the reply. That helps a lot. I also had written similar code and tried to invoke the script from the ADE explorer window. But unable to do that.  I was able to get the center location using the same script when I loaded through CIW. Error window is showing that the definition of output might be not correct. (For calling the ocean script from the ADE explorer followed the steps shown in this How do I use an OCEAN measure script in ADE Explorer, Assembler, or ADE XL? (cadence.com))

    Kadian

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Kadian
    Kadian over 2 years ago in reply to ShawnLogan

    Dear Shawn, 

    Thanks for the reply. That helps a lot. I also had written similar code and tried to invoke the script from the ADE explorer window. But unable to do that.  I was able to get the center location using the same script when I loaded through CIW. Error window is showing that the definition of output might be not correct. (For calling the ocean script from the ADE explorer followed the steps shown in this How do I use an OCEAN measure script in ADE Explorer, Assembler, or ADE XL? (cadence.com))

    Kadian

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to Kadian

    Kadian,

    The most likely reason is that the script doesn't handle family data - so it is quite likely to fail if run on the entire set of data (or you use re-evaluation). I think you'd have to write this as a new function:

    procedure(CCFfindMaxEyeHeightTime(eyeWaveform vthreshold startTime stopTime delta_t)
      cond(
        (drIsWaveform(eyeWaveform)
          let((time eye_height (max_eye_height -1.0) (max_eye_height_time 0.0))
            time=startTime
            while(time < (stopTime + 0.10*delta_t)
              eye_height = eyeHeightAtXY(eyeWaveform time vthreshold ?output "total")
              ;printf("%1.6e,%1.6e\n" time eye_height)
              when( eye_height > max_eye_height
                max_eye_height = eye_height
                max_eye_height_time = time
              )
              time = time + delta_t
            ) ; end while loop
            max_eye_height_time
          ))
        (famIsFamily(eyeWaveform)
          famMap('CCFfindMaxEyeHeightTime eyeWaveform vthreshold startTime
            stopTime delta_t
          )
        )
        (t
          error("CCFfindMaxEyeHeightTime: cannot handle %L\n" eyeWaveform)
        )
      )
    )

    Note, I have not tested this code. You'd call it from the outputs using something like:

    CCFfindMaxEyeHeightTime(eyeWaveform threshold PERIOD*0.5 PERIOD*1.5 PERIOD/10.0)

    The first argument is the output of an eyeDiagram.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kadian
    Kadian over 2 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for the repIy. I tried loading the above script from the CIW and used the function in the Outputs pane in the ADE explorer window. Was able to get the max eyeheight point. Can I include the ocean script in the ADE explorer window itself instead of loading from the CIW.

    Kadian

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago in reply to Kadian

    Hi Kadian,

    Glad it worked (not bad, since I didn't test it!) You have two approaches you could take:

    1. You could add this function as a new function in the calculator; either use the "fx" button in the function panel in the calculator, or the "+" button in the Expression Builder in ADE Explorer/Assembler. Define the UI and save back to the file - this will then cause it to be automatically loaded at startup and then be available in the calculator. This is the approach I'd use
    2. Load the file from your .cdsinit (and .vdsinit it using LSCS).

    That's cleaner than adding the function in an OCEAN script measurement which would cause the function to keep being redefined.

    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