Home > Community > Forums > RF Design > Reading parmetric sweep data through ocean

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

 Reading parmetric sweep data through ocean  

Last post Thu, Apr 18 2013 7:31 AM by lahsivece. 12 replies.
Started by lahsivece 14 Apr 2013 11:50 PM. Topic has 12 replies and 2029 views
Page 1 of 1 (13 items)
Sort Posts:
  • Sun, Apr 14 2013 11:50 PM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 30
    • Points 465
    Reading parmetric sweep data through ocean Reply

    Hi All,

    I have a set of parmetric sweep results generated through spectre simulation . These file names are of the format 

    "sweep_variablename_-<iteration numbers>_sweep_another_variable_name-<iteration_number>_....tran.tran"

    I am trying to read the file through Ocean and perform some analysis on data generated. My ocean script looks like following:

    sprintf(rdir "<path_to_spectre_simulation_directory>/spectre/schematic")
    openResults(strcat(rdir,"/psf")) 

    ; The above sets the results directory to the psf folder. All parametric sweep results are dumped there.

     

    selectResult('tran)
    clip_v1p=clip(v("/V1P" ?result "sweepb2_1-000_sweepb1_1-000_sweepb0_1-001_tran-tran") 010e-09 28e-09)

    On executing the script  i get following error message

    The output '/V1P' you selected does not exist.  Type
              outputs() to see the list of available outputs or type
              help('v) for more information on the 'v' command.


    However when I execute outputs() I get the netname in the list.

    What am I doing wrong ?

    I can read single spectre simulation data through ocean but Can I read parametric sweep spectre simulation data through ocean ?

    Please advise.

    Thanks & regards

    Vishal

    • Post Points: 20
  • Mon, Apr 15 2013 2:36 PM

    • smlogan
    • Top 75 Contributor
    • Joined on Tue, Jun 10 2014
    • Posts 99
    • Points 1,710
    Re: Reading parmetric sweep data through ocean Reply

     Hi Vishal,

    I am not an expert, but my experience with accessing parametric results suggest that you need to use the value attribute to access the results for a specific sweep. I am not aware that you can change the name of the transient results to correspond to a specific analysis.

    In other words, in my experience, the output file containing the analysis is still called tran.trn, (i.e., ?results "tran-tran"), but the family of waveforms is accessed and the value function is used to select the specific analysis within the family of waveforms.

     Perhaps this example will help...

    If my parametric wave is

    VLOAD  waveformobject
    -------------------------------
    0                  w1
    0.1               w2
    0.5               w3

    Here are 2 potential expressions :
    val1 = value(i("/IB25_0/PLUS" ?resultsDir "./spectre/101508_css_ss_bc" ?result "ac-ac") "VLOAD" 0.5)

    val2  = value(i("/IB25_0/PLUS" ?resultsDir "./spectre/101508_css_ss_bc" ?result "ac-ac")  0.5)

    val1 will return the waveform object corresponding to VLOAD=0.5 ie w3.
    val2 will return a new waveform as given below :

    VLOAD  waveformobject
    -------------------------------
    0                  value( w1  0.5 )
    0.1               value( w2  0.5 )
    0.5               value( w3  0.5 )

    The famValue function can also be used in this case ie :
    ib25_0 = famValue( ib25_0f VLOAD)

     Does this help?

     

    Shawn

    • Post Points: 20
  • Mon, Apr 15 2013 10:59 PM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 30
    • Points 465
    Re: Reading parmetric sweep data through ocean Reply

    Hi Shawn ,

    Thanks for the reply.

    I tried your method I am still getting errors. 

     ocean>clip_v1p=value(clip(v("/V2P" ?result "tran-tran") 010e-09 28e-09) "b0")
              Results "tran-tran" are not available for
              "/home/vishal/simulation/TB_RING_DIFF_INVERTER_4500MHz/spectre/schematic/psf". Use results() for a list of available
               results.
              The output '/V2P' you selected does not exist.  Type
              outputs() to see the list of available outputs or type
              help('v) for more information on the 'v' command.
    *Error* clip: can't handle clip(nil 1e-08 2.8e-08)

    There is no tran.tran file present in the psf directory. 

    Also the output exists. The reason I know this is because when I exceute outputs() , I get the net name /V2P in the list of outputs.

    I am using spectre to do a set of nested parametric sweeps. All the output files are dumped in one location. In my case I have following section added in my input.scs file 

    sweepb2_1 sweep param=b2 values=[0.0] {
      sweepb1_1 sweep param=b1 values=[0.0 ] {
        sweepb0_1 sweep param=b0 values=[0.0 1.2] {
    tran tran stop=50n write="spectre.ic" writefinal="spectre.fc" \
        annotate=status maxiters=5
        }
      }
    }
     

    The above generates tran.tran files in the same psf folder with following names.

    sweepb2_1-000_sweepb1_1-000_sweepb0_1-000_tran.tran

    sweepb2_1-000_sweepb1_1-000_sweepb0_1-001_tran.tran

    I then intend to use some user defined function to run some anaylsis on these files using OCEAN script. However I am not able to read these files.

    Can I create multiple results directory using spectre simulation ?

    Please advise

    Regards,

    Vishal

    • Post Points: 20
  • Tue, Apr 16 2013 9:14 AM

    • smlogan
    • Top 75 Contributor
    • Joined on Tue, Jun 10 2014
    • Posts 99
    • Points 1,710
    Re: Reading parmetric sweep data through ocean Reply

     Hi Vishal,

     

    I noticed a couple of things...

     

    1. The syntax for your getData() command appears to be missing the results directory. This is why you received the error message "Use results() for a list of available results." I think you are missing the ?resultsDir attribute. The command syntax, as I recall is:

    getData( <output_name> ?results <anaysis_type> ?resultsDir <path_to_results_directory>)

    If you already opened the results with openResults( <path_to_results_directory>) and used selecResult(<analysis_type>), then you do not need these attributes.

     Since you received the error message about the "results()", my thought is you may have overlooked the  openResults() command.

     

    2. When I perform a sweep analysis in IC 6.1.5, as in all prior versions, the result is a set of discrete directories whose names reflect the value of the sweep varaible(s). Within each subdirectory, there is a psf folder with the analysis results (i..e, tran.tran file for example). Are you using the paramRun() command in your script?

    For example, on a two variable sweep I recently performed the directory structure is:

     

    IBIAS=1.5e-05,NF_nmos=20  IBIAS=2e-05,NF_nmos=60    IBIAS=4.5e-05,NF_nmos=50
    IBIAS=1.5e-05,NF_nmos=30  IBIAS=3.5e-05,NF_nmos=20  IBIAS=4.5e-05,NF_nmos=60
    IBIAS=1.5e-05,NF_nmos=40  IBIAS=3.5e-05,NF_nmos=30  IBIAS=4e-05,NF_nmos=20
    IBIAS=1.5e-05,NF_nmos=50  IBIAS=3.5e-05,NF_nmos=40  IBIAS=4e-05,NF_nmos=30
    IBIAS=1.5e-05,NF_nmos=60  IBIAS=3.5e-05,NF_nmos=50  IBIAS=4e-05,NF_nmos=40
    IBIAS=2.5e-05,NF_nmos=20  IBIAS=3.5e-05,NF_nmos=60  IBIAS=4e-05,NF_nmos=50
    IBIAS=2.5e-05,NF_nmos=30  IBIAS=3e-05,NF_nmos=20    IBIAS=4e-05,NF_nmos=60
    IBIAS=2.5e-05,NF_nmos=40  IBIAS=3e-05,NF_nmos=30    IBIAS=5e-05,NF_nmos=20
    IBIAS=2.5e-05,NF_nmos=50  IBIAS=3e-05,NF_nmos=40    IBIAS=5e-05,NF_nmos=30
    IBIAS=2.5e-05,NF_nmos=60  IBIAS=3e-05,NF_nmos=50    IBIAS=5e-05,NF_nmos=40
    IBIAS=2e-05,NF_nmos=20      IBIAS=3e-05,NF_nmos=60    IBIAS=5e-05,NF_nmos=50
    IBIAS=2e-05,NF_nmos=30      IBIAS=4.5e-05,NF_nmos=20  IBIAS=5e-05,NF_nmos=60
    IBIAS=2e-05,NF_nmos=40      IBIAS=4.5e-05,NF_nmos=30  psf
    IBIAS=2e-05,NF_nmos=50      IBIAS=4.5e-05,NF_nmos=40

    Each sub-directory has a psf folder with the results. The top level psf folder only has the runObjFile. The containing diectory is the  name of the resuls directory I specify in the resultsDir() command.

    Shawn

    • Post Points: 20
  • Tue, Apr 16 2013 9:27 AM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 30
    • Points 465
    Re: Reading parmetric sweep data through ocean Reply

     

    Hi Shawn,

     1) I have already opened the results directory using openResults command .

    2) I am not using paramRun command in my .scs file. Do I need to use it ? To do nested armetric analysis , I have modified my input .scs as  following

    sweepb2_1 sweep param=b2 values=[0.0] {
      sweepb1_1 sweep param=b1 values=[0.0 ] {
        sweepb0_1 sweep param=b0 values=[0.0 1.2] {
    tran tran stop=50n write="spectre.ic" writefinal="spectre.fc" \
        annotate=status maxiters=5
        }
      }
    }
      

    This geneartes data at a single location when I execute netlist from command line. I would like to have seperate location for each sweep variable ouput run. (in ocean this is easy)

    Thanks & Regards

    Vishal

    • Post Points: 20
  • Tue, Apr 16 2013 10:42 AM

    • smlogan
    • Top 75 Contributor
    • Joined on Tue, Jun 10 2014
    • Posts 99
    • Points 1,710
    Re: Reading parmetric sweep data through ocean Reply

     Hi Vishal,

     I run the analysis using ocean. This is an example of the syntax:

     

    paramAnalysis("FREQ_ADJ" ?values '(0 1 2 3 )
      paramAnalysis("VLF_VAL" ?values '(0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 )
    ))
    paramRun()

    This generates a set of directories - one for each of the simulations as I showed in prior example. I think this is what you want to do if you want to generate a separate set of directories and access the data as I showed in the initial example I provided.

    The input.scs file is not impacted by the use of the paramRun() command. I believe the parameter sweep information is contained in the runObjFile contained in the psf directory. My interpretation of this file is that it is a script that controls the simulations requested. For a parametric analysis it contains lines such as:

    "FREQ_ADJ=0,VLF_VAL=0.2/psf" "runObject" (
    (
    "../FREQ_ADJ=0,VLF_VAL=0.2/psf/logFile"
    "../FREQ_ADJ=0,VLF_VAL=0.2/psf/artistLogFile"
    )
    "FREQ_ADJ=0"
    ()
    ) PROP(
    "netlistDir" "../netlist"
    "dataDir" "../FREQ_ADJ=0,VLF_VAL=0.2"
     "VLF_VAL" 2.000000e-01
    )
     

    Shawn

     

    • Post Points: 35
  • Tue, Apr 16 2013 10:21 PM

    Re: Reading parmetric sweep data through ocean Reply

    OK, I have a very simple example with a similar sweep to you:


    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
        }
      }
    }

    When I run spectre, and then look in the resulting raw directory, I have:

     > ls testsweep.raw                                                                     
    logFile                                                                                          
    sweepb2_1-000_sweepb1_1-000_sweepb0_1-000_tran_1.tran                                            
    sweepb2_1-000_sweepb1_1-000_sweepb0_1-001_tran_1.tran                                            
    sweepb2_1-000_sweepb1_1-000_sweepb0_1_tran_1.sweep                                               
    sweepb2_1-000_sweepb1_1-001_sweepb0_1-000_tran_1.tran                                            
    sweepb2_1-000_sweepb1_1-001_sweepb0_1-001_tran_1.tran                                            
    sweepb2_1-000_sweepb1_1-001_sweepb0_1_tran_1.sweep                                               
    sweepb2_1-000_sweepb1_1_tran_1.sweep                                                             
    sweepb2_1-001_sweepb1_1-000_sweepb0_1-000_tran_1.tran                                            
    sweepb2_1-001_sweepb1_1-000_sweepb0_1-001_tran_1.tran                                            
    sweepb2_1-001_sweepb1_1-000_sweepb0_1_tran_1.sweep                                               
    sweepb2_1-001_sweepb1_1-001_sweepb0_1-000_tran_1.tran                                            
    sweepb2_1-001_sweepb1_1-001_sweepb0_1-001_tran_1.tran                                            
    sweepb2_1-001_sweepb1_1-001_sweepb0_1_tran_1.sweep                                               
    sweepb2_1-001_sweepb1_1_tran_1.sweep                                                             
    sweepb2_1_tran_1.sweep    

    Now, you shouldn't worry too much about the file names, because these get organized in the logFile to  provide the structure of the family data because of the nested sweeps.

    In OCEAN, if I do:

    openResults("testsweep.raw")
    results()

    Then results will return that there is a result called tran - this is the "aliased" name for the result because you have a single transient analysis - it makes it easier because you don't have to worry about the particulars of the result naming. Alternatively, if I do:

    results(?noAlias t)

    you see it returns  ("sweepb2_1_tran_1-sweep") - which is the name of the outer sweep. It's the same thing, and either name will do.

    So if I then call:

        selectResult('tran)
    or selectResult("tran")
    or selectResult("sweepb2_1_tran_1-sweep")

    then I'll access the results, and can type outputs() to see what is there.

    ocean> outputs()
    ("d" "g" "vd:p" "vg:p")

    Then if I do: plot(v("d")) I willl plot the drain voltage over all the sweeps.

    I can also do:

    ocean> sweepNames()
    ("b2" "b1" "b0" "time")
    ocean> sweepValues()
    (0.0 1.2)

    The sweepNames tells me all the sweep names, and sweepValues tells me the values of the outer sweeps. If I then do:

      d=v("d")
      plot(value(d 0.2u))

    it would plot the values across the sweep at the value of the inner sweep (0.2u on the time axis). Or I can do:

      value(value(value(value(d 0.2u) 1.2) 0.0) 1.2)

    which will successively remove an inner sweep and give me a particular combination. Or I can do:

      plot(value(d 'b1 1.2))

    which will give me the family curves (i.e. still time on x-axis, and with b2 and b0 around them, but for a specific value of b1).

    Note that rather than using selectResult(), I could have just done:

      v("d" ?result 'tran)

    or

      v("d" ?result  "sweepb2_1_tran_1-sweep")

    All the selectResult does is give me a convenient default.

    Regards,

    Andrew.

     

    • Post Points: 20
  • Wed, Apr 17 2013 10:20 PM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 30
    • Points 465
    Re: Reading parmetric sweep data through ocean Reply

     

    Hi Shawn ,

    Thanks for the information

     Regards,

    Vishal

    • Post Points: 5
  • Wed, Apr 17 2013 10:29 PM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 30
    • Points 465
    Re: Reading parmetric sweep data through ocean Reply

    Hi Andrew ,

    Thanks for exlanation.

    This works. 

    However , I get following message after I execute openResults("psf").

    Could not find psf/runObjFile under
              /home/vishal/sweep_test. Calculator data access functions
              will not work

    Since spectre simulation was done from command line this file was not generated. 

    Is it needed for using some functions such as clip , frequency etc in ocean? Is there a way to generate it ?

    Thanks & Regards

    Vishal

     

    • Post Points: 20
  • Wed, Apr 17 2013 10:54 PM

    Re: Reading parmetric sweep data through ocean Reply

    Vishal,

    This is just saying that the data access functions from the calculator (e.g. VT, VF, IT, etc) won't work because some of the mapping information is not there. However, providing you can access the data with v(), i(), getData() etc, you can use any of the calculator processing funcitons such as clip etc.

    Regards,

    Andrew.

    • Post Points: 20
  • Wed, Apr 17 2013 11:24 PM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 30
    • Points 465
    Re: Reading parmetric sweep data through ocean Reply

    Hi Andrew,

    Here's what I am doing 

     d1=getData("V1P") ==> drwave:206614616

    in_b0=value(d1 'b0 1.2) ==> drwave:206614552

    in_b1=value(in_b0 'b1 1.2) ==>  drwave:206614952

    v1p_clip=clip(in_b1 10n 20n) ==> drwave:206615048

    frequency(v1p_clip) ==>  drwave:206614664 . I was expecting a number here but got a waveform. frequency is a waveform calculator function.

    Please tell me what I am doing wrong.

    Thanks

    With Regards,

    Vishal

     

     

     

     

     

    • Post Points: 20
  • Thu, Apr 18 2013 5:54 AM

    Re: Reading parmetric sweep data through ocean Reply

    Vishal,

    If your sweep is like you described earlier, with nested sweeps for b0, b1 and b2, your calculations are not doing a value() on 'b2 - so you will get the frequency versus b2  in the output above. Try plotting the result and see what you get - it's quite handy to see what the waveform looks like when you're trying to understand such issues.

    Regards,

    Andrew.

    • Post Points: 20
  • Thu, Apr 18 2013 7:31 AM

    • lahsivece
    • Top 500 Contributor
    • Joined on Tue, Oct 2 2012
    • Posts 30
    • Points 465
    Re: Reading parmetric sweep data through ocean Reply

    Hi Andrew,

    Yes, it was the case. On plottting , the plot was of frequency() with respect to b2. 

    After adding value() on b2 , I do get desired output. 

    Thanks for your help

    Regards

    Vishal

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