• 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. Scaling the X (time) axes of a trace in skill / ocean

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 10360
  • 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

Scaling the X (time) axes of a trace in skill / ocean

Simon T
Simon T over 4 years ago

Hi,

I am extracting data with a skill script and I want to scale the X axes of the traces.
I looked through the docu and forum but could not find a easy way to do it, hence I did it by hand.

Now I am wondering if there is a neat way to do it.

To scale the Y axes one can simply multiply it with a scalar.

Here is the snippet I use:

Fullscreen 3007.x_scaler.txt Download
(procedure (abWaveToList wave @key transpose)
    (let (xList yList xyList len
            (xVec (drGetWaveformXVec wave))
            (yVec (drGetWaveformYVec wave))
        )
        (setq len (drVectorLength xVec))
        ;-----------------------------------------------------------------
        ; Return value of this if is the list
        ;-----------------------------------------------------------------
        (if transpose
            (progn
            (for i 0 (sub1 len)
                (setq xList (tconc xList (drGetElem xVec i)))
                (setq yList (tconc yList (drGetElem yVec i)))
            )
            (list (car xList) (car yList))
        )
        ; else
            (progn
            (for i 0 (sub1 len)
                (setq xyList (tconc xyList (list (drGetElem xVec i)
                (drGetElem yVec i))))
            )
            (car xyList)
            )
        ) ; if
    ) ; let
) ; procedure

trace = getData("node_of_interest")
fprintf(trace_file "Time[ns] volts\n")
foreach( point trace_as_list
    fprintf(trace_file "%.16f %.16f\n" (car(point) / 1e-9) nth(1 point))
)
fprintf(trace_file "\n")


closeResults(cur_res_path)

Best,
Simon

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Hi Simon,

    I found that I wrote this a few years ago for another customer

    Andrew

    /* abScaleXaxis.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Dec 21, 2015 
    Modified   
    By         
    
    Scale the x-axis by a factor
    
    Note this only works with non-harmonic data (so if it's harmonic-indexed
    data, extract one harmonic at a time first using the harmonic() function)
    
    abScaleXaxis(wave 2.0)
    
    ***************************************************
    
    SCCS Info: @(#) abScaleXaxis.il 12/21/15.14:47:07 1.1
    
    */
    
    procedure(abScaleXaxis(wave scale)
      cond(
        (drIsWaveform(wave)
          let((new)
            new=drCreateWaveform(drGetWaveformXVec(wave)*scale
              drGetWaveformYVec(wave))
            famSetExpr(new `(abScaleXAxis ,famGetExpr(wave) ,scale))
            new
          ))
        (famIsFamily(wave)
          famMap('abScaleXAxis wave scale)
          )
        (t
          error("abScaleXaxis: Can't handle %L\n" wave)
        )
      )
    )
    

    • 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