• 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. How to plot an histogram using ocean script? (monte carlo...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 125
  • Views 13974
  • 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

How to plot an histogram using ocean script? (monte carlo problem)

Ricardo Alves
Ricardo Alves over 12 years ago
Hi all,

I am new using Ocean script and i am having a problem.

I want to do an histogram with the average value of a comparator output (voltage).

However I couldn´t get it yet.

The code i am trying to implement is the following:

ocnWaveformTool( 'wavescan )
simulator( 'spectre )
design(     "/home/user22/simulation/comparator/spectre/schematic/netlist/netlist")
resultsDir( "/home/user22/simulation/comparator/spectre/schematic" )
modelFile(
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l130e-rf-v171-control.scs" "")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/L130E_MM_TRIPLEWELL_MAIN_V151.lib.scs" "")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_cr20k_rfvil_V021.lib.scs" "typ")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_nwcr20k_rfvil_V021.lib.scs" "typ")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_sy20k_rfvil_V021.lib.scs" "typ")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_nwsy20k_rfvil_V021.lib.scs" "typ")
    '("/home/user22/CADENCE/UMC130_B06_PB/Monte_Carlo_libs/L130E_statistical_m.scs" "")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_sy20kct_rfvil_V021.lib.scs" "typ")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_nwsy20kct_rfvil_V021.lib.scs" "typ")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_sqsk_rfvil_V021.lib.scs" "typ")
    '("/opt/ic_tools/pdk/umc130_b06_pb/umc13mmrf/../Models/Spectre/l_nwsqsk_rfvil_V021.lib.scs" "typ")
    '("/home/user22/CADENCE/UMC130_B06_PB/Monte_Carlo_libs/L130E_HS12_V231_ma.lib.scs" "tt")
)
analysis('tran ?stop "170u"  )
save( 'v "/out" )
temp( 27 )
monteCarlo( ?numIters "2" ?startIter "1"
    ?analysisVariation 'mismatch ?sweptParam "None"
    ?sweptParamVals "27" ?saveData t
    ?nomRun "yes" ?append nil
    ?saveProcessParams t
)

monteRun()
selectResult('tran)
monteSelectResults()
specLimits ("bw_27" ?upper 15E+06 ?lower 5E+06)
monteExpr( "bw_27" 'average(clip(v("/out" ?result 'tran) 0 85u)))

histogram( "bw_27" ?type 'standard ?numBins '2 ?density 't)

The error is shown bellow:
simulation completed successfully.
 reading simulation data...
       ...successful.
 Monte Carlo Simulation completed successfully...
 ======================================================================
 Statistical Analysis Parameters and Spec Limits:
 
         Parameter        Lower        Upper
 ======================================================================
     noExprs_27       -1e+36       1e+36      
 *Error* eval: not a function - "bw_27"

 *Error* load: error while loading file - "monteCarlo.ocn"

  Can anyone help me please?

Regards

Ricardo Alves

 
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    You need to define the monteExpr before the monteRun. The expressions are evaluated as the simulation runs, and so you can't add them afterwards.

    Regards,

    Andrew

    • 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