Home > Community > Forums > RF Design > Corner and varible sweep simulation in spectre

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

 Corner and varible sweep simulation in spectre 

Last post Fri, Jul 5 2013 7:31 AM by jerry124. 11 replies.
Started by lahsivece 03 Apr 2013 10:08 PM. Topic has 11 replies and 2924 views
Page 1 of 1 (12 items)
Sort Posts:
  • Wed, Apr 3 2013 10:08 PM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 34
    • Points 515
    Corner and varible sweep simulation in spectre Reply

    Hi ,

    I am trying to do a multivariable sweep and corner simulation in spectre . 

    In ocean , it is easy , I can do following 

    b0_list = list(0.0 1.2)
    b1_list = list(0.0 1.2)
    b2_list = list(0.0 1.2)

    corners='("ss" "ff" "tt" "snfp" "fnsp")

    foreach(corner corners

    modelFile(list("<path_to_model_library>/model.lib.scs" sprintf(nil "%s" corner)))
    foreach(x b2_list
    desVar("b2" x)
    foreach(y b1_list
    desVar("b1" y)
    foreach(z b0_list
    desVar("b0" z)
      resultsDir(sprintf(nil "<path_to_result_directory>/spectre/schematic/corner=%sb5=%gb4=%gb3=%gb2=%gb1=%gb0=%g",corner,b5_z,b4_y,b3_x,x,y,z))
    run()
    )
    )
    )
    )


    How can I modify above to use it  for spectre simulations from command line ?

    Due to some logistical issues , I can have access to either one  MMSIM (for spectre) or IC514( for ocean) for simulation .

    Please advise. 

    Thanks 

    • Post Points: 20
  • Thu, Apr 4 2013 1:27 AM

    Re: Corner and varible sweep simulation in spectre Reply

    I'm guessing that you're asking what the equivalent syntax is for doing this within a spectre netlist (i.e. with no OCEAN involved at all). Is that correct?

    In other words, you want to just do "spectre yournetlist.scs" and have it run all the simulations?

    Regards,

    Andrew.

    • Post Points: 20
  • Thu, Apr 4 2013 1:47 AM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 34
    • Points 515
    Re: Corner and varible sweep simulation in spectre Reply

    Thanks for the reply, Andrew.

    Yes I am looking for equivalent syntax for doing the same within the spectre netlist .

    and yes I just want to do "spectre netlist.scs" and have it run all the simulations .

    Regards,

    Vishal

    • Post Points: 20
  • Sat, Apr 6 2013 7:52 AM

    Re: Corner and varible sweep simulation in spectre Reply

    Vishal,

    Unfortunately you can't sweep model sections in spectre, but you can do something like this:

    // example using nested sweeps

    include "models.scs" section=nn

    parameters b2=0.0 b1=0.0 b0=0.0

    // silly circuit just to do something
    M1 (d g 0 0) nch w=1u l=0.5u
    vd (d 0) vsource type=dc dc=b1
    vg (g 0) vsource type=sine freq=1M ampl=b2

    sweepb2_1 sweep param=b2 values=[0.0 1.2] {
      sweepb1_1 sweep param=b1 values=[0.0 1.2] {
        sweepb0_1 sweep param=b0 values=[0.0 1.2] {
        tran_1 tran stop=1u
        }
      }
    }

    alt1 altergroup {
        include "models.scs" section=ff
    }

    sweepb2_2 sweep param=b2 values=[0.0 1.2] {
      sweepb1_2 sweep param=b1 values=[0.0 1.2] {
        sweepb0_2 sweep param=b0 values=[0.0 1.2] {
        tran_2 tran stop=1u
        }
      }
    }

    alt2 altergroup {
        include "models.scs" section=ss
    }

    sweepb2_3 sweep param=b2 values=[0.0 1.2] {
      sweepb1_3 sweep param=b1 values=[0.0 1.2] {
        sweepb0_3 sweep param=b0 values=[0.0 1.2] {
        tran_3 tran stop=1u
        }
      }
    }

    Regards,

    Andrew.

    • Post Points: 20
  • Sun, Apr 7 2013 7:45 PM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 34
    • Points 515
    Re: Corner and varible sweep simulation in spectre Reply
    Thank you, Andrew . Regards, Vishal
    • Post Points: 20
  • Fri, May 17 2013 4:09 AM

    Re: Corner and varible sweep simulation in spectre Reply

    Vishal,

    At the time I first responded to your question, I also looked into using SpectreMDL as a way of avoiding having to duplicate the sweeps for each alter. Unfortunately it didn't work properly - so I requested a fix for this. This was implemented in MMSIM12.1 ISR8 (available on downloads.cadence.com). Here's the explanation of how this works:

    In the spectre netlist (testsweep2.scs), I have:
    
        include "models.scs" section=nn
    
        parameters b2=0.0 b1=0.0 b0=0.0
    
        // silly circuit just to do something
        M1 (d g 0 0) nch w=1u l=0.5u
        vd (d 0) vsource type=dc dc=b1
        vg (g 0) vsource type=sine freq=1M ampl=b2
    
        sweepb2 sweep param=b2 values=[0.0 1.2] {
          sweepb1 sweep param=b1 values=[0.0 1.2] {
    	sweepb0 sweep param=b0 values=[0.0 1.2] {
    	    tran tran stop=1u
    	}
          }
        }
    
        altff altergroup {
    	include "models.scs" section=ff
        }
    
        altss altergroup {
    	include "models.scs" section=ss
        }
    
    And then the MDL script (testsweep2.mdl) is:
    
        run sweepb2 as sweepb2_nn
        run altff
        run sweepb2 as sweepb2_ff
        run altss
        run sweepb2 as sweepb2_ss
    
    Then I can run:
    
    spectremdl testsweep2 

    If you do this (from MMSIM12.1 ISR8 onwards) it conveniently runs the nested sweep for all corners with the minimum of coding in the netlist/MDL file.

    Just thought you (and maybe others) might be interested in this alternative approach!

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, May 17 2013 8:39 AM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 34
    • Points 515
    Re: Corner and varible sweep simulation in spectre Reply

    Hi Andrew ,

    This is great. Thanks a lot for looking into this.

    Regards,

    Vishal

    • Post Points: 20
  • Wed, Jul 3 2013 1:09 AM

    • jerry124
    • Not Ranked
    • Joined on Fri, Jun 28 2013
    • Posts 12
    • Points 180
    Re: Corner and varible sweep simulation in spectre Reply

    I would like to sweep parameter in one of sub circuit. I am running simulation from command line. If I run sweep parameter on one of device on top lavel it works fine, but when I want run sweep parameter on sub circuit (circuit contains only one type of devices- mos) I get an error. below is part of my simulation file and error i get. do you have any suggestion what I am doing wrong?

    // sw1 sweep dev=m1 param=w values=[ 5u 6u 7u 8u 9u ] {

    sw1 sweep sub=xs25 mod=mos bsim3v3 param=w values=[5u 6u 7u 8u 9u] {
      ac ac start=100 stop=150M dec=20 
    }
    ------------------------------

     Error found by spectre during circuit read-in.
        ERROR (SFE-874): "test.scs" 389: Unexpected keyword "param".
            Expected equals.
        ERROR (SFE-874): "test.scs" 395: Unexpected end of block
            statement "}".
    Warning from spectre during circuit read-in.
        WARNING (SFE-618): Unterminated block statement. Terminating statement at
            the end of file.

    • Post Points: 20
  • Wed, Jul 3 2013 2:43 AM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 34
    • Points 515
    Re: Corner and varible sweep simulation in spectre Reply

    Hi ,

    Could you please try by removing "mod=mos bsim3v3" ? Also check for the dangling "}" .

    Regards,

    Vishal

     

    • Post Points: 20
  • Wed, Jul 3 2013 3:18 AM

    • jerry124
    • Not Ranked
    • Joined on Fri, Jun 28 2013
    • Posts 12
    • Points 180
    Re: Corner and varible sweep simulation in spectre Reply

    Hi Vishal,

    Thx for quick replay. if I remove "mod=mos bsi3v3" I get an error:

     Error found by spectre during Sweep analysis `sw1'.
        ERROR (SFE-54): Subckt instance `xs25' (an instance of `mir3_s25') does not
            have a subckt parameter `w'.

    as I understand correct I need to use "mod=" option in syntax or I am wrong?

     regarding to "}". there was mising last "}".

     BR

    Jerry

    • Post Points: 20
  • Thu, Jul 4 2013 6:38 AM

    Re: Corner and varible sweep simulation in spectre Reply

     It's really not that clear what you're trying to do. Maybe if you showed something of the structure of your netlist, and what it is you're trying to vary?

    Andrew.

    • Post Points: 20
  • Fri, Jul 5 2013 7:31 AM

    • jerry124
    • Not Ranked
    • Joined on Fri, Jun 28 2013
    • Posts 12
    • Points 180
    Re: Corner and varible sweep simulation in spectre Reply

    Hi Andrew,

    I would like to run top level simulation with sweeping "w" parameter of device "m1" in subcircuit "xs25".

    I know how to sweep parameter of device which are present on top level schematic (for example "m5"), but I don't know how to do this for device in subcircit.

    example:

    //

        m6 ( w_s2_i1 w_s1_fo1b w_s2_i1 vss )  modn w=1u l=0.35u ad=0.85p as=0.85p \
            pd=2.7u ps=2.7u nrs=0.3 nrd=0.3 ng=1
        m5 ( w_s2_i2 w_s1_fo2b w_s2_i2 vss )  modn w=1u l=0.35u ad=0.85p \
            as=0.85p pd=2.7u ps=2.7u nrs=0.3 nrd=0.3 ng=1
        xs25 ( w_33 w_32 vdda w_19 ) tst1

    .......

    subckt tst1 vbpp vbpc vdda out
    m1 ( w_1 vbpp vdda vdda )  modp w=7u l=1u ad=5.95p as=5.95p pd=8.7u ps=8.7u \
            nrs=42.857m nrd=42.857m ng=1
    m2 ( out vbpc w_1 vdda )  modp w=4u l=1u ad=3.4p as=3.4p pd=5.7u ps=5.7u \
            nrs=75m nrd=75m ng=1

    ...............

    ends tst1

    ...............

    sw1 sweep sub=xs25 mod=mos bsim3v3 param=w values=[5u 6u 7u 8u 9u] {
       ac ac start=100 stop=150M dec=20
    }
    //

    Jerry

    • Post Points: 5
Page 1 of 1 (12 items)
Sort Posts:
Started by lahsivece at 03 Apr 2013 10:08 PM. Topic has 11 replies.