• 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. Creating a Waveform from a Vector or a List

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 144
  • Views 17948
  • 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

Creating a Waveform from a Vector or a List

Orcun Kilic
Orcun Kilic over 16 years ago

I would really appreciate it, if someone could tell me how to turn a List or a Vector into a Waveform. I couldnt find anything about it in user references. Thanks!

 

Orcun 

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

    You can use something like the following SKILL code to do this:

    /* abMakeWaveform.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jul 14, 1999 
    Modified   Dec 10, 2007 
    By         A.D.Beckett
    
    A simple function to throw together waveforms for
    test purposes. Usage:
    
    abMakeWaveform('cos linRg(1 100 1)) => o_waveObj
    
    Returns a waveform with x axis 1 to 100, in 1 steps, with y
    axis the value of the x.
    
    A more complex example:
    
    abMakeWaveform(lambda((x) x*sin(x)) linRg(-40 40 0.1))
    
    Can be plotted in OCEAN using plot(var).
    
    Also supports the first argument being a list of y values:
    
    abMakeWaveform('(5 6 7) '(1 2 3))
    
    Note the lists must be equal length.
    
    An optional third argument which is the data type may be supplied,
    e.g. 'double (default) 'single etc. Finally a fourth argument
    may be given if the x-axis wants to be a different type. For example
    for bar graphs:
    
    abMakeWaveform('(1 -2 4) '("NOM" "SLOW" "FAST") 'double 'string)
    
    ***************************************************
    
    SCCS Info: @(#) abMakeWaveform.il 12/10/07.13:48:06 1.4
    
    */
    /*******************************************************************************
    *  DISCLAIMER: The following code is provided for Cadence customers to use at  *
    *   their own risk. The code may require modification to satisfy the           *
    *   requirements of any user. The code and any modifications to the code may   *
    *   not be compatible with current or future versions of Cadence products.     *
    *   THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING WITHOUT     *
    *   LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES OF MERCHANTABILITY *
    *   OR FITNESS FOR A PARTICULAR USE.                                           *
    *******************************************************************************/
    
    /***************************************************************
    *                                                              *
    * The generic function takes a function object, or the name of *
    *      a function (a symbol) and calls that function for       *
    *   each of the x values. This would be nice if it could be    *
    *    done as a method, but the problem is that you can only    *
    *   have a method specialised on user defined functions, not   *
    *                      binary functions.                       *
    *                                                              *
    ***************************************************************/
    
    (defgeneric abMakeWaveform (func xvalues @optional (yDataType 'double) 
        xDataType)
      (let (xVec yVec wave)
           (setq wave (drCreateEmptyWaveform))
           (unless xDataType (setq xDataType yDataType))
           (setq xVec (drCreateVec xDataType xvalues))
           (setq yVec (drCreateVec yDataType (mapcar func xvalues)))
           (drPutWaveformXVec wave xVec)
           (drPutWaveformYVec wave yVec)
           wave
           ))
    
    /****************************************************************
    *                                                               *
    * A method is defined to allow the first argument to be a list, *
    *               and do something different there.               *
    *                                                               *
    ****************************************************************/
    
    (defmethod abMakeWaveform ((yvalues list) xvalues @optional 
        (yDataType 'double) xDataType)
      (let (xVec yVec wave)
           (when
    	(and (listp xvalues) (equal (length xvalues) (length yvalues)))
    	(setq wave (drCreateEmptyWaveform))
    	(unless xDataType (setq xDataType yDataType))
    	(setq xVec (drCreateVec xDataType xvalues))
    	(setq yVec (drCreateVec yDataType yvalues))
    	(drPutWaveformXVec wave xVec)
    	(drPutWaveformYVec wave yVec)
    	wave
    	)
           ))
    
    

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    You can use something like the following SKILL code to do this:

    /* abMakeWaveform.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jul 14, 1999 
    Modified   Dec 10, 2007 
    By         A.D.Beckett
    
    A simple function to throw together waveforms for
    test purposes. Usage:
    
    abMakeWaveform('cos linRg(1 100 1)) => o_waveObj
    
    Returns a waveform with x axis 1 to 100, in 1 steps, with y
    axis the value of the x.
    
    A more complex example:
    
    abMakeWaveform(lambda((x) x*sin(x)) linRg(-40 40 0.1))
    
    Can be plotted in OCEAN using plot(var).
    
    Also supports the first argument being a list of y values:
    
    abMakeWaveform('(5 6 7) '(1 2 3))
    
    Note the lists must be equal length.
    
    An optional third argument which is the data type may be supplied,
    e.g. 'double (default) 'single etc. Finally a fourth argument
    may be given if the x-axis wants to be a different type. For example
    for bar graphs:
    
    abMakeWaveform('(1 -2 4) '("NOM" "SLOW" "FAST") 'double 'string)
    
    ***************************************************
    
    SCCS Info: @(#) abMakeWaveform.il 12/10/07.13:48:06 1.4
    
    */
    /*******************************************************************************
    *  DISCLAIMER: The following code is provided for Cadence customers to use at  *
    *   their own risk. The code may require modification to satisfy the           *
    *   requirements of any user. The code and any modifications to the code may   *
    *   not be compatible with current or future versions of Cadence products.     *
    *   THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING WITHOUT     *
    *   LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES OF MERCHANTABILITY *
    *   OR FITNESS FOR A PARTICULAR USE.                                           *
    *******************************************************************************/
    
    /***************************************************************
    *                                                              *
    * The generic function takes a function object, or the name of *
    *      a function (a symbol) and calls that function for       *
    *   each of the x values. This would be nice if it could be    *
    *    done as a method, but the problem is that you can only    *
    *   have a method specialised on user defined functions, not   *
    *                      binary functions.                       *
    *                                                              *
    ***************************************************************/
    
    (defgeneric abMakeWaveform (func xvalues @optional (yDataType 'double) 
        xDataType)
      (let (xVec yVec wave)
           (setq wave (drCreateEmptyWaveform))
           (unless xDataType (setq xDataType yDataType))
           (setq xVec (drCreateVec xDataType xvalues))
           (setq yVec (drCreateVec yDataType (mapcar func xvalues)))
           (drPutWaveformXVec wave xVec)
           (drPutWaveformYVec wave yVec)
           wave
           ))
    
    /****************************************************************
    *                                                               *
    * A method is defined to allow the first argument to be a list, *
    *               and do something different there.               *
    *                                                               *
    ****************************************************************/
    
    (defmethod abMakeWaveform ((yvalues list) xvalues @optional 
        (yDataType 'double) xDataType)
      (let (xVec yVec wave)
           (when
    	(and (listp xvalues) (equal (length xvalues) (length yvalues)))
    	(setq wave (drCreateEmptyWaveform))
    	(unless xDataType (setq xDataType yDataType))
    	(setq xVec (drCreateVec xDataType xvalues))
    	(setq yVec (drCreateVec yDataType yvalues))
    	(drPutWaveformXVec wave xVec)
    	(drPutWaveformYVec wave yVec)
    	wave
    	)
           ))
    
    

    Regards,

    Andrew.

    • 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