• 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 SKILL
  3. Scalar Vs. Wave results in OCEAN-XL

Stats

  • Replies 0
  • Subscribers 148
  • Views 14
  • Members are here 0

Scalar Vs. Wave results in OCEAN-XL

LN202602239051
LN202602239051 2 hours ago

Hi there!

I have been trying for weeks now... please advice Slight smile

I am running a DC sweep simulations with stepped parameter using OCEAN-XL script. Think transistor transfer characteristics...

I also have a CSV file containing data which I want to use as reference for my error calculation. Basically, after every sweep I am trying to calculate error between simulation and CSV data for each parameter value.

My problem is that in Maestro GUI everything works perfectly. By averaging my "error wave" I get scalar number, but when running OCEAN scripts (my own or generated in GUI) I get "wave" result.

How do I get scalar number from "wave" result in this case?

"calcVal" complains about cyclic dependencies, functions "leafValue", "value", "ymax", "mag" all produce wave result after running OCEAN scripts, I guess due to 'sweeps evalType.

There has to be a way how to dig up the scalar number since GUI can do it correctly.... 

Thanks you guys...

Snippet of my script

ocnxlBeginTest("SETUP")
    simulator('spectre)
    design("myLib" DESIGN "schematic")
    include(strcat(ROOT_DIR "/models.ocn"))

    analysis(
        'dc
        ?dev     "/V_G"
        ?param     "dc"
        ?start     0
        ?stop     "VAR(\"VDD\")"
        ?step     "10m"
    )

    ; Variables
    include(strcat(ROOT_DIR "/07_desVars.ocn"))
    
    temp(my_Temp)
    desVar("VDD"    my_VDD)
    desVar("frek"   1M)
    desVar("W"      3u)
    desVar("L"      3u)
    desVar("M"      1)
    desVar("NF"     1)
    desVar("VD"     0)
    desVar("VG"     0)
    desVar("VS"     0)
    desVar("VB"     0)

    ocnxlOutputTerminal("/V_D/MINUS" ?save t)

    ocnxlOutputExpr(
        "IS(\"/V_D/MINUS\")"
        ?name         "SIM"
        ?save         t
        ?plot         t
        ?evalType     'point
    )

    ; Down-sample the output for error calculation
    ocnxlOutputExpr(
        "sample(SIM 0 1.2 \"linear\" 25m)"
        ?name         "SAMPLED_SIM"
        ?save         t
        ?plot         t
        ?evalType     'sweeps         ; point, corners, sweeps, maa
    )

    ; Slice-up down-sampled sim data
    ; Output: SAMPLED_SIM_i
    for(i 1 12
        title    = sprintf(nil "SAMPLED_SIM_%d" i)
        expr     = sprintf(nil "leafValue(SAMPLED_SIM \"VD\" %3.2f)" 0.1*i)
        ocnxlOutputExpr(expr ?name title ?save t ?plot t ?evalType 'sweeps)
    )

    ; Import CSV reference data
    ; Output: REFERENCE_i
    file = strcat(CSV_DIR "/reference.csv")
    for(i 1 12
        title    = sprintf(nil "REFERENCE_%d" i)
        expr     = sprintf(nil "getAsciiWave(\"%s\" 1 %d ?xskip 2 ?yskip 2 ?xUnits \"V\" ?yUnits \"A\")" file i+1)
        ocnxlOutputExpr(expr ?name title ?save t ?plot t ?evalType 'point)
    )

    ; Sliced-up error
    ; Output: ERROR_i
    for(i 1 12
        title    = sprintf(nil "ERROR_%d" i)
        expr     = sprintf(nil "((SAMPLED_SIM_%d - REFERENCE_%d) / REFERENCE_%d * 100)" i i i)
        ocnxlOutputExpr(expr ?name title ?save t ?plot t ?evalType 'sweeps)
    )

    ; AVG error
    ; Output: ERROR_avg_i
    for(i 1 12
        title    = sprintf(nil "ERROR_avg_%d" i)
        expr     = sprintf(nil "average(ERROR_%d)" i)
        ocnxlOutputExpr(expr ?name title ?save t ?plot t ?evalType 'sweeps)
    )
ocnxlEndTest()

  • Cancel
  • Sign in to reply

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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information