Home > Community > Forums > RF Design > Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform

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

 Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform 

Last post Fri, Dec 21 2012 7:19 AM by RFQuery. 25 replies.
Started by RFQuery 18 Dec 2012 02:58 AM. Topic has 25 replies and 3996 views
Page 2 of 2 (26 items) < Previous 1 2
Sort Posts:
  • Fri, Dec 21 2012 5:31 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    My Monte expression is :

     monteExpr("RISE_TIME" sprintf(nil "MyRiseTime(v(\"/MIXER_I_P\" ?result 'tran) %g %g %g)" CLOCK_DUTY_PERIOD CLIP_START CLIP_END))

    • Post Points: 5
  • Fri, Dec 21 2012 5:33 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    My monteexpression is abelow:-

    monteExpr("RISE_TIME" sprintf(nil "MyRiseTime(v(\"/MIXER_I_P\" ?result 'tran) %g %g %g)" CLOCK_DUTY_PERIOD CLIP_START CLIP_END)) 

    • Post Points: 5
  • Fri, Dec 21 2012 5:35 AM

    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    No, that should not work. Your function is plotting things - and that makes no sense. This function is called by the simulator during each iteration of the monte carlo as a background process - it invokes the "artil" executable to do this. artil has no ability to plot anything, and so the calls to newWindow(), plot(), etc would fail.

    Even if it did work, you'd end up with many windows being opened (if you did a reasonable number of statistical points), which I'm sure you'd find annoying...

    The functions called from monteExpr can only compute a scalar result - they cannot do anything more complex like plot anything.

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, Dec 21 2012 5:44 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

     Dear Andrew,

    I commented the plot() and printf() commands.

    And ran the ocean. But it didn't work.

    it is showing the following errors

    subckts: writing subcircuits to rawfile.
    \o
    \o
    \o Error found by spectre during Monte Carlo analysis `mc1'.
    \o
    \o     ERROR (SPECTRE-8003): subckts: Error evaluating ocean expression
    \o         `RISE_TIME=MyRiseTime(v("/MIXER_I_P" ?result 'tran)
    \o             2.5e-10 8e-07 9e-07)'.
    \o
    \o
    \o
    \o Unsuccessfully evaluated export statements (based on return code).
    \o
    \o Analysis `mc1' was terminated prematurely due to an error

    • Post Points: 5
  • Fri, Dec 21 2012 6:08 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    Dear Andrew,

    The idea of doing this if-else waveform is that:-

    As the wave is settling, one can't predict the time instant where the start of the wave is clipped at the middle of the clock period.

    Without the if-else, I sometimes found some wave getting clipped at the middle of the rising edge which gives me erroneous results.

    Kind Regards,

     

    • Post Points: 20
  • Fri, Dec 21 2012 6:22 AM

    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    Without seeing your data, it's really hard to debug (as I keep saying - customer support is the best avenue for this). The most likely scenario is that the cross() function is returning nil in some cases, and hence the subtraction is failing. Maybe if you do:

            RISE_UPPER= cross( clip_I_P UPPER_THRESOLD 2 'rising ) || 0.0
            RISE_LOWER= cross( clip_I_P LOWER_THRESHOLD 2 'rising ) || 0.0

    then it will succeed (albeit giving the wrong answers) but it might highlight where the problem is. If you save the waveform data from the monte carlo by adding ?savefamilyplots "yes" to the monteCarlo() call in your OCEAN script, then you can look at the waveforms for each point and check them after the event.

    The code change above says to either return the cross() value, or if cross returned nil, it will set RISE_UPPER or RISE_LOWER to 0.0.

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, Dec 21 2012 6:28 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    Dear Andrew,

    I am really thankful to you for your time and patience.

    I have already filed a SR. 

    By the way, I tried with your testmonte.scs file with my ( what I have already posted) .artilinit code. It is showing the same error.

    I am wondering what is happening.

    • Post Points: 20
  • Fri, Dec 21 2012 6:41 AM

    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

     testmonte.scs fails because your function has:

             CLIP_START = CLIP_START + (CLOCK_DUTY_PERIOD*1.5)
            clip_I_P=clip( v("/MIXER_I_P" ?result 'tran) CLIP_START CLIP_END)

    if instead it was:

             CLIP_START = CLIP_START + (CLOCK_DUTY_PERIOD*1.5)
            clip_I_P=clip( signal CLIP_START CLIP_END)

    It would be OK. This is because in the testmonte.scs case, it can't use "/MIXER_I_P" to look up the signal name because that's in the "schematic" namespace, and since the netlist was not produced from a schematic, you don't have any mapping data (e.g. in the amap directory) to tell it the mapping between schematic and netlist names. If you recall, in the testmonte.scs file I had:

     export RISE_TIME=oceanEval("MyRiseTime(v(\"MIXER_I_P\" ?result 'tran) \
        8e-07 9e-07)") 

    (no leading slash). If I make the above change to the code, and then change the export statement to:

     export RISE_TIME=oceanEval("MyRiseTime(v(\"MIXER_I_P\" ?result 'tran) \
        2.5e-10 8e-07 9e-07)")

    Then it works fine. Note that I know it's definitely in the "then" branch of the if() because I tried multipling the abs() by 0.0, and the RISE_TIME ended up being 0.0 for all points.

    So almost certainly this is due to some failing of the cross() calls with your specific data. This shows the need to program defensively...

    Regards,

    Andrew.

     

    • Post Points: 20
  • Fri, Dec 21 2012 6:51 AM

    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    What's the SR number that you've logged? I wanted to point the AE who ends up dealing with this in the right direction before I leave for the Christmas holidays...

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, Dec 21 2012 7:16 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

    Dear Andrew,

    Thanks a lot for pointing out the mistakes.

    Here is the story:-

     In tesmonte.scs, I have changed to 

    export RISE_TIME=oceanEval("MyRiseTime(v(\"MIXER_I_P\" ?result 'tran) \
        2.5e-10 8e-07 9e-07)")

    But THE CULPRIT-1 is:-

     I had NOT done ( I somehow couldn't cath that) 

     clip_I_P=clip( v("/MIXER_I_P" ?result 'tran) CLIP_START CLIP_END) to clip_I_P=clip( signal CLIP_START CLIP_END)

    Even if everything right there is another one -->

     THE CULPRIT-2 is:-

         I had NOT commented 

          w = newWindow() ( The complex command for .artilint )

     

    After fixing the above two CULPRITS ( of course I am the real culprit), things indeed worked.

    I really appreciate your help,time and patience.

    Kind Regards,

     

     

     

    • Post Points: 5
  • Fri, Dec 21 2012 7:19 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Using Montecarlo simulation for finding Rise and fall tile of a SETTLING waveform Reply

     

    Dear Andrew, 

    The SR NO. is  43205866.

    The AE has replied. I have given him the version of OCEAN I am using.

    Don't worry about that.

    Mery Christmas

    Kind Regards,

    • Post Points: 5
Page 2 of 2 (26 items) < Previous 1 2
Sort Posts:
Started by RFQuery at 18 Dec 2012 02:58 AM. Topic has 25 replies.