Home > Community > Forums > Custom IC SKILL > How to Calculate Hysteresis using OCEAN/SKILL script

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 How to Calculate Hysteresis using OCEAN/SKILL script 

Last post Fri, Feb 15 2013 6:24 AM by Andrew Beckett. 3 replies.
Started by KishoreGunturi 15 Feb 2013 03:49 AM. Topic has 3 replies and 886 views
Page 1 of 1 (4 items)
Sort Posts:
  • Fri, Feb 15 2013 3:49 AM

    How to Calculate Hysteresis using OCEAN/SKILL script Reply

    I am trying to write a code that calculates the hysteresis window for my Schmitt trigger /comparator. When I try to get the expression through calculator and "intersect" function it gives a wavefrom and I am not sure how to obtain the co-ordinates fo the waveform. If I can obtain a list/co ordinates I can calculate the hysteresis by just sobtracting the two x-coordinates. I am struggling with this waveform object for a long time and not able to figure out the way. It happens with many functions of calculator that you will end up with waveform whose co-ordinates are not available in list form. Please let me know how to obtain this wave co crdinates in number format lists or something on which I can do some mathmatical processing.

    • Post Points: 20
  • Fri, Feb 15 2013 3:56 AM

    Re: How to Calculate Hysteresis using OCEAN/SKILL script Reply

    This might  help:

    /* 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 
    

     

    • Post Points: 20
  • Fri, Feb 15 2013 5:20 AM

    Re: How to Calculate Hysteresis using OCEAN/SKILL script Reply
    Hi,
     
    Thanks for the prompt reply. Works except one missing syntax "then" after if function.
     
    Regards,
    Kishore.
    • Post Points: 20
  • Fri, Feb 15 2013 6:24 AM

    Re: How to Calculate Hysteresis using OCEAN/SKILL script Reply

    Kishore, 

    There's nothing wrong with the syntax. There's no missing "then".

    The if function can be used without then and else - e.g. if you do if(condition thenExpression elseExpression) (i.e. if there's a single expression). In my code I'm using progn() to group multiple expressions into one). This is more of the LISP way of doing things.

    Regards,

    Andrew.

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by KishoreGunturi at 15 Feb 2013 03:49 AM. Topic has 3 replies.