• 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. Extract x and y Vector from srrWave

Stats

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

Extract x and y Vector from srrWave

tsnv
tsnv over 1 year ago

The goal is to extract the x and y vectors from an srrWave. In a first step from a single design point, but in a later stage ideally from a parameter sweep simulation. The current approach to get the x and y vectors from a waveform from a node voltage of a transient simulation is shown below. The code is written in Python. Python-Skill Bridge is used to forward the OCEAN commands. The function extracting the x and y vectors:

def wave2vec(ws, waveform):
x_vec = ws.dr.get_waveform_x_vec(waveform)
x = []
print(f'Vector length: {ws.dr.vector_length(x_vec)}')
for i in range(ws.dr.vector_length(x_vec)):
x.append(ws.dr.get_elem(x_vec, i))
y_vec = ws.dr.get_waveform_y_vec(waveform)
y = []
print(f'Vector length: {ws.dr.vector_length(y_vec)}')
for i in range(ws.dr.vector_length(y_vec)):
y.append(ws.dr.get_elem(y_vec, i))
return x, y

Getting the waveform data from the simulation results and calling wave2vec:

# setup Maestro mode explorer
ws['ocnSetXLMode']("explorer") # set mode to OCEANXL
ws['ocnxlProjectDir']("~/simulations") # location of simulation results
ws['ocnxlTargetCellView']("library", "cell", "view")
ws['ocnxlResultsLocation']("") # same as project dir
ws['ocnxlSimResultsLocation']("") # same as project dir
ws['ocnxlMaxJobFail'](20)

ws['openResults'](path_data)
results = ws['results']()
ws['selectResult'](Symbol("tran"))
data = ws['getData']("/net1")
x, y = wave2vec(ws, data)

The data variable does hold the correct result, i.e. the node votlages in an srrWave object (from a similar post), and the code runs without errors. However, the return values from `wave2vec` are not as expected: x returns [1.0] and y returns [<remote object0x...>].

How can I change the method above to correctly access the x and y vectors of an srrWave in case of a single design point and, if possible, in case of a parameter sweep simulation?

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    Without details of what this Python-Skill Bridge does or where it comes from, I think it will be hard for anyone to answer this (it's not a Cadence-provided capability). Do the maintainers of that have a forum or issues list?

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tsnv
    tsnv over 1 year ago in reply to Andrew Beckett

    I should have sent the SKILL code instead, my apologies. In SKILL I get the same results.

    Main code:

    ocnSetXLMode( "explorer" )
    ocnxlProjectDir( "~/simulations" )
    ocnxlTargetCellView( "library" "cell" "view" )
    openResults( "/somepath/Ocean.0/psf/tran/psf/" )
    selectResult( 'tran )
    data = getData( "/net1" )
    ocnPrint( data )
    ocnPrint( abWaveToList( data ) )
    ocnxlEndXLMode( "explorer" )

    abWaveToList.il (similar to wave2vec function):

    /* abWaveToList.il

    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Nov 17, 2003
    Modified   
    By         

    Convert a waveform to a list

    ***************************************************

    SCCS Info: @(#) abWaveToList.il 11/17/03.15:08:15 1.1

    */

    /************************************************************************
    *                                                                       *
    *                  (abWaveToList wave @key transpose)                   *
    *                                                                       *
    *    Take a waveform object, and return it as a list of xy pairs. Or    *
    * if transpose is set, it returns a list of x values followed by a list *
    *                             of y values.                              *
    *                                                                       *
    ************************************************************************/

    (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

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to tsnv

    I think (without testing this) the problem is most likely because your openResults is opening the root of the results - so if you have corners, sweeps etc, there will be multiple simulation runs and hence you've got a famlly of data (with the sweep variables). This happens even if there aren't any sweeps - and so the abWaveToList won't work properly because it's not expecting waveform data. Your edited post above makes that less obvious because it just says openResults(data path) whereas before it was:

    openResults( "/somepath/Ocean.0/psf/tran/psf/" )

    If that was a single point result:

    openResults( "/somepath/Ocean.0/1/tran/psf/" )

    then I think it should work. You either need to iterate over the point directories, or make your vector processing able to handle family data.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tsnv
    tsnv over 1 year ago in reply to Andrew Beckett

    Indeed, I assumed "*/Ocean.0/psf/tran/psf" was the correct path. Running the Python code with the "*/Ocean.0/1/tran/psf/" solves the issue. I will edit the post back to show the path.

    Thank you for the help!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • tsnv
    tsnv over 1 year ago in reply to Andrew Beckett

    Indeed, I assumed "*/Ocean.0/psf/tran/psf" was the correct path. Running the Python code with the "*/Ocean.0/1/tran/psf/" solves the issue. I will edit the post back to show the path.

    Thank you for the help!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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