• 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 Design
  3. spectremdl montecarlo simulations, how to fix my errors...

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 125
  • Views 17616
  • 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

spectremdl montecarlo simulations, how to fix my errors ?

samung
samung over 12 years ago
Hello,

I would like to launch some montecarlo simulations through spectremdl commandline interface.

I launch :
spectremdl -batch input.mdl -design input.scs -measure mc_results_file/results_file +log mc_log_file.log

I have the errors :
Error found by spectre.
    ERROR: line 11, column 2: syntax error before or at: <eof>
            unrecognised statement
    ERROR (MDL-6): Failed to parse MDL control file, `input.mdl'.

I don't know how I can fix these errors. Could you please help me ?

Thanks !!

Pedro


I have the following files :

###################################
input.mdl :

/* mdl measurement file */


alias measurement tran_meas {
    run tran
    export real test = 1000
}

run montecarlo (numruns=50, variations='mismatch, scalarfile="mc_results.dat", donominal='no) {
    run tran_meas
}


####################################
input.scs :

subckt inv A1 YN vdd vnw vpw vss
...
M5 (YN A1 vdd vnw) psvtlp w=wp*10e5 l=lp*10e5 nfing=pfolds mult=1 \
        srcefirst=1 mismatch=1 lpe=0 numcos=1 numcod=1 ngcon=1
...
M1 (saout_b saout vss vpw) nsvtlp w=wndiff l=lndiff nfing=1 mult=1 \
        srcefirst=1 mismatch=1 lpe=0 numcos=1 numcod=1 ngcon=1
include "./_graphical_stimuli.scs"
ic aout=1 aout_b=0 
simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=70.0 \
    tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \
    digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \
    checklimitdest=psf 
tran tran stop=20n write="spectre.ic" writefinal="spectre.fc" annotate=status maxiters=5
finalTimeOP info what=oppoint where=rawfile
modelParameter info what=models where=rawfile
element info what=inst where=rawfile
outputParameter info what=output where=rawfile
designParamVals info what=parameters where=rawfile
primitives info what=primitives where=rawfile
subckts info what=subckts  where=rawfile
save aeni aout aout_b
saveOptions options save=allpub subcktprobelvl=2


  • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    What version of spectre are you using? (Type "spectre -W" in the UNIX command line).

    Your example (or a slightly modified one) works fine for me - I used your MDL script with a separate design example, with a tran statement in the same as yours. I was using MMSIM12.1 ISR10 (but also tried a recent MMSIM11.1 version too).

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • samung
    samung over 12 years ago

    Hello Andrew,

     

    thanks for the quick feedback.

    I am using :

    ...> which spectre

    /home/.../cadence/MMSIM10_11/tools/bin/spectre

    ...> spectre -W

    sub-version  10.1.1.181.isr12 

     

    I am still investigating on my way.

     

    P. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • samung
    samung over 12 years ago

    OK, I have a kind of workaround. I am using straight spectre and not spectremdl, as follow :

    I execute : mc_script_spectremdl.sh and I get the waveform results of my montecarlo simulations :

    My current issue is to get the  mc simulation runs where the below export (written in the input.scs) is greater than a value (1 for example):

    export aout_b_max=oceanEval("ymax(v(\"/aout_b\" ?result \"tran\"))")

    Graphically, it's easy to put a "target" and then get the yield of the mc run, but I don't know how to do it in batch. 

     

    I have the following files : 

    mc_script_spectre.sh : 

    #! /bin/csh -f 

    spectre input.scs +log mc_log_file.log

     

    input.scs :

    // Generated for: spectre

     

    simulator lang=spectre

    global 0

    include "models.scs"

    parameters ...

     

    subckt ncx ncx

    ends ncx

    // End of subcircuit definition.

     

    subckt inv A1 YN vdd vnw vpw vss

    parameters wp=xxx lp=xxx pfolds=1 wn=xxx ln=xxx nfolds=1

    M5 (YN A1 vdd vnw) psvtlp w=wp*10e5 l=lp*10e5 nfing=pfolds mult=1 \

            srcefirst=1 mismatch=1 lpe=0 numcos=1 numcod=1 ngcon=1

    M2 (YN A1 vss vpw) nsvtlp w=wn*10e5 l=ln*10e5 nfing=nfolds mult=1 \

            srcefirst=1 mismatch=1 lpe=0 numcos=1 numcod=1 ngcon=1

    ends inv

     

    ...

    M0 (aout aout_b vss vpw) nsvtlp w=wndiff l=lndiff nfing=1 mult=1 \

            srcefirst=1 mismatch=1 lpe=0 numcos=1 numcod=1 ngcon=1

    ...

    include "./_graphical_stimuli.scs"

    ic aout=1 aout_b=0 

    simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=70.0 \

        tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \

        digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \

        checklimitdest=psf 

    mc1 montecarlo numruns=50 seed=12345 variations=mismatch sampling=standard \

        donominal=yes scalarfile="../monteCarlo/mcdata" \

        paramfile="../monteCarlo/mcparam" savemismatchparams=yes \

        mismatchparamfile="../monteCarlo/mismatchparam" \

        mismatchscalarfile="../monteCarlo/mismatchdata" \

        dumpdependency=mismatch \

        dependencymapfile="../monteCarlo/mismatchdependency" \

        savefamilyplots=yes savedatainseparatedir=yes {

    tran tran stop=20n write="spectre.ic" writefinal="spectre.fc" \

        annotate=status maxiters=5 

    finalTimeOP info what=oppoint where=rawfile

    modelParameter info what=models where=rawfile

    element info what=inst where=rawfile

    outputParameter info what=output where=rawfile

    designParamVals info what=parameters where=rawfile

    primitives info what=primitives where=rawfile

    subckts info what=subckts  where=rawfile

    export saout_b_max=oceanEval("ymax(v(\"/aout_b\" ?result \"tran\"))")

    }

    mcOptions options genmcdep=yes

    saveOptions options save=allpub subcktprobelvl=2 

    -------------------------------------------------------------------

     I have the expected mc1_tran.tran waveforms :

    ...> ls input.raw/mc1_separate/

    mc1-001/ mc1-003/ mc1-005/ mc1-007/ ...

     

    ...> ls input.raw/mc1_separate/mc1-001/

    logFile                         mc1_element.info                mc1_modelParameter.info         mc1_primitives.info.primitives  mc1_tran.tran

    mc1_designParamVals.info        mc1_finalTimeOP.info            mc1_outputParameter.info        mc1_subckts.info.subckts

     

     

    However, I would like to get the mc simulation runs where the below export (writen in the input.scs) is greater than a value (1 for example):

    export aout_b_max=oceanEval("ymax(v(\"/aout_b\" ?result \"tran\"))")

     

    I would like to write in a result file this value. I think I should specify a result file in the spectre commandline (spectre input.scs +log mc_log_file.log) ?

    Then, I would like to remove the useless files to get some disk space. How can I specify that I want to keep only the transeint result files and the result file with the export value ? 

     

    Thanks.

     

    P. 

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • samung
    samung over 12 years ago
    Andrew, in addition, I would like to specify, in batch mode for a "spectre" simulation, that I keep the following result info : Yield/Min/Target/Max/Mean/sigma aout_b_max/26/150m/>1000m/1/400m/300m (example) Thanks a lot for your return. P.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • samung
    samung over 12 years ago

    Regarding the spectre method (and not the spectremdl  which doesnt work for some unknown reason, cf. above), I display the input.scs from the adexl window. 

    At this time, I have the line :

    export aout_b_max=oceanEval("ymax(v(\"/aout_b\" ?result \"tran\"))")

    which corresponds to the graphical setting I did (meaning the yield, sigma... of the montecarlo runs will be based on a comparison of this aout_b_max and a spec value (not specified in the input.scs)).

    I decide to use this input.scs to launch the montecarlo simu : spectre input.scs +log mc_log_file.log

    And surprise, surprise, I have the above export in error :

    *Error* _ymaxMethod: can't handle _ymaxMethod(nil)

    Error found by spectre during Monte Carlo analysis `mc1'.

        ERROR (SPECTRE-8003): subckts: Error evaluating ocean expression

            `aout_b_max=ymax(v("/aout_b" ?result "tran"))'.

    Unsuccessfully evaluated export statements (based on return code).

    Analysis `mc1' was terminated prematurely due to an error. 

     

     

    In graphical mode, the montecarlo runs occur very well using this input.scs, how it comes in batch mode I have this issue ?

     

    The input.scs file I am using :

     

    // Generated for: spectre

    // Design library name: Test

    simulator lang=spectre

    global 0

    include "corners_SS.scs"

    parameters lndiff=...

    subckt ncx ncx

    ends ncx

    // End of subcircuit definition.

     

    subckt inv A1 YN vdd vnw vpw vss

    parameters wp=xxx lp=xxx pfolds=1 wn=xxx ln=xxx nfolds=1

    M5 (YN A1 vdd vnw) psvtlp w=wp*10e5 l=lp*10e5 nfing=pfolds mult=1 \

            srcefirst=1 mismatch=1 lpe=0 numcos=1 numcod=1 ngcon=1

    ...

     

    I0 (aout net33 vdd vnw vpw vss) inv wp=xxx lp=xxx pfolds=1 wn=xxx \

            ln=xxx nfolds=1

    ...

    Rright (vdd aout) resistor r=Rright

    Rleft (vdd aout_b) resistor r=Rleft

    M0 (aout aout_b vss vpw) nsvtlp w=wndiff l=lndiff nfing=1 mult=1 \

            srcefirst=1 mismatch=1 lpe=0 numcos=1 numcod=1 ngcon=1

    ...

    include "./_graphical_stimuli.scs"

    ic aout=1 aout_b=0 

    simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=70.0 \

        tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \

        digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \

        checklimitdest=psf 

    mc1 montecarlo numruns=1 seed=12345 variations=mismatch sampling=standard \

        donominal=yes scalarfile="../monteCarlo/mcdata" \

        paramfile="../monteCarlo/mcparam" savemismatchparams=yes \

        mismatchparamfile="../monteCarlo/mismatchparam" \

        mismatchscalarfile="../monteCarlo/mismatchdata" \

        dumpdependency=mismatch \

        dependencymapfile="../monteCarlo/mismatchdependency" \

        savefamilyplots=yes savedatainseparatedir=yes {

    tran tran stop=20n write="spectre.ic" writefinal="spectre.fc" \

        annotate=status maxiters=5 

    finalTimeOP info what=oppoint where=rawfile

    modelParameter info what=models where=rawfile

    element info what=inst where=rawfile

    outputParameter info what=output where=rawfile

    designParamVals info what=parameters where=rawfile

    primitives info what=primitives where=rawfile

    subckts info what=subckts  where=rawfile

    export aout_b_max=oceanEval("ymax(v(\"/aout_b\" ?result \"tran\"))")

    }

    mcOptions options genmcdep=yes

    saveOptions options save=allpub subcktprobelvl=2 

     

    Thanks & best regards !! 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • samung
    samung over 12 years ago

    Regarding the spectre method, I have the feeling I need the amap/ directory otherwise I have the error :

     *Error* _ymaxMethod: can't handle _ymaxMethod(nil)

    Error found by spectre during Monte Carlo analysis `mc1'.

        ERROR (SPECTRE-8003): subckts: Error evaluating ocean expression

            `aout_b_max=ymax(v("/aout_b" ?result "tran"))'.

    Unsuccessfully evaluated export statements (based on return code).

    Analysis `mc1' was terminated prematurely due to an error. 

     

     

    I found that doing the simulation in the adexl simulation database (.../xxxdesign_cell_namexxx/adexl/results/data/MonteCarlo.0/2/Test:xxxdesign_cell_namexxx:1/netlist/), whereas until now I was just simulating in a remote location.

     

    ...> ls amap/

    __multiplefiles_amap_format__          __simulator_information__              cmosxxx_psvtlp_SimMosfetStandard.inst  xxxdesign_cell_namexxx.inst      ncx.inst                               top_level_map.net

    __new_amap_format__                    analogLib_res_hspiceD.inst             inv.inst                               xxxdesign_cell_namexxx.net       ncx.net                                top_level_map.port

    __nmp_amap_format__                    cmosxxx_nsvtlp_SimMosfetStandard.inst  inv.net                                xxxdesign_cell_namexxx.port      top_level_map.inst 

     

    How it comes I cannot simulate without an error my input.scs with the export line : export aout_b_max=oceanEval("ymax(v(\"/aout_b\" ?result \"tran\"))") if I don't have the amap/ directory ? 

    To my point, I should be able to launch the commandline : spectre input.scs +log mc_log_file.log with only :

    _graphical_stimuli.scs

    corners_SS.scs

    global_flags.scs

    input.scs

    netlist

    stat_flags.scs 

     

    Thanks.

    P. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    I'm out of the office today (and tomorrow), but will carefully read through your various posts and give more thought out answers, but to answer this issue with the amap directory - you only need that if you use schematic names for your signals. Because your expressions are using v("/aout_b") etc - the "/" at the beginning tells it that it's a "schematic" name rather than a "netlist" name. If you omit the leading "/" it will assume it's a netlist name (so you have to use "." as the hierarchy delimiter rather than "/" too) - and then the amap dir is not needed.

    More when I have a chance to respond properly

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • samung
    samung over 12 years ago

    Hello Andrew,

    thanks it works with this syntax modification, meaning launching graphically a 3 runs mc with the

    export aout_b_max=oceanEval("ymax(v(\"aout_b\" ?result \"tran\"))")

    I can then move to another directory, recreate/copy the input files I need and launch the simu for one of the 3 cases and I refind the /monteCarlo/mcdata value 

    such as  (for example) :

    more ../monteCarlo/mcdata

    0.999954 

     

    with the following lines in the input.scs :

    ...

    mc1 montecarlo numruns=1 seed=12345 variations=mismatch sampling=standard \

        donominal=no scalarfile="../monteCarlo/mcdata" \

        savefamilyplots=yes savedatainseparatedir=yes firstrun=2 {

    tran tran stop=20n write="spectre.ic" writefinal="spectre.fc" \

        annotate=status maxiters=5 

    finalTimeOP info what=oppoint where=rawfile

    modelParameter info what=models where=rawfile

    element info what=inst where=rawfile

    outputParameter info what=output where=rawfile

    designParamVals info what=parameters where=rawfile

    primitives info what=primitives where=rawfile

    subckts info what=subckts  where=rawfile

    export saout_b_max=oceanEval("ymax(v(\"aout_b\" ?result \"tran\"))")

    } 

    ... 

     

    One notice :

    It seems there is a bug in the scalarfile, because when I specify :  scalarfile="../monteCarlo/mcdata", the mc run will create the monteCarlo/mcdata file in the current directory (and not the specified directory).

     

    Next step is to be able to launch the 3 mc runs and get the information (so it means global information) :

    yield/min/target/max/mean/sigma

    33/300m/900m/1000m/500m/600m (example) 

     

    Does someone know what is the option for the montecarlo simu to get (in batch) the above global information on all (here just 3) the mc runs ?

    The unix architecture is :

    xxxDesign_Cell_Namexxx/adexl/results/data/MonteCarlo.1/

    1/   2/   3/   psf/ 

     

    Thanks.

    P. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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